无法 assemble EICAR 测试文件 NASM
Can't assemble EICAR test file with NASM
我disassembled EICAR 测试文件并得到以下代码:
[org 100h]
pop ax
xor ax,214Fh
push ax
and ax,4140h
push ax
pop bx
xor al,5Ch
push ax
pop dx
pop ax
xor ax,2834h
push ax
pop si
sub [bx],si
inc bx
inc bx
sub [bx],si
jge 0140h
db "EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$"
dec ax
sub cx,[bx+si+2Ah]
我不明白为什么当我尝试使用 nasm -fbin
将它 assemble 返回到 DOS COM 文件时它不起作用,它给了我以下输出(它不执行):
X5O!P%@AP[4\PZX54(P^)7CC)7..".EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
实际应该在的位置:
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
关于 NASM 出了什么问题的任何指示?
PS1:当使用旧的 A86 Assembler 时,它工作得很好。
PS2: 我正在使用 Windows 7 32 位。
试试 nasm -O0 -fbin
-O0(大写"o",零)将关闭所有优化。 Nasm 尽力帮助你。
此外,如果您稍微调整一下源代码...
bits 16
[org 100h]
pop ax
xor ax,214Fh
push ax
and ax,4140h
push ax
pop bx
xor al,5Ch
push ax
pop dx
pop ax
xor ax,2834h
push ax
pop si
sub [bx],si
inc bx
inc bx
sub [bx],si
db "}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$"
dec ax
sub cx,[bx+si+2Ah]
有效。我的 AV 刚刚标记了输出。
那个 jge 似乎是问题所在。看看它是如何组装的——不同的长度跳跃等。这很可能解释了文件中的差异,特别是因为你的输出似乎与正确的输出长度不同。
我disassembled EICAR 测试文件并得到以下代码:
[org 100h]
pop ax
xor ax,214Fh
push ax
and ax,4140h
push ax
pop bx
xor al,5Ch
push ax
pop dx
pop ax
xor ax,2834h
push ax
pop si
sub [bx],si
inc bx
inc bx
sub [bx],si
jge 0140h
db "EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$"
dec ax
sub cx,[bx+si+2Ah]
我不明白为什么当我尝试使用 nasm -fbin
将它 assemble 返回到 DOS COM 文件时它不起作用,它给了我以下输出(它不执行):
X5O!P%@AP[4\PZX54(P^)7CC)7..".EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
实际应该在的位置:
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
关于 NASM 出了什么问题的任何指示?
PS1:当使用旧的 A86 Assembler 时,它工作得很好。
PS2: 我正在使用 Windows 7 32 位。
试试 nasm -O0 -fbin
-O0(大写"o",零)将关闭所有优化。 Nasm 尽力帮助你。
此外,如果您稍微调整一下源代码...
bits 16
[org 100h]
pop ax
xor ax,214Fh
push ax
and ax,4140h
push ax
pop bx
xor al,5Ch
push ax
pop dx
pop ax
xor ax,2834h
push ax
pop si
sub [bx],si
inc bx
inc bx
sub [bx],si
db "}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$"
dec ax
sub cx,[bx+si+2Ah]
有效。我的 AV 刚刚标记了输出。
那个 jge 似乎是问题所在。看看它是如何组装的——不同的长度跳跃等。这很可能解释了文件中的差异,特别是因为你的输出似乎与正确的输出长度不同。