FreeCalypso > hg > freecalypso-reveng
changeset 106:a39a38bbec4d
analysis of what osmocon's voodoo payloads disassemble to in ARM/Thumb
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 31 Mar 2014 06:33:14 +0000 |
parents | 49c7cda96f04 |
children | c883e60df239 |
files | .hgignore compal/Makefile compal/osmovoodoo.c |
diffstat | 3 files changed, 40 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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$
--- 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}
--- /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 <sys/types.h> +#include <stdio.h> +#include <stdlib.h> + +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); +}