typedef int(__stdcall *__MessageBoxA)(HWND, LPCSTR, LPCSTR, UINT);
As I said, im trying to learn how to reverse engineer programs using C++ / Assembly, so I'm going through some open source projects I found on the internet. But can anyone explain what this line does? Im not advanced in C++, which is why I'm going through sources.
Your code is C language. So it also compiles fine in C++.
Let 's go step by step.
It returns an int, accepts 4 parameters :
So a pointer to a function variable can be declared.
__stdcall is the way the function is called by the compiler ( Are parameters passed from left to right or reverse ? Is return value passed through stack memory or CPU register ?) - details most people don't care as long as caller and called agree
Regards