close

How to - generate an binary file or *.com, simple as source code and the pre-defined byte order, example is following,


create a script file, test.txt
paste the content below-------------

f 100 500 90
a100
db ff 99 88 77
nop
CLI
XOR AX,AX

a108
MOV CX,0003
PUSH CX

N key.bin
RCX
10
W
Q
paste the content above-------------

explaineation for this script-------------
f 100 500 90 ; 以 0x90 填滿範圍 0x100 - 0x500
a100 ; 在 0x100 開始, 輸入自己的資料
db ff 99 88 77; 定義3位, 0xff, 0x99, 0x88, 0x77
nop ; Intel assembly instruction
CLI ; Intel assembly instruction
XOR AX,AX ; Intel assembly instruction
<<<<空白行, 等於 在DEBUG內輸入 ENTER, 結束
a108 ; 在 0x100 開始, 輸入自己的資料
MOV CX,0003 ; Intel assembly instruction
PUSH CX ; Intel assembly instruction
<<<<空白行, 等於 在DEBUG內輸入 ENTER, 結束
N key.bin ; 定義檔案名稱為 key.bin, 可以任意
RCX ; 修改寄存器 RCX
10 ; 輸入 0x10
W ; 寫入磁碟, 從0x100起, 把連續的 0x10 BYTE 紀錄到key.bin
Q ; 退出 DEBUG
explaineation for this script-------------



open DOS box, use the DEBUG to load our script as following,
debug

screen capture of the process above





or creat a batch file, my_script.bat, this will not show any process result
paste the content above-------------
debug
pause

paste the content below-------------



once the key.bin is generated, review this content as followings,



arrow
arrow
    全站熱搜
    創作者介紹
    創作者 xiaolabaDIY 的頭像
    xiaolabaDIY

    xiaolabaDIY 的部落格

    xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()