Flatten is a Win32 utility for extracting executable code out of Android ELF files. It operates in two distinct modes for xbl and abl.
Most ELF files have sections. Qualcomm files only have programs in the program table. Each is a chunk that will be mapped to memory. Some disassemblers can not handle these separate chunks. The point of flatten in this case is to convert the separate chunks to a contiguous binary file. First we look at what is in the file.
Some of these programs are even embedded ELF files! But let's say that we are interested in the first six programs.
Now we have a single binary file with the load address of 14015000. We can dissasemble it.
ABL files have only three programs. The third program is an embedded UEFI file system. Inside this complicated structure is a single, contiguous code chunk with a load address of zero. We can extract this for analysis.
One of the most trivial usages is determining what fastboot commands are supported.
flatten can (usually) extract this as either plain text or symbols for the command handlers.
If Secure Boot is enabled, this is about the limit of usefullness.
In the rare case that you have a device without Secure Boot enabled you can extract the code, modify it and replace it.
Note that modifications to an abl will break the program hashes. Even if your device does not have Secure Boot you will have to fix the program hashes. Of course the signature and signing will remain broken, but this is not an issue.
Download the executable.