README.md
December 4, 2022 ยท View on GitHub
Description
Advance Calling function in asembly no need for a linker with correct tables :).
More Info
| Submitted On | |
| By | OpcodeVoid |
| Level | Advanced |
| User Rating | 4.3 (26 globes from 6 users) |
| Compatibility | C, C++ (general), Microsoft Visual C++, Borland C++, UNIX C++ |
| Category | Coding Standards |
| World | C / C++ |
| Archive File |
Source Code
#include "stdafx.h"
#include "windows.h"
char * title = "Unhanlde Execpetion";
char * msg = "Proc Base Address";
char *dump = "Hello";
FARPROC DLLADDRESS;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
HINSTANCE HI;
HI = LoadLibrary("USER32.DLL");
DLLADDRESS = GetProcAddress
(HI,"MessageBoxA");
if(DLLADDRESS == NULL)
{
MessageBox(NULL,"Dll not found","Error",MB_OK);
return 0;
}
_asm
{
//HWND
//MSG
//TITLE
//TYPE
push MB_OK
push title
push msg
push NULL
mov eax,DLLADDRESS
call eax
}
return 0;
}
//
Soure End
Your might be wondering how it works. Very simple really
I just Get the address of a function in a library then push values into the stack.
Backwards because we push data into the stack LIFO(Last in first out). If you don't understand anything email vbmew@hotmail.com