بنام خدا



Creating a batch file using FASM


ایجاد یک فایل  batch  با استفاده از فلت اسمبلر:



سورس لازم برای نوشتن این نوع فایل بچ  را در اینجا  می توانید مشاهده و مطالعه کنید:


;***;  Format  ;***;
format PE console
entry  _main


;***;  Includes  ;***;
include
'import32.inc'


;***;  Data  ;***;
section
'data' data readable writeable
Path  db
'out.cmd', 0

Cmmd1 db
'<first command>', 0
Cmmd2 db
'<second command>', 0
_endl db
0xD, 0xA, 0

_bwr       dd
0
FileHandle dd
0


;***;  Code  ;***;
section
'code' code readable executable
_main
:

       
; clear file
        push Path
        call
[W32_FileDelete]
       
       
; open file
        push
0
        push
0x80
        push
1
        push
0
        push
0
        push
0x40000000
        push Path
        call
[W32_FileOpen]
        mov 
[FileHandle], eax
       
       
; reset 'bytes written'

        mov dword
[_bwr], 0
       
       
; write first command
        push
0
        push _bwr
        push
15 ; write size
        push Cmmd1
        push
[FileHandle]
        call
[W32_FileWrite]
       
       
; reset 'bytes written'
        mov dword
[_bwr], 0
       
       
; write end of the line
        push
0
        push _bwr
        push
2 ; write size
        push _endl
        push
[

مشخصات

آخرین ارسال ها

آخرین جستجو ها