2017-04-15 69 views
3

我在制作一个程序,使用AutoIt显示hello world。汇编代码在其他语言的示例中使用,但不是AutoIt。该代码是: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

您试过这样做吗?

#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)