I'm already doing that and i have a program ready to do that, i also released it here on gbatemp with full source, just nobody noticed it...
The problem is, it doesn't work ^^
Just knowing how it works and what all rop's are doing isn't enough to do anything, there are lots of missing memory gadgets (example: IFile_Write) to make my own ram dumps.
The main problem is, you NEED ram dumps to get any code working...
About the obfuscation:
If you know all rop gadgets, then you will see, that most of it is not even obfuscated, just painful long to read.
Example: (only fw 7.1-9.X)
this gadget: 0x0023FF9C
translates to:
But what is gateway actually doing to call this gadget?:
step1: POP R0-R4, R7, PC //<- this loads the R0-R2 values for memcpy
step2: POP R4-R12, PC //<- this writes a NOP to R12
step3: POP R4-R6,LR then BX R12 //<- this writes a value to LR and then uses the NOP in R12 to jump into the next gadget
step4: memcpy then BX LR //it ends in BX LR, that's why they do step2&3 to load a NOP into LR...
if you translate these gadgets into actual code you get something like this: (note: gateway fills the unused register with junk data)
memcpy(0x08F02894, 0x08F028D8, 0x00000044) =
Code:
08F01874: 0x001946EB:
POP {R0-R4,R7,PC}
POP(0x08F02894)
POP(0x08F028D8)
POP(0x00000044)
POP(0x001CCC64)
POP(0x00354850)
POP(0x00101408)
08F01890: 0x001065A8:
POP {R4-R12,PC}
POP(0x002104E5)
POP(0x002CCF7C)
POP(0x00184700)
POP(0x00116400)
POP(0x001B4300)
POP(0x00113200)
POP(0x0007B800)
POP(0x0021E630)
POP(0x001057C4)
08F018B8: 0x002C5AE0:
POP {R4-R6,LR}
BX R12
POP(0x0010322C)
POP(0x0022FE44)
POP(0x00100B5C)
POP(0x001057C4)
08F018CC: 0x0023FF9C:
memcpy()
BX LR