Is there GetLocalizedText function in 2.4.3? If yes, any suggestions how to find it? Because by simply searching strings in IDA etc. can't find it.
Is there GetLocalizedText function in 2.4.3? If yes, any suggestions how to find it? Because by simply searching strings in IDA etc. can't find it.
Couldn't find GetLocalizedText (no even such function name listed in .idb). Though as it seemed interesting, I found another function:
Takes pointer to dword result storage and ASCII variable name (returns some kind of success or not). After execution retValue will have pointer to string within. It's located at 0x305A30 (rebased and 2.4.3 of course). Found by pattern of InitializePlayerName which calls this (gets some UNIT_FONT variable).Code:int __cdecl FrameScript_GetVariable(char *a1, DWORD* retValue)
P.S. actually, if you need it for some lua functions returns, then it's probably better to take any return values directly from lua stack.
P.P.S. working as intended
PHP Code:
wow.Asm.AddLine("push {0}", retValuePtr);
wow.Asm.AddLine("push {0}", varName);
wow.Asm.AddLine("call {0}", GetVariablePtr);
wow.Asm.AddLine("add esp, 8");
uint stringPtr=wow.ReadUInt(retValuePtr);
Last edited by Empted; 10-30-2012 at 01:59 PM.
Works! Tyvm, for this info. Here is method i use:
// use as:PHP Code:
typedef bool (__cdecl* tFrameScript_C__GetVariable)(const char * varName, DWORD * outNamePtr);
tFrameScript_C__GetVariable FrameScript_C__GetVariable = reinterpret_cast<tFrameScript_C__GetVariable>(0x00705A30);
void Execute(string luaCmd)
{
Lua(luaCmd); //LuaDoString
}
template <class T>
T Execute(string luaCmd, string varName)
{
}
template <>
int Execute(string luaCmd, string varName)
{
Execute(luaCmd);
DWORD resultPtr = 0;
FrameScript_C__GetVariable(varName.c_str(),&resultPtr);
CLog::p()->Debug(_LUA,"Executed with int type, ptr: %.0X",resultPtr);
string resultStr = Memory->ReadString(resultPtr);
CLog::p()->Debug(_LUA,"Result = %s",resultStr.c_str());
return atoi(resultStr.c_str());
}
Wrapper.Execute<int>("INitemCount = GetContainerNumSlots(0);","INitemCount");
Last edited by nerexis; 10-31-2012 at 06:19 AM.