Simple solution:
If you want (this will throw a segment fault)
call *_MessageBoxA@16
do this instead
call *__imp__MessageBoxA@16
and you will get an indirect call without extra useless code.
Вопрос
When I assemble a file using GCC tools (from MinGW package), calls to WINAPI functions from system DLLs have this form:
call label
...
ret
label: jmp dword [ExitProcess]
Instead of:
call dword [ExitProcess]
...
ret
How can I force GCC to call directly idata section pointers instead of generating that extra code?
Решение
Simple solution:
If you want (this will throw a segment fault)
call *_MessageBoxA@16
do this instead
call *__imp__MessageBoxA@16
and you will get an indirect call without extra useless code.