I'm working on decompiling the scripting engine from the game Rayman 2. It's going pretty well, but I'm getting stuck on a particular function which calls another function with arguments that aren't initialized.

This is the relevant piece of the function:

void __cdecl fn_p_stIntelligenceEvalTreeEngine(HIE_tdstSuperObject 
*superObject, tdstNodeInterpret_ *nodeInterpreter, tdstGetSetParam_ 

  HIE_tdstSuperObject *superObject_1; // [sp+0h] [bp-20h]@0
  tdstNodeInterpret_ *nodeInterpreter_1; // [sp+4h] [bp-1Ch]@0
  tdstGetSetParam_ *getSetParam_1; // [sp+8h] [bp-18h]@0


  evaluatedNode = fn_p_stEvalTree(superObject_1, nodeInterpreter_1, getSetParam_1);

From what I understand, at the time of calling the variables have already been put in place, namely at bp-20, bp-1C and bp-18h. Now what I'm failing to understand is how these variables are assigned. Should I be looking at the parent function which calls this function to see how these variables are created? Or is there some other explanation?

Here's the full function for those interested: https://pastebin.com/Udj4K8PW

  • 2
    It's "some other explanation": decompilation is still guesswork. It helps, for stock functions that do standard things, but as soon as you go "WTH!?", it's time to take a look at the original disassembly. – Jongware Jan 1 '18 at 22:28
  • 4
    show us the asm. – Igor Skochinsky Jan 1 '18 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.