# HG changeset patch # User Michael Spacefalcon # Date 1396247594 0 # Node ID a39a38bbec4dd349d27846a30c7e1db1783a6746 # Parent 49c7cda96f04d9eb396b9916b795107681558f02 analysis of what osmocon's voodoo payloads disassemble to in ARM/Thumb diff -r 49c7cda96f04 -r a39a38bbec4d .hgignore --- a/.hgignore Mon Mar 31 05:51:57 2014 +0000 +++ b/.hgignore Mon Mar 31 06:33:14 2014 +0000 @@ -14,6 +14,7 @@ ^compal/c139-boot\. ^compal/c140-boot\. +^compal/osmovoodoo ^mpffs/mpffs-cat$ ^mpffs/mpffs-dbgls$ diff -r 49c7cda96f04 -r a39a38bbec4d compal/Makefile --- a/compal/Makefile Mon Mar 31 05:51:57 2014 +0000 +++ b/compal/Makefile Mon Mar 31 06:33:14 2014 +0000 @@ -1,7 +1,8 @@ C139= c139-boot.90.04.bin C140= c140-boot.bin GEN= c139-boot.dis16 c139-boot.dis32 c139-boot.hex \ - c140-boot.dis16 c140-boot.dis32 c140-boot.hex + c140-boot.dis16 c140-boot.dis32 c140-boot.hex \ + osmovoodoo osmovoodoo.bin ARMDIS= ../arm7dis/armdis THUMBDIS=../arm7dis/thumbdis @@ -25,5 +26,11 @@ c140-boot.hex: ${C140} hd ${C140} > $@ +osmovoodoo: osmovoodoo.c + gcc -O2 -o $@ $@.c + +osmovoodoo.bin: osmovoodoo + ./osmovoodoo + clean: rm -f ${GEN} diff -r 49c7cda96f04 -r a39a38bbec4d compal/osmovoodoo.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compal/osmovoodoo.c Mon Mar 31 06:33:14 2014 +0000 @@ -0,0 +1,31 @@ +#include +#include +#include + +u_char data_hdr_c123[] = { 0xee, 0x4c, 0x9f, 0x63 }; + +u_char data_hdr_c155[] = { 0x78, 0x47, 0xc0, 0x46 }; + +u_char chainloader[] = { + 0x0a, 0x18, 0xa0, 0xe3, 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff, + 0x1a, 0x08, 0x10, 0x9f, 0xe5, 0x01, 0x2c, 0xa0, 0xe3, 0xb0, 0x20, + 0xc1, 0xe1, 0x00, 0xf0, 0xa0, 0xe3, 0x10, 0xfb, 0xff, 0xff, +}; + +char outfile[] = "osmovoodoo.bin"; + +main() +{ + FILE *f; + + f = fopen(outfile, "w"); + if (!f) { + perror(outfile); + exit(1); + } + fwrite(data_hdr_c123, 1, sizeof data_hdr_c123, f); + fwrite(data_hdr_c155, 1, sizeof data_hdr_c155, f); + fwrite(chainloader, 1, sizeof chainloader, f); + fclose(f); + exit(0); +}