我试图“破解”一个控制台程序,迫使它显示一些东西。问题是我无法打印换行符 ( \r\n
)。使用 disassebler 我找到了这个地方并编辑了二进制文件:
push 4ad0eb46 ; the string (let's pretend "Hi guys")
push 4ad0eb80 ; and the format ("%s")
call near ds:[<&msvcrt.printf>] ; call printf
jmp 4ad0eb4f ; skip data
; now here I coded the strings
mov ds:[4ad289ec],eax ; and here the program resumes
正如我所说,我无法打印换行符。我尝试"\r\n"
在格式字符串中进行编码(所以它变成"%s\r\n"
,就像我在 C 中所做的那样)并打印"Hi guys\r\n"
,并在字符串本身中对其进行编码(制作它"Hi guys\x13\x10"
)并获取"Hi guys"
两个奇怪的字符,可能是 0x13 和 0x10 的 ASCII 表示。