Created
November 15, 2017 02:10
-
-
Save milankragujevic/ec31e65e08bf9daa3c2607d0bee5006f to your computer and use it in GitHub Desktop.
Dump script.bin from Allwinner A33 tablet running Android. Run this on the device and then run `./perl.pl < sysconfig_dump.txt > script.bin`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
SYS_CONFIG_MEMBASE="0x43000000" | |
SYS_CONFIG_MEMSIZE="0x10000" | |
CHUNK="0x200" | |
OUTFILE=/data/local/tmp/sysconfig_dump.txt | |
rm $OUTFILE | |
let address=$SYS_CONFIG_MEMBASE | |
let "end=(SYS_CONFIG_MEMBASE+SYS_CONFIG_MEMSIZE)" | |
while [ $address -lt $end ]; do | |
let "last=(address+CHUNK-1)" | |
busybox printf "%04x,%04x\n" $address $last | |
busybox printf "%04x,%04x\n" $address $last > /sys/class/sunxi_dump/dump | |
cat /sys/class/sunxi_dump/dump >> $OUTFILE | |
let "address=(address+CHUNK)" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
while(<>) { | |
chomp; | |
@words = split; | |
shift @words; | |
foreach $w (@words) { | |
$w =~ s/^0x//; | |
$w = reverse(pack('H*', $w)); | |
print $w; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment