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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top