tihmstar / libpatchfinder Goto Github PK
View Code? Open in Web Editor NEWA arm offsetfinder. It finds offsets, patches, parses Mach-O and even supports IMG4/IMG3
License: GNU Lesser General Public License v2.1
A arm offsetfinder. It finds offsets, patches, parses Mach-O and even supports IMG4/IMG3
License: GNU Lesser General Public License v2.1
On commit 43f2c1a
, the following is produced:
In file included from patchfinder64.cpp:14:
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22:
../include/liboffsetfinder64/OFexception.hpp:18:76: error: no matching constructor for initialization of 'tihmstar::exception'
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^ ~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/exception.hpp:23:9: note: candidate constructor not viable: requires single argument 'cpy', but 3 arguments were provided
exception(const exception &cpy); //copy constructor
^
/usr/local/include/libgeneral/exception.hpp:22:9: note: candidate constructor not viable: requires at least 5 arguments, but 3 were provided
exception(const char *commit_count_str, const char *commit_sha_str, int line, const char *filename, const char *err ...);
^
patchfinder64.cpp:31:17: warning: implicit conversion of NULL constant to 'offsetfinder64::loc_t' (aka 'unsigned long') [-Wnull-conversion]
_entrypoint(NULL),
~^~~~
0
patchfinder64.cpp:32:11: warning: implicit conversion of NULL constant to 'offsetfinder64::loc_t' (aka 'unsigned long') [-Wnull-conversion]
_base(NULL)
~^~~~
0
patchfinder64.cpp:220:5: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("call reference not found");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 5 were provided
patchfinder64.cpp:231:17: error: no matching constructor for initialization of 'tihmstar::OFexception'
retassure(limit < 0, "search limit reached");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:85:67: note: expanded from macro 'retassure'
# define retassure(cond, errstr ...) do{ if ((cond) == 0) throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__,__FILE__,errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 5 were provided
patchfinder64.cpp:242:16: error: no matching constructor for initialization of 'tihmstar::OFexception'
retassure(limit > 0, "search limit reached");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:85:67: note: expanded from macro 'retassure'
# define retassure(cond, errstr ...) do{ if ((cond) == 0) throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__,__FILE__,errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 5 were provided
patchfinder64.cpp:250:5: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("branchref not found");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 5 were provided
patchfinder64.cpp:303:21: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("[4K] bad level=%d",level);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
patchfinder64.cpp:317:21: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("[16K] bad level=%d",level);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
patchfinder64.cpp:329:21: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("[64K] bad level=%d",level);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
patchfinder64.cpp:333:13: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("bad pagesize");
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 5 were provided
patchfinder64.cpp:350:21: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("[4K] bad level=%d",level);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
patchfinder64.cpp:364:21: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("[16K] bad level=%d",level);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
patchfinder64.cpp:376:21: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("[64K] bad level=%d",level);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 6 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 6 were provided
patchfinder64.cpp:380:13: error: no matching constructor for initialization of 'tihmstar::OFexception'
reterror("bad pagesize");
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libgeneral/macros.h:88:43: note: expanded from macro 'reterror'
# define reterror(errstr ...) do{ throw tihmstar::EXPECTIONNAME(VERSION_COMMIT_COUNT, VERSION_COMMIT_SHA, __LINE__, __FILE__, errstr); } while(0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/liboffsetfinder64/OFexception.hpp:18:9: note: candidate constructor not viable: no known conversion from 'const char [4]' to 'int' for 1st argument
OFexception(int code, const char *filename, const char *err ...) : tihmstar::exception(code,filename,err){}
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 5 were provided
class OFexception : public tihmstar::exception{
^
../include/liboffsetfinder64/OFexception.hpp:16:11: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 5 were provided
2 warnings and 13 errors generated.
All subsequent commits produce
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp: In constructor ‘tihmstar::load_command_not_found::load_command_not_found(const char*, const char*, int, const char*, int)’:
../include/liboffsetfinder64/OFexception.hpp:38:113: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
38 | : OFexception(commit_count_str,commit_sha_str,line,filename, "failed to find cmd: %s",cmd), _cmd(cmd) {};
| ^
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
patchfinder64.cpp: In constructor ‘tihmstar::offsetfinder64::patchfinder64::patchfinder64(bool)’:
patchfinder64.cpp:31:17: warning: converting to non-pointer type ‘tihmstar::offsetfinder64::loc_t’ {aka ‘long unsigned int’} from NULL [-Wconversion-null]
31 | _entrypoint(NULL),
| ^~~~
patchfinder64.cpp:32:11: warning: converting to non-pointer type ‘tihmstar::offsetfinder64::loc_t’ {aka ‘long unsigned int’} from NULL [-Wconversion-null]
32 | _base(NULL)
| ^~~~
In file included from patchfinder64.cpp:11:
patchfinder64.cpp: In member function ‘uint64_t tihmstar::offsetfinder64::patchfinder64::pte_vma_to_index(uint32_t, uint8_t, uint64_t)’:
patchfinder64.cpp:303:21: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
303 | reterror("[4K] bad level=%d",level);
| ^~~~~~~~
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
In file included from patchfinder64.cpp:11:
patchfinder64.cpp:317:21: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
317 | reterror("[16K] bad level=%d",level);
| ^~~~~~~~
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
In file included from patchfinder64.cpp:11:
patchfinder64.cpp:329:21: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
329 | reterror("[64K] bad level=%d",level);
| ^~~~~~~~
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
In file included from patchfinder64.cpp:11:
patchfinder64.cpp: In member function ‘uint64_t tihmstar::offsetfinder64::patchfinder64::pte_index_to_vma(uint32_t, uint8_t, uint64_t)’:
patchfinder64.cpp:350:21: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
350 | reterror("[4K] bad level=%d",level);
| ^~~~~~~~
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
In file included from patchfinder64.cpp:11:
patchfinder64.cpp:364:21: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
364 | reterror("[16K] bad level=%d",level);
| ^~~~~~~~
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
In file included from patchfinder64.cpp:11:
patchfinder64.cpp:376:21: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
376 | reterror("[64K] bad level=%d",level);
| ^~~~~~~~
In file included from ../include/liboffsetfinder64/patchfinder64.hpp:22,
from patchfinder64.cpp:14:
../include/liboffsetfinder64/OFexception.hpp:17:26: note: declared here
17 | using exception::exception;
| ^~~~~~~~~
patchfinder64.cpp: In member function ‘uint64_t tihmstar::offsetfinder64::patchfinder64::pte_vma_to_index(uint32_t, uint8_t, uint64_t)’:
patchfinder64.cpp:335:1: warning: control reaches end of non-void function [-Wreturn-type]
335 | }
| ^
patchfinder64.cpp: In member function ‘uint64_t tihmstar::offsetfinder64::patchfinder64::pte_index_to_vma(uint32_t, uint8_t, uint64_t)’:
patchfinder64.cpp:382:1: warning: control reaches end of non-void function [-Wreturn-type]
382 | }
|
Is there a version of liboffsetfinder64 that is usable?
std::vector ibootpatchfinder64::get_sigcheck_patch() seems to have 2 issues in iOS 13.3
(haven't checked on earlier version so it might be the case in more versions)
first issue i have encountered is that it doesn't find the the register for "always production patch"
I think that the register address for iPhone 7+ (iOS 13.3) - is not one of those that appear in the list.
second issue i have encountered is that the layout of the image4_validate_property_callback function has changed in the binary.
if i compare it the SecureRom Binary you can see that the function ends with
RET
BL VALIDATE_STACK_COOKIE
so the patch that replaces this 2 opcodes with
MOV X0, 0
RET
is harmless (to the logic of the function)
Where as in the iBSS code for 13.3 the function layout is like that
iBoot:00000001800C223C RET
iBoot:00000001800C2240 ; ---------------------------------------------------------------------------
iBoot:00000001800C2240
iBoot:00000001800C2240 loc_1800C2240 ; CODE XREF: callback+5E8↑j
iBoot:00000001800C2240 LDR X8, [SP,#0x90+var_78]
iBoot:00000001800C2244 CMP X8, #8
iBoot:00000001800C2248 B.NE loc_1800C2260
iBoot:00000001800C224C LDR X8, [SP,#0x90+var_80]
iBoot:00000001800C2250 LDR X8, [X8]
iBoot:00000001800C2254 STR X8, [SP,#0x90+var_70]
iBoot:00000001800C2258 MOV X0, X8
iBoot:00000001800C225C B loc_1800C1FC0
iBoot:00000001800C2260 ; ---------------------------------------------------------------------------
iBoot:00000001800C2260
iBoot:00000001800C2260 loc_1800C2260 ; CODE XREF: callback+650↑j
iBoot:00000001800C2260 MOV W8, #0x40040011
iBoot:00000001800C2268 ADD W0, W8, #7
iBoot:00000001800C226C B loc_1800C2204
iBoot:00000001800C2270 ; ---------------------------------------------------------------------------
iBoot:00000001800C2270
iBoot:00000001800C2270 loc_1800C2270 ; CODE XREF: callback+628↑j
iBoot:00000001800C2270 BL check_stack_cookie
AS you can see after the RET there is another part of code (that is being invoked earlier in a good context of the function....
causing the RET to arrive skipping the mov x0,0 and also the register restoration from the stack (the function trailer)
Seems like this is the reason that this doesn't work.
Interestingly enough -- it seems to be the function layout for SecureROM of T8010 is the same as in iOS 13.3 (weird but probably compiler optimization stuff)
../../include/libpatchfinder/OFexception.hpp:38:113: sorry, unimplemented: passing arguments to ellipsis of inherited constructor ‘tihmstar::OFexception::OFexception(const char*, const char*, int, const char*, const char*, ...) [inherited from tihmstar::exception]’
38 | _str,commit_sha_str,line,filename, "failed to find cmd: %d",cmd), _cmd(cmd) {};
| ^
In file included from ../../include/libpatchfinder/patchfinder.hpp:17,
from ../../include/libpatchfinder/ibootpatchfinder/ibootpatchfinder.hpp:15,
from ibootpatchfinder.cpp:8:
Whenever I try to compile iBoot64Patcher using gcc and g++ i get 13 warnings and 4 errors
π iBoot64Patcher/iBoot64Patcher master ✗ ❯ gcc main.cpp
In file included from main.cpp:13:
In file included from /usr/local/include/liboffsetfinder64/ibootpatchfinder64.hpp:12:
In file included from /usr/local/include/liboffsetfinder64/patchfinder64.hpp:20:
In file included from /usr/local/include/liboffsetfinder64/OFexception.hpp:12:
In file included from /usr/local/include/libgeneral/macros.h:69:
/usr/local/include/libgeneral/exception.hpp:37:9: error: exception specification of overriding function is more lax than base version
~exception();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:102:13: note: overridden virtual function is here
virtual ~exception() _NOEXCEPT;
^
In file included from main.cpp:13:
In file included from /usr/local/include/liboffsetfinder64/ibootpatchfinder64.hpp:12:
In file included from /usr/local/include/liboffsetfinder64/patchfinder64.hpp:20:
In file included from /usr/local/include/liboffsetfinder64/OFexception.hpp:12:
/usr/local/include/libgeneral/macros.h:96:27: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
guard(const guard&) = delete; //delete copy constructor
^
/usr/local/include/libgeneral/macros.h:97:17: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
guard(guard &&o) = delete; //move constructor
^
/usr/local/include/libgeneral/macros.h:97:24: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
guard(guard &&o) = delete; //move constructor
^
In file included from main.cpp:13:
In file included from /usr/local/include/liboffsetfinder64/ibootpatchfinder64.hpp:12:
In file included from /usr/local/include/liboffsetfinder64/patchfinder64.hpp:20:
/usr/local/include/liboffsetfinder64/OFexception.hpp:21:48: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
std::string build_commit_count() const override {
^
/usr/local/include/liboffsetfinder64/OFexception.hpp:25:46: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
std::string build_commit_sha() const override{
^
In file included from main.cpp:13:
In file included from /usr/local/include/liboffsetfinder64/ibootpatchfinder64.hpp:12:
In file included from /usr/local/include/liboffsetfinder64/patchfinder64.hpp:21:
/usr/local/include/liboffsetfinder64/patch.hpp:27:36: error: expected ';' at end of declaration list
patch(const patch& cpy) noexcept;
^
;
In file included from main.cpp:13:
/usr/local/include/liboffsetfinder64/ibootpatchfinder64.hpp:28:35: error: expected ';' at end of declaration list
bool has_kernel_load() noexcept;
^
;
/usr/local/include/liboffsetfinder64/ibootpatchfinder64.hpp:29:40: error: expected ';' at end of declaration list
bool has_recovery_console() noexcept;
^
;
main.cpp:58:17: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto p = ibp.get_boot_arg_patch(custom_boot_args);
^
main.cpp:70:13: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto p = ibp.get_debug_enabled_patch();
^
main.cpp:83:17: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto p = ibp.get_cmd_handler_patch(cmd_handler_str, cmd_handler_ptr);
^
main.cpp:94:17: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto p = ibp.get_unlock_nvram_patch();
^
main.cpp:106:9: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto p = ibp.get_sigcheck_patch();
^
main.cpp:121:10: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
for (auto p : patches) {
^
main.cpp:121:17: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
for (auto p : patches) {
^
main.cpp:124:39: warning: format specifies type 'void *' but the argument has type 'tihmstar::offsetfinder64::loc_t' (aka 'unsigned long long') [-Wformat]
printf("applying patch=%p : ",p._location);
~~ ^~~~~~~~~~~
%llu
13 warnings and 4 errors generated.
Anyone else getting the same issue?
AppleTV 4k has no ipsw download. How can I use your tool?
How to get the kernelcache?
Thanks.
After the update that was pushed most recently, I get these errors after running make
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/neuroses/test2/liboffsetfinder64/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make all-recursive
make[1]: Entering directory '/home/neuroses/test2/liboffsetfinder64'
Making all in liboffsetfinder64
make[2]: Entering directory '/home/neuroses/test2/liboffsetfinder64/liboffsetfinder64'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-insn.lo -MD -MP -MF .deps/liboffsetfinder64_la-insn.Tpo -c -o liboffsetfinder64_la-insn.lo test -f 'insn.cpp' || echo './'
insn.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-insn.lo -MD -MP -MF .deps/liboffsetfinder64_la-insn.Tpo -c insn.cpp -fPIC -DPIC -o .libs/liboffsetfinder64_la-insn.o
insn.cpp:30:2: warning: #warning TODO is this distance validation correct?? [-Wcpp]
30 | #warning TODO is this distance validation correct??
| ^~~~~~~
insn.cpp:170:2: warning: #warning TODO incomplete function implementation! [-Wcpp]
170 | #warning TODO incomplete function implementation!
| ^~~~~~~
insn.cpp:213:2: warning: #warning TODO recheck this mask [-Wcpp]
213 | #warning TODO recheck this mask
| ^~~~~~~
insn.cpp:249:2: warning: #warning TODO redo this! currently only recognises STR (immediate) [-Wcpp]
249 | #warning TODO redo this! currently only recognises STR (immediate)
| ^~~~~~~
insn.cpp:254:2: warning: #warning TODO redo this! currently only recognises STR (immediate) [-Wcpp]
254 | #warning TODO redo this! currently only recognises STR (immediate)
| ^~~~~~~
insn.cpp:423:2: warning: #warning TODO rewrite this! currently only unsigned offset supported [-Wcpp]
423 | #warning TODO rewrite this! currently only unsigned offset supported
| ^~~~~~~
insn.cpp:144:67: warning: always_inline function might not be inlinable [-Wattributes]
144 | attribute((always_inline)) static std::pair<int64_t, int64_t> DecodeBitMasks(uint64_t immN, uint8_t imms, uint8_t immr, bool immediate){
| ^~~~~~~~~~~~~~
insn.cpp:102:48: warning: always_inline function might not be inlinable [-Wattributes]
102 | attribute((always_inline)) static uint64_t ROR(uint64_t x, int shift, int len){
| ^~~
insn.cpp:93:48: warning: always_inline function might not be inlinable [-Wattributes]
93 | attribute((always_inline)) static uint64_t ones(uint64_t n){
| ^~~~
insn.cpp:84:48: warning: always_inline function might not be inlinable [-Wattributes]
84 | attribute((always_inline)) static uint64_t replicate(uint64_t val, int bits){
| ^~~~~~~~~
insn.cpp:76:43: warning: always_inline function might not be inlinable [-Wattributes]
76 | attribute((always_inline)) static int lowestSetBit(uint64_t x){
| ^~~~~~~~~~~~
insn.cpp:68:43: warning: always_inline function might not be inlinable [-Wattributes]
68 | attribute((always_inline)) static int highestSetBit(uint64_t x){
| ^~~~~~~~~~~~~
insn.cpp:61:47: warning: always_inline function might not be inlinable [-Wattributes]
61 | attribute((always_inline)) static int64_t signExtend64(uint64_t v, int vSize){
| ^~~~~~~~~~~~
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-insn.lo -MD -MP -MF .deps/liboffsetfinder64_la-insn.Tpo -c insn.cpp -o liboffsetfinder64_la-insn.o >/dev/null 2>&1
mv -f .deps/liboffsetfinder64_la-insn.Tpo .deps/liboffsetfinder64_la-insn.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-vsegment.lo -MD -MP -MF .deps/liboffsetfinder64_la-vsegment.Tpo -c -o liboffsetfinder64_la-vsegment.lo test -f 'vsegment.cpp' || echo './'
vsegment.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-vsegment.lo -MD -MP -MF .deps/liboffsetfinder64_la-vsegment.Tpo -c vsegment.cpp -fPIC -DPIC -o .libs/liboffsetfinder64_la-vsegment.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-vsegment.lo -MD -MP -MF .deps/liboffsetfinder64_la-vsegment.Tpo -c vsegment.cpp -o liboffsetfinder64_la-vsegment.o >/dev/null 2>&1
mv -f .deps/liboffsetfinder64_la-vsegment.Tpo .deps/liboffsetfinder64_la-vsegment.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-vmem.lo -MD -MP -MF .deps/liboffsetfinder64_la-vmem.Tpo -c -o liboffsetfinder64_la-vmem.lo test -f 'vmem.cpp' || echo './'
vmem.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-vmem.lo -MD -MP -MF .deps/liboffsetfinder64_la-vmem.Tpo -c vmem.cpp -fPIC -DPIC -o .libs/liboffsetfinder64_la-vmem.o
vmem.cpp: In constructor ‘tihmstar::offsetfinder64::vmem::vmem(std::vectortihmstar::offsetfinder64::vsegment, int)’:
vmem.cpp:21:30: error: ‘remove_if’ is not a member of ‘std’; did you mean ‘remove_cv’?
21 | _segments.erase(std::remove_if(_segments.begin(), _segments.end(), [&](const vsegment& obj){
| ^~~~~~~~~
| remove_cv
vmem.cpp:25:10: error: ‘sort’ is not a member of ‘std’
25 | std::sort(_segments.begin(),_segments.end(),[ ]( const vsegment& lhs, const vsegment& rhs){
| ^~~~
vmem.cpp: In copy constructor ‘tihmstar::offsetfinder64::vmem::vmem(const tihmstar::offsetfinder64::vmem&, tihmstar::offsetfinder64::loc_t, int)’:
vmem.cpp:37:30: error: ‘remove_if’ is not a member of ‘std’; did you mean ‘remove_cv’?
37 | _segments.erase(std::remove_if(_segments.begin(), _segments.end(), [&](const vsegment& obj){
| ^~~~~~~~~
| remove_cv
vmem.cpp:41:10: error: ‘sort’ is not a member of ‘std’
41 | std::sort(_segments.begin(),_segments.end(),[ ]( const vsegment& lhs, const vsegment& rhs){
| ^~~~
vmem.cpp: In member function ‘tihmstar::offsetfinder64::loc_t tihmstar::offsetfinder64::vmem::memmem(const void*, size_t)’:
vmem.cpp:73:12: warning: converting to non-pointer type ‘tihmstar::offsetfinder64::loc_t’ {aka ‘long unsigned int’} from NULL [-Wconversion-null]
73 | return NULL;
| ^~~~
vmem.cpp: In member function ‘tihmstar::offsetfinder64::loc_t tihmstar::offsetfinder64::vmem::memstr(const char*)’:
vmem.cpp:82:12: warning: converting to non-pointer type ‘tihmstar::offsetfinder64::loc_t’ {aka ‘long unsigned int’} from NULL [-Wconversion-null]
82 | return NULL;
| ^~~~
make[2]: *** [Makefile:502: liboffsetfinder64_la-vmem.lo] Error 1
make[2]: Leaving directory '/home/neuroses/test2/liboffsetfinder64/liboffsetfinder64'
make[1]: *** [Makefile:472: all-recursive] Error 1
make[1]: Leaving directory '/home/neuroses/test2/liboffsetfinder64'
make: *** [Makefile:381: all] Error 2
After i run autogen.sh and configure and try to make the project, I get these errors
https://pastebin.com/raw/WxsYrvdU
It finds the wrong offsets leading to wrong patches
Just a request, you can find all the offsets needed here:
https://github.com/wh1te4ever/kfd/blob/main/kfd/fun/offsets.m
Double checked on 2 devices, x86_64 and arm64 (macOS 13.6, 13.5) 2 different versions. Same error : Xcode 15.1.
Command ran to configure
./configure --with-offsetexporter
Configuration
then to make
make
I'm not the only one experiencing this issue.
Got function 'loc_t' 'find_literal_ref' args: ['loc_t pos', ' int ignoreTimes = 0', ' loc_t startPos = 0']
Got function 'loc_t' 'find_call_ref' args: ['loc_t pos', ' int ignoreTimes = 0', ' loc_t startPos = 0']
Got function 'loc_t' 'find_branch_ref' args: ['loc_t pos', ' int limit', ' int ignoreTimes = 0', ' loc_t startPos = 0']
Got function 'loc_t' 'find_block_branch_ref' args: ['loc_t pos', ' int limit', ' int ignoreTimes = 0', ' loc_t startPos = 0']
Got function 'uint64_t' 'find_register_value' args: ['loc_t where', ' int reg', ' loc_t startAddr = 0']
Got function 'loc_t' 'findnops' args: ['uint16_t nopCnt', ' bool useNops = true', ' uint32_t nopOpcode = 0']
Got function 'loc_t' 'memmem' args: ['const void *little', ' size_t little_len', ' patchfinder::loc_t startLoc = 0']
Got function 'loc_t' 'memstr' args: ['const char *str']
Got function 'loc_t' 'deref' args: ['loc_t pos']
Got function 'std::vector<patch>' 'get_replace_string_patch' args: ['std::string needle', ' std::string replacement']
Written to 'reflected_patchfinder.cpp'
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -stdlib=libc++ -I/usr/local/include -g -O2 -stdlib=libc++ -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT offsetexporter-main.o -MD -MP -MF .deps/offsetexporter-main.Tpo -c -o offsetexporter-main.o `test -f 'main.cpp' || echo './'`main.cpp
main.cpp:148:30: error: no viable conversion from 'Mem' to 'std::vector<uint8_t>' (aka 'vector<unsigned char>')
std::vector<uint8_t> templ_f = tihmstar::readFile(templatefile);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:458:57: note: candidate constructor not viable: no known conversion from 'Mem' to 'const vector<unsigned char> &' for 1st argument
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(const vector& __x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:465:5: note: candidate constructor not viable: no known conversion from 'Mem' to 'initializer_list<value_type>' (aka 'initializer_list<unsigned char>') for 1st argument
vector(initializer_list<value_type> __il);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:476:5: note: candidate constructor not viable: no known conversion from 'Mem' to 'vector<unsigned char> &&' for 1st argument
vector(vector&& __x)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:381:66: note: explicit constructor is not a candidate
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(const allocator_type& __a)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:391:66: note: explicit constructor is not a candidate
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit vector(size_type __n);
^
main.cpp:184:78: error: too few arguments to function call, expected at least 3, have 2
tihmstar::writeFile(outfile, {templ.data(),templ.data()+templ.size()});
~~~~~~~~~~~~~~~~~~~ ^
/usr/local/include/libgeneral/Utils.hpp:19:6: note: 'writeFile' declared here
void writeFile(const char *path, const void *mem, size_t memSize, int perm = 0644);
^
2 errors generated.
make[4]: *** [offsetexporter-main.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2```
Hi,
I know this might not get respond from @tihmstar or from anyone at least not soon but anyways I'll issue it so it's could be taken as a serious issue in the feature, until then I'll be using the @haiyuidesu fork which has a less headache on compiling.
I would even tag the issue number #21 here since the solution there doesn't works on MSYS2 too.
Compiler output (stripped):
Zero@unknown:~/Downloads/mysources/liboffsetfinder64
$ export CC=clang
Zero@unknown:~/Downloads/mysources/liboffsetfinder64
$ export CXX=clang++
Zero@unknown:~/Downloads/mysources/liboffsetfinder64
$ ./autogen.sh
configure.ac:4: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:4: You should run autoupdate.
./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:4: the top level
configure.ac:6: warning: The macro `AM_PROG_LIBTOOL' is obsolete.
configure.ac:6: You should run autoupdate.
m4/libtool.m4:101: AM_PROG_LIBTOOL is expanded from...
configure.ac:6: the top level
libpatchfinder/ibootpatchfinder/Makefile.am:54: warning: eval fileoff=$(shell $(OTOOLARM: non-POSIX variable name
libpatchfinder/ibootpatchfinder/Makefile.am:54: (probably a GNU make extension)
libpatchfinder/ibootpatchfinder/Makefile.am:55: warning: eval filesize=$(shell $(OTOOLARM: non-POSIX variable name
libpatchfinder/ibootpatchfinder/Makefile.am:55: (probably a GNU make extension)
configure.ac:4: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:4: You should run autoupdate.
./lib/autoconf/general.m4:2081: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:4: the top level
configure.ac:6: warning: The macro `AM_PROG_LIBTOOL' is obsolete.
configure.ac:6: You should run autoupdate.
m4/libtool.m4:101: AM_PROG_LIBTOOL is expanded from...
configure.ac:6: the top level
libpatchfinder/ibootpatchfinder/Makefile.am:54: warning: eval fileoff=$(shell $(OTOOLARM: non-POSIX variable name
libpatchfinder/ibootpatchfinder/Makefile.am:54: (probably a GNU make extension)
libpatchfinder/ibootpatchfinder/Makefile.am:55: warning: eval filesize=$(shell $(OTOOLARM: non-POSIX variable name
libpatchfinder/ibootpatchfinder/Makefile.am:55: (probably a GNU make extension)
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang accepts -g... yes
checking for clang option to enable C11 features... none needed
checking whether clang understands -c and -o together... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by clang... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/bin/nm -B output from clang object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if clang supports -fno-rtti -fno-exceptions... yes
checking for clang option to produce PIC... -fPIC -DPIC
checking if clang PIC flag -fPIC -DPIC works... yes
checking if clang static flag -static works... yes
checking if clang supports -c -o file.o... yes
checking if clang supports -c -o file.o... (cached) yes
checking whether the clang linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of clang... gcc3
checking whether the compiler supports GNU C++... yes
checking whether clang++ accepts -g... yes
checking for clang++ option to enable C++11 features... none needed
checking how to run the C++ preprocessor... clang++ -E
checking for ld used by clang++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the clang++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for clang++ option to produce PIC... -fPIC -DPIC
checking if clang++ PIC flag -fPIC -DPIC works... yes
checking if clang++ static flag -static works... yes
checking if clang++ supports -c -o file.o... yes
checking if clang++ supports -c -o file.o... (cached) yes
checking whether the clang++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of clang++... gcc3
checking for gcc... (cached) clang
checking whether the compiler supports GNU C... (cached) yes
checking whether clang accepts -g... (cached) yes
checking for clang option to enable C11 features... (cached) none needed
checking whether clang understands -c and -o together... (cached) yes
checking whether we need platform-specific build settings... checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libimg4tool >= 202... yes
checking for libimg3tool >= 8... yes
checking for libgeneral >= 75... yes
checking for libinsn >= 49... yes
*** Note: wtfpwndfu has been disabled ***
checking for fcntl.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for arpa/inet.h... yes
checking for winsock.h... no
checking for memmem... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating libpatchfinder/Makefile
config.status: creating libpatchfinder/ibootpatchfinder/Makefile
config.status: creating libpatchfinder/kernelpatchfinder/Makefile
config.status: creating tools/Makefile
config.status: creating tools/binrider/Makefile
config.status: creating tools/offsetexporter/Makefile
config.status: creating libpatchfinder.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
config.status: executing depfiles commands
Configuration for liboffsetfinder64-154:
-------------------------------------------
install prefix ..........: /usr/local
have img4tool ...........: yes
have img3tool ...........: yes
debug build ............: false
asan build .............: false
with binrider ...........: no
with offsetexporter .....: no
with wtfpwndfu ..........: no
compiler ................: clang
Now type 'make' to build liboffsetfinder64-154,
and then 'make install' for installation.
Zero@unknown:~/Downloads/mysources/liboffsetfinder64
$ make
make all-recursive
make[3]: Leaving directory '/home/Zero/Downloads/mysources/liboffsetfinder64/libpatchfinder/kernelpatchfinder'
make[3]: Entering directory '/home/Zero/Downloads/mysources/liboffsetfinder64/libpatchfinder'
/bin/bash ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patch.lo -MD -MP -MF .deps/libpatchfinder_la-patch.Tpo -c -o libpatchfinder_la-patch.lo `test -f 'patch.cpp' || echo './'`patch.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patch.lo -MD -MP -MF .deps/libpatchfinder_la-patch.Tpo -c patch.cpp -fPIC -DPIC -o .libs/libpatchfinder_la-patch.o
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patch.lo -MD -MP -MF .deps/libpatchfinder_la-patch.Tpo -c patch.cpp -o libpatchfinder_la-patch.o >/dev/null 2>&1
mv -f .deps/libpatchfinder_la-patch.Tpo .deps/libpatchfinder_la-patch.Plo
/bin/bash ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-StableHash.lo -MD -MP -MF .deps/libpatchfinder_la-StableHash.Tpo -c -o libpatchfinder_la-StableHash.lo `test -f 'StableHash.cpp' || echo './'`StableHash.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-StableHash.lo -MD -MP -MF .deps/libpatchfinder_la-StableHash.Tpo -c StableHash.cpp -fPIC -DPIC -o .libs/libpatchfinder_la-StableHash.o
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-StableHash.lo -MD -MP -MF .deps/libpatchfinder_la-StableHash.Tpo -c StableHash.cpp -o libpatchfinder_la-StableHash.o >/dev/null 2>&1
mv -f .deps/libpatchfinder_la-StableHash.Tpo .deps/libpatchfinder_la-StableHash.Plo
/bin/bash ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder.Tpo -c -o libpatchfinder_la-patchfinder.lo `test -f 'patchfinder.cpp' || echo './'`patchfinder.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder.Tpo -c patchfinder.cpp -fPIC -DPIC -o .libs/libpatchfinder_la-patchfinder.o
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder.Tpo -c patchfinder.cpp -o libpatchfinder_la-patchfinder.o >/dev/null 2>&1
mv -f .deps/libpatchfinder_la-patchfinder.Tpo .deps/libpatchfinder_la-patchfinder.Plo
/bin/bash ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder32.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder32.Tpo -c -o libpatchfinder_la-patchfinder32.lo `test -f 'patchfinder32.cpp' || echo './'`patchfinder32.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder32.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder32.Tpo -c patchfinder32.cpp -fPIC -DPIC -o .libs/libpatchfinder_la-patchfinder32.o
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder32.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder32.Tpo -c patchfinder32.cpp -o libpatchfinder_la-patchfinder32.o >/dev/null 2>&1
mv -f .deps/libpatchfinder_la-patchfinder32.Tpo .deps/libpatchfinder_la-patchfinder32.Plo
/bin/bash ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder64.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder64.Tpo -c -o libpatchfinder_la-patchfinder64.lo `test -f 'patchfinder64.cpp' || echo './'`patchfinder64.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder64.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder64.Tpo -c patchfinder64.cpp -fPIC -DPIC -o .libs/libpatchfinder_la-patchfinder64.o
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-patchfinder64.lo -MD -MP -MF .deps/libpatchfinder_la-patchfinder64.Tpo -c patchfinder64.cpp -o libpatchfinder_la-patchfinder64.o >/dev/null 2>&1
mv -f .deps/libpatchfinder_la-patchfinder64.Tpo .deps/libpatchfinder_la-patchfinder64.Plo
/bin/bash ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-machopatchfinder32.lo -MD -MP -MF .deps/libpatchfinder_la-machopatchfinder32.Tpo -c -o libpatchfinder_la-machopatchfinder32.lo `test -f 'machopatchfinder32.cpp' || echo './'`machopatchfinder32.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I../include -I/usr/local/include -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT libpatchfinder_la-machopatchfinder32.lo -MD -MP -MF .deps/libpatchfinder_la-machopatchfinder32.Tpo -c machopatchfinder32.cpp -fPIC -DPIC -o .libs/libpatchfinder_la-machopatchfinder32.o
machopatchfinder32.cpp:23:10: fatal error: 'mach-o/loader.h' file not found
#include <mach-o/loader.h>
^~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [Makefile:575: libpatchfinder_la-machopatchfinder32.lo] Error 1
make[3]: Leaving directory '/home/Zero/Downloads/mysources/liboffsetfinder64/libpatchfinder'
make[2]: *** [Makefile:601: all-recursive] Error 1
make[2]: Leaving directory '/home/Zero/Downloads/mysources/liboffsetfinder64/libpatchfinder'
make[1]: *** [Makefile:482: all-recursive] Error 1
make[1]: Leaving directory '/home/Zero/Downloads/mysources/liboffsetfinder64'
make: *** [Makefile:391: all] Error 2
Best regards.
I have problems finding offsets , some offsets result 0x0, and if put inside the kfd project they don't work
The ./autogen.sh works, but the make fails with:
fatal error: 'liboffsetfinder64/libgeneral/macros.h' file not found
As the title mentioned already. The guide howto compile it is missing. It will be very appreciated if you can add it aswell,
If the default boot-args string is not found, vmem::vmem::memstr should return 0 and ibootpatchfinder64::get_boot_arg_patch should fall back to the iOS 13 default string, but instead memstr instead throws an exception
terminate called after throwing an instance of 'tihmstar::not_found'
what(): std::exception
Aborted (core dumped)
Temporarily fixed by renaming the DEFAULT_BOOTARGS_STR macro.
Also, how do you get the exceptions to have the full information (like "memstr failed to find \"%s\""
)?
iOS14's kernel patch doesn't work(my tried kernel is D20AP one).
I get segmentation fault on get_amfi_patch() :(
mach-o dependency isn't available on Linux. Perhaps consider a build flag/configuration to exclude the files that use it?
config.status: creating Makefile
config.status: creating img4tool/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
configure: WARNING: unrecognized options: --without-cython
~/liboffsetfinder64
configure: WARNING: unrecognized options: --enable-static, --disable-shared, --without-cython, --without-openssl, --without-lzfse
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
In file included from insn.cpp:11:
../include/liboffsetfinder64/OFexception.hpp:12:10: fatal error:
'liboffsetfinder64/libgeneral/macros.h' file not found
I already cloned recursively
Building on Centos 7.1, fixed the vsegment.cpp errors and now I see:
In file included from vmem.cpp:10:0:
../include/liboffsetfinder64/libgeneral/macros.h:44:21: error: expected unqualified-id before '{' token
#define log(a ...) ({printf(a),printf("\n");})
^
../include/liboffsetfinder64/libgeneral/macros.h:44:21: error: expected ')' before '{' token
../include/liboffsetfinder64/libgeneral/macros.h:44:46: error: expected unqualified-id before ')' token
#define log(a ...) ({printf(a),printf("\n");})
^
I can not compile due to the error:
patchfinder64.cpp:37:19: error: use of undeclared identifier 'safeFreeConst' if (_freeBuf) safeFreeConst(_buf);
kqworkloop__kqwl_p I think is the crashpoint, tried all page numbers and am using smith (personal device is iphone 13, 16.4.1) though i have talked to other people who tried offsets generated for kfd who also got a crash due to the same offset value.
Hi, how do I compile offsetexporter into a binary? If I run make
inside tools/
or tools/offsetexporter/
it says make[1]: Nothing to be done for 'all-am'.
but there is no compiled binary leftover. Is the binary output at a different path? Thank you!
Edit: building inside Xcode gives me a "'reflected_kernelpatchfinder.cpp' file not found" error inside of reflected_kernelpatchfinder.cpp
.
I've been trying to do this for 6 hours. Any time I try to use make I get this error.
make all-recursive
make[1]: Entering directory '/home/neuroses/liboffsetfinder64'
Making all in liboffsetfinder64
make[2]: Entering directory '/home/neuroses/liboffsetfinder64/liboffsetfinder64'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-insn.lo -MD -MP -MF .deps/liboffsetfinder64_la-insn.Tpo -c -o liboffsetfinder64_la-insn.lo test -f 'insn.cpp' || echo './'
insn.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include/liboffsetfinder64 -I/usr/local/include -I/usr/local/include -g -O2 -std=c++11 -O3 -D EXPECTIONNAME=OFexception -MT liboffsetfinder64_la-insn.lo -MD -MP -MF .deps/liboffsetfinder64_la-insn.Tpo -c insn.cpp -fPIC -DPIC -o .libs/liboffsetfinder64_la-insn.o
In file included from insn.cpp:11:
../include/liboffsetfinder64/OFexception.hpp:12:10: fatal error: liboffsetfinder64/libgeneral/macros.h: No such file or directory
12 | #include <liboffsetfinder64/libgeneral/macros.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:488: liboffsetfinder64_la-insn.lo] Error 1
make[2]: Leaving directory '/home/neuroses/liboffsetfinder64/liboffsetfinder64'
make[1]: *** [Makefile:472: all-recursive] Error 1
make[1]: Leaving directory '/home/neuroses/liboffsetfinder64'
make: *** [Makefile:381: all] Error 2
hi tihmstar, im getting compiler errors spewing out, any luck compiling this build or am i missing something
In file included from kernelpatchfinder64.cpp:14:
kernelpatchfinder64_iOS15.hpp:20:17: error: reference to ‘offset_t’ is ambiguous
20 | virtual offset_t find_struct_offset_for_PACed_member(const char *strDesc) override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:20:17: error: reference to ‘offset_t’ is ambiguous
20 | virtual offset_t find_struct_kqworkloop_offset_kqwl_owner() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:21:17: error: reference to ‘offset_t’ is ambiguous
21 | virtual offset_t find_struct_task_offset_thread_count() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:22:17: error: reference to ‘offset_t’ is ambiguous
22 | virtual offset_t find_struct_thread_offset_map() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:23:17: error: reference to ‘offset_t’ is ambiguous
23 | virtual offset_t find_struct_thread_offset_thread_id() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:24:17: error: reference to ‘offset_t’ is ambiguous
24 | virtual offset_t find_struct__vm_map_offset_vmu1_lowest_unnestable_start() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:26:17: error: reference to ‘offset_t’ is ambiguous
26 | virtual offset_t find_elementsize_for_zone(const char *zonedesc) override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:28:17: error: reference to ‘offset_t’ is ambiguous
28 | virtual offset_t find_sizeof_struct_proc() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:29:17: error: reference to ‘offset_t’ is ambiguous
29 | virtual offset_t find_sizeof_struct_task() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:30:17: error: reference to ‘offset_t’ is ambiguous
30 | virtual offset_t find_sizeof_struct_thread() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:31:17: error: reference to ‘offset_t’ is ambiguous
31 | virtual offset_t find_sizeof_struct_uthread() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
| ^~~~~~~~
In file included from kernelpatchfinder64.cpp:15:
kernelpatchfinder64_iOS16.hpp:32:17: error: reference to ‘offset_t’ is ambiguous
32 | virtual offset_t find_sizeof_struct__vm_map() override;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:13,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder.hpp:20:19: note: candidates are: ‘using offset_t = tihmstar::libinsn::arm64::insn::loc_t’
20 | using offset_t = tihmstar::libinsn::arm64::insn::loc_t;
| ^~~~~~~~
In file included from ../../include/libpatchfinder/machopatchfinder64.hpp:12,
from ../../include/libpatchfinder/kernelpatchfinder/kernelpatchfinder64.hpp:12,
from kernelpatchfinder64.cpp:9:
../../include/libpatchfinder/patchfinder64.hpp:30:19: note: ‘using offset_t = tihmstar::libinsn::arm64::insn::offset_t’
30 | using offset_t = tihmstar::libinsn::arm64::insn::offset_t;
|
The patch of Pinmux of SWD on ATV4K works on my atv 4k 1st . And I checked the board id is 0x2, and the leaked iBoot showed pinmux of j105 with board 0,1 only.
How could you found the correct offset of the pinmux? I'm tring to find the SWD pin and it's pinmux address, thanks !
Whenever I try to run the findjboffsets.sh in example folder I got this error:
./findjboffsets.sh
offsetexporter: liboffsetfinder64 version: 0.143-ab2d635e1cd0c51ae6e7ff1d2bfa2b6af9bdeee7-RELEASE
Init KPF('/Users/ethernal/kernel.dec')
Warning: compiled without img4tool, extracting from IMG4/IM4P disabled!
got fat macho with first slice at 50896896
[WARNING] We encountered __TEXT_EXEC section, marking normal __TEXT section as non-executable!
Detected non-slid kernel.
Inited machopatchfinder64 143 ab2d635e1cd0c51ae6e7ff1d2bfa2b6af9bdeee7
Kernel version: 8796.122.4~1
Detected iOS 16 kernel
[Error] liboffsetfinder64: failed with exception:
[exception]:
what=overflow reached end of vmem
code=29032456
line=443
file=vmem.cpp
commit count=42
commit sha =f4037f7763f724fdb389d18d625bad9495509206
kernel.dec : iPhone X - iOS 16.5
vmem.cpp: In constructor ‘tihmstar::offsetfinder64::vmem::vmem(std::vectortihmstar::offsetfinder64::vsegment, int)’:
vmem.cpp:21:30: error: ‘remove_if’ is not a member of ‘std’
_segments.erase(std::remove_if(_segments.begin(), _segments.end(), [&](const vsegment& obj){
^~~~~~~~~
vmem.cpp:21:30: note: suggested alternative: ‘remove_cv’
_segments.erase(std::remove_if(_segments.begin(), _segments.end(), [&](const vsegment& obj){
^~~~~~~~~
remove_cv
vmem.cpp:25:10: error: ‘sort’ is not a member of ‘std’
std::sort(_segments.begin(),_segments.end(),[ ]( const vsegment& lhs, const vsegment& rhs){
^~~~
vmem.cpp: In copy constructor ‘tihmstar::offsetfinder64::vmem::vmem(const tihmstar::offsetfinder64::vmem&, tihmstar::offsetfinder64::loc_t, int)’:
vmem.cpp:37:30: error: ‘remove_if’ is not a member of ‘std’
_segments.erase(std::remove_if(_segments.begin(), _segments.end(), [&](const vsegment& obj){
^~~~~~~~~
vmem.cpp:37:30: note: suggested alternative: ‘remove_cv’
_segments.erase(std::remove_if(_segments.begin(), _segments.end(), [&](const vsegment& obj){
^~~~~~~~~
remove_cv
vmem.cpp:41:10: error: ‘sort’ is not a member of ‘std’
std::sort(_segments.begin(),_segments.end(),[ ]( const vsegment& lhs, const vsegment& rhs){
^~~~
vmem.cpp: In member function ‘tihmstar::offsetfinder64::loc_t tihmstar::offsetfinder64::vmem::memmem(const void*, size_t)’:
vmem.cpp:73:12: warning: converting to non-pointer type ‘tihmstar::offsetfinder64::loc_t {aka long unsigned int}’ from NULL [-Wconversion-null]
return NULL;
^~~~
vmem.cpp: In member function ‘tihmstar::offsetfinder64::loc_t tihmstar::offsetfinder64::vmem::memstr(const char*)’:
vmem.cpp:82:12: warning: converting to non-pointer type ‘tihmstar::offsetfinder64::loc_t {aka long unsigned int}’ from NULL [-Wconversion-null]
return NULL;
^~~~
Makefile:487: recipe for target 'liboffsetfinder64_la-vmem.lo' failed
make[2]: *** [liboffsetfinder64_la-vmem.lo] Error 1
make[2]: Leaving directory '/home/vagrant/liboffsetfinder64/liboffsetfinder64'
Makefile:472: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/vagrant/liboffsetfinder64'
Makefile:381: recipe for target 'all' failed
make: *** [all] Error 2
This is on a Vagrant VM (default linux distro).
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.