zoukankan      html  css  js  c++  java
  • masm学习

            .486
            .model flat,stdcall
            option casemap:none   ; case sensitive
    ;http://www.popbook.com/wbbs/topic.asp?l_id=5&t_id=2294
    include masm32includewindows.inc 
    include masm32includekernel32.inc 
    includelib masm32libkernel32.lib 
    include masm32includeuser32.inc 
    includelib masm32libuser32
    
    ABCCC struct
       String1    DWORD      ?
       String2    DWORD      ?
       String3    DWORD      ?
    ABCCC ends
    
    .const ; 
        dbtext db "hello",0;
        dbtitle db "title",0;
    
    .data
        testst ABCCC <"A","b","c">
    
     
    
    .code
     
        start :
            call main;
            invoke ExitProcess,eax;
            
            testfnvar proc C var_1
                ret;
            testfnvar endp
            
            main proc 
                mov esi, OFFSET testst;
                assume esi:ptr ABCCC; ;给寄存器声明结构
                ;类型 pre 变量名 ;转换类型
                mov eax, [esi].String1; 
                invoke MessageBox, NULL, addr [esi].String1, addr dbtitle, MB_OK;
                 invoke testfnvar ,1 ;            
            main endp
            
            
    
            
            testfn proc 
                local @l1:dword;
                local @l2:word;
                local @l3:word;
                mov eax,@l1;
                mov ax,@l2;
                mov bx,@l3;
                invoke MessageBox ,NULL, addr dbtext,addr dbtitle,MB_OK;
                ;ret;
            testfn endp
        
        end start

    notepad++ 配置

    安装 nppexec插件

    在插件菜单里添加

    npp_save
    echo $(CURRENT_DIRECTORY)
    echo $(FILE_NAME)
    echo $(NAME_PART)
    cd $(CURRENT_DIRECTORY)
    D:masm32inml /c /coff /Cp $(FILE_NAME)
    D:masm32inlink /SUBSYSTEM:WINDOWS /LIBPATH:D:masm32lib $(NAME_PART).obj
    
    $(CURRENT_DIRECTORY)$(NAME_PART).exe
  • 相关阅读:
    【收集】13款Linux系统有
    【收集】13款Linux系统有
    献给母亲节的沙画,致此生最爱——母亲!
    ACM2136
    WTF is The BlockChain?
    Java 多线程(上)
    Kubernetes集群部署DNS插件
    Vue组件
    写在APIO2016之前
    5G-NR物理信道与调制-下行链路v1.1.0
  • 原文地址:https://www.cnblogs.com/solq/p/3622256.html
Copyright © 2011-2022 走看看