FASM練習代碼

 

;import 構建
;練習之作..

format  PE  GUI  
4.0
entry   _start

;
;data section..
;

section  
'.data'  data   readable

       lpCaption   db    
'test',0
       lpText      db     'hello world',0

;
;code section
;

section   
'.code'  code  readable  executable

_start:
        
        push 40h
    push lpCaption
    push lpText
    push 0h
    
call [MessageBox]
    push 0h
    
call [ExitProcess]

;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

;
;import section
;

section  
'.import'  import  data readable writeable

     ;IMAGE_IMPORT_DESCRIPTOR

     dd 
000, RVA user32_dll, RVA user_thunk
     dd 
000, RVA kernel_dll, RVA kernel_thuk
     dd 
00000
 
      ; DLL Name

     user32_dll      db  
'user32.dll',0
     kernel_dll      db  'kernel32.dll',0
     
     ; THUNK DATA
     user_thunk:
     MessageBox      dd   RVA msg_byname
                     dd   
0
    
     kernel_thuk:
     ExitProcess     dd   RVA process_byname
                     dd   
0
 
     ;import_Byname 
     msg_byname      dw   
0
                     db   
'MessageBoxA',0

     process_byname  dw   
0
                     db   
'ExitProcess',0

     

 ;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章