Fixing Converted Code [Solved]
i've procceded to do some reverse engineering work to fix some code that i've found.
After decomplieing the .exe ive come up with this sub routine that holds the crypto class to that of the .exe..
Was wondering if anyone had any better ideas to short this down to a smaller function with only using 2 variables...
now im trying to shortin it down to something like this but it doesnt seem right..
Does this seem right at all????? If u like i can post the ASM to hopefully understand it more...
After decomplieing the .exe ive come up with this sub routine that holds the crypto class to that of the .exe..
Was wondering if anyone had any better ideas to short this down to a smaller function with only using 2 variables...
Code:
//----- (00842A80) --------------------------------------------------------
char __thiscall sub_842A80(void *this, int a2, unsigned int a3)
{
char result; //
unsigned int i; //
char v5; //
if ( a2 )
{
for ( i = 0; i < a3; ++i )
{
if ( *(_BYTE *)(i + a2) )
{
v5 = *((_BYTE *)this + i % 0xB) ^ *(_BYTE *)(i + a2);
if ( v5 )
*(_BYTE *)(i + a2) = v5;
}
}
result = 1;
}
else
{
result = 0;
}
return result;
}
Code:
void CCrypto::cypto( unsigned char* buffer, unsigned size )
{
for ( unsigned i = 5; i < size; i++)
{
buffer[i] = (byte)(buffer[i]^0xB );
}
}
