TA的每日心情 | 奋斗 2023-11-29 18:29 |
---|
签到天数: 26 天 [LV.4]偶尔看看III
|
反编译一个dll插件,选取其中一段进行交流,如何将以下代码改写成易语言。
希望有大神能给点提示,或直接改写出来以供参考。
int __cdecl sub_10007B40(int a1, _BYTE *a2, signed int a3, unsigned int a4)
{
int result; // eax@1
char *v5; // ebp@3
signed int v6; // ebx@3
int v7; // esi@3
int v8; // eax@8
char *v9; // ecx@12
char *v10; // ecx@15
int v11; // eax@14
int v12; // ebx@25
int v13; // edx@32
unsigned int v14; // ecx@35
char v15; // al@35
char *v16; // edi@35
int v17; // eax@39
int v18; // ebx@44
char v19[256]; // [sp+4h] [bp-100h]@32
result = dword_1010DB24;
if ( dword_1010DB24 >= 3 )
{
result = (int)a2;
if ( a2 )
{
v5 = (char *)(dword_1010DB4C + dword_1010DB30 + 260);
v6 = 0;
v7 = dword_1010DB40;
if ( dword_1010DB40 == -1 )
v7 = a1;
if ( dword_10110070 )
{
*v5 = 91;
v6 = 1;
}
if ( dword_10110060
|| (v8 = *(_DWORD *)(dword_1010DB30 + 772) & 0xF0, v8 == 48)
|| v8 == 224
|| *(_DWORD *)(dword_1010DB30 + 772) & 1 )
{
if ( a4 >= 0xB )
{
v10 = aPtr_0;
if ( dword_10110070 )
v10 = Caption;
v11 = sprintf(&v5[v6], aIByteS, a4, v10);
}
else
{
v9 = aPtr_0;
if ( dword_10110070 )
v9 = Caption;
v11 = sprintf(&v5[v6], aSS, off_10107F6C[a4], v9);
}
v6 += v11;
}
if ( (dword_1011005C || v7 != a1) && v7 != -1 )
v6 += sprintf(&v5[v6], aS_0, off_10107F4C[v7]);
if ( !dword_10110070 )
v5[v6++] = 91;
v12 = sprintf(&v5[v6], aS, a2) + v6;
if ( dword_10110084 )
strlwr(v5);
if ( a3 )
{
if ( dword_1011008C && dword_1010DB24 >= 4 && (v13 = sub_100DE0F0(a3, v19, 232 - v12, 0), v13 > 0) )
{
if ( *a2 )
v5[v12++] = 43;
v14 = strlen(v19) + 1;
v15 = v14;
v14 >>= 2;
qmemcpy(&v5[v12], v19, 4 * v14);
v16 = &v5[4 * v14] + v12;
v12 += v13;
qmemcpy(v16, &v19[4 * v14], v15 & 3);
}
else
{
if ( a3 < 0 && a3 > -16384 && *a2 )
{
v17 = sprintf(&v5[v12], aLx, -a3);
}
else
{
if ( *a2 )
v5[v12++] = 43;
v17 = sprintf(&v5[v12], aLx_0, a3);
}
v12 += v17;
}
}
else if ( !*a2 )
{
v5[v12++] = 48;
}
v5[v12] = 93;
v18 = v12 + 1;
v5[v18] = 0;
result = v18 + dword_1010DB4C;
dword_1010DB4C += v18;
}
}
return result;
}
|
|