that looks about right. The GetText string is referenced in those functions. Just double click on one of them and start reversing.
that looks about right. The GetText string is referenced in those functions. Just double click on one of them and start reversing.
"Threads should always commit suicide - they should never be murdered" - DirectX SDK
I double click the first one . What can I do next? Sorry, I havn't reversed before. THANKS.
pic here:1.jpg
What you see is a list of pairs of string and function pointers. click on the function below the aGetText. (sub_48D730) (You might need to check the other 3 xrefs as well if that function isnt what you were looking for)
"Threads should always commit suicide - they should never be murdered" - DirectX SDK
I got to those functions, and got some codes with pressing "F5". But all codes end with "return 1" instead of some string var . I think that's not expected result.
In addition its difficult for me to figure out the right codes from those results. After all the programm language I'm using is autoit.
Therefor I think I have to give up. Maybe I'll never learn it before afk from wow in one or two years.
Thank you very much for teaching me so much.
ps:2.jpg 4.jpg 3.jpg 1.jpg
I suggest taking a look at c/c++, x86 assembler and embedding lua into your own application. I wrote a simple pinvoke wrapper around the lua library in c#. This way I learned how c/c++ functions need to be structured for lua, which allows me to reverse simple functions like your first example (2.jpg) in a few seconds.
Your examples show c functions that have been registered in lua via lua_register(). Those functions accept a single parameter (the lua state, a1 in the hexrays pseudocode) and need to return an integer with the amount of values pushed (and left) on the stack. (those are the return values in lua) The last function in your first example (2.jpg) is lua_pushstring. It accepts 2 parameters: the lua state and a string. Therefor, the string you are looking for is stored in the local variable v4.
The Usage text gives you some more hints to what the current state of the stack could be and predict what the other methods can be:
since sub_84F280 is called with an error string and the lua state as parameters, the most likely candidate is lua_error() in this case.
The first function should be lua_isstring() (sub_84E0E0). You can see that by looking at the error message: GetText() expects a string and can handle up to 2 optional integers (parameters in brackets are considered optional). If the return value of sub_84E0E0 is false, it returns the error message.
The other 2 functions are probably lua_isnumber()(sub_84DF20) and lua_tointeger()(sub_84E070)
I assume sub_819D40() is FrameScript::GetText() or something similar to that.
Good luck.
Last edited by xalcon; 06-06-2018 at 07:08 AM.
"Threads should always commit suicide - they should never be murdered" - DirectX SDK