Skip to content

19atlas/appendheader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appendheader - add DHTB to boot.img

build appendheader
For every device that need "DHTB" string to boot
written in c
Tried and worked for gtexswifi ✅️

minimal usage

./appendheader -i [input file]
default output file name is boot.img

add SEANDROIDENFORCE

./appendheader -s [input file]
and you don't see red text

advanced usage

./appendheader -i [input file] -o [output file name]
for save input and output files (because why not)

for bash scripting

# Patch image to include additional 512 Bytes Header found on SM-T280 devices
if [ "$(dd if=$BOOTIMAGE count=4 bs=1)" = "DHTB" ]; then 
  ui_print "- Found DHTB Header at 0x0000, expecting ANDR at 0x0200"
  if [ "$(dd if=$BOOTIMAGE count=4 bs=1 skip=512)" = "ANDR" ]; then
    ui_print "- Found ANDR Header at 0x0200, patching boot.img"
    dd if=$BOOTIMAGE of=/sutmp/prefix.img count=8 bs=1
    dd if=/dev/zero of=/sutmp/prefix-pad.img count=504 bs=1
    cat /sutmp/prefix.img /sutmp/prefix-pad.img /sutmp/boot.img > /sutmp/patched.img
    rm /sutmp/boot.img
    mv /sutmp/patched.img /sutmp/boot.img
  else
    ui_print "- ANDR Header NOT found at 0x0200, boot.img may not work!"
  fi
else
  ui_print "- DHTB Header at 0x0000 NOT found, skipping step"
fi

LICENSE

licenced under GPL v3 licence

GPLV3

About

a tool that appends DHTB to boot.img

Topics

Resources

License

Stars

Watchers

Forks