DarkMystrik How do I cheat?
Reputation: 0
Joined: 11 Jul 2014 Posts: 1
|
Posted: Mon Dec 01, 2014 9:53 am Post subject: C++ ASM convert |
|
|
Hey! I've got a problem i cant seem to solve. I've been searching for the past 4 hours on google, but i couldnt find anything similar to me
Code: | alloc(WhatNowMinesweeper,256)
0067C8F8:
jmp WhatNowMinesweeper
WhatNowMinesweeper:
push eax
mov eax,1
mov [0067C8F8],eax
pop eax |
How do i convert that into C++ Inline ASM?
Code: |
#include <windows.h>
#define JMP(frm,to) (((int)to - (int)frm)-5)
DWORD Adress = 0x0067C8F8;
__declspec(naked) void myCodeCave()
{
__asm
{
Adress:
jmp WhatNowMinesweeper
WhatNowMinesweeper :
push eax
mov eax, 1
mov [Adress], eax
pop eax
}
}
void main()
{
*(BYTE*)Adress = 0xe9; // defining jump opcode
*(DWORD*)(Adress + 1) = JMP(Adress, myCodeCave);
*(WORD*)(Adress + 5) = 0x9090;
}
BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved) {
if (callReason == DLL_PROCESS_ATTACH) {
//MessageBox(NULL, L"Hooked <3 ~Mystrik", L"", MB_OK);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, 0, 0, 0);
}
return 1;
} |
Doesnt seem to work. Because of these errors
puu.sh/dcFBs/6d69e71ce8.png
Could anyone fix it, and after that tell me how they fixed it?
|
|