Custom Bitmap Injection

Lord Zedd
By Lord Zedd in Tutorials & Guides,
Doesn't take nearly as long as sounds do, promise. Again, turns out the SDK handles the file conversions.   Update 3: New tool, new info   Update 2: Oops rawpage no worky for this right now.   Update 1: Added new version of Injection Helper, added tutorial for converting an adj bin with unbundler   Gonna need some things: Assembly, https://github.com/XboxChaos/Assembly/releases/tag/downloader Xbox 360 SDK installation, specifically, bundler.exe and unbundler.exe found in "\Program Files\Microsoft Xbox 360 SDK\bin\win32". (No links) Adjutant https://mega.co.nz/#!dwlyiS6Q!WCYcmLZE3d1tUNFJj5z8ktmMiZ3HU2EJpAYfzGVRs4Q Easy Bitmap Injection tool http://www.xboxchaos.com/files/file/175-easy-bitmap-injection/ An image editor that can open/save as .TGA (Photoshop works but costs money) Hex Editor (I use Hex Workshop, but any should do) (Manual Only) MapExpand that supports raw (blamite edition) http://www.mediafire.com/download/7r7xl8tufp5bo9x/mapexpand_10-20-14.rar (This particular link is the latest version that doesn't require that extra verbose option) (Manual Only) OrangeMohawk's convenient Raw Page Hash Checker Tool http://www.xboxchaos.com/topic/4445-raw-page-hash-checker/   1. Deciding Your Bitmap   As is common in all these injection tutorials, you need to know what you want. While you should be able to replace an existing bitmap without   Either way you will be using an existing bitmap as a base to duplicate off of, but are you modifying something existing or plan on making something all new? This will also help you choose your base.   With a modification, you are obviously going to want to use what you plan on editing. But for something new, it would be wise to find a bitmap that is applied similarly (UI bitmap if going for UI, HUD for HUD, etc) so the format doesn't need to be changed.   This tutorial will use modification but with a modified (upscaled) resolution to demonstrate what you'd do for a "new" image.   2. Tool Preparation   Extract the EasyBitmapInjection folder to your desktop and copy bundler.exe to EasyBitmapInjection's directory.   Extract the contents of "bitm Plugins.zip" to your Assembly directory and overwrite.   3. Map Preparation   Make a copy of the map you want (backups, yo) and open it in Assembly. Navigate to your base bitm and Right Click>Extract it using "Extract... (Without Raw)".   Extracting without raw will save some space in your map.   But before you reinject, you need to open up the tagc in a hex editor and modify the tag's name so it will inject. Nothing fancy, just swap a letter out for now.   To find it, do a text search (or just take a look, since the tagc should be pretty small) for "bitm" then the full name. So for me editing the Foundry signs, I need to find "bitmobjects\levels\dlc\warehouse\bitmaps\fence_sign_red"   Just going to replace the "o" in "objects" to an "x". That will serve the added function of it sorting at the end of the tag tree for easy access.   Once done save it and inject the tagc back and open the new bitm for later.   4. Bitmap Preparation   While not necessary, it is highly recommended that you use the original image as a base. And in most cases Adjutant will provide that for you, here's how:     Open the map with the bitmap you wish to modify in Adjutant and bring it up.   Note down the format and then Right Click>Export This Image. Save it as .BIN and again as DDS.   Open the .DDS file in your image editor and give it a look over, does it look like it does in Adjutant? Is the alpha channel intact?   If the resolution isn't "normal" (not 64/128/256/etc) your DDS may be the wrong size, but a crop/canvas resize down to the correct resolution will work if everything else is fine (anchor the upper left corner).   If there is a major issue with the DDS you will need to convert that .bin you also extracted. But since that requires the tool let's get that mostly filled out first.   If the DDS is good feel free to edit and save as .tga, if not make sure the size is still right and save as .tga anyway so it can be used as a dummy for bin conversion.   5. Tool Usage A     With the injected bitm still open in Assembly you need to check 4 things; the "Is Tiled" flag, the format, the mipmap count, and the zone Asset Index at the bottom.   Open EasyBitmapInjection and get ready to start filling things in as such:   If "Is Tiled" is checked, leave the first Format dropdown alone, if unchecked, change it to "Linear"   Set the second Format dropdown to match the Format value in Assembly.   If you have to convert a .bin from Adjutant, just write down the mipmap count for now and keep it at 0/1 in the tool.   Lastly, enter the Zone Asset Index for the bitmap data.   Close the map in Assembly.   Current Notes: For formats like  DXT*a_mono use DXT*a, the only difference is that they may use a single channel or something. If you having to convert a .bin it was probably one of these formats.   6 Manual Bitmap Conversion   This can be skipped if your DDS worked fine.   In the tool, tick "Keep XPR" but NOT "Inject Into Map" and run the tool, which will ask for your .tga.   What we are doing here is creating a dummy file that we can put the bin file into. Go ahead and delete the "convertedBitmap.bin", "convertedBitmap_mipmaps.bin" and CustomImageNoMip.xpr" files that got made   Open CustomImage.xpr in a hex editor as well as the Adjutant .bin.   Look at x4 in the file and ensure the 4 bytes after are equal to the size of the .bin. It should be.   Now go to offset x80C, hold shift, then press the End key on your keyboard. This will select everything past the offset. Delete the selection.   Switch to the .bin and do select all then copy.   Switch back to the XPR file and paste at the end. Save and close the Hex Editor.   Now make sure unbundler.exe is in the same location as your XPR, then right click>Open Command Window Here somewhere.   Enter the following: unbundler customimage.xpr Then hit enter. This will spit out a couple files, but among them will be InitialImage.tga. That is your image so go ahead and open it in your image editor.   This should be a perfect file so edit as you will and save as a new .tga (or the same, whatever) when done.   7. Tool Usage B   If you had to convert the .bin, you will need to remove any extra non dll or exe files from the directory to continue.   The tool should still be open so uncheck "Keep XPR" if needed.   Enter the Mipmap count   Select your map that you reinjected the bitm tag to and once again check the Asset Index one more time.   Run the tool and give it your .tga. If you have been following along it should tell you when everything is done with no problems. The process shouldn't take very long.   8. Applying The Bitmap   So open your map back up in Assembly and go to your bitm tag. If you made any modifications to width/height or mipmaps, update them here and save,   Now open whatever shader or relevant tag that you wish to use your bitmap in, then swap it and save.   Congratulations You Did The Thing! Copy the map over and (hopefully) enjoy   Below is that manual later-half of the original tutorial. At this point it probably isn't very coherent and I don't really care to fix it but here it is:  
  • 41 replies