AutoIt汇编代码打印消息

3

我正在使用AutoIt编写一个程序来显示 hello world。该汇编代码被用于其他语言的示例中,但没有在AutoIt中使用。代码如下:

char code[] =
"\xb8\x04\x00\x00\x00"
"\xbb\x01\x00\x00\x00"
"\xb9\x00\x00\x00\x00"
"\xba\x0f\x00\x00\x00"
"\xcd\x80\xb8\x01\x00"
"\x00\x00\xbb\x00\x00"
"\x00\x00\xcd\x80";

我将尝试使用AutoIt:


$pt = DLLStructCreate("byte[" & BinaryLen($YourShellcode) & "]")

DllStructSetData($pt, 1, $YourShellcode)

$y=DllStructGetPtr($pt)

_WinAPI_CallWindowProc($y, 0, 0, 0, 0)

但我不确定如何包含这个汇编代码来打印 hello world。怎么做呢?请提供一个使用asm和AutoIt的小例子,只需一个简单的 hello world

1个回答

1

你试过这样做吗?

#include <WinAPI.au3>
Global $YourShellcode = "0xb804000000bb01000000b900000000ba0f000000cd80b801000000bb00000000cd80"

$pt = DLLStructCreate("byte[" & BinaryLen($YourShellcode) & "]")

DllStructSetData($pt, 1, $YourShellcode)

$y=DllStructGetPtr($pt)

_WinAPI_CallWindowProc($y, 0, 0, 0, 0)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接