i've post all to fix it all what Millow and you got to do is put it in your code.
If there are still errors post it here.
now to my Problem:
i try to get a Return of the LuaDostring with this
Code:
LuaDoString("test = CanSendAuctionQuery()");
test = GetLocalizedText("test");
here the GetLocalizedText Function:
Code:
public static string GetLocalizedText(string Commandline)
{
// Command to send using LUA
String Command = Commandline;
var proc = Process.GetProcessesByName("Wow");
IntPtr WoWBase = proc[0].MainModule.BaseAddress;
// Allocate memory for command
uint Lua_GetLocalizedText_Space = MyHook.Memory.AllocateMemory(Encoding.UTF8.GetBytes(Command).Length + 1);
// offset:
uint ClntObjMgrGetActivePlayerObj = 0x93AD0;
uint FrameScript__GetLocalizedText = 0x1C4190;
// Write command in the allocated memory
MyHook.Memory.WriteBytes(Lua_GetLocalizedText_Space, Encoding.UTF8.GetBytes(Command));
String[] asm = new String[]
{
"call " + ((uint)WoWBase + ClntObjMgrGetActivePlayerObj),
"mov ecx, eax",
"push -1",
"mov edx, " + Lua_GetLocalizedText_Space,
"push edx",
"call " + ((uint)WoWBase + FrameScript__GetLocalizedText),
"retn",
};
// Inject the shit
string sResult = Encoding.ASCII.GetString(MyHook.InjectAndExecute(asm));
// Free memory allocated for command
MyHook.Memory.FreeMemory(Lua_GetLocalizedText_Space);
// Uninstall the hook
return sResult;
}
Wow Crashes me after string sResult = Encoding.ASCII.GetString(MyHook.InjectAndExecute(asm));