开发者

Problem with assembly programming and Procedure calls

开发者 https://www.devze.com 2023-02-19 14:26 出处:网络
I am using MASM 开发者_运维问答to do some assembly programming. When I try to run my program it crashes immediately when it encounters \"call myFunction\", even after I\'ve stripped out all the code f

I am using MASM 开发者_运维问答to do some assembly programming. When I try to run my program it crashes immediately when it encounters "call myFunction", even after I've stripped out all the code from the procedure. Here is my code any help would be greatly appreciated.

    .486
    .model flat
    .stack 100h

    ExitProcess PROTO NEAR32 stdcall, dExitCode:DWORD

    .code
_start:

    call myFunction

    INVOKE ExitProcess,0
    PUBLIC _start

myFunction  proc  near32


myFunction  endp

END


Change myFunction to

myFunction  proc  near32
     ret
myFunction  endp

to make it a stub. In your version, it has no instructions, so it executes whatever follows it in memory.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号