wghost81 Posted December 8, 2013 Share Posted December 8, 2013 (edited) Good news: I was able to successfully expand function size by moving it to the end of UPK file and changing corresponding parameters of ExportObjectList in UPK header. No more size limitations! Hooray! :smile: Right now I have a set of console utilities to work with upk files: extract information, patch upk, move and expand function. I plan on releasing those (with sources) asap after I perform a little more testing to make sure I didn't made some stupid mistakes. :smile: Stay tuned! :wink: Edited December 8, 2013 by wghost81 Link to comment Share on other sites More sharing options...
Amineri Posted December 8, 2013 Share Posted December 8, 2013 That is some awesome news. One issue I'm curious about is how such changes are going to be handled when a patch is released and mods have to be updated. Because of this I'm thinking that it may generally be safer to not change function size. Sometimes I admit that it is a hugely painful limitation. Generally the way I've gotten around it when needed is by finding and taking over unused functions to use as helpers. Definitely very interested in seeing your utilities, though! ^_^ Link to comment Share on other sites More sharing options...
wghost81 Posted December 8, 2013 Author Share Posted December 8, 2013 (edited) Well, patch will mess things up, sure. But at this point I don't think it's a problem, because mod "sources" are usually a set of changes, applied to set of functions. And if function still exist, there is no problem in moving it to new upk end again. I made an alternative UPK patcher, which is fully compatible with ToolBoks custom mod format, plus supports before/after style, plus allows to patch functions by name with no need to know it's offset. So patching will look like "find name.function, move and expand, apply code changes". No problems. :smile: PS I was thinking about expanding GetSupportingAlien when I was at it... Just imagine all the new crazy combinations... :smile: Edited December 8, 2013 by wghost81 Link to comment Share on other sites More sharing options...
dreadylein Posted December 8, 2013 Share Posted December 8, 2013 Nice one ;) Link to comment Share on other sites More sharing options...
Neonin Posted December 8, 2013 Share Posted December 8, 2013 Does that work if you move/expand more than one function to the end of a UPK? Either way that's a pretty amazing discovery, considering the amount of time and effort that normally goes into rewriting functions without messing something up! Link to comment Share on other sites More sharing options...
wghost81 Posted December 8, 2013 Author Share Posted December 8, 2013 Does that work if you move/expand more than one function to the end of a UPK?Yes. Object data are extracted by offset in UPK file. You leave original data where they are, append new data and change offset in objectlist. You can move any number of functions in this manner, as long as you append new data to the end of file. Link to comment Share on other sites More sharing options...
Bertilsson Posted December 8, 2013 Share Posted December 8, 2013 Is it working together with UE Explorer? Link to comment Share on other sites More sharing options...
wghost81 Posted December 8, 2013 Author Share Posted December 8, 2013 Yes, UE Explorer reads upk correctly. Link to comment Share on other sites More sharing options...
Bertilsson Posted December 8, 2013 Share Posted December 8, 2013 Then this is truly good news indeed :) Does this also mean that it is possible to insert completely new objects by moving the very first objects to the end of file and thereby making room available for new declarations? Link to comment Share on other sites More sharing options...
wghost81 Posted December 8, 2013 Author Share Posted December 8, 2013 (edited) Does this also mean that it is possible to insert completely new objects by moving the very first objects to the end of file and thereby making room available for new declarations?Theoretically, yes. But this will require a lot of work with rebuilding headers/lists. And there is something about that list order I don't yet understand: there are some references (?) in function header to objectlist, which could be order-sensitive. The problem is, I don't know a thing about first 0x28 bytes of function header, so I can't tell for sure. :sad: UPD Didn't read correctly: no, you can't make space in objectlist by moving first object, as first object after objectlist is importtlist, so you have to move importlist too. This is doable, but will require a lot of work (see above). Edited December 8, 2013 by wghost81 Link to comment Share on other sites More sharing options...
Recommended Posts