-
Notifications
You must be signed in to change notification settings - Fork 16
[DRAFT] Apple silicon macs #10
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
Draft
alexandredoyen29
wants to merge
18
commits into
Cryptiiiic:main
Choose a base branch
from
alexandredoyen29:apple-silicon-macs
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.
Draft
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cd8a294
Beginning of the plugin for iokernelrw + Some fixes to build on my mac
alexandredoyen29 0eaa43f
Added Makefile -> We have to link the IOKernelRW kext with the plugin
alexandredoyen29 79c8818
Merge remote-tracking branch 'origin/main' into apple-silicon-macs
alexandredoyen29 7a88df2
Added TODOs
alexandredoyen29 132ed71
kwrite wrapper implementation
alexandredoyen29 2837516
Ooops
alexandredoyen29 262c43f
Functions to load KRW plugins + Export to CLI
alexandredoyen29 bb2768c
Requested patches (FAT.h -> Fat.h)
alexandredoyen29 7fa85c1
Error management + doc
alexandredoyen29 942b74c
Forgotten call to set_krw_plugin()
alexandredoyen29 1035b0d
IOKernelRW as a libkrw plugin
alexandredoyen29 aae216a
Revert plugin loading by x8A4
alexandredoyen29 916061a
Missing iokernelrw_open() and IOKit framework declaration
alexandredoyen29 72bb31f
Missing bundle option (Regarding libkrw doc) + Clean target
alexandredoyen29 50b2e1e
Missing deletes :/
alexandredoyen29 bff650e
New libkrw plugins path
alexandredoyen29 56bc121
WIP AS
Cryptiiiic 26d5899
Initial working AS support
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 |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ | |
| *.dylib | ||
| *.bin | ||
| cmake-build-*/ | ||
| .DS_Store | ||
| .DS_Store | ||
| .vscode | ||
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
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,7 @@ | ||
| CC=clang | ||
| CFLAGS=-fPIC -shared | ||
| IPATH=-I../../Include | ||
| LDFLAGS=-L/Library/Extensions/IOKernelRW.kext/Contents/MacOS/ -lIOKernelRW | ||
|
|
||
| iokernelrw_krw_plugin.so: iokernelrw_krw_plugin.c | ||
| $(CC) $(CFLAGS) $(IPATH) $^ -o $@ $(LDFLAGS) |
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,72 @@ | ||
| #include <IOKit/IOKitLib.h> | ||
| #include <iokernelrw.h> | ||
| #include <mach/arm/kern_return.h> | ||
| #include <mach/kern_return.h> | ||
| #include <sys/errno.h> | ||
|
|
||
| #include "libkrw_plugin.h" | ||
|
|
||
| io_connect_t krw_client = IO_OBJECT_NULL; | ||
|
|
||
| int kread_wrapper(uint64_t from, void* to, size_t len) | ||
| { | ||
| kern_return_t result_read; | ||
| int result; | ||
|
|
||
| if (krw_client == IO_OBJECT_NULL) | ||
| { | ||
| krw_client = iokernelrw_open(); | ||
| } | ||
|
|
||
| result_read = iokernelrw_read(krw_client, from, to, len); | ||
|
|
||
| if (result_read == KERN_SUCCESS) | ||
| { | ||
| result = 0; | ||
| } | ||
| else | ||
| { | ||
| result = EDEVERR; | ||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| int kwrite_wrapper(void* from, uint64_t to, size_t len) | ||
| { | ||
| kern_return_t result_write; | ||
| int result; | ||
|
|
||
| if (krw_client == IO_OBJECT_NULL) | ||
| { | ||
| krw_client = iokernelrw_open(); | ||
| } | ||
|
|
||
| result_write = iokernelrw_write(krw_client, from, to, len); | ||
|
|
||
| if (result_write == KERN_SUCCESS) | ||
| { | ||
| result = 0; | ||
| } | ||
| else | ||
| { | ||
| result = EDEVERR; | ||
| } | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| int krw_plugin_initializer(krw_handlers_t handlers) | ||
| { | ||
| //handlers->version = TODO; | ||
| //handlers->kbase = TODO; | ||
| handlers->kread = kread_wrapper; | ||
| handlers->kwrite = kwrite_wrapper; | ||
| //handlers->kmalloc = TODO; | ||
| //handlers->kdealloc = TODO; | ||
| //handlers->kcall = TODO; | ||
| //handlers->physread = TODO; | ||
| //handlers->physwrite = TODO; | ||
|
|
||
| return 0; | ||
| } |
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
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
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.