Hallo.
Ich habe folgenden funktionierenden CheatEngine Autoassamble-Code und will daraus eine dll schreiben. Injected wird sie dann mit Wininject.
Die dll sieht im Moment so aus:
Vielen Dank bereits im Vorraus
Ich habe folgenden funktionierenden CheatEngine Autoassamble-Code und will daraus eine dll schreiben. Injected wird sie dann mit Wininject.
Code:
[ENABLE] alloc(injectLocWrite,1024) label(isPlayer) "abc.exe"+2CD2B6: jmp injectLocWrite injectLocWrite: push eax mov eax,["abc.exe"+01075E88] mov eax,[eax+4] cmp ecx,eax pop eax je isPlayer movss [esi+08],xmm0 jmp "abc.exe"+2CD2BB isPlayer: jmp "abc.exe"+2CD2D6 [DISABLE] dealloc(injectLocWrite) "abc.exe"+2CD2B6: movss [esi+08],xmm0
Code:
#include <iostream>
#include <Windows.h>
using namespace std;
typedef unsigned int uint;
enum data
{
ncentry=0x2CD2B6,
ncp1=0x1075E88,
ncp2=0x2CD2BB,
ncp3=0x2CD2D6,
};
DWORD base;
DWORD baseentry;
DWORD basepb;
DWORD basep1;
DWORD basep2;
__declspec(naked)void AsmOn()
{
__asm
{
push eax
mov eax, dword ptr basepb
mov eax, [eax+0x4]
cmp ecx, eax
pop eax
je isPlayer
movss [esi+0x08], xmm0
jmp dword ptr basep1
isPlayer:
jmp dword ptr basep2
};
}
extern "C" __declspec(dllexport)DWORD Initialize()
{
base=(DWORD)GetModuleHandle(NULL);
baseentry=base+ncentry;
basepb=base+ncp1;
basep1=base+ncp2;
basep2=base+ncp3;
return 1;
}
BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
CreateThread(0, 0, &Initialize, 0, 0, 0);
}
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
- Stimmt "CreateThread(0, 0, &Initialize, 0, 0, 0);" überhaupt? / Kann ich nicht einfach "Initialize()" aufrufen?
- Muß ich Speicher mittels alloc reservieren? / Macht das der Injector?
- Wie schreibe ich einen Jump-Befehl zu meinem Code, in ""abc.exe"+2CD2B6 / baseentry"?
- Wer kann mit helfen?
Vielen Dank bereits im Vorraus