Hi, the correct code is :
public static string GetTextFixed(string commandline)
{
uint FrameScript_GetText = 0x0819d40;
var commandByte = System.Text.Encoding.UTF8.GetBytes(commandline + "\0");
var luaGetLocalizedTextSpace = wManager.Wow.Memory.WowMemory.AllocData.Get(commandByte.Length);
var rCodecave = wManager.Wow.Memory.WowMemory.AllocData.Get(IntPtr.Size);
if (luaGetLocalizedTextSpace <= 0)
return "";
wManager.Wow.Memory.WowMemory.Memory.WriteBytes(luaGetLocalizedTextSpace, commandByte);
wManager.Wow.Memory.WowMemory.Memory.WritePtr(rCodecave, 0);
var asm = new[]
{
wManager.Wow.Memory.WowMemory.CallWrapperCodeRebaseEsp(FrameScript_GetText, 0x0C, luaGetLocalizedTextSpace, -1, 0),
"mov ecx, " + rCodecave,
"mov [ecx], eax",
wManager.Wow.Memory.WowMemory.RetnToHookCode
};
wManager.Wow.Memory.WowMemory.InjectAndExecute(asm);
var sResult = string.Empty;
var a = wManager.Wow.Memory.WowMemory.Memory.ReadPtr(rCodecave);
if (a > 0)
sResult = wManager.Wow.Memory.WowMemory.Memory.ReadStringUTF8(a);
if (string.IsNullOrEmpty(sResult))
sResult = string.Empty;
wManager.Wow.Memory.WowMemory.AllocData.Free(luaGetLocalizedTextSpace);
wManager.Wow.Memory.WowMemory.AllocData.Free(rCodecave);
return sResult;
}