twinj Posted January 9, 2013 Share Posted January 9, 2013 (edited) These can be found in Core.upk, Engine.upk. And in these classes: Object.class, Actor.class, Controller.class, I checked other main upks and there are no native functions in them (XComGame, Stratgey, Framework) I could not find location of last 3 or native functions on the list. XCOM adds natives that are not in the 2011UDK. The extra natives are in the Object.class For those who wish to understand the format of the list //-------------------------------------- //--- 010 Editor v4.0.3 Binary Template // // File: // Author: // Revision: // Purpose: //-------------------------------------- local int j; typedef struct { BYTE StringLength; CHAR Name[stringLength]; BYTE OperatorPrecedence; enum <BYTE> FUNCTION_TYPE { function = 1, operator = 2, preoperator = 3, postoperator = 4} Type; DWORD HexCode <format=hex>; } ENTRY <read=ReadENTRY>; string ReadENTRY(ENTRY &Entry) { string s; SPrintf(s, "native(%d) %s(%d) %s", Entry.HexCode, EnumToString(Entry.Type), Entry.OperatorPrecedence, Entry.Name); return s; } typedef struct { for (j = 0; j < count; j++) { ENTRY Entry; } } ENTRIES <read=ReadENTRIES>; string ReadENTRIES(ENTRIES &Entries) { string s; SPrintf(s, "Names: %d", count); return s; } // Code start here LittleEndian(); // Check to make sure it's a file DWORD MagicNumber; if (MagicNumber != 0x2C8D14F1) { Warning("Not a valid native table file"); return 1; } //Read number DWORD count; ENTRIES Entries; Edited January 9, 2013 by twinj Link to comment Share on other sites More sharing options...
EliotVU Posted January 9, 2013 Share Posted January 9, 2013 I'm quite surprised there's interest for this :dance: I might as well release the source code for NTL files: https://gist.github.com/a9d16bfdb650b45708b8 Link to comment Share on other sites More sharing options...
twinj Posted January 10, 2013 Author Share Posted January 10, 2013 Lol. Thanks Eliot. Looks like I reversed correctly. :biggrin: Link to comment Share on other sites More sharing options...
Amineri Posted April 30, 2013 Share Posted April 30, 2013 (edited) This Native Table List really needs to be added to the standard tools list on the wiki. It's really quite essential! With this I was able to correctly decompile XGAIBehavior -- without it, the virtual sizes were calculated incorrectly, so the if/else conditional brackets were all messed up. All these mods I've done have been without this -- I can't believe it! @_@ EDIT:It decompiled CLOSER to correct. There are still a few glitches with the calculation of the virtual size -- I'm guessing it has to do with the 3 natives that twinj coudn't find? Edited April 30, 2013 by Amineri Link to comment Share on other sites More sharing options...
dubiousintent Posted May 2, 2013 Share Posted May 2, 2013 (edited) Added to Wiki tools list 'here'. Need a separate subject article explaining what these tables are and how they are used. Anyone interested in contributing, there is a template 'here' and guidelines 'here'. Edit: the bare bones start of an article is now 'here'. -Dubious- Edited May 9, 2013 by dubiousintent Link to comment Share on other sites More sharing options...
bokauk Posted May 7, 2013 Share Posted May 7, 2013 Can someone please explain what this Natives Table List does exactly, and how it might be useful?To test it out, I saw a reference to LineOfSight so I opened Engine.upk > Controller. LineOfSightTo first with the XCOM NTL, then closed it and loaded it again with the UDK-2012-05 NTL, but I saw no difference at all.I know the native functions are inside the .exe, so I'm quite lost what this NTL does :blink: Link to comment Share on other sites More sharing options...
johnnylump Posted May 7, 2013 Share Posted May 7, 2013 I think they're just the interpretation guidelines for bytecodes into decompiled code. I was using an old one on XGStrategyAI, AddLateMission, and it didn't decompile the modulo function correctly, but switching to the most recent (2012-5) did the trick. Link to comment Share on other sites More sharing options...
EliotVU Posted May 20, 2013 Share Posted May 20, 2013 The NativeTables are necessary for UE Explorer to detect if a bytecode is for a specific Native function. Here's an example: // Export UObject::execSaveConfig(FFrame&, void* const)native(536) final function SaveConfig(); as you can see this function is native and has this number 536 which is the bytecode that will represent the call to this function, so whenever UE Explorer sees a bytecode with a high number it'll assume there's another one, so a 2 bytes bytecode and then it'll scan the NativesTableList for this number which has the name of each function and its number, and so this way UE Explorer knows the name, format and anything else necessary. UE Explorer includes a tool that can automatically generate these tables by simply loading every package suspicious of having such native function declarations(note only those with the numbers matter). These numbers may vary from game to game so NTLs are needed to solve this issue. Link to comment Share on other sites More sharing options...
dubiousintent Posted May 21, 2013 Share Posted May 21, 2013 Thanks, Eliot. This explanation has been added to the Wiki page on NativeTables. -Dubious- Link to comment Share on other sites More sharing options...
bokauk Posted May 21, 2013 Share Posted May 21, 2013 Thanks for the explanation; it makes a whole lot more sense to me now :smile: I suspect it's not likely, but is there any way to find the native function's address within the .exe by using it's bytecode id/number, or by any other method? For example, I can see the string "UObjectexecSaveConfig" grouped with all of the other native function names in the exe, but how does the game then know where that function is in the exe file? No worries if you're not sure, but I thought I'd ask just in case anyway :smile: Link to comment Share on other sites More sharing options...
Recommended Posts