How do I edit gpt.bin? - General Questions and Answers

Hey. I'm running a Moto G5 Plus, but I feel like this is a general question. The question is, how do I edit gpt.bin? I want to make the boot partition just a little bigger. One of the other partitions can afford to get 4 MB smaller to make room. How do I do it? What do I do?
I thought this would be an easy thing to find out. But from all the searching I've done, it seems that nobody will say how to do it! They won't even tell you what tool you need! A hex editor? Hah! No! Tried it! The results were no better than opening the file with Notepad. I see some words, and I see a lot of nonsense characters that mean nothing. Now, I can open GPT.bin with 7zip, and when I do, it shows me partitions, with sizes, and labels from aboot.img to utagsBackup.img. But of course, 7zip is not an editor.
So what am I supposed to do? What can parse GPT.bin and edit it? This place has some of the best Android developers in the world. Someone has got to know how to edit such a common file! Or is it not that common at all?

Related

Editing APK files

Hi i have read a few posts about editing apk files but most are only about editing the image files. i need to edit the classes.dex file inside the apk i have done this but when i try and install the apk it doesnt work is this possible to do? thanks
this is not to do anything illegal it is simply to make an android app i use equal to the iphone equivalent (there are less servers for the android app) so i basically want to change the url from the apk to the iphone url)
Cheers
morgs640 said:
Hi i have read a few posts about editing apk files but most are only about editing the image files. i need to edit the classes.dex file inside the apk i have done this but when i try and install the apk it doesnt work is this possible to do? thanks
this is not to do anything illegal it is simply to make an android app i use equal to the iphone equivalent (there are less servers for the android app) so i basically want to change the url from the apk to the iphone url)
Cheers
Click to expand...
Click to collapse
Tried signing the file after modding it?
Sent from my GT-S5360 using xda premium
Hi thanks for your reply, yes i have and it still doesnt work unfortunately
Use apktool to extract the APK, you'll get .smali files instead of classes.dex (this is the decompiled version). Edit these files appropriately, then repack the APK with apktool and sign it. Should work.
Does apktool require command line? if so it is too complicated for me
Yes, it does. If command line is too difficult, it's probably unlikely you'll be able to get this working I'm afraid. You could try this: http://forum.xda-developers.com/showthread.php?t=1619473
It's an IDE for editing APKs, might help. But honestly, the command line part is the easy bit
Just never had any luck with any command line stuff for android never works for me and i hate all the extra crap you have to install to use it. Thanks anyway ill see how i go.
morgs640 said:
Just never had any luck with any command line stuff for android never works for me and i hate all the extra crap you have to install to use it. Thanks anyway ill see how i go.
Click to expand...
Click to collapse
If you wanna do basic stuff wid apktool then its a reaaly easy tool.. The commands are really very small!
Apktool d xxxx.apk for decompile
Apktool b xxxx for compiling n ur done!
Even the complex ones arent difficult! Only the installing of apktool takes time and its the hardest thing in the whole procedure
Sent from my GT-S5360 using XDA
in theory apktool is faily simple. but if you compile for android 4.0 better prepare yourself for huge headaches and a couple of white hairs as this thing wont work. i know two solutions, one consists of a really stupid juggling with two versions, one old which you can barely find, and one new, decompile with the old one, compile with the new one. some guy made a mod though and it finally ends the trouble, but i haven't seen it officially pronounced, which made it so damn hard to find it, hidden in some internet forums. another problem was that aapt needs to be present in the same directory, error codes will just spew out a bunch of gibbersish and you will never know whats wrong so all thats left is trying. but once you got it working it is as easy as pie.
molesarecoming said:
some guy made a mod though and it finally ends the trouble, but i haven't seen it officially pronounced, which made it so damn hard to find it, hidden in some internet forums. but once you got it working it is as easy as pie.
Click to expand...
Click to collapse
You mean this: http://forum.xda-developers.com/showthread.php?t=1551236 ? (It was about two threads below this one at the time I posted this )
nice! i made myself little batch files for this. i just go "apkd skype" to decompile skype.apk and apkb skype for building it, zipping it, signing it. didnt even know theres a guy out there now.
SifJar said:
Yes, it does. If command line is too difficult, it's probably unlikely you'll be able to get this working I'm afraid. You could try this: http://forum.xda-developers.com/showthread.php?t=1619473
It's an IDE for editing APKs, might help. But honestly, the command line part is the easy bit
Click to expand...
Click to collapse
This program worked perfectly thank you so much

[Q] Question on D2G downgrading

I have a question, that probably isn't feasible, but I will ask it anyway. I was noticing that the size of the actual cdt.bin codegroup is a lot larger than the file flashed by the SBF. This makes me think that when the normal CG31 file is flashed to the system, that rather than replacing the existing file, it updates it, and the update must be in line with what it is expecting.
I was looking at sbf_flash, and the capability it is supposed to have, and it got me to thinking. It says that it is able to flash a specified file, that will overwrite what is there whether it is the right thing or not. (or something to that effect) what it says is, " in other words you can write arbitrary data to any location on the flash -- be careful."
This makes me wonder if it would be feasible to extract the complete cdt.bin file from a phone that has not taken the .629 update, and completely overwrite the cdt.bin codegroup, using sbf_flash.
Someone more familiar with all of this has probably already thought of this, and found it won't work, but just in case I figured I would throw the idea out there.

[Q] Recmod and Reversmode not working

I am using a couple of really old programs called recmod and reversmod and I am having trouble getting them to work. When I use the recmod tool, I do get a .dll file out of it, but the file is always 1kb and if I open a bunch of them in hex edit, they are nearly identical and each mentions that "this file cannot be run in DOS mode". Other than that, the rest of the file is almost entirely zeroes, so the code is null. Also the reversmode crashes when I try to use it on the .dll files I created, most likely because the files are busted.
In this thread: http://forum.xda-developers.com/showthread.php?t=1251237 OndraSter mentions something about recmod/reversmode using type 5 and 7 instead of just type 3. I don't really know what to make of this and Google leads me only to things that don't pertain to recmod at all.
Does anyone know how to make recmod work nowadays? Thanks in advance for any help provided!
ckv said:
I am using a couple of really old programs called recmod and reversmod and I am having trouble getting them to work. When I use the recmod tool, I do get a .dll file out of it, but the file is always 1kb and if I open a bunch of them in hex edit, they are nearly identical and each mentions that "this file cannot be run in DOS mode". Other than that, the rest of the file is almost entirely zeroes, so the code is null. Also the reversmode crashes when I try to use it on the .dll files I created, most likely because the files are busted.
In this thread: http://forum.xda-developers.com/showthread.php?t=1251237 OndraSter mentions something about recmod/reversmode using type 5 and 7 instead of just type 3. I don't really know what to make of this and Google leads me only to things that don't pertain to recmod at all.
Does anyone know how to make recmod work nowadays? Thanks in advance for any help provided!
Click to expand...
Click to collapse
The only thing i could find on it was ... http://forum.xda-developers.com/showthread.php?t=576027 and it hasnt been updated in awhile.
Diablo67 said:
The only thing i could find on it was ... http://forum.xda-developers.com/showthread.php?t=576027 and it hasnt been updated in awhile.
Click to expand...
Click to collapse
Yeah, that's the thread that first got me into the recmod tool. Great thread, just out of date. /:
Thanks for the reply though.
This may help
This may help someone help me a little. When I use recmod through the command line, I get an error saying "Error! ProcessCase0: bit 5 is zero!"
and this is the .dll file that I get out of it:
View attachment a.zip
I renamed the file name to a so it would be shorter to type because I was trying a lot of different command prompt things. It was originally k.senscmdd.dll, not that it really matters. All of the modules I tried came out almost exactly like this.

Alternative BOOT LOGOS for your 5X

Tired of looking at that honor 5X standard boot logo? Well here are 8 different ones I've made for you to chose from. This has been a bit of a challenge due to the different and occasionally strange 5X OS. I must thank @deadman96385 for pointing me in the right direction to where the 5X has it's boot logo stored.
Before using you must be aware that it is possible to soft brick your device, however I have changed my own boot logo 8 times using each one of the posted examples successfully.
At this point I must emphasise that I am not responsible for any ills that may befall your device, including soft and hard bricking through to Aliens landing, mating with your dog and then trashing all your devices.
It is not possible to upload .mbn files to XDA, therefore I have renamed the file extensions to .img, AS SOON AS YOU DOWNLOAD THE FILE rename the extension to .mbn
UPDATED 2/23/2016
I've had a request to give a guide for creating the oemlogo.mbn files to complement what I posted in respect of installing new boot logos. To keep it in logical order I have done a rewrite of the first guide and put in the new points at the appropriate places. If you are not bothered about making your own .mbn files but instead are just happy to use ones that I or anyone else post then you can just pick up at the appropriate point in the install part of the guide.
To create .mbn files for the honor 5X you will need the following..... (1) A graphics manipulation program - the one I use is the free "Paint.net" which can be downloaded from their web site at http://www.getpaint.net/index.html..... (2) You will also need a program which can remove the 54 byte header from .BMP files. Those of you proficient in code/scripting can probably do this with a good hex editor but I needed to find a program to do it for me. I use "bmp-header-remover.exe" from here http://karpolan.com/software/bmp-header-remover/ .... to be honest there is a lot of dispute and controversy on the Web about this type of program so I won't tell you to use it but for what I wanted it did the job.
When you get to the installation stage you will need on your 5X a File Manager and a Terminal Emulator.
OK let's get started ....
1) Firstly you have to find an image you want to use, this can be any of these .JPG, .PNG, or .BMP, personally I prefer to work with .JPG's. Bear in mind that the 5X default image size is 1080 x 1920 so if you start with a small image let's say 300 x 300, by the time it has been blown up to the full 5X size you are going to lose some definition and you will likely get an unwelcome degree of distortion.
2) Open the "Paint.net" program and click on the heading "Layers" then on the drop down menu click on "Import from File" then in the window that opens, navigate to where your image is and click on it to open it in "Paint.net". Don't be disturbed by the size or appearance.
3) Click on the heading "Image" then on the drop down menu click on "Resize". In the "Resize" window that opens enter the size of 1080 in the width box and 1920 in the height box. Then click "Ok". Your image will now be resized to the 5X parameters.
4) At this point you can use the "Paint.net" tools to adjust colors or add text and if you experiment you should be able to stretch or contract the image to how you want it. I make no apology for the fact that I am not giving a guide to the use of "Paint.net" here (their help page should answer any questions you have).
5) Now comes the juggling bit. In "Paint.net" click on the heading "Image", a drop down menu opens so click on the choice "Flip Vertical". Your image now takes what I think of as an "upside down and inside out" aspect, you'll see that it's upside down and in effect is a mirror image.
6) Now you need to save the file. Click on the heading "File" and from the drop down menu click on "SaveAs". Now it is important to save the image as a .BMP file irrespective of whether you started with a .JPG or .PNG or .BMP original. In the "SaveAs" box "Paint.net" tends to default as its own file format(.PDN) so change this by selecting .BMP. At this time you can leave the filename as it is or change it, it doesn't matter. Make certain that it is being saved to the folder location you want then click "Save". The next screen you get is the "SaveConfiguration" window, on the left hand side of this window you must click on "24-bit", leave everything else alone and click on "OK". Exit out of "Paint.net".
7) Now you need to run the program "bmp-header-remover.exe". A small window opens up and you will see two empty slots (to be honest you only have to read the screen and you will see what you have to do). In the top slot enter the path to your newly created .BMP file - In the bottom slot enter the path and name that you chose for your modified file. ***VERY IMPORTANT - YOU MUST GIVE THE FILE NAME AN .MBN EXTENSION*** So just to emphasize in the top slot you will have a .BMP file and in the bottom slot you will have an .MBN file. Click on the button "Remove BMP Header" and you have successfully created your .MBN file.
Now we move on to the "INSTALLATION" phase
8) Transfer the .MBN file to your device putting it in whichever folder of your SD Card you prefer. Use your File Manager to copy or Move the .MBN file to the Internal folder...../cust/hw/usa/logo..... If you want to keep the standard boot logo (as a safety precaution), rename it now or it will be overwritten. Rename your new .MBN file to oemlogo.mbn and change the permissions to match the original.
9) Come out of File Manager and open your Terminal Emulator. At the $ prompt change into superuser mode by typing su and pressing Return/Enter. You will then get the # prompt.Type load_oemlogo press Return/Enter and several lines of text will display, when this stops exit out of Terminal Emulator.
10) REBOOT and enjoy your new boot logo.
I have posted .jpg's so that you can see what you are getting.
Thought I would knock up another one. Very simple this one. All above instructions apply. Works on mine. JPG shows what it's like.
metpolds said:
Thought I would knock up another one. Very simple this one. All above instructions apply. Works on mine. JPG shows what it's like.
Click to expand...
Click to collapse
Can you write a guide on how to make these properly?
deadman96385 said:
Can you write a guide on how to make these properly?
Click to expand...
Click to collapse
Hey @deadman96385 thanks for your post. I have been making boot logos and boot animations for my varied Android devices since 2012 and believe me when I say I have never come up with such a complicated way of dealing with them as that which is used by Huawei in it's EMUI operating/themed system, I think you might agree with me. Looking at my above instructions (just to INSTALL the darned thing) I am amazed that so many downloads have been made without a squawk about the complicated proceedure compared with a "normal" device using a flashable zip in recovery. That by the way is my ultimate aim (flashable zips) but so far very little success with my Edify scripting.
However even if I was successfull that would not tackle the problem of constructing the ".mbn" file which I'm sure is the point you are making by posting your query. @Deadman it is one of the weirdest and complicated set of steps I have ever had to take in order to create a file which I could "flash/load/push". On initially thinking about posting my method I am a little reluctant because I don't want to lead a possible "noob" into soft/hard bricking his/her device because of me. However I appreciate your interest and if you think it would assist the thread's community then I will do so. A word of warning, it will take me a bit of time to try and write in logical understandable steps the way to go.
metpolds said:
Hey @deadman96385 thanks for your post.
Click to expand...
Click to collapse
@deadman96385 ... please see my edit to post#1 this effectively changes the playing field for the moment.
TO ALL READERS ..... This post can be ignored now later events have overtaken it.
@deadman96385 ... Don't know if this has anything to do with anything ... In twrp recovery in the "Mount" section I have a partition named "cust" with an empty check box beside it. It is not possible to chose "cust" , the check box will not accept a click. If I use any "Install type" function i.e. install a zip or install an image or wipe Dalvic & Cache, although the function is "Successful" , I also get written several lines in Red (Error) text i.e. "Failed to mount '/cust' (Invalid argument)"
It may seem a remote possibility but is there any chance that the mount "cust" has anything to with my missing folders?
THIS POST CAN NOW BE IGNORED ..... My system was screwed up by the B140 update.
metpolds said:
@deadman96385 ... Don't know if this has anything to do with anything ... In twrp recovery in the "Mount" section I have a partition named "cust" with an empty check box beside it. It is not possible to chose "cust" , the check box will not accept a click. If I use any "Install type" function i.e. install a zip or install an image or wipe Dalvic & Cache, although the function is "Successful" , I also get written several lines in Red (Error) text i.e. "Failed to mount '/cust' (Invalid argument)"
It may seem a remote possibility but is there any chance that the mount "cust" has anything to with my missing folders?
Click to expand...
Click to collapse
I have installed the B140 update and all the directories are still their and I can still see the oemlogo.mbn from ES file explorer
clsA said:
I have installed the B140 update and all the directories are still their and I can still see the oemlogo.mbn from ES file explorer
Click to expand...
Click to collapse
@clsA ... much appreciate your post, it just about confirms my suspicions that all the problems I'm having result from my installation of B140. Had tentatively decided that today I would restore one of my twrp backups taking me back to B130 then let it settle down before maybe trying B140 again. Just in the rare possibility that anyone else is having the same issues as me, when I found the folders missing I re-created them but on reboot they were deleted again.
deadman96385 said:
Can you write a guide on how to make these properly?
Click to expand...
Click to collapse
@deadman96385 ... Will give it a go this week. Can't give an estimated day to finish it. Having problems with my own system.
@deadman96385 ... All problems resolved. Will work on the guide @clsA ... Thankyou for all your assistance..
metpolds said:
@deadman96385 ... All problems resolved. Will work on the guide @clsA ... Thankyou for all your assistance..
Click to expand...
Click to collapse
@deadman96385 ... Post #1 amended. Guide now explains how to create .mbn files as well as installing them.
Skull splash screen
I made one, if anyone is interested I may post some more when I make them. Remember to rename .img file to .mbn and to follow the install guide posted here. I also suggest to make a nandroid beforehand. My thanks for it to @metpolds for the tutorial, and I apologize if I messed up the upload this is my first contribution to xda. If you like or use the file please hit thanks I need em right now.
wickedesires said:
I need em right now.
Click to expand...
Click to collapse
@wickedesires ... Do like your skull, I'll try it out for a while. Glad my original post was of some assistance. As for "Thanks" don't stop breathing awaiting them. If you add them up you will find that my original 8 logos have been downloaded 954 times and you can see that 5 different people gave a "Thanks" throughout the thread. It would seem that the new phone has attracted a new breed of poster.
metpolds said:
@wickedesires ... Do like your skull, I'll try it out for a while. Glad my original post was of some assistance. As for "Thanks" don't stop breathing awaiting them. If you add them up you will find that my original 8 logos have been downloaded 954 times and you can see that 5 different people gave a "Thanks" throughout the thread. It would seem that the new phone has attracted a new breed of poster.
Click to expand...
Click to collapse
I'm glad you like it, I've use xda for so long I'm glad to finally contribute to the community a little bit. About the thanks, yeah I've noticed that in a few other places in the 5x forums as well. It'll be nice to have the prerequisites out of the way. Again thanks for your tutorials, as soon as I find a video or something I like enough to put the work into I'm going to make a bootani also. I've been fooling around with the 2 that came stock and you're right Huawei made all of this much more complicated than it needed to be or has ever been on any other device I've owned.
Rgb skull splash screen
I made a red version of the skull splash screen to go with the new boot animation, for some reason when installed they render a different color than what I made on the PC so when trying to nail down red I got green and blue also that I will post. Since they render a different color I can't provide accurate thumbnails but they are the color in the file name. Remember to rename to oemlogo.mbn, put in the correct folder, change permissions, and load with terminal emulator as per the tutorial. I may take a break from making any more until I see about making them into flashable zips.
wickedesires said:
for some reason when installed they render a different color ............. I see about making them into flashable zips.
Click to expand...
Click to collapse
@wickedesires ... Congrats on the logos. Regarding the color change - I vaguely remember that in the early days of making logos for the moto G, I and others ran into a similar problem. This turned out to be a problem in the script used, the particular graphics program used by the script changed the colors. However if you are using the program "Paint.net" for your graphics manipulation then that probably isn't the problem.
As far as flashable zips go, since February when I posted my first logos for the 5X I have been working, fairly regularly, on trying to create flashables. I keep on running into errors which is particularly aggravating because I don't run into problems with creating them for the moto G or the moto X Pure. I think it's as we have both agreed - the problem lies in the difference between the 5X EMUI coding compared to genuine Android.
@metpolds I'm actually using gimp,but I'll give paint.net a look. If you break any ground on flashable zips let me know, I'll do the same.
View attachment oemlogo.bmpmy oemlogo
linux33it said:
View attachment 3715579my oemlogo
Click to expand...
Click to collapse
@linux33it ... Thanks for adding your logo to the thread.
I see that you have this well in hand but I thought you might find this interesting anyway -
https://github.com/fedotawa/flash_oemlogo_u9500?files=1
Looks like it would be easy to modify if this helps.
Could start by commenting out the final load step, changing the resolution, feeding it a PNG, and see if it produces the same oemlogo.mbn as the same PNG run through your procedure.
I mention this because some of us don't normally run Windows.
Edit - now that I think about it, I may be able to get the original bootsplash as a PNG and then compare with the original Huawei mbn. I think I'll do that and get back to you unless you beat me to it.

Looking for someone to help create reprogram0.xml

Hey everyone,
Since the v40 firehouse is available and it works with the g7 by flashing the abl bootloader, I'm trying to create a rawprogram0.xml and I seem to can't get it to create one. I tried putting it in the GPTAnalyzer python program and it shoots out zeros on guid or anything uses a numerical value. I've tried different firmwares same result. I've seen a raw program file around here but that one, im not sure how the guy even managed to create it. He was on last a year ago and pretty sure he won't be coming back anytime soon to message him
Anywho If you wanna try creating the rawprogram0.xml and feel brave enough to brick your device and try it, you can find the file in this thread thanks to @Xsavi for leaking it to us https://forum.xda-developers.com/lg...k-lg-v40-via-9008-root-t-mobile-t4042207/amp/
i have rawprogram0.xml from my G710N, but i am not able to try it though because it still needs a firehose file, and i dont have that.

Categories

Resources