c - Can anyone tell me what this section of pseudocode is doing? -
can tell me section of pseudocode doing?
produced use ida pro
thanks in advance!
int __cdecl sub_401000(int a1, int a2) { int result; // eax@4 int v3; // [sp+0h] [bp-ch]@4 char v4; // [sp+7h] [bp-5h]@4 int i; // [sp+8h] [bp-4h]@1 signed int v6; // [sp+8h] [bp-4h]@4 ( = 0; *(_byte *)(i + a1); ++i ) ; result = - 1; v6 = - 1; v3 = 0; v4 = -1; while ( v4 ) { v4 = *(_byte *)(v6 + a1); result = a2; *(_word *)(a2 + 2 * v3) = ((unsigned __int8)byte_40a300[v6 % 4] ^ *(_byte *)(v6 + a1)) & 0x7f; --v6; ++v3; } return result; }
the first for
loop finds length of string a1
. following while
loop transforms bytes of a1
xoring them 4 byte constant key, , widening utf16 (presumably). result written reversed a2
.
Comments
Post a Comment