-
Notifications
You must be signed in to change notification settings - Fork 135
Add x8A4, Switch to libkrw fork #1459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Cryptiiiic
wants to merge
9
commits into
main
Choose a base branch
from
Cryptic/x8A4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0265431
Switch to libkrw fork
Cryptiiiic a342c0c
Add x8A4
Cryptiiiic 342b4a6
Fix homepage
Cryptiiiic 5c7a1d4
Fix phony
Cryptiiiic 7a598d1
Rename sover
Cryptiiiic 6e47367
Fix include
Cryptiiiic 78b35cd
Fixes
Cryptiiiic 2f7319b
Update x8A4
Cryptiiiic 15f3e75
Update x8A4
Cryptiiiic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| Package: libkrw-dev | ||
| Author: Siguza | ||
| Author: Cryptiiiic | ||
| Maintainer: @DEB_MAINTAINER@ | ||
| Architecture: @DEB_ARCH@ | ||
| Version: @DEB_LIBKRW_V@ | ||
| Depends: libkrw0 (= @DEB_LIBKRW_V@) | ||
| Section: Development | ||
| Priority: optional | ||
| Homepage: https://github.com/Siguza/libkrw | ||
| Homepage: https://github.com/Cryptiiiic/libkrw | ||
| Description: A kernel R/W API for jailbreaks (Development Files) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| Package: libkrw0-tfp0 | ||
| Author: Siguza | ||
| Author: Cryptiiiic | ||
| Maintainer: @DEB_MAINTAINER@ | ||
| Architecture: @DEB_ARCH@ | ||
| Version: @DEB_LIBKRW_V@ | ||
| Provides: libkrw0-plugin | ||
| Enhances: libkrw0 | ||
| Section: Libraries | ||
| Priority: standard | ||
| Homepage: https://github.com/Siguza/libkrw | ||
| Homepage: https://github.com/Cryptiiiic/libkrw | ||
| Description: Plugin for libkrw that interfaces with tfp0/hgsp4 (Shared Library) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| Package: libkrw0 | ||
| Author: Siguza | ||
| Author: Cryptiiiic | ||
| Maintainer: @DEB_MAINTAINER@ | ||
| Architecture: @DEB_ARCH@ | ||
| Version: @DEB_LIBKRW_V@ | ||
| Provides: libkrw (= @DEB_LIBKRW_V@) | ||
| Depends: libkrw0-plugin | ||
| Section: Libraries | ||
| Priority: standard | ||
| Homepage: https://github.com/Siguza/libkrw | ||
| Homepage: https://github.com/Cryptiiiic/libkrw | ||
| Description: A kernel R/W API for jailbreaks (Shared Library) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Package: libx8A4-dev | ||
| Author: Cryptiiiic | ||
| Maintainer: @DEB_MAINTAINER@ | ||
| Architecture: @DEB_ARCH@ | ||
| Version: @DEB_X8A4_V@ | ||
| Depends: libx8A4 (= @DEB_X8A4_V@) | ||
| Section: Development | ||
| Priority: optional | ||
| Homepage: https://github.com/Cryptiiiic/x8A4 | ||
| Description: An all-in-one tool for firmware nonces, seeds, and downgrade support (Development Files) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Package: libx8A4 | ||
| Author: Cryptiiiic | ||
| Maintainer: @DEB_MAINTAINER@ | ||
| Architecture: @DEB_ARCH@ | ||
| Version: @DEB_X8A4_V@ | ||
| Provides: libx8A4 (= @DEB_X8A4_V@) | ||
| Depends: libkrw | ||
Cryptiiiic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Section: Libraries | ||
| Priority: standard | ||
| Homepage: https://github.com/Cryptiiiic/x8A4 | ||
| Description: An all-in-one tool for firmware nonces, seeds, and downgrade support (Shared Library) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Package: x8A4 | ||
| Author: Cryptiiiic | ||
| Maintainer: @DEB_MAINTAINER@ | ||
| Architecture: @DEB_ARCH@ | ||
| Version: @DEB_X8A4_V@ | ||
| Depends: libx8A4 (= @DEB_X8A4_V@) | ||
| Enhances: dimentio | ||
| Section: Utilities | ||
| Priority: optional | ||
| Homepage: https://github.com/Cryptiiiic/x8A4 | ||
| Description: An all-in-one tool for firmware nonces, seeds, and downgrade support |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>get-task-allow</key> | ||
| <true/> | ||
| <key>task_for_pid-allow</key> | ||
| <true/> | ||
| <key>platform-application</key> | ||
| <true/> | ||
| <key>com.apple.private.kernel.get-kext-info</key> | ||
| <true/> | ||
| <key>com.apple.private.security.no-container</key> | ||
| <true/> | ||
| <key>com.apple.security.iokit-user-client-class</key> | ||
| <string>AppleMobileApNonceUserClient</string> | ||
| <key>com.apple.security.exception.iokit-user-client-class</key> | ||
| <string>IOSurfaceRootUserClient</string> | ||
Cryptiiiic marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </dict> | ||
| </plist> | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| diff --git a/src/arm64.c b/src/arm64.c | ||
| index 2b07da0..99420f5 100644 | ||
| --- a/src/arm64.c | ||
| +++ b/src/arm64.c | ||
| @@ -442,6 +442,90 @@ int arm64_dec_add_imm(uint32_t inst, arm64_register *destinationRegOut, arm64_re | ||
| return 0; | ||
| } | ||
|
|
||
| +int arm64_gen_sub_imm(arm64_register destinationReg, arm64_register sourceReg, optional_uint64_t optImm, optional_bool optS, uint32_t *bytesOut, uint32_t *maskOut) { | ||
| + if (ARM64_REG_IS_ANY_VECTOR(destinationReg)) return -1; | ||
| + if (ARM64_REG_IS_ANY_VECTOR(sourceReg)) return -1; | ||
| + | ||
| + if (!ARM64_REG_IS_ANY(destinationReg) && !ARM64_REG_IS_ANY(sourceReg)) { | ||
| + // if both regs are set and have a mismatching width, abort | ||
| + if (ARM64_REG_IS_W(destinationReg) != ARM64_REG_IS_W(sourceReg)) return -1; | ||
| + } | ||
| + | ||
| + uint32_t inst = 0x51000000; | ||
| + uint32_t mask = 0x7f800000; | ||
| + if(OPT_BOOL_IS_SET(optS)) { | ||
| + bool s = OPT_BOOL_GET_VAL(optS); | ||
| + if(s) { | ||
| + inst = 0x71000000; | ||
| + mask |= (1 << 29); | ||
| + inst |= (1 << 29); | ||
| + } | ||
| + } | ||
| + | ||
| + // if one is set and 32 bit, include 32 bit in mask and set it in inst | ||
| + if (!ARM64_REG_IS_ANY(destinationReg)) { | ||
| + mask |= (1 << 31); | ||
| + inst |= ((uint32_t)(ARM64_REG_IS_X(destinationReg)) << 31); | ||
| + } | ||
| + else if (!ARM64_REG_IS_ANY(sourceReg)) { | ||
| + mask |= (1 << 31); | ||
| + inst |= ((uint32_t)(ARM64_REG_IS_X(sourceReg)) << 31); | ||
| + } | ||
| + | ||
| + if (!ARM64_REG_IS_ANY(destinationReg)) { | ||
| + mask |= 0x1F; | ||
| + inst |= (uint32_t)(ARM64_REG_GET_NUM(destinationReg)); | ||
| + } | ||
| + if (!ARM64_REG_IS_ANY(sourceReg)) { | ||
| + mask |= (0x1F << 5); | ||
| + inst |= ((uint32_t)(ARM64_REG_GET_NUM(destinationReg)) << 5); | ||
| + } | ||
| + | ||
| + if (OPT_UINT64_IS_SET(optImm)) { | ||
| + uint64_t imm = OPT_UINT64_GET_VAL(optImm); | ||
| + if (imm & ~0xFFF) return -1; | ||
| + mask |= (0xFFF << 10); | ||
| + inst |= (imm << 10); | ||
| + } | ||
| + | ||
| + if (bytesOut) *bytesOut = inst; | ||
| + if (maskOut) *maskOut = mask; | ||
| + return 0; | ||
| +} | ||
| + | ||
| +int arm64_dec_sub_imm(uint32_t inst, arm64_register *destinationRegOut, arm64_register *sourceRegOut, uint16_t *immOut, bool *sOut) { | ||
| + if ((inst & 0x7f800000) != 0x51000000) { | ||
| + if ((inst & 0x7f800000) != 0x71000000) { | ||
| + return -1; | ||
| + } | ||
| + } | ||
| + bool is64 = (inst & 0x80000000); | ||
| + bool isS = (inst & 0x20000000); | ||
| + bool shift = (inst & 0x400000); | ||
| + | ||
| + if (destinationRegOut) { | ||
| + *destinationRegOut = ARM64_REG(is64 ? ARM64_REG_TYPE_X : ARM64_REG_TYPE_W, inst & 0x1F); | ||
| + } | ||
| + if (sourceRegOut) { | ||
| + *sourceRegOut = ARM64_REG(is64 ? ARM64_REG_TYPE_X : ARM64_REG_TYPE_W, (inst >> 5) & 0x1F); | ||
| + } | ||
| + | ||
| + if (immOut) { | ||
| + uint16_t imm = ((inst >> 10) & 0xFFF); | ||
| + if (shift) { | ||
| + imm = (imm << 12); | ||
| + } | ||
| + *immOut = imm; | ||
| + } | ||
| + | ||
| + if (sOut) { | ||
| + *sOut = isS; | ||
| + } | ||
| + | ||
| + return 0; | ||
| +} | ||
| + | ||
| + | ||
| static int _arm64_gen_str_ldr_imm(uint32_t inst, uint32_t mask, char type, arm64_ldr_str_type instType, arm64_register sourceDestinationReg, arm64_register addrReg, optional_uint64_t optImm, uint32_t *bytesOut, uint32_t *maskOut) | ||
| { | ||
| if (ARM64_REG_IS_ANY_VECTOR(addrReg)) return -1; | ||
| diff --git a/src/arm64.h b/src/arm64.h | ||
| index 6cc1329..5ad903b 100644 | ||
| --- a/src/arm64.h | ||
| +++ b/src/arm64.h | ||
| @@ -85,6 +85,8 @@ int arm64_gen_mov_reg(arm64_register destinationReg, arm64_register sourceReg, u | ||
| int arm64_dec_mov_reg(uint32_t inst, arm64_register *destinationRegOut, arm64_register *sourceRegOut); | ||
| int arm64_gen_add_imm(arm64_register destinationReg, arm64_register sourceReg, optional_uint64_t optImm, uint32_t *bytesOut, uint32_t *maskOut); | ||
| int arm64_dec_add_imm(uint32_t inst, arm64_register *destinationRegOut, arm64_register *sourceRegOut, uint16_t *immOut); | ||
| +int arm64_gen_sub_imm(arm64_register destinationReg, arm64_register sourceReg, optional_uint64_t optImm, optional_bool optS, uint32_t *bytesOut, uint32_t *maskOut); | ||
| +int arm64_dec_sub_imm(uint32_t inst, arm64_register *destinationRegOut, arm64_register *sourceRegOut, uint16_t *immOut, bool *sOut); | ||
| int arm64_gen_ldr_imm(char type, arm64_ldr_str_type instType, arm64_register destinationReg, arm64_register addrReg, optional_uint64_t optImm, uint32_t *bytesOut, uint32_t *maskOut); | ||
| int arm64_dec_ldr_imm(uint32_t inst, arm64_register *destinationReg, arm64_register *addrReg, uint64_t *immOut, char *typeOut, arm64_ldr_str_type *instTypeOut); | ||
| int arm64_gen_ldrs_imm(char type, arm64_ldr_str_type instType, arm64_register destinationReg, arm64_register addrReg, optional_uint64_t optImm, uint32_t *bytesOut, uint32_t *maskOut); | ||
|
|
||
| diff --git a/src/MachOByteOrder.h b/src/MachOByteOrder.h | ||
| index 47f6f7d..56e28ea 100644 | ||
| --- a/src/MachOByteOrder.h | ||
| +++ b/src/MachOByteOrder.h | ||
| @@ -3,6 +3,7 @@ | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| +#include <libkern/OSByteOrder.h> | ||
|
|
||
| // 8-bit integers needed for CodeDirectory | ||
| #define BIG_TO_HOST(n) _Generic((n), \ |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.