Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Pls help with Trampoline Example (delphi / c++)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
rovnix
Newbie cheater
Reputation: 0

Joined: 09 Feb 2014
Posts: 18

PostPosted: Mon Feb 10, 2014 2:51 pm    Post subject: Pls help with Trampoline Example (delphi / c++) Reply with quote

Hallo someone,

I don't mean to be spoonfed. I need a simple example of a trampoline hook with _asm
Code should be c++ / delphi

Step by step explanation using comments could be more useful / simplified.

Thanking you.
Back to top
View user's profile Send private message Yahoo Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Feb 10, 2014 2:53 pm    Post subject: Reply with quote

There are tons of examples on the net you can find via Google. I'd recommend you take the time to look first. If you still have issues understanding parts then come back and ask specific questions, not just 'gimmie a full example'.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
rovnix
Newbie cheater
Reputation: 0

Joined: 09 Feb 2014
Posts: 18

PostPosted: Mon Feb 10, 2014 3:04 pm    Post subject: Reply with quote

You mean like this?
Code:

#include <windows.h>
#include <stdio.h>
#include <wininet.h>

DWORD HookFunction(LPCSTR lpModule, LPCSTR lpFuncName, LPVOID lpFunction, unsigned char *lpBackup);
int newHttpSendRequestW(HINTERNET hRequest, LPCTSTR lpszHeaders, DWORD dwHeadersLength, LPVOID lpOptional, DWORD dwOptionalLength);

BYTE hook[6];

int main()
{

void WinMainCRTStartup()
{

HookFunction("wininet.dll","HttpSendRequestW",newHttpSendRequestW,hook);
if dwOptionalLength > 0
{
MessageBox(0,lpOptional,"",MB_OK);
}

    }

DWORD HookFunction(LPCSTR lpModule, LPCSTR lpFuncName, LPVOID lpFunction, unsigned char *lpBackup)
 {
DWORD dwAddr = (DWORD)GetProcAddress(GetModuleHandle(lpModule),lpFuncName);
BYTE jmp[6] = { 0xe9,//jmp
0x00, 0x00, 0x00, 0x00,//address
0xc3
};
ReadProcessMemory(GetCurrentPRocess(),(LPVOID)dwAddr,lpBackup,6,0);
DWORD dwCalc = ((DWORD)lpFunction - dwAddr - 5);
&jmp[1], &dwCalc, 4);//build the jmp

WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwAddr, jmp, 6, 0);

return dwAddr;

    }
}



I am hooking httpsendrequest for Educational use only.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites