New API hooking in C

Ok i started to new coding with C, so i decided to code something

So lets begin, i started of with this code.
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <windows.h>
#include <stdio.h>

DWORD HookFunction(LPCSTR lpModule, LPCSTR lpFuncName, LPVOID lpFunction, unsigned char *lpBackup, LPCSRTR lpProccessName); 

BOOL UnHookFunction(LPCST­R lpModule, LPCSTR lpFuncName, unsigned char *lpBackup); int MyMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);

If (lpProcessName == "notepad.exe") {
DWORD HookFunction(LPCSTR lpModule, LPCSTR lpFuncName, LPVOID lpFunction, unsigned char *lpBackup,LPCSTR lpProcessName) {
DWORD dwAddr = (DWORD)GetProcAddres­s(GetModuleHandle("k­ernel32.dll"), "GetProcAddress");
printf("Hook successful");
}
}


Kindly assist me as soon as possible, i am quite new to API programming
 
DWORD dwAddr = (DWORD)GetProcAddres­s(GetModuleHandle("k­ernel32.dll"), "GetProcAddress");

Let's pretend for a moment that this isn't inside of an if statement that is in the global scope. Do you actually know what this line of code is meant for compared to what you have it doing?
Huh...

Do you actually know what hooking is?
closed account (Dy7SLyTq)
i am quite new to API programming

no your not. the standard c library and the stl are both apis. i think you meant you are new to the windows api and or hooking
Topic archived. No new replies allowed.