MPQC Posted April 30, 2015 Share Posted April 30, 2015 (edited) How do you find a function that isn't called? In my case, I want to be able to call a function which isn't called elsewhere, but only from the key binds (an exec function). Normally I can just find it elsewhere in the code nd use that as a referance, but that doesn't seem to be possible in this case. (Quick edit: this is not for XCOM). Edited April 30, 2015 by MPQC Link to comment Share on other sites More sharing options...
dubiousintent Posted April 30, 2015 Share Posted April 30, 2015 (edited) Have you seen the "Unreal Engine 3 Console Commands" article? (Originally linked in the XCOM "Keybind Commands" wiki article.) Which is not to say all listed exec commands are available in all UE3 games, but if one isn't listed there then it would most probably be a vendor specific implementation. If the vendor doesn't list it, they are typically found only by stumbling upon them looking for something else. Otherwise you will have to hope one of the code divers like wghost81 or Amineri has a tip. In which case a PM in a couple of days might be more effective. -Dubious- Edited April 30, 2015 by dubiousintent Link to comment Share on other sites More sharing options...
wghost81 Posted May 1, 2015 Share Posted May 1, 2015 Before it can be called, a function has to be defined. exec functions can be found in the code by decompiling it with UE Explorer and searching the classes for "exec" keyword. Link to comment Share on other sites More sharing options...
MPQC Posted May 2, 2015 Author Share Posted May 2, 2015 Ah, I think what I wanted was misunderstood - I'll try to explain again. Basically, I can see that there are many functions that are defined in the code, but are never called elsewhere (exec functions are the perfect example of this, which is why I used them as an example). Generally, if I want to find out how to call a function, I can simply look elsewhere in the code and use that. But since these functions are never called elsewhere, I can't use this method. So is there a different way of finding them so I can call them? Link to comment Share on other sites More sharing options...
johnnylump Posted May 4, 2015 Share Posted May 4, 2015 In UE Explorer, go to the function and open buffer view. The last eight bytes, what Explorer calls the "FriendlyName" on Mouseover, is the hex reference for calling that function. eg XGAction_Fire.AddVictim, friendlyname is d2 02 00 00 00 00 00 00, so a call to that (within the scope) is 1b d2 02 00 00 00 00 00 00 Link to comment Share on other sites More sharing options...
wghost81 Posted May 4, 2015 Share Posted May 4, 2015 One little addition: if the function is final, it's called with 1C + object reference. For script packages object reference is equal to NetIndex+1. NetIndex is the first four bytes in buffer view of UE Explorer. And native functions are called by their native index. More information here: http://wiki.tesnexus.com/index.php?title=Hex_values_XCOM_Modding Link to comment Share on other sites More sharing options...
MPQC Posted May 9, 2015 Author Share Posted May 9, 2015 That's awesome. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts