xerub / img4lib Goto Github PK
View Code? Open in Web Editor NEWimage4 vfs
image4 vfs
Since commit d273abb I am unable to build img4lib.
Error :
libvfs/vfs_img4.c:354:8: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
rsa->n = BN_bin2bn(pkeyComponents[0].data, pkeyComponents[0].length, NULL);
OS/version :
Distributor ID: Debian
Description: Debian GNU/Linux 9.9 (stretch)
Release: 9.9
Codename: stretch
I also tested on Ubuntu 18.04, same error.
hi, I'm collecting various tools and libs at https://github.com/stek29/homebrew-idevice, so I was wondering - what is the current licensing for img4lib?
please help, cannot install on mac os catalina, i get error on
make -C lzfse [CC="cross-cc"] [LD="cross-ld"]
zsh: no matches found: [CC=cross-cc]
if I try to compile with make CORECRYPTO=1
I get the following error:
corecrypto/cc_clear.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] https://developer.apple.com/security/ ^ corecrypto/cc_clear.c:1:6: error: expected ';' after top level declarator https://developer.apple.com/security/ ^ ; 1 warning and 1 error generated. make: *** [corecrypto/cc_clear.o] Error 1
Hello, @xerub
I found your library as a tool for decrypt Ramdisks, Kernel, iBSS, iBEC from iOS firmware. But there were no mentions about relatively fresh iPhone's, only 5 and older. I have iPhone 6S+ with iOS 9.0.2 which is stucked on bootloop due to file modifications on System partition. The problem to deal with is to get access to device System partition and revert file modification. Device was jailbroken, but unfortunately USB SSH does not load before it gets stucked on bootloop.
If I understand correctly it is possible with loading SSH Ramdisk from DFU mode using checkm8. Could you please clarify, how img4lib could be used to get SSH Ramdisk in my case?
Thanks
While compiling lzss.c and img4.c with
gcc -o img4 -L/usr/local/openssl-1.0.2h/lib -I/usr/local/openssl-1.0.2h/include/openssl lzss.o img4.o libDER/DER_Encode.o libDER/DER_Decode.o libDER/oids.o libvfs/vfs_file.o libvfs/vfs_mem.o libvfs/vfs_sub.o libvfs/vfs_enc.o libvfs/vfs_lzss.o libvfs/vfs_lzfse.o libvfs/vfs_img4.o -lcrypto
I get:
Undefined symbols for architecture x86_64: "_lzfse_decode_buffer", referenced from: _lzfse_reopen in vfs_lzfse.o "_lzfse_decode_scratch_size", referenced from: _lzfse_reopen in vfs_lzfse.o "_lzfse_encode_buffer", referenced from: _lzfse_fsync in vfs_lzfse.o "_lzfse_encode_scratch_size", referenced from: _lzfse_fsync in vfs_lzfse.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am on Mac OSX 10.12
Newer IM4Ps have a SEQUENCE attached at the end. When creating an IMG4 the last INTEGER gets changed and makes the IMG4 invalid. This SEQUENCE seems to only be present on A11+ IM4Ps but I have only tested this on an A13 device and restoring this INTEGER from the original IM4P makes the image valid.
1158681:d=1 hl=2 l= 116 prim: OCTET STRING [HEX DUMP]:3072303702010104108B899A083A93F9788381A12B63CDD9BA04204983AD5134850A540BB81264F5DE41A764A0EACF84F0D857B6649800C49004A230370201020410F3B47B6767EBDCDA3E7B5363D80A5A6F0420E67E948423DE8E0294400FF6B5936E1BD6282ADD0F757A88D880450A7803D5AA. <---[KEYBAGS]
1158799:d=1 hl=2 l= 8 cons: SEQUENCE
1158801:d=2 hl=2 l= 1 prim: INTEGER :01
1158804:d=2 hl=2 l= 3 prim: INTEGER :177500 <---[This thing gets changed and it shouldn't]
I've read the documentation and commentary in the project, but I cannot convince compilation to pick up my openssl aes.h headers at /usr/local/Cellar/openssl/1.0.2n/include/openssl/aes.h
. I've tweaked every env variable I can imagine to force compilation to recognize this.
~/Downloads/playground/img4lib$ make
gcc -o img4.o -Wall -W -pedantic -Wno-variadic-macros -Wno-multichar -Wno-four-char-constants -Wno-unused-parameter -O2 -I. -g -DiOS10 -DDER_MULTIBYTE_TAGS=1 -DDER_TAG_SIZE=8 -D__unused="__attribute__((unused))" -Ilzfse/src -Wno-deprecated-declarations -c img4.c
In file included from /usr/include/fcntl.h:77:0,
from img4.c:4:
/usr/include/bits/stat.h:106:31: error: expected identifier or ‘(’ before ‘[’ token
__syscall_slong_t __unused[3];
^
Hi, I wanna to patch ibss.im4p, I've already decrypted it and patched.
I do not know how to pack it back to encrypted im4p.
I have downgraded my ssl just to get this thing to compile, and it still spits out errors at me:
ar: `u' modifier ignored since `D' is the default (see `U')
gcc -o img4 -g img4.o lzss.o libDER/DER_Encode.o libDER/DER_Decode.o libDER/oids.o libvfs/vfs_file.o libvfs/vfs_mem.o libvfs/vfs_sub.o libvfs/vfs_enc.o libvfs/vfs_lzss.o libvfs/vfs_lzfse.o libvfs/vfs_img4.o libimg4.a -llzfse -lssl -lcrypto -lcrypto
/usr/bin/ld: libvfs/vfs_img4.o: in function `dovalidate':
/home/ezra/git/img4lib/libvfs/vfs_img4.c:1952: undefined reference to `EVP_cleanup'
/usr/bin/ld: /home/ezra/git/img4lib/libvfs/vfs_img4.c:1954: undefined reference to `CRYPTO_cleanup_all_ex_data'
collect2: error: ld returned 1 exit status
make: *** [Makefile:141: img4] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.