Gazzzz Posted October 19, 2012 Share Posted October 19, 2012 For decompressing with that tool, what worked for me wasdecompress -export -all -lzo xcomgame.upkThat's lzo with lowercase L. But I haven't been able to get UE Explorer to show me anything. I'm well familiar with programming, but also haven't touched the unreal engine before.Thanks. This is what worked for me in the end: decompress.exe -lzo -out=upk_unpacked xcomgame.upkdecompress.exe -lzo -out=upk_unpacked XComStrategyGame.upk Specifying the output path makes sure it doesn't overwrite the original files. And makes them easier to find. I still don't "get" Unreal modding, what goes where and why, but that's no different from any other new game. Reading time. =) Link to comment Share on other sites More sharing options...
kanet32 Posted October 19, 2012 Share Posted October 19, 2012 (edited) Managed to make the edit I wanted to make to XGCharacterGenerator, so I thought I'd share some information that helped me. Get UE Explorer and Gildor's decompressor and extractor. Then, like Mashadar said, decompress UPK and use UE Explorer to find which file has the code you want to change. Then, extract the UPK and find that file, open it up in a hex editor, and figure out how to alter the bytecode to make the change you want. This source file for an UnrealScript decompiler gives a ton of detail on the compiled bytecode. The list of bytecode values close to the top doesn't include function calls, like Rand(), or native operators like == and !=, but if you have UE Explorer, the Native Tables in its program directory will give you those if you open them in a hex editor. For reference, when you're trying to figure out the format of those Native Tables files, == is 9A, != is 9B, and Rand() is A7. Presumably, the ExportTable, ImportTable, and NameTable in the UPKs should have the rest of the functions, but in practice I haven't been able to get them to work. I just converted the decimal values to hex, maybe it's a little-endian/big-endian thing? Once you've made the change, you can search for the original contents of the file in the UPK (again, using a hex editor) and replace them with the new contents. Then, apparently, you have to update the file hashes in the executable, but I haven't tried that, yet. Figure I'll wait for Sir Daemonjax's program, rather than trying to figure it out myself. EDIT: Oh, and just in case somebody runs into the same problem I had, they have separate bytecodes for constant 0 and 1, 0x25 and 0x26, respectively. Other constants are preceeded by something like 2C (IntConstByte) or 1D (IntConst). So, for instance, 2 is "2C 02," but 1 is just "26" Edited October 19, 2012 by kanet32 Link to comment Share on other sites More sharing options...
Daemonjax Posted October 19, 2012 Share Posted October 19, 2012 Then, apparently, you have to update the file hashes in the executable, but I haven't tried that, yet. Figure I'll wait for Sir Daemonjax's program, rather than trying to figure it out myself. It's available. It's beta, but it works. Look for the XSHAPE thread. Now I'm going to actually try to mod something. :D Link to comment Share on other sites More sharing options...
kanet32 Posted October 19, 2012 Share Posted October 19, 2012 It's available. It's beta, but it works. Look for the XSHAPE thread. Now I'm going to actually try to mod something. :D Awesome work. That should simplify things enormously. Thanks muchly for your efforts. Gotta say, though, it's kinda sad that we have to do this. Deliberately putting checks in to stop people modding the game? Have those nitwits not been made aware of the massive number of sales of ArmA 2 that DayZ has been driving? Link to comment Share on other sites More sharing options...
Daemonjax Posted October 19, 2012 Share Posted October 19, 2012 It's available. It's beta, but it works. Look for the XSHAPE thread. Now I'm going to actually try to mod something. :D Awesome work. That should simplify things enormously. Thanks muchly for your efforts. Gotta say, though, it's kinda sad that we have to do this. Deliberately putting checks in to stop people modding the game? Have those nitwits not been made aware of the massive number of sales of ArmA 2 that DayZ has been driving? Yeah, man... They've really got us jumping through hoops. But.. I dunno... maybe we'll be able to actually make some mods. I'm trying to stay positive, but it's kinda hard. Link to comment Share on other sites More sharing options...
kanet32 Posted October 19, 2012 Share Posted October 19, 2012 Haha, don't worry, it was made with the UDK, so it's pretty much certain that people will figure out how to use the UDK tools to repack the UPKs and recompile the scripts. They might not want us modding the game, but by using UE3 they basically gave us all the original source code. All we're missing now is essentially compiler settings. Heck of a lot better than the good old days of C&C modding ;) Link to comment Share on other sites More sharing options...
dreadylein Posted October 19, 2012 Share Posted October 19, 2012 if i remember correct the hash checks are standart function of the unreal engine, so dont think it had something todo with stopping us, more stopping other people, hell i can understand them, we have full acess to the dlc manager, nothing they are happy about i guess Link to comment Share on other sites More sharing options...
kanet32 Posted October 19, 2012 Share Posted October 19, 2012 Oh, is that true? I hadn't thought about that. I guess it makes sense--maybe it's a debugging facility that most devs don't turn off. You know, when a new test build goes out you lock the hashes for all the game files into the executable so that your testers can't accidentally run the game with bits and pieces of old code. If that's the case, maybe there's a command line argument for some kind of "developer mode" where it doesn't bother with such sanity checks. Link to comment Share on other sites More sharing options...
dreadylein Posted October 19, 2012 Share Posted October 19, 2012 most of the "standart" commandline args of the engine are stript off if i didnt overlooked something while reversing Link to comment Share on other sites More sharing options...
Daemonjax Posted October 20, 2012 Share Posted October 20, 2012 Haha, don't worry, it was made with the UDK, so it's pretty much certain that people will figure out how to use the UDK tools to repack the UPKs and recompile the scripts. They might not want us modding the game, but by using UE3 they basically gave us all the original source code. All we're missing now is essentially compiler settings. Heck of a lot better than the good old days of C&C modding ;) You seem to know exactly what to say to brighten my day. ;) Link to comment Share on other sites More sharing options...
Recommended Posts