rovnix Newbie cheater
Reputation: 0
Joined: 09 Feb 2014 Posts: 18
|
Posted: Mon Feb 10, 2014 3:04 pm Post subject: |
|
|
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. |
|