有熟悉易语言的佬吗,转C语言没法运行,救命
易语言:
转换的C语言:
enum Offset {
OPEN_INIT = 0xB5A0
};
int CallAsm(DWORD offset, DWORD p1) {
__asm {
push esi
mov esi, 0000000Fh
lea ecx, dword ptr [ebp+08h]
lea ecx, dword ptr [ecx+esi*8-04h]
Label2:
mov eax, dword ptr [ecx+04h]
test eax, eax
je Label1
push dword ptr [ecx]
Label1:
dec esi
sub ecx, 08h
test esi, esi
jne Label2
call dword ptr [ebp+08h]
pop esi
leave
retn 007Ch
};
return 0;
}
int WxInjectInit(char *dllName) {
char currentDir[256];
if (GetCurrentDirectoryA(MAX_PATH, currentDir) == 0) {
printf("获取当前目录失败");
return FALSE;
}
char dllPath[256];
snprintf(dllPath, 256, "%s\\%s", currentDir, dllName);
HMODULE hModule = LoadLibraryA(dllPath);
if (hModule == NULL) {
printf("加载动态库错误:%lu", GetLastError());
return FALSE;
}
DWORD moduleAddress = (DWORD) hModule + (DWORD) OPEN_INIT;
int ok = CallAsm(moduleAddress, 0);
return 0;
}