Answer the question
In order to leave comments, you need to log in
How to push a parameter onto the stack?
I decided to try to pee on FASM,
In kernel32.dll, there is a function (GetModuleFileNameA) that returns the path to the file
. I want to call it, for this I need to import the function on the stack, and then put the parameters?
How to do it?
format PE console
entry start
include 'win32a.inc'
section '.data' data readable writable
NULL = 0
section '.code' code readable executable
start:
push NULL
call [ExitProcess]
section '.idata' import data readable
library kernel, 'kernel32.dll',\
msvcrt, 'msvcrt.dll',\
user32dll, 'user32.dll'
import kernel,\
ExitProcess, 'ExitProcess',\
CreateDirectoryA, 'CreateDirectoryA',\
GetModuleFileNameA, 'GetModuleFileNameA'
import msvcrt,\
printf, 'printf',\
getch, '_getch'
import user32dll,\
MessageBoxA, 'MessageBoxA'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question