Online game like this will be excellent for software job interview.
Andy Malakov software blog
Tuesday, September 30, 2008
Friday, September 12, 2008
Obfuscated code
Situation: Third-party client API library periodically fails with nasty exception:
After verifying that input parameters are legitimate I decided to take a look at the failing code. My trusty Reflector exposed the following:
That code is supposed to read data block from memory queue and possibly format it as string. What kind of secret know-how can it be?
Now instead of figuring out the problem by ourselves we are going to send this error to the vendor. What a waste of time on both sides.
Caused by: cli.System.AccessViolationException: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.
at cli.TalTrade.Toolkit.DataBlock.ReadData(Unknown Source)
at cli.TalTrade.Toolkit.RawData.GetDataAsBlock(Unknown Source)
... 34 more
After verifying that input parameters are legitimate I decided to take a look at the failing code. My trusty Reflector exposed the following:
private unsafe void ReadData(void modopt(IsConstModifier)* pData)
{
// This item is obfuscated and can not be translated.
...
if (*(((int*) (>al_handle + 4)))[4] < 6)
goto Label_0038;
ushort num5 = *((ushort*) (((*(((int*) (>al_handle + 4))) + *(((int*) (>al_handle + 4)))[6]) - 8) + 6));
... 100 more lines like these ...
}
That code is supposed to read data block from memory queue and possibly format it as string. What kind of secret know-how can it be?
Now instead of figuring out the problem by ourselves we are going to send this error to the vendor. What a waste of time on both sides.
Subscribe to:
Posts (Atom)
Blog Archive
- November 2024 (1)
- November 2016 (1)
- March 2015 (2)
- December 2011 (1)
- October 2010 (2)
- June 2010 (1)
- May 2010 (1)
- December 2009 (1)
- November 2009 (4)
- October 2009 (1)
- July 2009 (2)
- June 2009 (1)
- December 2008 (1)
- September 2008 (2)
- August 2008 (4)
- July 2008 (3)
- June 2008 (4)
- May 2008 (1)