【问题标题】:MessageBox is not showing message on assemblerMessageBox 未在汇编程序上显示消息
【发布时间】:2022-01-06 13:21:43
【问题描述】:

Screenshot of the result

嗨。我重新安装了 RadASM,但在此 MessageBox 之后仍然没有显示该消息。它正在编译,然后……结束!只是标准调用,所有代码如下:

lab1.Asm

.386
.model flat,STDCALL
option casemap :none  ;case sensitive

include lab1.inc

.code
Begin:
    call main
    
invoke ExitProcess,NULL


main proc
    
    Start:
    invoke GetComputerName,addr user_name,addr buflen
    invoke MessageBox,0,addr hello_message,addr hello_title,MB_OK

    ret

main endp

end Begin

lab1.Inc

include WINDOWS.inc

include user32.inc
include kernel32.inc

includelib user32.lib
includelib kernel32.lib
.data   
  buflen                dd 256 
  hello_title          db ' 
  hello_message   db 'Computer Name: '  
  user_name         db 256 dup (0)  

【问题讨论】:

  • 获取OllyDbg 并尝试在其中签名您的程序:ollydbg.exe lab1.exe

标签: assembly masm messagebox masm32


【解决方案1】:
include WINDOWS.inc

include user32.inc
include kernel32.inc

includelib user32.lib
includelib kernel32.lib
.data   
  buflen                dd 256 
  hello_title          db ' 
  hello_message   db 'Computer Name: '  
  user_name         db 256 dup (0)  

这里有错误,因为你开始初始化变量,没有完成变量的内容。

另外我看到一个字符串。行必须以零字符结尾。

hello_title     db 'My title',0
hello_message   db 'Computer Name: ',0

ps 哦对了,我忘了说,程序很简单,程序的主要目的是确定用户名。对于签名防病毒软件,这是一种病毒模式。因此,我建议暂时禁用杀毒软件,或者使用附加功能稀释程序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    • 1970-01-01
    • 2019-02-14
    • 1970-01-01
    • 2014-04-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多