Giter VIP home page Giter VIP logo

qtestsign's People

Contributors

stephan-gh avatar z3ntu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

qtestsign's Issues

test signing sdm636 soc hyp.mbn, something weird

Hi,

I know this qtestsign is not made for other/newer SOCs. I still wanna try this out with a minor branded sdm636 phone and found something strange. please take a look if you are willing to support other SOCs.

the weird happened in Program Headers, looks like the load address altered. and the supposed hash/cert section is absent/stripped in the output mbn file. the source mbn and the output mbn file is zipped.

e3_hyp.zip

~/source/qtestsign# readelf -a e3_hyp-test-signed.mbn
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: AArch64
Version: 0x1
Entry point address: 0x85810000
Start of program headers: 64 (bytes into file)
Start of section headers: 0 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 4
Size of section headers: 64 (bytes)
Number of section headers: 0
Section header string table index: 0
There are no sections in this file.
There are no sections to group in this file.
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
NULL 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000120 0x0000000000000000 0x0
NULL 0x0000000000001000 0x0000000085a18000 0x0000000085a18000
0x00000000000009a8 0x0000000000001000 0x1000
LOAD 0x0000000000002000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 0x1000
LOAD 0x0000000000002000 0x0000000085810000 0x0000000085810000
0x000000000003f000 0x0000000000208000 RWE 0x1000
There is no dynamic section in this file.
There are no relocations in this file.
The decoding of unwind sections for machine type AArch64 is not currently supported.
Dynamic symbol information is not available for displaying symbols.
No version information found in this file.

and the original:

~/source/qtestsign# readelf -a e3_hyp.mbn
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: AArch64
Version: 0x1
Entry point address: 0x85810000
Start of program headers: 64 (bytes into file)
Start of section headers: 0 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 4
Size of section headers: 64 (bytes)
Number of section headers: 0
Section header string table index: 0
There are no sections in this file.
There are no sections to group in this file.
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
NULL 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000120 0x0000000000000000 0x0
NULL 0x0000000000001000 0x0000000085a18000 0x0000000085a18000
0x00000000000019a8 0x0000000000002000 0x1000
LOAD 0x0000000000002000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 0x1000
LOAD 0x0000000000003000 0x0000000085810000 0x0000000085810000
0x000000000003f000 0x0000000000208000 RWE 0x1000
There is no dynamic section

sign failed?

./qtestsign.py hyp ../qhypstub.elf
Before: Elf(ehdr=Ehdr(ei_magic=b'\x7fELF', ei_class=2, ei_data=1, ei_version=1, ei_os_abi=0, ei_abi_version=0, e_type=2, e_machine=183, e_version=1, e_entry=2252341248, e_phoff=64, e_shoff=428688, e_flags=0, e_ehsize=64, e_phentsize=56, e_phnum=2, e_shentsize=64, e_shnum=9, e_shstrndx=8), phdrs=[Phdr(p_type=1, p_offset=65536, p_vaddr=2147483648, p_paddr=2147483648, p_filesz=355044, p_memsz=355044, p_flags=7, p_align=65536), Phdr(p_type=1, p_offset=421888, p_vaddr=2252341248, p_paddr=2252341248, p_filesz=4096, p_memsz=4096, p_flags=7, p_align=2048)])
Traceback (most recent call last):
File "./qtestsign.py", line 61, in
_sign_elf(elf_bytes, out, FW_SW_ID[args.type])
File "./qtestsign.py", line 35, in _sign_elf
hashseg.generate(elf, sw_id)
File "/home/boomhacker/qhypstub/qtestsign/hashseg.py", line 122, in generate
cert_chain = sign.generate_cert_chain(sw_id)
File "/home/boomhacker/qhypstub/qtestsign/sign.py", line 32, in generate_cert_chain
root_key, builder = _begin_cert()
File "/home/boomhacker/qhypstub/qtestsign/sign.py", line 18, in _begin_cert
key = rsa.generate_private_key(public_exponent=65537, key_size=KEY_BITS)
TypeError: generate_private_key() missing 1 required positional argument: 'backend'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.