AutoIt build code to print message
I am making a program to show hello world
using AutoIt. The assembly code was used in examples for other languages, but not for AutoIt. Code:
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";
I will try to use AutoIt like this:
$pt = DLLStructCreate("byte[" & BinaryLen($YourShellcode) & "]")
DllStructSetData($pt, 1, $YourShellcode)
$y=DllStructGetPtr($pt)
_WinAPI_CallWindowProc($y, 0, 0, 0, 0)
But I'm not sure how to enable this assembly code for printing hello world
. How to do it? Just a small example hello world
using asm and AutoIt.
+3
source to share
1 answer
Have you tried this?
#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)
+1
source to share