Specifically, can I pass a pointer to the native ahk array and navigate it in c? I tried making a simple mcode function to explore the memory after the array pointer but didn't see anything recognizable.
Code: Select all
out := ""
test := [1,2,3,4,5,6,7,8,9]
MyFunction := MCode("2,x86:VYnlg+wEi0UMiEX8D75V/ItFCAHQD7YAycOQkA==")
loop 200
{
raw := DllCall(MyFunction,"ptr",&test ,"int",A_index-1, "cdecl")
out .= chr(raw) . " " . raw . "`n"
}
clipboard := out
msgbox done
/*
char explore(char *arrayPtr,char offset)
{
return *(arrayPtr+offset);
}
*/
MCode(mcode)
{
static e := {1:4, 2:1}, c := (A_PtrSize=8) ? "x64" : "x86"
if (!regexmatch(mcode, "^([0-9]+),(" c ":|.*?," c ":)([^,]+)", m))
return
if (!DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", 0, "uint*", s, "ptr", 0, "ptr", 0))
return
p := DllCall("GlobalAlloc", "uint", 0, "ptr", s, "ptr")
if (c="x64")
DllCall("VirtualProtect", "ptr", p, "ptr", s, "uint", 0x40, "uint*", op)
if (DllCall("crypt32\CryptStringToBinary", "str", m3, "uint", 0, "uint", e[m1], "ptr", p, "uint*", s, "ptr", 0, "ptr", 0))
return p
DllCall("GlobalFree", "ptr", p)
}
Thanks for any tips.