dubiousintent Posted July 13, 2015 Share Posted July 13, 2015 Does anyone know how the HEX code manipulation program works?Which program would that be you are speaking about, specifically? Lots of possibilities. -Dubious- Link to comment Share on other sites More sharing options...
Wraithdrof Posted July 13, 2015 Author Share Posted July 13, 2015 Which program would that be you are speaking about, specifically? Lots of possibilities. Any, really. I know the HxD HEX Editor is used for XCOM, but I haven't tried it myself. I guess the simplest? Link to comment Share on other sites More sharing options...
dubiousintent Posted July 13, 2015 Share Posted July 13, 2015 (edited) Pretty much any Hex Editor would work, but HxD is easy enough to use (GUI interface) and you can expect to find people with experience with it here if needed. It's what was used to illustrate the documentation of that portion of the "Hex Editing UPK Files" wiki article, and it's free. The primary thing that trips people up is to forget to set the "datatype" field in the search option (hex or string, unicode, etc.). It shows a split screen with hex on the left and the printable ASCII on the right. (Non-printable ASCII values appear as periods ("."), which is why searching for hex works better most of the time.) Changes to either side are immediately reflected on the other. Has an "undo" function as well. See the download site blog for other help. -Dubious- Edited July 13, 2015 by dubiousintent Link to comment Share on other sites More sharing options...
Wraithdrof Posted July 13, 2015 Author Share Posted July 13, 2015 Sorry, I don't mean how to use it - how does it actually look into the UPK files and edit the data? Link to comment Share on other sites More sharing options...
Krazyguy75 Posted July 13, 2015 Share Posted July 13, 2015 Sorry, I don't mean how to use it - how does it actually look into the UPK files and edit the data? I'm guessing you've never used a hex editor before. That, or you have no idea how they work. Hex editors edit the actual bytes which compose the file. Hex strings are virtually unreadable. We use UE explorer to find what the original hex was, then we change it in a hex editor. What we are trying to do now is find what location in the code the hex is located. Link to comment Share on other sites More sharing options...
dubiousintent Posted July 13, 2015 Share Posted July 13, 2015 (edited) Sorry, I don't mean how to use it - how does it actually look into the UPK files and edit the data?A compiled program consists of hex code. (The hex code itself depends upon the platform architecture (Intel, AMD, Mac/Linux, etc.) the code is compiled for.) This applies to both the EXE and the "uncompressed" but "cooked" UPK files. A Hex Editor can directly read and manipulate that hex code, but has no preconceived idea as to it's purpose. It's just going to show you every byte as it finds it. YOU have to provide that "framework" of how it is organized. Which is why you need to have an idea from the previously referenced UPK Data Format document and what the UE Explorer program shows you. Finding the location of the desired hex code is the "art" of hex editing. It depends upon determining a unique sequence of hex code that you can search on. Unfortunately this is seldom as simple as looking for a plaintext string. Usually it requires knowing the UnrealScript code you need (i.e. from UE Explorer or source code) and the hex code representation of that UnrealScript (which is either in the "Hex Values XCOM Modding" wiki article or other articles in that file's "References" section). The "Hex editing the UPK" wiki article walks you through the basic process, but in this instance you still have to figure out what UnrealScript code you need to look for. That is going to require trial and error, and lots of patience. -Dubious- Edited July 13, 2015 by dubiousintent Link to comment Share on other sites More sharing options...
Wraithdrof Posted July 13, 2015 Author Share Posted July 13, 2015 And I'm guessing UPKs have their own code style for models too, as well as just their scripts. Is there any method to the madness that Unreal uses to package a UPK? If we get the same version of UE that XCOM was made in, would we be able to figure out the HEX codes by:Extracting a model from an XCOM UPKPutting the model in a functional project within UECompiling the project into a UPKGetting the much-easier-to-find HEX values that holds all the vertices in the new UPKand using them in a ctrl+f search on the original UPK to locate the equivalent model's HEX valuesThe issue is that there WILL be a limit to the amount of things that we can change within the UPK, because all it is really is an optimized and compressed version of all the source files. And the compression in this case is likely only going to be one-way, as the engine and computer can fill in the gaps. Changing a value for a variable could be a very different beast to changing an actual mesh. Link to comment Share on other sites More sharing options...
tracktwo Posted July 13, 2015 Share Posted July 13, 2015 The umodel program, made by the same person as ue explorer, can view the models in a upk. So it clearly knows how to locate and visualize the vertex data. I believe at least part of the library that is used under ue explorer has been open sourced, but I'm not sure if that includes the part that can analyze a model or not. Link to comment Share on other sites More sharing options...
Wraithdrof Posted July 13, 2015 Author Share Posted July 13, 2015 Perhaps we could get into contact with the developer of umodel/ue explorer? I'm guessing they'd be able to help us a lot. Link to comment Share on other sites More sharing options...
Krazyguy75 Posted July 14, 2015 Share Posted July 14, 2015 umodel is fully open source. I can never read another person's source code without getting nightmares, but I'll link it here. https://github.com/gildor2/UModel Link to comment Share on other sites More sharing options...
Recommended Posts