├── .gitattributes ├── .gitignore ├── Blueprint └── FridaCodeManager.app │ ├── AppIcon.png │ ├── Info.plist │ ├── Launch Screen.storyboardc │ ├── 01J-lp-oVM-view-Ze5-6b-2t3.nib │ ├── Info.plist │ └── UIViewController-01J-lp-oVM.nib │ ├── LaunchImage-568h@2x.png │ ├── LaunchImage-700-568h@2x.png │ ├── LaunchImage-700-Landscape@2x~ipad.png │ ├── LaunchImage-700-Landscape~ipad.png │ ├── LaunchImage-700-Portrait@2x~ipad.png │ ├── LaunchImage-700-Portrait~ipad.png │ ├── LaunchImage-700@2x.png │ ├── LaunchImage-800-667h@2x.png │ ├── LaunchImage-800-Landscape-736h@3x.png │ ├── LaunchImage-800-Portrait-736h@3x.png │ ├── LaunchImage-Landscape@2x~ipad.png │ ├── LaunchImage-Landscape~ipad.png │ ├── LaunchImage-Portrait@2x~ipad.png │ ├── LaunchImage-Portrait~ipad.png │ ├── LaunchImage.png │ ├── LaunchImage@2x.png │ ├── default.png │ └── tshelper ├── Chainmaker ├── build.sh ├── dylibify │ ├── Dylibify.h │ ├── Makefile │ └── main.m ├── jailed.sh └── shell │ ├── cat │ ├── entitlements.plist │ └── main.c │ ├── chmod │ ├── entitlements.plist │ └── main.c │ ├── chown │ ├── entitlements.plist │ └── main.c │ ├── compile.sh │ ├── cp │ ├── entitlements.plist │ └── main.c │ ├── csh │ ├── cmd_utils.c │ ├── cmd_utils.h │ ├── csh.h │ ├── entitlements.plist │ ├── envcontroller.c │ ├── envcontroller.h │ ├── extra.c │ ├── extra.h │ ├── fetch.c │ ├── fetch.h │ └── main.c │ ├── echo │ ├── entitlements.plist │ └── main.c │ ├── grep │ ├── entitlements.plist │ └── main.c │ ├── hostname │ ├── entitlements.plist │ ├── fetch.c │ ├── fetch.h │ └── main.c │ ├── id │ ├── entitlements.plist │ └── main.c │ ├── ln │ ├── entitlements.plist │ └── main.c │ ├── ls │ ├── entitlements.plist │ └── main.c │ ├── mkdir │ ├── entitlements.plist │ └── main.c │ ├── mv │ ├── entitlements.plist │ └── main.c │ ├── ping │ ├── entitlements.plist │ └── main.c │ ├── rm │ ├── entitlements.plist │ └── main.c │ ├── rmdir │ ├── entitlements.plist │ └── main.c │ ├── touch │ ├── entitlements.plist │ └── main.c │ └── whoami │ ├── entitlements.plist │ ├── fetch.c │ ├── fetch.h │ └── main.c ├── Essentials ├── Makefile ├── debughelper │ ├── Makefile │ ├── debug.dylib │ ├── entitlements.plist │ ├── injectable │ │ ├── Makefile │ │ └── main.m │ ├── libinject.a │ ├── opainject │ │ ├── CoreSymbolication.h │ │ ├── Makefile │ │ ├── README.md │ │ ├── arm64.h │ │ ├── arm64.m │ │ ├── control │ │ ├── dyld.h │ │ ├── dyld.m │ │ ├── entitlements.plist │ │ ├── main.m │ │ ├── pac.h │ │ ├── rop_inject.h │ │ ├── rop_inject.m │ │ ├── sandbox.h │ │ ├── shellcode_inject.h │ │ ├── shellcode_inject.m │ │ ├── task_utils.h │ │ ├── task_utils.m │ │ ├── thread_utils.h │ │ └── thread_utils.m │ ├── poc │ └── poc.m ├── include │ ├── libcheck │ │ └── check.h │ ├── libdycall │ │ └── dyexec.h │ ├── libfcm │ │ ├── fcm.h │ │ ├── fload.h │ │ └── proc.h │ ├── libroot │ │ └── libroot.h │ ├── libsean │ │ ├── Bootloader │ │ │ ├── bootloader.h │ │ │ └── proc.h │ │ ├── CPU │ │ │ ├── cpu.h │ │ │ ├── peripheral.h │ │ │ └── rdrand.h │ │ ├── GPU │ │ │ └── gpu.h │ │ ├── Peripherals │ │ │ ├── Display │ │ │ │ └── Display.h │ │ │ └── Mouse │ │ │ │ └── Mouse.h │ │ ├── RAM │ │ │ └── ram.h │ │ ├── VFS │ │ │ └── fs.h │ │ ├── compiler.h │ │ └── ios.h │ ├── libserver │ │ └── server.h │ └── libzip │ │ └── libzip.h ├── lib │ └── prebuild │ │ ├── libroot.a │ │ ├── libserver.a │ │ └── libzip.a ├── libcheck │ ├── Makefile │ ├── sdk │ └── typecheck.m ├── libdycall │ ├── Makefile │ ├── dyexec.m │ ├── dyfree.m │ ├── dylock.m │ ├── fishhook.c │ ├── fishhook.h │ ├── hooker.c │ ├── hooker.h │ ├── sdk │ ├── symbols │ │ └── exit.c │ ├── thread.c │ └── thread.h ├── libfcm │ ├── Makefile │ ├── fcm.m │ ├── fload.m │ ├── proc.c │ └── sdk └── libsean │ ├── Compiler │ ├── code.c │ ├── code.h │ ├── compiler.h │ └── compiler.m │ ├── Makefile │ ├── SOC │ ├── Bootloader │ │ ├── bootloader.h │ │ ├── bootloader.m │ │ ├── proc.c │ │ └── proc.h │ ├── CPU │ │ ├── cpu.h │ │ ├── cpu.m │ │ ├── peripheral.h │ │ ├── peripheral.m │ │ ├── rdrand.c │ │ └── rdrand.h │ ├── GPU │ │ ├── gpu.h │ │ └── gpu.m │ ├── Peripherals │ │ ├── Display │ │ │ ├── Display.h │ │ │ └── Display.m │ │ └── Mouse │ │ │ ├── Mouse.h │ │ │ └── Mouse.m │ ├── RAM │ │ ├── ram.c │ │ └── ram.h │ └── VFS │ │ ├── fs.h │ │ ├── fs.m │ │ └── mgr.m │ ├── Sean16.h │ ├── kickstart.m │ ├── libasmfile.c │ ├── libasmfile.h │ └── sdk ├── FCM ├── Generic.swift ├── Main.swift ├── RootView.swift ├── ToolKit │ ├── AltRootToolKit.swift │ ├── BuildToolKit.swift │ ├── Compiling │ │ ├── API │ │ │ ├── api.swift │ │ │ ├── data │ │ │ │ └── tag.swift │ │ │ ├── load.swift │ │ │ └── run.swift │ │ ├── Sean16.swift │ │ ├── SeansBuild.swift │ │ └── Shell.swift │ ├── FeedbackToolKit.swift │ ├── FileToolKit.swift │ ├── FontToolKit.swift │ ├── FrameworksToolKit.swift │ ├── LogToolKit.swift │ ├── LoggingSystem.swift │ ├── NSRangeToolKit.swift │ ├── PlistToolKit.swift │ ├── SwitchToolKit.swift │ └── Typecheck │ │ └── SeansCheck.swift ├── UI │ ├── FluidGradient │ │ ├── BlobLayer.swift │ │ ├── CGPoint+Extensions.swift │ │ ├── FluidGradient.swift │ │ ├── FluidGradientView.swift │ │ └── ResizableLayer.swift │ ├── Popup │ │ ├── BottomPopupView.swift │ │ └── Items │ │ │ ├── ButtonBar.swift │ │ │ ├── Header.swift │ │ │ ├── Picker.swift │ │ │ └── TextField.swift │ ├── TabBar │ │ ├── GitHub │ │ │ └── Utils.swift │ │ ├── Home.swift │ │ ├── ProjectManagement │ │ │ ├── MacroManager.swift │ │ │ ├── Project.swift │ │ │ ├── ProjectPreferences.swift │ │ │ ├── ProjectView.swift │ │ │ └── Sean16Stuff.swift │ │ ├── Settings │ │ │ ├── Cleaner │ │ │ │ └── CleanerBundleMain.swift │ │ │ ├── DumpLog │ │ │ │ └── DumpLogBundleMain.swift │ │ │ ├── Experimental │ │ │ │ └── ExperimentalSettingsBundle.swift │ │ │ ├── SDKHub │ │ │ │ ├── SDKHUBBundleMain.swift │ │ │ │ └── sdk │ │ │ │ │ ├── build.sh │ │ │ │ │ ├── iOS11.4.zip │ │ │ │ │ ├── iOS12.4.zip │ │ │ │ │ ├── iOS13.7.zip │ │ │ │ │ ├── iOS14.5.zip │ │ │ │ │ ├── iOS15.6.zip │ │ │ │ │ └── iOS16.5.zip │ │ │ ├── Settings.swift │ │ │ └── Spacing │ │ │ │ └── SpacingSettingsBundle.swift │ │ └── Wiki │ │ │ ├── ParsedView.swift │ │ │ ├── Parser.swift │ │ │ └── Wiki.swift │ ├── UIAboutView.swift │ ├── UIAppeareance.swift │ ├── UIBackgroundHack.swift │ ├── UIConsole.swift │ ├── UIFileList.swift │ ├── UIIconSetter.swift │ ├── UIImgView.swift │ ├── UINeoEditor.swift │ ├── UISymbolView.swift │ └── UISymbols.swift ├── bridge.h ├── debug.xml └── ent.xml ├── LICENSE ├── Makefile └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_store 2 | Blueprint/FridaCodeManager.app/swifty 3 | Blueprint/FridaCodeManager.app/sdk 4 | Product/* 5 | .package 6 | Chainmaker/.tmp 7 | Essentials/libsean/tmp 8 | Essentials/libsean/libsean16.o 9 | Essentials/lib/build 10 | tmp 11 | SDK 12 | -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/AppIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/AppIcon.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/Launch Screen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/Launch Screen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/Launch Screen.storyboardc/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/Launch Screen.storyboardc/Info.plist -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/Launch Screen.storyboardc/UIViewController-01J-lp-oVM.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/Launch Screen.storyboardc/UIViewController-01J-lp-oVM.nib -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-568h@2x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-700-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-700-568h@2x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-700-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-700-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-700-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-700-Landscape~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-700-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-700-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-700-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-700-Portrait~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-700@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-700@2x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-800-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-800-667h@2x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-800-Landscape-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-800-Landscape-736h@3x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-800-Portrait-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-800-Portrait-736h@3x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-Landscape~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage-Portrait~ipad.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/LaunchImage@2x.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/default.png -------------------------------------------------------------------------------- /Blueprint/FridaCodeManager.app/tshelper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Blueprint/FridaCodeManager.app/tshelper -------------------------------------------------------------------------------- /Chainmaker/build.sh: -------------------------------------------------------------------------------- 1 | # prepare # 2 | if [ -d .tmp ]; then 3 | rm -rf .tmp 4 | fi 5 | mkdir -p .tmp .tmp/procursus .tmp/toolchain .tmp/toolchain/bin .tmp/toolchain/lib 6 | 7 | # toolchain packages download # 8 | packages=("coreutils" "libreadline8" "libiosexec1" "libncursesw6" "libintl8" "libssl3" "libedit0" "libzstd1" "libxar1" "dash" "ld64" "libuuid16" "libtapi" "odcctools" "libllvm14" "libclang-cpp14" "libclang1-14" "clang-14" "libclang-common-14-dev" "ldid" "zip" "unzip" "libplist3" "shell-cmds" "libc-ares2" "libnghttp2-14" "libidn2-0" "librtmp1" "libgmp10" "libgnutls30" "libhogweed6" "libnettle8" "libssh2-1" "libssl3" "libbrotli1" "libunistring5" "libp11-kit0" "libtasn1-6" "libffi8") 9 | 10 | for package in "${packages[@]}"; do 11 | echo -e "\e[38;5;208mdownloading $package\e[0m" 12 | cd .tmp/procursus 13 | while ! apt download --download-only "$package" > /dev/null 2>&1; do 14 | echo -e "failed, retry!" 15 | echo -e "\e[38;5;208mdownloading $package\e[0m" 16 | done 17 | dpkg --extract "${package}"*.deb ./ 18 | rm "${package}"*.deb 19 | cd ../../ 20 | done 21 | 22 | # toolchain creation # 23 | echo -e "\033[32mcreating toolchain\e[0m" 24 | 25 | ## ENV ## 26 | echo -e "\e[38;5;208msetting environment\e[0m" 27 | ROOT_BIN=.tmp/procursus/var/jb/usr/bin 28 | ROOT_LIB=.tmp/procursus/var/jb/usr/lib 29 | ROOT_RPATH=/var/jb/usr/lib 30 | CHAIN_BIN=.tmp/toolchain/bin 31 | CHAIN_LIB=.tmp/toolchain/lib 32 | CHAIN_RPATH=@loader_path/../lib 33 | 34 | ## COPY STAGE ## 35 | echo -e "\e[38;5;208mcopy stage\e[0m" 36 | binaries=("dash" "echo" "ld" "ln" "install_name_tool" "otool" "ldid" "zip" "unzip" "killall") 37 | libraries=("libedit.0.dylib" "libiosexec.1.dylib" "libreadline.8.dylib" "libhistory.8.dylib" "libncursesw.6.dylib" "libzstd.1.dylib" "libxar.1.dylib" "libcrypto.3.dylib" "libtapi.dylib" "libplist-2.0.3.dylib" "libp11-kit.0.dylib" "libtasn1.6.dylib" "libffi.8.dylib") 38 | 39 | for binary in "${binaries[@]}"; do 40 | cp $ROOT_BIN/$binary $CHAIN_BIN/$binary 41 | done 42 | for library in "${libraries[@]}"; do 43 | cp -L $ROOT_LIB/$library $CHAIN_LIB/$library 44 | done 45 | 46 | ## Special Stuff ## 47 | # copy patched llvm to toolchain 48 | cp $ROOT_LIB/llvm-14/bin/clang-14 $CHAIN_BIN/clang-14 49 | rm $ROOT_LIB/llvm-14/lib/libLLVM-14.dylib 50 | cp -rL $ROOT_LIB/llvm-14/lib/*.dylib $CHAIN_LIB 51 | rm -rf $ROOT_LIB/llvm-14/lib/clang/14.0.0/lib 52 | cp -r $ROOT_LIB/llvm-14/lib/clang $CHAIN_LIB 53 | 54 | ## @RPATH PATCH ## 55 | echo -e "\e[38;5;208mpatching @rpath\e[0m" 56 | for dir in $CHAIN_BIN $CHAIN_LIB; do 57 | for file in "$dir"/*; do 58 | if [ ! -d "$file" ]; then 59 | # nobody listens to you XD 60 | install_name_tool -delete_rpath $ROOT_RPATH "$file" > /dev/null 2>&1 61 | if ! install_name_tool -add_rpath $CHAIN_RPATH "$file" > /dev/null 2>&1; then 62 | echo "failed to relink $file" 63 | else 64 | echo "relinked $file" 65 | fi 66 | fi 67 | done 68 | done 69 | 70 | mkdir shell/output 71 | bash shell/compile.sh 72 | cp shell/output/* $CHAIN_BIN 73 | rm -rf shell/output 74 | -------------------------------------------------------------------------------- /Chainmaker/dylibify/Dylibify.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | void Dylibify(NSString* ExecutablePath); 4 | -------------------------------------------------------------------------------- /Chainmaker/dylibify/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | all: 4 | clang -isysroot ../../SDK -target apple-arm64-ios15.0 -arch arm64 main.m -framework Foundation -o Dylibify 5 | -------------------------------------------------------------------------------- /Chainmaker/dylibify/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import "Dylibify.h" 8 | 9 | static uint32_t rnd32(uint32_t v, uint32_t r) { 10 | r--; 11 | return (v + r) & ~r; 12 | } 13 | 14 | static void insertDylibCommand(const char *path, struct mach_header_64 *header) { 15 | char *name = basename((char *)path); 16 | struct dylib_command *dylib = (struct dylib_command *)(sizeof(struct mach_header_64) + (void *)header+header->sizeofcmds); 17 | dylib->cmd = LC_ID_DYLIB; 18 | dylib->cmdsize = sizeof(struct dylib_command) + rnd32((uint32_t)strlen(name) + 1, 8); 19 | dylib->dylib.name.offset = sizeof(struct dylib_command); 20 | dylib->dylib.compatibility_version = 0x10000; 21 | dylib->dylib.current_version = 0x10000; 22 | dylib->dylib.timestamp = 2; 23 | strncpy((void *)dylib + dylib->dylib.name.offset, name, strlen(name)); 24 | header->ncmds++; 25 | header->sizeofcmds += dylib->cmdsize; 26 | } 27 | 28 | static void patchExecSlice(const char *path, struct mach_header_64 *header) { 29 | uint8_t *imageHeaderPtr = (uint8_t*)header + sizeof(struct mach_header_64); 30 | 31 | // Literally convert an executable to a dylib 32 | if (header->magic == MH_MAGIC_64) { 33 | //assert(header->flags & MH_PIE); 34 | header->filetype = MH_DYLIB; 35 | header->flags &= ~MH_PIE; 36 | } 37 | 38 | // Add LC_ID_DYLIB 39 | BOOL hasDylibCommand = NO; 40 | struct load_command *command = (struct load_command *)imageHeaderPtr; 41 | for(int i = 0; i < header->ncmds > 0; i++) { 42 | if(command->cmd == LC_ID_DYLIB) { 43 | hasDylibCommand = YES; 44 | break; 45 | } 46 | command = (struct load_command *)((void *)command + command->cmdsize); 47 | } 48 | if (!hasDylibCommand) { 49 | insertDylibCommand(path, header); 50 | } 51 | 52 | // Patch __PAGEZERO to map just a single zero page, fixing "out of address space" 53 | struct segment_command_64 *seg = (struct segment_command_64 *)imageHeaderPtr; 54 | assert(seg->cmd == LC_SEGMENT_64); 55 | if (seg->vmaddr == 0) { 56 | assert(seg->vmsize == 0x100000000); 57 | seg->vmaddr = 0x100000000 - 0x4000; 58 | seg->vmsize = 0x4000; 59 | } 60 | } 61 | 62 | void Dylibify(NSString* ExecutablePath) { 63 | const char* path = (const char*)ExecutablePath.UTF8String; 64 | int fd = open(path, O_RDWR, (mode_t)0600); 65 | struct stat s; 66 | fstat(fd, &s); 67 | void *map = mmap(NULL, s.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 68 | uint32_t magic = *(uint32_t *)map; 69 | if (magic == FAT_CIGAM) { 70 | // Find compatible slice 71 | struct fat_header *header = (struct fat_header *)map; 72 | struct fat_arch *arch = (struct fat_arch *)(map + sizeof(struct fat_header)); 73 | for (int i = 0; i < OSSwapInt32(header->nfat_arch); i++) { 74 | if (OSSwapInt32(arch->cputype) == CPU_TYPE_ARM64) { 75 | patchExecSlice(path, (struct mach_header_64 *)(map + OSSwapInt32(arch->offset))); 76 | } 77 | arch = (struct fat_arch *)((void *)arch + sizeof(struct fat_arch)); 78 | } 79 | } else if (magic == MH_MAGIC_64) { 80 | patchExecSlice(path, (struct mach_header_64 *)map); 81 | } else { 82 | printf("Error: 32-bit app is not supported\n"); 83 | } 84 | msync(map, s.st_size, MS_SYNC); 85 | munmap(map, s.st_size); 86 | close(fd); 87 | } 88 | 89 | int main(int argc, char *argv[]) { 90 | if(argc > 1) { 91 | Dylibify([NSString stringWithFormat:@"%s",argv[1]]); 92 | } else { 93 | printf("Usage: %s \n", argv[0]); 94 | } 95 | 96 | return 0; 97 | } 98 | -------------------------------------------------------------------------------- /Chainmaker/jailed.sh: -------------------------------------------------------------------------------- 1 | # prepare # 2 | if [ -d .tmp ]; then 3 | rm -rf .tmp 4 | fi 5 | mkdir -p .tmp .tmp/procursus .tmp/toolchain .tmp/toolchain/bin .tmp/toolchain/lib 6 | 7 | # toolchain packages download # 8 | packages=("libiosexec1" "libedit0" "libzstd1" "libxar1" "ld64" "libtapi" "libllvm16" "libclang-cpp16" "clang-16" "libclang-common-16-dev" "libssl3" "libncursesw6") 9 | 10 | for package in "${packages[@]}"; do 11 | echo -e "\e[38;5;208mdownloading $package\e[0m" 12 | cd .tmp/procursus 13 | while ! apt download --download-only "$package" > /dev/null 2>&1; do 14 | echo -e "failed, retry!" 15 | echo -e "\e[38;5;208mdownloading $package\e[0m" 16 | done 17 | dpkg --extract "${package}"*.deb ./ 18 | rm "${package}"*.deb 19 | cd ../../ 20 | done 21 | 22 | # toolchain creation # 23 | echo -e "\033[32mcreating toolchain\e[0m" 24 | 25 | ## ENV ## 26 | echo -e "\e[38;5;208msetting environment\e[0m" 27 | ROOT_BIN=.tmp/procursus/var/jb/usr/bin 28 | ROOT_LIB=.tmp/procursus/var/jb/usr/lib 29 | ROOT_RPATH=/var/jb/usr/lib 30 | CHAIN_BIN=.tmp/toolchain/bin 31 | CHAIN_LIB=.tmp/toolchain/lib 32 | CHAIN_RPATH=@loader_path/../lib 33 | 34 | ## COPY STAGE ## 35 | echo -e "\e[38;5;208mcopy stage\e[0m" 36 | libraries=("libedit.0.dylib" "libiosexec.1.dylib" "libzstd.1.dylib" "libxar.1.dylib" "libtapi.dylib" "libcrypto.3.dylib" "libncursesw.6.dylib") 37 | 38 | for library in "${libraries[@]}"; do 39 | cp -L $ROOT_LIB/$library $CHAIN_LIB/$library 40 | done 41 | 42 | ## Special Stuff ## 43 | # copy patched llvm to toolchain 44 | cp $ROOT_LIB/llvm-16/bin/clang-16 $CHAIN_BIN/clang-16 45 | cp $ROOT_BIN/ld64 $CHAIN_BIN/ld64 46 | rm $ROOT_LIB/llvm-16/lib/libLLVM-16.dylib 47 | cp -rL $ROOT_LIB/llvm-16/lib/*.dylib $CHAIN_LIB 48 | rm -rf $ROOT_LIB/llvm-16/lib/clang/16.0.0/lib 49 | cp -r $ROOT_LIB/llvm-16/lib/clang $CHAIN_LIB 50 | 51 | ## @RPATH PATCH ## 52 | echo -e "\e[38;5;208mpatching @rpath\e[0m" 53 | for dir in $CHAIN_BIN $CHAIN_LIB; do 54 | for file in "$dir"/*; do 55 | if [ ! -d "$file" ]; then 56 | # nobody listens to you XD 57 | install_name_tool -delete_rpath $ROOT_RPATH "$file" > /dev/null 2>&1 58 | install_name_tool -delete_rpath /var/jb/usr/lib/llvm-16/lib "$file" > /dev/null 2>&1 59 | if ! install_name_tool -add_rpath $CHAIN_RPATH "$file" > /dev/null 2>&1; then 60 | echo "failed to relink $file" 61 | else 62 | echo "relinked $file" 63 | fi 64 | fi 65 | done 66 | done 67 | 68 | ## making the dylibification ## 69 | make -C dylibify all 70 | dylibify/Dylibify $CHAIN_BIN/clang-16 71 | dylibify/Dylibify $CHAIN_BIN/ld64 72 | mv $CHAIN_BIN/clang-16 $CHAIN_BIN/clang.dylib 73 | mv $CHAIN_BIN/ld64 $CHAIN_BIN/ld.dylib 74 | rm dylibify/Dylibify 75 | -------------------------------------------------------------------------------- /Chainmaker/shell/cat/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/cat/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | 10 | void print_file(const char *filename) { 11 | FILE *file = fopen(filename, "r"); 12 | if (file == NULL) { 13 | perror(filename); 14 | exit(EXIT_FAILURE); 15 | } 16 | 17 | int ch; 18 | while ((ch = fgetc(file)) != EOF) { 19 | putchar(ch); 20 | } 21 | 22 | fclose(file); 23 | } 24 | 25 | int main(int argc, char *argv[]) { 26 | if (argc < 2) { 27 | fprintf(stderr, "Usage: %s file1 [file2 ...]\n", argv[0]); 28 | return EXIT_FAILURE; 29 | } 30 | 31 | for (int i = 1; i < argc; i++) { 32 | print_file(argv[i]); 33 | } 34 | 35 | return EXIT_SUCCESS; 36 | } -------------------------------------------------------------------------------- /Chainmaker/shell/chmod/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/chmod/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | void print_usage_and_exit() { 17 | fprintf(stderr, "Usage: ./chmod_extended \n"); 18 | fprintf(stderr, " ./chmod_extended -R \n"); 19 | fprintf(stderr, "Modes: \n"); 20 | fprintf(stderr, " Octal mode: 0755, 0644, etc.\n"); 21 | fprintf(stderr, " Symbolic mode: +x, -w, etc.\n"); 22 | exit(EXIT_FAILURE); 23 | } 24 | 25 | void apply_chmod(const char *mode, const char *path, int recursive) { 26 | struct stat st; 27 | if (stat(path, &st) == -1) { 28 | perror("stat"); 29 | exit(EXIT_FAILURE); 30 | } 31 | 32 | if (recursive && S_ISDIR(st.st_mode)) { 33 | // Apply recursively to directory and its contents 34 | printf("Recursively changing permissions of directory '%s' to '%s'\n", path, mode); 35 | if (chmod(path, strtol(mode, 0, 8)) == -1) { 36 | perror("chmod"); 37 | exit(EXIT_FAILURE); 38 | } 39 | 40 | DIR *dir = opendir(path); 41 | if (dir == NULL) { 42 | perror("opendir"); 43 | exit(EXIT_FAILURE); 44 | } 45 | 46 | struct dirent *entry; 47 | while ((entry = readdir(dir)) != NULL) { 48 | if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { 49 | continue; 50 | } 51 | 52 | char new_path[PATH_MAX]; 53 | snprintf(new_path, sizeof(new_path), "%s/%s", path, entry->d_name); 54 | apply_chmod(mode, new_path, 1); // Recursive call 55 | } 56 | 57 | closedir(dir); 58 | } else { 59 | // Apply chmod to a single file or non-recursive directory 60 | printf("Changing permissions of '%s' to '%s'\n", path, mode); 61 | if (chmod(path, strtol(mode, 0, 8)) == -1) { 62 | perror("chmod"); 63 | exit(EXIT_FAILURE); 64 | } 65 | } 66 | } 67 | 68 | int main(int argc, char *argv[]) { 69 | if (argc < 3 || (argc == 3 && argv[1][0] == '-')) { 70 | print_usage_and_exit(); 71 | } 72 | 73 | int recursive = 0; 74 | int start_index = 1; 75 | 76 | if (argv[1][0] == '-' && argv[1][1] == 'R' && argc >= 4) { 77 | recursive = 1; 78 | start_index = 2; 79 | } 80 | 81 | const char *mode = argv[start_index]; 82 | const char *path = argv[start_index + 1]; 83 | 84 | apply_chmod(mode, path, recursive); 85 | 86 | return EXIT_SUCCESS; 87 | } -------------------------------------------------------------------------------- /Chainmaker/shell/chown/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/chown/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | void change_owner(const char *path, uid_t uid, gid_t gid) { 18 | if (chown(path, uid, gid) == -1) { 19 | fprintf(stderr, "Error: Failed to change ownership of %s: %s\n", path, strerror(errno)); 20 | } else { 21 | printf("Changed ownership of %s\n", path); 22 | } 23 | } 24 | 25 | int main(int argc, char *argv[]) { 26 | if (argc < 3) { 27 | fprintf(stderr, "Usage: %s owner:group file/dir [file/dir...]\n", argv[0]); 28 | return 1; 29 | } 30 | 31 | char *owner_group = argv[1]; 32 | char *colon = strchr(owner_group, ':'); 33 | if (!colon) { 34 | fprintf(stderr, "Error: Missing colon separating owner and group\n"); 35 | return 1; 36 | } 37 | 38 | *colon = '\0'; 39 | char *owner = owner_group; 40 | char *group = colon + 1; 41 | 42 | struct passwd *pwd = getpwnam(owner); 43 | if (!pwd) { 44 | fprintf(stderr, "Error: User %s not found\n", owner); 45 | return 1; 46 | } 47 | uid_t uid = pwd->pw_uid; 48 | 49 | struct group *grp = getgrnam(group); 50 | if (!grp) { 51 | fprintf(stderr, "Error: Group %s not found\n", group); 52 | return 1; 53 | } 54 | gid_t gid = grp->gr_gid; 55 | 56 | for (int i = 2; i < argc; ++i) { 57 | change_owner(argv[i], uid, gid); 58 | } 59 | 60 | return 0; 61 | } -------------------------------------------------------------------------------- /Chainmaker/shell/compile.sh: -------------------------------------------------------------------------------- 1 | # Compile function 2 | compile() { 3 | local name=$1 4 | local sources=$2 5 | local output="shell/output/$name" 6 | if [ $name = "neofetch" ]; then 7 | if clang $sources shell/neofetch/*.m -framework Foundation -framework UIKit -o $output; then 8 | echo -e "$name compiled" 9 | else 10 | echo -e "$name did not compile successfully\n" 11 | exit 255 12 | fi 13 | else 14 | if clang $sources -o $output; then 15 | echo -e "$name compiled" 16 | else 17 | echo -e "$name did not compile successfully\n" 18 | exit 255 19 | fi 20 | fi 21 | } 22 | 23 | # Sign function 24 | sign() { 25 | local name=$1 26 | local entitlements="shell/$name/entitlements.plist" 27 | local output="shell/output/$name" 28 | if ldid -S$entitlements $output; then 29 | echo -e "$name entitled" 30 | else 31 | echo -e "$name did not entitle\n" 32 | exit 255 33 | fi 34 | } 35 | 36 | # Move function 37 | move() { 38 | local name=$1 39 | local destination=$2 40 | if mv "shell/output/$name" $destination; then 41 | echo -e "$name moved" 42 | else 43 | echo -e "$name did not move\n" 44 | exit 255 45 | fi 46 | } 47 | 48 | # List of shell programs 49 | programs=("ls" "mkdir" "rmdir" "rm" "cp" "echo" "chmod" "chown" "grep" "cat" "ping" "id" "ln" "touch" "mv" "whoami" "hostname") 50 | 51 | # Compile stage 52 | echo -e "\033[32mcompiling NoWayStrap\e[0m" 53 | for program in "${programs[@]}"; do 54 | compile $program "shell/$program/*.c" 55 | done 56 | 57 | # Sign stage 58 | echo -e "\033[32mentitleing NoWayStrap\e[0m" 59 | for program in "${programs[@]}"; do 60 | sign $program 61 | done 62 | -------------------------------------------------------------------------------- /Chainmaker/shell/cp/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/csh/cmd_utils.c: -------------------------------------------------------------------------------- 1 | // 2 | // cmd_utils.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | //custom headers 12 | #include "csh.h" 13 | 14 | // Function to read command from user input 15 | void read_cmd(char *command) { 16 | fgets(command, MAX_INPUT_LENGTH, stdin); 17 | // Remove newline character at the end 18 | command[strcspn(command, "\n")] = '\0'; 19 | } 20 | 21 | // Function to parse command into arguments 22 | void parse_cmd(char *command, char **args) { 23 | char *token; 24 | int i = 0; 25 | 26 | token = strtok(command, " "); 27 | while (token != NULL && i < MAX_ARGS - 1) { 28 | args[i++] = token; 29 | token = strtok(NULL, " "); 30 | } 31 | args[i] = NULL; // Null-terminate the argument list 32 | } -------------------------------------------------------------------------------- /Chainmaker/shell/csh/cmd_utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // cmd_utils.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | void read_cmd(char *command); 8 | void parse_cmd(char *command, char **args); -------------------------------------------------------------------------------- /Chainmaker/shell/csh/csh.h: -------------------------------------------------------------------------------- 1 | // 2 | // csh.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #define MAX_INPUT_LENGTH 1024 8 | #define MAX_ARGS 64 -------------------------------------------------------------------------------- /Chainmaker/shell/csh/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | proc_info-allow 8 | 9 | com.apple.private.persona-mgmt 10 | 11 | com.apple.private.tcc.allow 12 | 13 | kTCCServiceSystemPolicyAllFiles 14 | 15 | com.apple.private.security.storage-exempt.heritable 16 | 17 | com.apple.private.security.storage.AppBundles 18 | 19 | com.apple.private.security.no-sandbox 20 | 21 | com.apple.springboard.CFUserNotification 22 | 23 | com.apple.springboard.launchapplications 24 | 25 | com.apple.security.network.client 26 | 27 | com.apple.private.mobileinstall.allowedSPI 28 | 29 | InstallForLaunchServices 30 | Install 31 | UninstallForLaunchServices 32 | Uninstall 33 | UpdatePlaceholderMetadata 34 | 35 | com.apple.security.exception.iokit-user-client-class 36 | 37 | AGXDevice 38 | AGXDeviceUserClient 39 | AGXSharedUserClient 40 | AGXGLContext 41 | AGXCommandQueue 42 | IOSurfaceRoot 43 | IOSurfaceRootUserClient 44 | AppleJPEGDriverUserClient 45 | H11ANEInDirectPathClient 46 | 47 | com.apple.developer.kernel.extended-virtual-addressing 48 | 49 | com.apple.developer.kernel.increased-memory-limit 50 | 51 | 52 | -------------------------------------------------------------------------------- /Chainmaker/shell/csh/envcontroller.c: -------------------------------------------------------------------------------- 1 | // 2 | // cwdtopwd.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | int setpwd() { 12 | char cwd[1024]; // Buffer to hold the current working directory path 13 | 14 | if (getcwd(cwd, sizeof(cwd)) != NULL) { 15 | // Successfully got the current working directory 16 | if (setenv("PWD", cwd, 1) != 0) { 17 | perror("setenv"); 18 | return 1; // Return error if setenv fails 19 | } 20 | return 0; // Return success 21 | } else { 22 | // Error in getting current working directory 23 | perror("getcwd"); 24 | return 1; // Return error 25 | } 26 | } 27 | 28 | int setcwd() { 29 | char *pwd = getenv("PWD"); 30 | 31 | if (pwd == NULL) { 32 | fprintf(stderr, "PWD environment variable is not set.\n"); 33 | return 1; 34 | } 35 | 36 | if (chdir(pwd) != 0) { 37 | perror("chdir"); 38 | return 1; // Return error if chdir fails 39 | } 40 | 41 | return 0; // Return success 42 | } 43 | 44 | int sethomecwd() { 45 | char *pwd = getenv("HOME"); 46 | 47 | if (pwd == NULL) { 48 | fprintf(stderr, "PWD environment variable is not set.\n"); 49 | return 1; 50 | } 51 | 52 | if (chdir(pwd) != 0) { 53 | perror("chdir"); 54 | return 1; // Return error if chdir fails 55 | } 56 | 57 | return 0; // Return success 58 | } -------------------------------------------------------------------------------- /Chainmaker/shell/csh/envcontroller.h: -------------------------------------------------------------------------------- 1 | // 2 | // cwdtopwd.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | int setpwd(); 8 | int setcwd(); 9 | int sethomecwd(); -------------------------------------------------------------------------------- /Chainmaker/shell/csh/extra.h: -------------------------------------------------------------------------------- 1 | // 2 | // extra.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | int cshcd(char **args); 8 | int cshexp(char **args); 9 | void expvar(char **args); -------------------------------------------------------------------------------- /Chainmaker/shell/csh/fetch.c: -------------------------------------------------------------------------------- 1 | // 2 | // user.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | char* getuser() { 14 | uid_t uid = geteuid(); // Get effective user ID 15 | 16 | struct passwd *pw = getpwuid(uid); 17 | if (pw == NULL) { 18 | perror("getpwuid"); 19 | return NULL; 20 | } 21 | 22 | return strdup(pw->pw_name); // Duplicate and return username 23 | } 24 | 25 | char* getpwd() { 26 | char* pwd = getenv("PWD"); 27 | if (pwd == NULL) { 28 | perror("getenv"); 29 | return NULL; 30 | } 31 | return pwd; 32 | } 33 | 34 | char* gethost() { 35 | char *hostname = NULL; 36 | size_t size = 256; // Initial buffer size assumption 37 | 38 | while (1) { 39 | hostname = (char*)malloc(size); 40 | if (hostname == NULL) { 41 | perror("malloc"); 42 | return NULL; // Return NULL if malloc fails 43 | } 44 | 45 | if (gethostname(hostname, size) == 0) { 46 | // Successfully got the host name 47 | return hostname; 48 | } else { 49 | // Error in getting host name 50 | perror("gethostname"); 51 | free(hostname); // Free allocated memory on error 52 | return NULL; 53 | } 54 | 55 | // If the buffer was too small, retry with a larger buffer 56 | size *= 2; 57 | free(hostname); // Free the current attempt before retrying 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Chainmaker/shell/csh/fetch.h: -------------------------------------------------------------------------------- 1 | // 2 | // user.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | char* getuser(); 8 | char* getpwd(); 9 | char* gethost(); -------------------------------------------------------------------------------- /Chainmaker/shell/csh/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | //system header 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | //custom header 15 | #include "csh.h" 16 | #include "fetch.h" 17 | #include "cmd_utils.h" 18 | #include "extra.h" 19 | #include "envcontroller.h" 20 | 21 | void execute_cmd(char **args) { 22 | pid_t pid; 23 | int status; 24 | 25 | pid = fork(); 26 | if (pid < 0) { 27 | perror("Fork failed"); 28 | exit(1); 29 | } else if (pid == 0) { 30 | if (execvp(args[0], args) == -1) { 31 | perror("Execvp failed"); 32 | exit(1); 33 | } 34 | } else { 35 | waitpid(pid, &status, 0); 36 | } 37 | } 38 | 39 | int main() { 40 | sethomecwd(); 41 | setpwd(); 42 | 43 | char* host = gethost(); 44 | char* user = getuser(); 45 | char* pwd; 46 | 47 | setenv("USER", user, 1); 48 | 49 | char command[MAX_INPUT_LENGTH]; 50 | char *args[MAX_ARGS]; 51 | 52 | while (1) { 53 | pwd = getpwd(); 54 | 55 | if (strcmp(pwd, getenv("HOME")) == 0) { 56 | pwd = "~"; 57 | } 58 | 59 | printf("%s@%s$ ",user,host); 60 | 61 | fflush(stdout); 62 | read_cmd(command); 63 | parse_cmd(command, args); 64 | 65 | expvar(args); 66 | if (args[0] != NULL) { 67 | if (strcmp(args[0], "cd") == 0) { 68 | if (cshcd(args) != 0) { 69 | fprintf(stderr, "Error: cd command failed\n"); 70 | } 71 | } else if (strcmp(args[0], "export") == 0) { 72 | cshexp(args); 73 | } else if (strcmp(args[0], "info") == 0) { 74 | printf("NoWay Terminal CSH v0.2\nFirst unsandboxed Terminal on iOS\nMade by.SeanIsNotAConstant\n"); 75 | } else if (strcmp(args[0], "getpid") == 0) { 76 | printf("%d\n",getpid()); 77 | } else if (strcmp(args[0], "getppid") == 0) { 78 | printf("%d\n",getppid()); 79 | } else if (strcmp(args[0], "exit") == 0) { 80 | return 0; 81 | } else { 82 | execute_cmd(args); 83 | } 84 | } 85 | } 86 | 87 | return 0; 88 | } -------------------------------------------------------------------------------- /Chainmaker/shell/echo/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chainmaker/shell/echo/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | void interpret_escapes(const char *str) { 12 | for (size_t i = 0; str[i] != '\0'; i++) { 13 | if (str[i] == '\\' && str[i + 1] != '\0') { 14 | switch (str[++i]) { 15 | case 'a': putchar('\a'); break; 16 | case 'b': putchar('\b'); break; 17 | case 'c': return; // Do not print the rest of the line 18 | case 'e': putchar('\033'); break; 19 | case 'f': putchar('\f'); break; 20 | case 'n': putchar('\n'); break; 21 | case 'r': putchar('\r'); break; 22 | case 't': putchar('\t'); break; 23 | case 'v': putchar('\v'); break; 24 | case '\\': putchar('\\'); break; 25 | case '\'': putchar('\''); break; 26 | case '\"': putchar('\"'); break; 27 | case '?': putchar('\?'); break; 28 | case '0': // Octal sequence 29 | { 30 | int octal = 0; 31 | int j; 32 | for (j = 0; j < 3 && str[i + j] >= '0' && str[i + j] <= '7'; j++) { 33 | octal = octal * 8 + (str[i + j] - '0'); 34 | } 35 | putchar(octal); 36 | i += j - 1; 37 | } 38 | break; 39 | default: 40 | putchar('\\'); 41 | putchar(str[i]); 42 | break; 43 | } 44 | } else { 45 | putchar(str[i]); 46 | } 47 | } 48 | } 49 | 50 | int main(int argc, char *argv[]) { 51 | int n_flag = 0; 52 | int e_flag = 0; 53 | int start_index = 1; 54 | 55 | if (argc > 1) { 56 | for (int i = 1; i < argc; i++) { 57 | if (argv[i][0] == '-' && argv[i][1] != '\0') { 58 | for (int j = 1; argv[i][j] != '\0'; j++) { 59 | switch (argv[i][j]) { 60 | case 'n': 61 | n_flag = 1; 62 | break; 63 | case 'e': 64 | e_flag = 1; 65 | break; 66 | case 'E': 67 | e_flag = 0; 68 | break; 69 | default: 70 | fprintf(stderr, "Unknown option: -%c\n", argv[i][j]); 71 | return EXIT_FAILURE; 72 | } 73 | } 74 | start_index++; 75 | } else { 76 | break; 77 | } 78 | } 79 | } 80 | 81 | for (int i = start_index; i < argc; i++) { 82 | if (e_flag) { 83 | interpret_escapes(argv[i]); 84 | } else { 85 | fputs(argv[i], stdout); 86 | } 87 | 88 | if (i < argc - 1) { 89 | putchar(' '); 90 | } 91 | } 92 | 93 | if (!n_flag) { 94 | putchar('\n'); 95 | } 96 | 97 | return EXIT_SUCCESS; 98 | } -------------------------------------------------------------------------------- /Chainmaker/shell/grep/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/hostname/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/hostname/fetch.c: -------------------------------------------------------------------------------- 1 | // 2 | // fetch.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #define HOST_NAME_MAX 255 13 | 14 | char* gethost() { 15 | static char hostname[HOST_NAME_MAX]; 16 | if (gethostname(hostname, HOST_NAME_MAX) == 0) { 17 | return hostname; 18 | } else { 19 | return NULL; 20 | } 21 | } -------------------------------------------------------------------------------- /Chainmaker/shell/hostname/fetch.h: -------------------------------------------------------------------------------- 1 | // 2 | // fetch.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | char* gethost(); -------------------------------------------------------------------------------- /Chainmaker/shell/hostname/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 10.07.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include "fetch.h" 11 | 12 | int main(void) { 13 | printf("%s\n",gethost()); 14 | } -------------------------------------------------------------------------------- /Chainmaker/shell/id/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chainmaker/shell/id/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | int main() { 13 | uid_t uid = getuid(); // Get the real user ID 14 | uid_t euid = geteuid(); // Get the effective user ID 15 | gid_t gid = getgid(); // Get the real group ID 16 | gid_t egid = getegid(); // Get the effective group ID 17 | 18 | printf("uid=%d(%s) gid=%d(%s) euid=%d(%s) egid=%d(%s)\n", 19 | uid, getlogin(), gid, getlogin(), euid, getlogin(), egid, getlogin()); 20 | 21 | // Print supplementary group IDs 22 | int num_groups = 0; 23 | gid_t *groups = NULL; 24 | num_groups = getgroups(0, NULL); // Get number of groups 25 | if (num_groups > 0) { 26 | groups = malloc(num_groups * sizeof(gid_t)); 27 | getgroups(num_groups, groups); // Get the group list 28 | printf("groups="); 29 | for (int i = 0; i < num_groups; ++i) { 30 | printf("%d", groups[i]); 31 | if (i < num_groups - 1) { 32 | printf(","); 33 | } 34 | } 35 | printf("\n"); 36 | free(groups); 37 | } 38 | 39 | return EXIT_SUCCESS; 40 | } -------------------------------------------------------------------------------- /Chainmaker/shell/ln/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | com.apple.private.persona-mgmt 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chainmaker/shell/ln/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 25.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | void print_usage() { 14 | fprintf(stderr, "Usage: ln [-s] \n"); 15 | exit(EXIT_FAILURE); 16 | } 17 | 18 | int main(int argc, char *argv[]) { 19 | int symbolic = 0; // Flag for symbolic link 20 | char *source, *destination; 21 | 22 | // Parse command line arguments 23 | if (argc < 3 || argc > 4) { 24 | print_usage(); 25 | } 26 | 27 | // Check for symbolic link option 28 | if (argc == 4 && strcmp(argv[1], "-s") == 0) { 29 | symbolic = 1; 30 | source = argv[2]; 31 | destination = argv[3]; 32 | } else { 33 | source = argv[1]; 34 | destination = argv[2]; 35 | } 36 | 37 | // Create link 38 | if (symbolic) { 39 | if (symlink(source, destination) == -1) { 40 | perror("symlink"); 41 | exit(EXIT_FAILURE); 42 | } 43 | } else { 44 | if (link(source, destination) == -1) { 45 | perror("link"); 46 | exit(EXIT_FAILURE); 47 | } 48 | } 49 | 50 | return EXIT_SUCCESS; 51 | } -------------------------------------------------------------------------------- /Chainmaker/shell/ls/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | com.apple.private.persona-mgmt 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chainmaker/shell/ls/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 23.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | void print_file_info(const char *path, const char *name, int human_readable) { 19 | struct stat file_stat; 20 | char full_path[1024]; 21 | snprintf(full_path, sizeof(full_path), "%s/%s", path, name); 22 | 23 | if (stat(full_path, &file_stat) == -1) { 24 | perror("stat"); 25 | return; 26 | } 27 | 28 | printf((S_ISDIR(file_stat.st_mode)) ? "d" : "-"); 29 | printf((file_stat.st_mode & S_IRUSR) ? "r" : "-"); 30 | printf((file_stat.st_mode & S_IWUSR) ? "w" : "-"); 31 | printf((file_stat.st_mode & S_IXUSR) ? "x" : "-"); 32 | printf((file_stat.st_mode & S_IRGRP) ? "r" : "-"); 33 | printf((file_stat.st_mode & S_IWGRP) ? "w" : "-"); 34 | printf((file_stat.st_mode & S_IXGRP) ? "x" : "-"); 35 | printf((file_stat.st_mode & S_IROTH) ? "r" : "-"); 36 | printf((file_stat.st_mode & S_IWOTH) ? "w" : "-"); 37 | printf((file_stat.st_mode & S_IXOTH) ? "x" : "-"); 38 | 39 | printf(" %hu", file_stat.st_nlink); 40 | 41 | struct passwd *pw = getpwuid(file_stat.st_uid); 42 | struct group *gr = getgrgid(file_stat.st_gid); 43 | 44 | printf(" %s %s", pw->pw_name, gr->gr_name); 45 | 46 | if (human_readable) { 47 | double size = (double)file_stat.st_size; 48 | const char *units[] = {"B", "K", "M", "G", "T"}; 49 | int unit_index = 0; 50 | while (size >= 1024 && unit_index < 4) { 51 | size /= 1024; 52 | unit_index++; 53 | } 54 | printf(" %4.1f%s", size, units[unit_index]); 55 | } else { 56 | printf(" %lld", (long long)file_stat.st_size); 57 | } 58 | 59 | char time_str[256]; 60 | strftime(time_str, sizeof(time_str), "%b %d %H:%M", localtime(&file_stat.st_mtime)); 61 | printf(" %s %s\n", time_str, name); 62 | } 63 | 64 | void list_directory(const char *path, int show_all, int long_format, int human_readable) { 65 | struct dirent *entry; 66 | DIR *dp = opendir(path); 67 | 68 | if (dp == NULL) { 69 | perror("opendir"); 70 | return; 71 | } 72 | 73 | while ((entry = readdir(dp))) { 74 | if (!show_all && entry->d_name[0] == '.') { 75 | continue; 76 | } 77 | 78 | if (long_format) { 79 | print_file_info(path, entry->d_name, human_readable); 80 | } else { 81 | printf("%s\n", entry->d_name); 82 | } 83 | } 84 | 85 | closedir(dp); 86 | } 87 | 88 | int main(int argc, char *argv[]) { 89 | const char *path = "."; 90 | int show_all = 0; 91 | int long_format = 0; 92 | int human_readable = 0; 93 | 94 | for (int i = 1; i < argc; i++) { 95 | if (argv[i][0] == '-') { 96 | for (int j = 1; argv[i][j] != '\0'; j++) { 97 | switch (argv[i][j]) { 98 | case 'a': 99 | show_all = 1; 100 | break; 101 | case 'l': 102 | long_format = 1; 103 | break; 104 | case 'h': 105 | human_readable = 1; 106 | break; 107 | default: 108 | fprintf(stderr, "Unknown option: -%c\n", argv[i][j]); 109 | exit(EXIT_FAILURE); 110 | } 111 | } 112 | } else { 113 | path = argv[i]; 114 | } 115 | } 116 | 117 | list_directory(path, show_all, long_format, human_readable); 118 | 119 | return 0; 120 | } -------------------------------------------------------------------------------- /Chainmaker/shell/mkdir/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/mkdir/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | void create_directory(const char *path, mode_t mode, int verbose) { 16 | if (mkdir(path, mode) == 0) { 17 | if (verbose) { 18 | printf("mkdir: created directory '%s'\n", path); 19 | } 20 | } else { 21 | fprintf(stderr, "mkdir: cannot create directory '%s': %s\n", path, strerror(errno)); 22 | } 23 | } 24 | 25 | int main(int argc, char *argv[]) { 26 | int p_flag = 0; 27 | int m_flag = 0; 28 | int v_flag = 0; 29 | mode_t mode = 0777; // Default mode (rwxrwxrwx) 30 | 31 | // Parse command-line arguments 32 | int opt; 33 | while ((opt = getopt(argc, argv, "pm:v")) != -1) { 34 | switch (opt) { 35 | case 'p': 36 | p_flag = 1; 37 | break; 38 | case 'm': 39 | m_flag = 1; 40 | mode = strtol(optarg, NULL, 8); // Convert octal string to mode_t 41 | break; 42 | case 'v': 43 | v_flag = 1; 44 | break; 45 | default: 46 | fprintf(stderr, "Usage: %s [-p] [-m mode] [-v] directory...\n", argv[0]); 47 | exit(EXIT_FAILURE); 48 | } 49 | } 50 | 51 | // Create directories 52 | for (int i = optind; i < argc; i++) { 53 | if (p_flag) { 54 | char *path = argv[i]; 55 | char *slash = strrchr(path, '/'); 56 | if (slash != NULL) { 57 | *slash = '\0'; // Temporarily truncate path 58 | if (mkdir(argv[i], mode) == -1 && errno != EEXIST) { 59 | fprintf(stderr, "mkdir: cannot create directory '%s': %s\n", argv[i], strerror(errno)); 60 | continue; 61 | } 62 | *slash = '/'; // Restore path 63 | } 64 | } else { 65 | create_directory(argv[i], mode, v_flag); 66 | } 67 | } 68 | 69 | return EXIT_SUCCESS; 70 | } -------------------------------------------------------------------------------- /Chainmaker/shell/mv/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/mv/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 07.07.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | void print_usage(const char *prog_name) { 12 | fprintf(stderr, "Usage: %s \n", prog_name); 13 | } 14 | 15 | int main(int argc, char *argv[]) { 16 | // Check for the correct number of arguments 17 | if (argc != 3) { 18 | print_usage(argv[0]); 19 | return EXIT_FAILURE; 20 | } 21 | 22 | const char *source = argv[1]; 23 | const char *destination = argv[2]; 24 | 25 | // Attempt to rename the file 26 | if (rename(source, destination) != 0) { 27 | perror("Error moving file"); 28 | return EXIT_FAILURE; 29 | } 30 | 31 | printf("File moved successfully from %s to %s\n", source, destination); 32 | return EXIT_SUCCESS; 33 | } -------------------------------------------------------------------------------- /Chainmaker/shell/ping/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | com.apple.private.network.client 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chainmaker/shell/rm/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/rm/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #define _POSIX_C_SOURCE 200809L // Ensure we get POSIX.1-2008 definitions 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | void remove_file(const char *path, bool verbose, bool interactive) { 19 | if (unlink(path) == -1) { 20 | perror("unlink"); 21 | exit(EXIT_FAILURE); 22 | } 23 | 24 | if (verbose) { 25 | printf("Removed file: %s\n", path); 26 | } 27 | } 28 | 29 | void remove_directory(const char *path, bool verbose, bool interactive, bool recursive) { 30 | DIR *dir = opendir(path); 31 | if (!dir) { 32 | perror("opendir"); 33 | exit(EXIT_FAILURE); 34 | } 35 | 36 | struct dirent *entry; 37 | while ((entry = readdir(dir)) != NULL) { 38 | if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { 39 | continue; 40 | } 41 | 42 | char *child_path = (char *)malloc(strlen(path) + strlen(entry->d_name) + 2); 43 | sprintf(child_path, "%s/%s", path, entry->d_name); 44 | 45 | struct stat st; 46 | if (lstat(child_path, &st) == -1) { 47 | perror("lstat"); 48 | free(child_path); 49 | closedir(dir); 50 | exit(EXIT_FAILURE); 51 | } 52 | 53 | if (S_ISDIR(st.st_mode)) { 54 | if (recursive) { 55 | remove_directory(child_path, verbose, interactive, recursive); 56 | } else { 57 | fprintf(stderr, "rm: cannot remove '%s': Is a directory\n", child_path); 58 | } 59 | } else { 60 | remove_file(child_path, verbose, interactive); 61 | } 62 | 63 | free(child_path); 64 | } 65 | 66 | closedir(dir); 67 | 68 | if (rmdir(path) == -1) { 69 | perror("rmdir"); 70 | exit(EXIT_FAILURE); 71 | } 72 | 73 | if (verbose) { 74 | printf("Removed directory: %s\n", path); 75 | } 76 | } 77 | 78 | void remove_entry(const char *path, bool verbose, bool interactive, bool recursive) { 79 | struct stat st; 80 | if (lstat(path, &st) == -1) { 81 | perror("lstat"); 82 | exit(EXIT_FAILURE); 83 | } 84 | 85 | if (S_ISDIR(st.st_mode)) { 86 | remove_directory(path, verbose, interactive, recursive); 87 | } else { 88 | remove_file(path, verbose, interactive); 89 | } 90 | } 91 | 92 | int main(int argc, char *argv[]) { 93 | int opt; 94 | bool recursive = false; 95 | bool force = false; 96 | bool interactive = false; 97 | bool verbose = false; 98 | 99 | while ((opt = getopt(argc, argv, "rfiv")) != -1) { 100 | switch (opt) { 101 | case 'r': 102 | recursive = true; 103 | break; 104 | case 'f': 105 | force = true; 106 | break; 107 | case 'i': 108 | interactive = true; 109 | break; 110 | case 'v': 111 | verbose = true; 112 | break; 113 | default: 114 | fprintf(stderr, "Usage: %s [-rRfiv] file...\n", argv[0]); 115 | exit(EXIT_FAILURE); 116 | } 117 | } 118 | 119 | if (optind >= argc) { 120 | fprintf(stderr, "Missing file operand\n"); 121 | fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); 122 | exit(EXIT_FAILURE); 123 | } 124 | 125 | for (int i = optind; i < argc; i++) { 126 | remove_entry(argv[i], verbose, interactive, recursive); 127 | } 128 | 129 | return EXIT_SUCCESS; 130 | } -------------------------------------------------------------------------------- /Chainmaker/shell/rmdir/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/rmdir/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #define _POSIX_C_SOURCE 200809L // Ensure we get POSIX.1-2008 definitions 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | void remove_directory(const char *path, bool verbose, bool interactive, bool parents) { 19 | struct stat st; 20 | 21 | // Check if the directory exists 22 | if (stat(path, &st) == -1) { 23 | perror("stat"); 24 | exit(EXIT_FAILURE); 25 | } 26 | 27 | if (!S_ISDIR(st.st_mode)) { 28 | fprintf(stderr, "'%s' is not a directory\n", path); 29 | exit(EXIT_FAILURE); 30 | } 31 | 32 | if (verbose) { 33 | printf("Removing directory: %s\n", path); 34 | } 35 | 36 | if (interactive) { 37 | char response; 38 | printf("Remove directory '%s'? (y/n): ", path); 39 | fflush(stdout); 40 | scanf(" %c", &response); 41 | if (response != 'y' && response != 'Y') { 42 | printf("Not removing directory '%s'\n", path); 43 | return; 44 | } 45 | } 46 | 47 | // Remove directory 48 | if (parents) { 49 | // Recursive removal using opendir(), readdir() and remove_directory() 50 | DIR *dir = opendir(path); 51 | if (!dir) { 52 | perror("opendir"); 53 | exit(EXIT_FAILURE); 54 | } 55 | 56 | struct dirent *entry; 57 | while ((entry = readdir(dir)) != NULL) { 58 | if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { 59 | continue; 60 | } 61 | 62 | char *child_path = (char *)malloc(strlen(path) + strlen(entry->d_name) + 2); 63 | sprintf(child_path, "%s/%s", path, entry->d_name); 64 | remove_directory(child_path, verbose, interactive, parents); 65 | free(child_path); 66 | } 67 | 68 | closedir(dir); 69 | 70 | // Now remove the current directory itself 71 | if (rmdir(path) == -1) { 72 | perror("rmdir"); 73 | exit(EXIT_FAILURE); 74 | } 75 | } else { 76 | // Non-recursive removal 77 | if (rmdir(path) == -1) { 78 | perror("rmdir"); 79 | exit(EXIT_FAILURE); 80 | } 81 | } 82 | 83 | if (verbose) { 84 | printf("Directory '%s' removed successfully\n", path); 85 | } 86 | } 87 | 88 | int main(int argc, char *argv[]) { 89 | int opt; 90 | bool verbose = false; 91 | bool interactive = false; 92 | bool parents = false; 93 | 94 | while ((opt = getopt(argc, argv, "pvi")) != -1) { 95 | switch (opt) { 96 | case 'p': 97 | parents = true; 98 | break; 99 | case 'v': 100 | verbose = true; 101 | break; 102 | case 'i': 103 | interactive = true; 104 | break; 105 | default: 106 | fprintf(stderr, "Usage: %s [-p] [-v] [-i] directory...\n", argv[0]); 107 | exit(EXIT_FAILURE); 108 | } 109 | } 110 | 111 | if (optind >= argc) { 112 | fprintf(stderr, "Missing directory operand\n"); 113 | fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); 114 | exit(EXIT_FAILURE); 115 | } 116 | 117 | for (int i = optind; i < argc; i++) { 118 | remove_directory(argv[i], verbose, interactive, parents); 119 | } 120 | 121 | return EXIT_SUCCESS; 122 | } -------------------------------------------------------------------------------- /Chainmaker/shell/touch/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/whoami/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | platform-application 6 | 7 | com.apple.private.security.container-required 8 | 9 | com.apple.private.security.no-container 10 | 11 | com.apple.private.security.no-sandbox 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chainmaker/shell/whoami/fetch.c: -------------------------------------------------------------------------------- 1 | // 2 | // fetch.c 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | char* getuser() { 13 | uid_t uid = geteuid(); 14 | 15 | struct passwd *pw = getpwuid(uid); 16 | if (pw == NULL) { 17 | perror("getpwuid"); 18 | return NULL; 19 | } 20 | 21 | return strdup(pw->pw_name); 22 | } -------------------------------------------------------------------------------- /Chainmaker/shell/whoami/fetch.h: -------------------------------------------------------------------------------- 1 | // 2 | // fetch.h 3 | // 4 | // Created by SeanIsNotAConstant on 24.06.24 5 | // 6 | 7 | char* getuser(); -------------------------------------------------------------------------------- /Chainmaker/shell/whoami/main.c: -------------------------------------------------------------------------------- 1 | // 2 | // main.c 3 | // 4 | // Created by SeanIsNotAConstant on 10.07.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include "fetch.h" 11 | 12 | int main(void) { 13 | printf("%s\n",getuser()); 14 | } -------------------------------------------------------------------------------- /Essentials/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # Compile all FridaCodeManager essentials 4 | # :3 5 | # 6 | 7 | SHELL := /var/jb/bin/bash 8 | 9 | all: prepare libfcm-compile libdycall-compile libsean-compile #libcheck-compile 10 | 11 | prepare: 12 | @if [ -d lib/build ]; then \ 13 | rm -rf lib/build; \ 14 | mkdir lib/build; \ 15 | else \ 16 | mkdir lib/build; \ 17 | fi 18 | 19 | libfcm-compile: 20 | @$(MAKE) -C libfcm all 21 | @cp libfcm/tmp/lib/libfcm.a lib/build/libfcm.a 22 | @$(MAKE) -C libfcm clean 23 | 24 | libsean-compile: 25 | @$(MAKE) -C libsean all 26 | @cp libsean/tmp/lib/libsean.a lib/build/libsean.a 27 | @$(MAKE) -C libsean clean 28 | 29 | libdycall-compile: 30 | @$(MAKE) -C libdycall all 31 | @cp libdycall/tmp/lib/libdycall.a lib/build/libdycall.a 32 | @$(MAKE) -C libdycall clean 33 | 34 | libcheck-compile: 35 | @$(MAKE) -C libcheck all 36 | @cp libcheck/tmp/lib/libcheck.a lib/build/libcheck.a 37 | @$(MAKE) -C libcheck clean 38 | 39 | clean: 40 | @rm -rf lib/build 41 | -------------------------------------------------------------------------------- /Essentials/debughelper/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | all: 4 | make -C opainject all 5 | mv opainject/libinject.a libinject.a 6 | make -C injectable all 7 | mv injectable/debug.dylib debug.dylib 8 | clang poc.m libinject.a -framework Foundation -o poc 9 | ldid -Sentitlements.plist poc 10 | -------------------------------------------------------------------------------- /Essentials/debughelper/debug.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Essentials/debughelper/debug.dylib -------------------------------------------------------------------------------- /Essentials/debughelper/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | get-task-allow 5 | 6 | platform-application 7 | 8 | task_for_pid-allow 9 | 10 | com.apple.private.security.container-required 11 | 12 | com.apple.system-task-ports 13 | 14 | com.apple.system-task-ports.control 15 | 16 | com.apple.private.thread-set-state 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Essentials/debughelper/injectable/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | all: 4 | clang main.m -shared -framework Foundation -o debug.dylib 5 | -------------------------------------------------------------------------------- /Essentials/debughelper/injectable/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | void removeFileAt(NSString *filePath) { 6 | NSFileManager *fileManager = [NSFileManager defaultManager]; 7 | 8 | if ([fileManager fileExistsAtPath:filePath]) { 9 | NSError *error = nil; 10 | 11 | [fileManager removeItemAtPath:filePath error:&error]; 12 | } 13 | } 14 | 15 | void redirectOutput(NSString *docsPath) { 16 | printf("[*] hello from FCM!\n"); 17 | NSString *stdoutFilePath = [docsPath stringByAppendingPathComponent:@"stdout.txt"]; 18 | NSString *stderrFilePath = [docsPath stringByAppendingPathComponent:@"stderr.txt"]; 19 | 20 | removeFileAt(stdoutFilePath); 21 | removeFileAt(stderrFilePath); 22 | 23 | FILE *stdoutFile = fopen([stdoutFilePath UTF8String], "w"); 24 | FILE *stderrFile = fopen([stderrFilePath UTF8String], "w"); 25 | 26 | if (stdoutFile == NULL || stderrFile == NULL) { 27 | perror("Failed to open output files"); 28 | exit(EXIT_FAILURE); 29 | } 30 | 31 | dup2(fileno(stdoutFile), STDOUT_FILENO); 32 | dup2(fileno(stderrFile), STDERR_FILENO); 33 | 34 | fclose(stdoutFile); 35 | fclose(stderrFile); 36 | } 37 | 38 | __attribute__((constructor)) 39 | void init() { 40 | NSString *docsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; 41 | printf("[*] %s\n", [docsPath UTF8String]); 42 | redirectOutput(docsPath); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Essentials/debughelper/libinject.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Essentials/debughelper/libinject.a -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | all: SHELL := /var/jb/usr/bin/sh 4 | all: 5 | clang -c *.m -framework Foundation -fPIC 6 | ar rcs libinject.a *.o 7 | rm *.o 8 | -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/README.md: -------------------------------------------------------------------------------- 1 | # opainject 2 | 3 | iOS tool to inject a dylib into a process using both shellcode and ROP methods. (By default ROP method is used, it's superior to the shellcode method in every way but I started with the shellcode method and decided to leave it in). 4 | 5 | Tested on iOS 14, 15, 16 and 17. Should theoretically work on 11.0 and up. On arm64e devices the dylib will inject but crash the process if it's not in Trust Cache. -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/arm64.h: -------------------------------------------------------------------------------- 1 | #ifndef arm64_h 2 | #define arm64_h 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | uint32_t generate_movk(uint8_t x, uint16_t val, uint16_t lsl); 9 | uint32_t generate_br(uint8_t x); 10 | bool decode_adrp(uint32_t inst, uint8_t *rd_out, int32_t *imm_out); 11 | bool decode_ldr_imm(uint32_t inst, uint16_t *imm_out, uint8_t *rn_out, uint8_t *rt_out); 12 | bool decode_adrp_ldr(uint32_t adrp_inst, uint32_t ldr_inst, uint64_t pc, uint64_t *dst_out); 13 | 14 | #endif /* arm64_h */ 15 | -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/arm64.m: -------------------------------------------------------------------------------- 1 | #include "arm64.h" 2 | #include 3 | 4 | uint32_t generate_movk(uint8_t x, uint16_t val, uint16_t lsl) 5 | { 6 | uint32_t base = 0b11110010100000000000000000000000; 7 | 8 | uint32_t hw = 0; 9 | if (lsl == 16) { 10 | hw = 0b01 << 21; 11 | } 12 | else if (lsl == 32) { 13 | hw = 0b10 << 21; 14 | } 15 | else if (lsl == 48) { 16 | hw = 0b11 << 21; 17 | } 18 | 19 | uint32_t imm16 = (uint32_t)val << 5; 20 | uint32_t rd = x & 0x1F; 21 | 22 | return base | hw | imm16 | rd; 23 | } 24 | 25 | uint32_t generate_br(uint8_t x) 26 | { 27 | uint32_t base = 0b11010110000111110000000000000000; 28 | uint32_t rn = ((uint32_t)x & 0x1F) << 5; 29 | return base | rn; 30 | } 31 | 32 | bool decode_adrp(uint32_t inst, uint8_t *rd_out, int32_t *imm_out) 33 | { 34 | if ((inst & 0x9F000000) != 0x90000000) return false; 35 | 36 | uint32_t mask_immlo = 0b01100000000000000000000000000000; 37 | uint32_t mask_immhi = 0b00000000111111111111111111100000; 38 | uint32_t mask_rd = 0b00000000000000000000000000011111; 39 | 40 | int32_t imm = (((inst & mask_immlo) >> 29) | ((inst & mask_immhi) >> 3)) << 12; 41 | uint8_t rd = inst & mask_rd; 42 | 43 | if (rd_out) *rd_out = rd; 44 | if (imm_out) *imm_out = imm; 45 | 46 | return true; 47 | } 48 | 49 | bool decode_ldr_imm(uint32_t inst, uint16_t *imm_out, uint8_t *rn_out, uint8_t *rt_out) 50 | { 51 | if ((inst & 0xBFC00000) != 0xB9400000) return false; 52 | // TODO: Support non unsigned instructions 53 | 54 | uint32_t mask_imm12 = 0b00000000001111111111110000000000; 55 | uint32_t mask_rn = 0b00000000000000000000001111100000; 56 | uint32_t mask_rt = 0b00000000000000000000000000011111; 57 | 58 | uint8_t rt = (inst & mask_rt); 59 | uint8_t rn = (inst & mask_rn) >> 5; 60 | uint16_t imm12 = (inst & mask_imm12) >> 10; 61 | 62 | uint32_t bit_is_64_bit = 0b01000000000000000000000000000000; 63 | if (inst & bit_is_64_bit) { 64 | imm12 *= 8; 65 | } 66 | else { 67 | imm12 *= 4; 68 | } 69 | 70 | if (imm_out) *imm_out = imm12; 71 | if (rn_out) *rn_out = rn; 72 | if (rt_out) *rt_out = rt; 73 | 74 | return true; 75 | } 76 | 77 | bool decode_adrp_ldr(uint32_t adrp_inst, uint32_t ldr_inst, uint64_t pc, uint64_t *dst_out) 78 | { 79 | int32_t adrp_imm = 0; 80 | if (!decode_adrp(adrp_inst, NULL, &adrp_imm)) return false; 81 | 82 | uint16_t ldr_imm = 0; 83 | if (!decode_ldr_imm(ldr_inst, &ldr_imm, NULL, NULL)) return false; 84 | 85 | uint64_t pc_page = pc - (pc % 0x1000); 86 | uint64_t dst = (pc_page + adrp_imm) + ldr_imm; 87 | if (dst_out) *dst_out = dst; 88 | return true; 89 | } 90 | 91 | /*bool decode_ldr(uint32_t inst, uint8_t *rt_out, uint8_t *rn_out, uint8_t *rm_out) 92 | { 93 | if ((inst & 0xFFE00C00) != 0xF8600800) return false; 94 | 95 | uint32_t mask_rm = 0b00000000000111110000000000000000; 96 | uint32_t mask_option = 0b00000000000000001110000000000000; 97 | uint32_t mask_s = 0b00000000000000000001000000000000; 98 | uint32_t mask_rn = 0b00000000000000000000001111100000; 99 | uint32_t mask_rt = 0b00000000000000000000000000011111; 100 | 101 | uint8_t rt = inst & mask_rt; 102 | uint8_t rn = inst & mask_rn >> 5; 103 | uint8_t rm = inst & mask_rm >> 16; 104 | bool s = inst & mask_s >> 12; 105 | uint8_t option = inst & mask_option >> 13; 106 | 107 | printf("rt=%d, rn=%d, rm=%d, s=%d, option=%X\n", rt, rn, rm, s, option); 108 | 109 | return true; 110 | }*/ 111 | -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/control: -------------------------------------------------------------------------------- 1 | Package: com.opa334.opainject 2 | Name: opainject 3 | Version: 1.0.6 4 | Architecture: iphoneos-arm 5 | Description: Injection tool! 6 | Maintainer: opa334 7 | Author: opa334 8 | Section: System 9 | Tag: role::hacker 10 | -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/dyld.h: -------------------------------------------------------------------------------- 1 | extern vm_address_t getRemoteImageAddress(task_t task, vm_address_t imageStartPtr, const char* imageName); 2 | extern vm_address_t remoteDlSym(task_t task, vm_address_t imageStartPtr, const char* symbolName); 3 | extern vm_address_t remoteDlSymFindImage(task_t task, vm_address_t allImageInfoAddr, const char* symbolName, char** imageOut); 4 | 5 | extern void printImages(task_t task, vm_address_t imageStartPtr); 6 | extern void printSymbols(task_t task, vm_address_t imageAddress); 7 | extern vm_address_t scanLibrariesForMemory(task_t task, vm_address_t imageStartPtr, char* memory, size_t memorySize, int alignment); -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | get-task-allow 5 | 6 | platform-application 7 | 8 | task_for_pid-allow 9 | 10 | com.apple.private.security.container-required 11 | 12 | com.apple.system-task-ports 13 | 14 | com.apple.system-task-ports.control 15 | 16 | com.apple.private.thread-set-state 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/pac.h: -------------------------------------------------------------------------------- 1 | #ifndef PTRAUTH_HELPERS_H 2 | #define PTRAUTH_HELPERS_H 3 | // Helpers for PAC archs. 4 | 5 | // If the compiler understands __arm64e__, assume it's paired with an SDK that has 6 | // ptrauth.h. Otherwise, it'll probably error if we try to include it so don't. 7 | #if __arm64e__ 8 | #include 9 | #endif 10 | 11 | #pragma clang diagnostic push 12 | #pragma clang diagnostic ignored "-Wunused-function" 13 | 14 | // Given a pointer to instructions, sign it so you can call it like a normal fptr. 15 | static void *make_sym_callable(void *ptr) { 16 | #if __arm64e__ 17 | ptr = ptrauth_sign_unauthenticated(ptrauth_strip(ptr, ptrauth_key_function_pointer), ptrauth_key_function_pointer, 0); 18 | #endif 19 | return ptr; 20 | } 21 | 22 | static void *make_sym_callable_data(void *ptr) { 23 | #if __arm64e__ 24 | ptr = ptrauth_sign_unauthenticated(ptrauth_strip(ptr, ptrauth_key_process_independent_data), ptrauth_key_process_independent_data, 0); 25 | #endif 26 | return ptr; 27 | } 28 | 29 | // Given a function pointer, strip the PAC so you can read the instructions. 30 | static void *make_sym_readable(void *ptr) { 31 | #if __arm64e__ 32 | ptr = ptrauth_strip(ptr, ptrauth_key_function_pointer); 33 | #endif 34 | return ptr; 35 | } 36 | 37 | static void *make_sym_readable_data(void *ptr) { 38 | #if __arm64e__ 39 | ptr = ptrauth_strip(ptr, ptrauth_key_process_independent_data); 40 | #endif 41 | return ptr; 42 | } 43 | 44 | #pragma clang diagnostic pop 45 | #endif -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/rop_inject.h: -------------------------------------------------------------------------------- 1 | extern void injectDylibViaRop(task_t task, pid_t pid, const char* dylibPath, vm_address_t allImageInfoAddr); -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/shellcode_inject.h: -------------------------------------------------------------------------------- 1 | int injectDylibViaShellcode(task_t task, pid_t pid, const char* dylibPath, vm_address_t allImageInfoAddr); -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/task_utils.h: -------------------------------------------------------------------------------- 1 | kern_return_t task_read(task_t task, vm_address_t address, void *outBuf, vm_size_t size); 2 | char *task_copy_string(task_t task, vm_address_t address); 3 | kern_return_t task_write(task_t task, vm_address_t address, void* inBuf, vm_size_t size); -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/task_utils.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | kern_return_t task_read(task_t task, vm_address_t address, void *outBuf, vm_size_t size) 5 | { 6 | size_t maxSize = size; 7 | kern_return_t kr = vm_read_overwrite(task, address, size, (vm_address_t)outBuf, &maxSize); 8 | if (kr == KERN_SUCCESS) { 9 | if (maxSize < size) { 10 | uint8_t *outBufU = outBuf; 11 | memset(&outBufU[maxSize-1], 0, size - maxSize); 12 | } 13 | } 14 | return kr; 15 | } 16 | 17 | char *task_copy_string(task_t task, vm_address_t address) 18 | { 19 | // find end of string 20 | size_t len = 0; 21 | char buf = 0; 22 | do { 23 | if (task_read(task, address + (len++), &buf, sizeof(buf)) != KERN_SUCCESS) return NULL; 24 | } while (buf != '\0'); 25 | 26 | // copy string 27 | char *strBuf = malloc(len); 28 | if (task_read(task, address, &strBuf[0], len) != KERN_SUCCESS) return NULL; 29 | return strBuf; 30 | } 31 | 32 | kern_return_t task_write(task_t task, vm_address_t address, void* inBuf, vm_size_t size) 33 | { 34 | return vm_write(task, address, (vm_offset_t)inBuf, size); 35 | } -------------------------------------------------------------------------------- /Essentials/debughelper/opainject/thread_utils.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | 7 | 8 | #define STACK_SIZE 65536 9 | static uint64_t ropLoop; 10 | 11 | #if __DARWIN_OPAQUE_ARM_THREAD_STATE64 12 | #define FP_UNIFIED __opaque_fp 13 | #define LR_UNIFIED __opaque_lr 14 | #define SP_UNIFIED __opaque_sp 15 | #define PC_UNIFIED __opaque_pc 16 | #define FLAGS_UNIFIED __opaque_flags 17 | #define REGISTER_TYPE void* 18 | #else 19 | #define FP_UNIFIED __fp 20 | #define LR_UNIFIED __lr 21 | #define SP_UNIFIED __sp 22 | #define PC_UNIFIED __pc 23 | #define FLAGS_UNIFIED __pad 24 | #define REGISTER_TYPE uint64_t 25 | #endif 26 | 27 | struct arm64_thread_full_state { 28 | arm_thread_state64_t thread; 29 | arm_exception_state64_t exception; 30 | arm_neon_state64_t neon; 31 | arm_debug_state64_t debug; 32 | uint32_t thread_valid:1, 33 | exception_valid:1, 34 | neon_valid:1, 35 | debug_valid:1, 36 | cpmu_valid:1; 37 | }; 38 | 39 | extern struct arm64_thread_full_state* thread_save_state_arm64(thread_act_t thread); 40 | extern bool thread_restore_state_arm64(thread_act_t thread, struct arm64_thread_full_state* state); 41 | extern kern_return_t wait_for_thread(thread_act_t thread, uint64_t pcToWait, struct arm_unified_thread_state* stateOut); 42 | extern void printThreadState_state(struct arm_unified_thread_state threadState); 43 | extern void printThreadState(thread_act_t thread); 44 | extern void printThreadInfo(thread_act_t thread); 45 | kern_return_t suspend_threads_except_for(thread_act_array_t allThreads, mach_msg_type_number_t threadCount, thread_act_t exceptForThread); 46 | kern_return_t resume_threads_except_for(thread_act_array_t allThreads, mach_msg_type_number_t threadCount, thread_act_t exceptForThread); 47 | -------------------------------------------------------------------------------- /Essentials/debughelper/poc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Essentials/debughelper/poc -------------------------------------------------------------------------------- /Essentials/debughelper/poc.m: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | extern int inject(NSString *inputString); 5 | 6 | int main(void) { 7 | int result = inject(@"opainject 30319 debug.dylib"); 8 | printf("%d\n", result); 9 | } 10 | -------------------------------------------------------------------------------- /Essentials/include/libcheck/check.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | NSString* typecheckC(NSArray *stringArray, NSString *content); 4 | -------------------------------------------------------------------------------- /Essentials/include/libdycall/dyexec.h: -------------------------------------------------------------------------------- 1 | // 2 | // dyexec.h 3 | // libdycall 4 | // Created by SeanIsNotAConstant on October the 19th 2024 5 | // 6 | 7 | #ifndef DYEXEC_H 8 | #define DYEXEC_H 9 | 10 | #include 11 | 12 | /** 13 | * @brief This function executes dybinaries 14 | * 15 | */ 16 | int dyexec(NSString *dylibPath, NSString *arguments); 17 | 18 | /** 19 | * @brief These functions lock or unlock a certain dylib or dybinary 20 | * 21 | */ 22 | void dylock(NSString *dylibPath); 23 | void dyunlock(); 24 | 25 | /** 26 | * @brief This function lists all loaded dylibs or dybinaries 27 | * 28 | */ 29 | void listdylibs(); 30 | 31 | #endif // DYEXEC_H 32 | -------------------------------------------------------------------------------- /Essentials/include/libfcm/fcm.h: -------------------------------------------------------------------------------- 1 | #ifndef FCM_H 2 | #define FCM_H 3 | 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #include 10 | 11 | /** 12 | * @brief Functions to get Information about the darwin host machine 13 | * 14 | */ 15 | NSString *ghost(); 16 | NSString *gosver(); 17 | NSString *gos(); 18 | NSString *gosb(); 19 | NSString *gmodel(); 20 | NSString *garch(); 21 | NSString *gcpu(); 22 | 23 | /** 24 | * @brief Functions to generate a documents container in case it doesnr exist yet 25 | * 26 | */ 27 | NSString* contgen(void); 28 | 29 | void killTaskWithBundleID(NSString *bundleID); 30 | void killTaskWithProcessName(NSString *processName); 31 | 32 | #endif // FCM_H 33 | -------------------------------------------------------------------------------- /Essentials/include/libfcm/fload.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void fdownload(NSString *urlString, NSString *destinationPath); -------------------------------------------------------------------------------- /Essentials/include/libfcm/proc.h: -------------------------------------------------------------------------------- 1 | void killallchilds(void); 2 | -------------------------------------------------------------------------------- /Essentials/include/libroot/libroot.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __BEGIN_DECLS 4 | 5 | _Pragma("GCC visibility push(hidden)") 6 | 7 | const char *_Nonnull libroot_dyn_get_root_prefix(void); 8 | const char *_Nonnull libroot_dyn_get_jbroot_prefix(void); 9 | const char *_Nonnull libroot_dyn_get_boot_uuid(void); 10 | char *_Nullable libroot_dyn_rootfspath(const char *_Nullable path, char *_Nullable resolvedPath); 11 | char *_Nullable libroot_dyn_jbrootpath(const char *_Nullable path, char *_Nullable resolvedPath); 12 | 13 | _Pragma("GCC visibility pop") 14 | 15 | __END_DECLS 16 | 17 | #define __CONVERT_PATH_CSTRING(converter, path) ({ \ 18 | static char outPath[PATH_MAX]; \ 19 | converter(path, outPath); \ 20 | }) 21 | 22 | #define JBROOT_PATH_CSTRING(path) __CONVERT_PATH_CSTRING(libroot_dyn_jbrootpath, path) 23 | #define ROOTFS_PATH_CSTRING(path) __CONVERT_PATH_CSTRING(libroot_dyn_rootfspath, path) 24 | 25 | #if __has_attribute(overloadable) 26 | __attribute__((__overloadable__)) 27 | static inline const char *_Nullable __libroot_convert_path(char *_Nullable (*_Nonnull converter)(const char *_Nonnull, char *_Nullable), const char *_Nullable path, char *_Nonnull buf) { 28 | return converter(path, buf); 29 | } 30 | #endif /* __has_attribute(overloadable) */ 31 | 32 | #ifdef __OBJC__ 33 | 34 | #import 35 | 36 | #define __CONVERT_PATH_NSSTRING(converter, path) ({ \ 37 | char tmpBuf[PATH_MAX]; \ 38 | const char *converted = converter(path.fileSystemRepresentation, tmpBuf); \ 39 | converted ? [NSString stringWithUTF8String:converted] : nil; \ 40 | }) 41 | 42 | #define JBROOT_PATH_NSSTRING(path) __CONVERT_PATH_NSSTRING(libroot_dyn_jbrootpath, path) 43 | #define ROOTFS_PATH_NSSTRING(path) __CONVERT_PATH_NSSTRING(libroot_dyn_rootfspath, path) 44 | 45 | #if __has_attribute(overloadable) 46 | __attribute__((__overloadable__)) 47 | static inline NSString *_Nullable __libroot_convert_path(char *_Nullable (*_Nonnull converter)(const char *_Nonnull, char *_Nullable), NSString *_Nullable path, void *_Nullable const __unused buf) { 48 | return __CONVERT_PATH_NSSTRING(converter, path); 49 | } 50 | #endif /* __has_attribute(overloadable) */ 51 | 52 | #endif /* __OBJC__ */ 53 | 54 | #if __has_attribute(overloadable) 55 | 56 | #define __BUFFER_FOR_CHAR_P(x) \ 57 | __builtin_choose_expr( \ 58 | __builtin_types_compatible_p(__typeof__(*(x)), char), \ 59 | ({ static char buf[PATH_MAX]; buf; }), \ 60 | NULL \ 61 | ) 62 | 63 | # define JBROOT_PATH(path) __libroot_convert_path(libroot_dyn_jbrootpath, (path), __BUFFER_FOR_CHAR_P(path)) 64 | # define ROOTFS_PATH(path) __libroot_convert_path(libroot_dyn_rootfspath, (path), __BUFFER_FOR_CHAR_P(path)) 65 | #else 66 | # define JBROOT_PATH(path) _Pragma("GCC error \"JBROOT_PATH is not supported with this compiler, use JBROOT_PATH_CSTRING or JBROOT_PATH_NSSTRING\"") path 67 | # define ROOTFS_PATH(path) _Pragma("GCC error \"ROOTFS_PATH is not supported with this compiler, use ROOTFS_PATH_CSTRING or ROOTFS_PATH_NSSTRING\"") path 68 | #endif /* __has_attribute(overloadable) */ 69 | 70 | #define JBRAND libroot_dyn_get_boot_uuid() 71 | -------------------------------------------------------------------------------- /Essentials/include/libsean/Bootloader/bootloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // kernel.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #ifndef kernel_h 9 | #define kernel_h 10 | 11 | #include 12 | #include "proc.h" 13 | 14 | void bootloader(uint8_t binmap[1000][6]); 15 | 16 | #endif /* kernel_h */ 17 | -------------------------------------------------------------------------------- /Essentials/include/libsean/Bootloader/proc.h: -------------------------------------------------------------------------------- 1 | // 2 | // proc.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #ifndef proc_h 9 | #define proc_h 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | typedef struct { 18 | uint8_t pid; // process identifier 19 | uint8_t state; // 0 = not running / 1 = running / 2 = paused / 3 = killed 20 | pthread_t thread; // processes thread; 21 | page_t *page[126]; // process pages 22 | } proc; 23 | 24 | proc* proc_fork(uint8_t binmap[1000][6]); 25 | void proc_kill(proc *process); 26 | 27 | #endif /* proc_h */ 28 | -------------------------------------------------------------------------------- /Essentials/include/libsean/CPU/cpu.h: -------------------------------------------------------------------------------- 1 | // 2 | // cpu.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 04.10.24. 6 | // 7 | 8 | #ifndef cpu_h 9 | #define cpu_h 10 | 11 | // CPU - Main 12 | #define EXT 0x00 13 | #define STO 0x01 14 | #define ADD 0x02 15 | #define SUB 0x03 16 | #define MUL 0x04 17 | #define DIV 0x05 18 | #define DSP 0x06 //DEBUG INSTRUCTION 19 | #define JMP 0x07 20 | #define IFQ 0x08 21 | #define RAN 0x0A 22 | 23 | // CPU - Peripherals 24 | #define MUS 0x09 25 | 26 | // CPU - Clocl 27 | #define SSP 0xB0 28 | #define NSP 0xB1 29 | 30 | // GPU - Main 31 | #define GPX 0xA0 32 | #define GDL 0xA1 33 | #define GDC 0xA2 34 | #define GCS 0xA3 35 | #define GGC 0xA4 36 | 37 | void *execute(void *arg); 38 | 39 | #endif /* cpu_h */ 40 | -------------------------------------------------------------------------------- /Essentials/include/libsean/CPU/peripheral.h: -------------------------------------------------------------------------------- 1 | // 2 | // peripheral.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 01.10.24. 6 | // 7 | 8 | #import "../../Sean16.h" 9 | #import 10 | #import 11 | 12 | void periphalMUS(page_t *periphals, uint16_t *x, uint16_t *y, uint16_t *btn); 13 | -------------------------------------------------------------------------------- /Essentials/include/libsean/CPU/rdrand.h: -------------------------------------------------------------------------------- 1 | // 2 | // rdrand.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 03.10.24. 6 | // 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #ifndef rdrand_h 14 | #define rdrand_h 15 | 16 | void rdrand(uint16_t *ptr, uint16_t min, uint16_t max); 17 | 18 | #endif /* rdrand_h */ 19 | -------------------------------------------------------------------------------- /Essentials/include/libsean/GPU/gpu.h: -------------------------------------------------------------------------------- 1 | // 2 | // gpu.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 27.09.24. 6 | // 7 | 8 | #ifndef gpu_h 9 | #define gpu_h 10 | 11 | void clearScreen(void); 12 | void setpixel(int x, int y, uint8_t color); 13 | uint8_t getColorOfPixel(uint8_t x, uint8_t y); 14 | void drawLine(int x0, int y0, int x1, int y1, uint8_t color); 15 | void drawCharacter(uint8_t x, uint8_t y, char ascii, uint8_t color); 16 | 17 | #endif /* gpu_h */ 18 | -------------------------------------------------------------------------------- /Essentials/include/libsean/Peripherals/Display/Display.h: -------------------------------------------------------------------------------- 1 | // 2 | // Display.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 27.09.24. 6 | // 7 | 8 | #import 9 | 10 | @interface MyScreenEmulatorView : UIView 11 | 12 | - (instancetype)initWithFrame:(CGRect)frame screenWidth:(NSInteger)width screenHeight:(NSInteger)height; 13 | - (void)setPixelAtX:(NSInteger)x y:(NSInteger)y colorIndex:(NSUInteger)colorIndex; 14 | - (UIColor *)colorAtPixelX:(NSInteger)x y:(NSInteger)y; 15 | - (NSInteger)colorIndexAtPixelX:(NSInteger)x y:(NSInteger)y; 16 | - (void)clear; 17 | 18 | @end 19 | 20 | MyScreenEmulatorView *getEmulator(void); 21 | -------------------------------------------------------------------------------- /Essentials/include/libsean/Peripherals/Mouse/Mouse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mouse.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 05.10.24. 6 | // 7 | 8 | #import 9 | 10 | @interface TouchTracker : NSObject 11 | 12 | @property (nonatomic, assign) CGPoint touchPosition; 13 | @property (nonatomic, assign) NSInteger lastTouchState; 14 | 15 | - (instancetype)initWithView:(UIView *)view scale:(CGFloat)scale; 16 | - (void)startTracking; 17 | - (void)stopTracking; 18 | - (CGPoint*)getPos; 19 | - (NSInteger*)getBtn; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Essentials/include/libsean/RAM/ram.h: -------------------------------------------------------------------------------- 1 | // 2 | // ram.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 27.09.24. 6 | // 7 | 8 | #ifndef ram_h 9 | #define ram_h 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define S_RAMSIZE_MAX 100000 17 | 18 | typedef struct { 19 | uint16_t id; 20 | uint8_t *memory[1024][6]; 21 | } page_t; 22 | 23 | page_t* genpage(void); 24 | void freepage(page_t *page); 25 | 26 | #endif /* ram_h */ 27 | -------------------------------------------------------------------------------- /Essentials/include/libsean/compiler.h: -------------------------------------------------------------------------------- 1 | // 2 | // compiler.h 3 | // libsean 4 | // 5 | // Created by SeanIsNotAConstant 6 | // 7 | 8 | uint8_t** sean16compiler(NSString *arguments); 9 | -------------------------------------------------------------------------------- /Essentials/include/libsean/ios.h: -------------------------------------------------------------------------------- 1 | // 2 | // ios.h 3 | // 4 | // Created by SeanIsNotAConstant on 22.10.24 5 | // 6 | 7 | #import 8 | #import "Peripherals/Display/Display.h" 9 | #import "Peripherals/Mouse/Mouse.h" 10 | 11 | void kickstart(NSString *path); 12 | TouchTracker *getTracker(void *arg); 13 | void send_cpu(uint8_t); 14 | -------------------------------------------------------------------------------- /Essentials/include/libserver/server.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | @interface httpObjServer : NSObject 4 | 5 | - (void)startHttpServer:(NSString*)path; 6 | - (void)stopHttpServer; 7 | - (void)rotateHttpServer; 8 | 9 | @end -------------------------------------------------------------------------------- /Essentials/include/libzip/libzip.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBZIP_H 2 | #define LIBZIP_H 3 | 4 | #import 5 | 6 | /** 7 | * @brief Functions to handle zip files 8 | * 9 | */ 10 | int libzip_zip(NSString *path, NSString *dest, BOOL keepParent); 11 | int libzip_unzip(NSString *path, NSString *dest); 12 | 13 | #endif // LIBZIP_H 14 | -------------------------------------------------------------------------------- /Essentials/lib/prebuild/libroot.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Essentials/lib/prebuild/libroot.a -------------------------------------------------------------------------------- /Essentials/lib/prebuild/libserver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Essentials/lib/prebuild/libserver.a -------------------------------------------------------------------------------- /Essentials/lib/prebuild/libzip.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/Essentials/lib/prebuild/libzip.a -------------------------------------------------------------------------------- /Essentials/libcheck/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # libcheck 4 | # Meow :3 5 | # Created by SeanIsNotAConstant on October the 11th november 2024 6 | # 7 | 8 | # config 9 | SHELL := /var/jb/bin/sh 10 | SDKROOT := ./sdk 11 | CC := clang 12 | CF := -target arm64-apple-ios15 -arch arm64 -I/var/jb/usr/lib/llvm-16/include -Ddebug 13 | 14 | # finding all C and Objective-C files 15 | CFILES := $(shell find . -name "*.c") 16 | MFILES := $(shell find . -name '*.m') 17 | 18 | # compiling them to libsean16 19 | # fishy patch 20 | uuid := uuid 21 | 22 | all: compile bind 23 | 24 | compile: 25 | @if [ -d tmp ]; then \ 26 | rm -rf tmp; \ 27 | mkdir tmp tmp/out tmp/lib; \ 28 | else \ 29 | mkdir tmp tmp/out tmp/lib; \ 30 | fi 31 | @for file in $(CFILES); do \ 32 | $(CC) -isysroot $(SDKROOT) $(CF) -c $$file -o "tmp/out/$$($(uuid)).o"; \ 33 | done 34 | @for file in $(MFILES); do \ 35 | $(CC) -isysroot $(SDKROOT) $(CF) -c $$file -o "tmp/out/$$($(uuid)).o"; \ 36 | done 37 | 38 | bind: 39 | @ar rcs tmp/lib/libcheck.a tmp/out/*.o 40 | 41 | clean: 42 | @rm -rf tmp 43 | -------------------------------------------------------------------------------- /Essentials/libcheck/sdk: -------------------------------------------------------------------------------- 1 | ../../SDK -------------------------------------------------------------------------------- /Essentials/libcheck/typecheck.m: -------------------------------------------------------------------------------- 1 | #import 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | NSString* process_diagnostics(CXTranslationUnit tu, const char *filename) { 10 | unsigned int diagnosticCount = clang_getNumDiagnostics(tu); 11 | if (diagnosticCount == 0) { 12 | } else { 13 | for (unsigned int i = 0; i < diagnosticCount; i++) { 14 | CXDiagnostic diagnostic = clang_getDiagnostic(tu, i); 15 | CXString diagnosticStr = clang_formatDiagnostic(diagnostic, clang_defaultDiagnosticDisplayOptions()); 16 | NSString *result = [NSString stringWithFormat:@"%s\n", clang_getCString(diagnosticStr)]; 17 | clang_disposeString(diagnosticStr); 18 | clang_disposeDiagnostic(diagnostic); 19 | return result; 20 | } 21 | } 22 | 23 | return @""; 24 | } 25 | 26 | NSString* typecheckC(NSArray *stringArray, NSString *content) { 27 | // preparing unsaved file 28 | const char *filename = [stringArray.lastObject UTF8String]; 29 | struct CXUnsavedFile cfile; 30 | cfile.Filename = filename; 31 | cfile.Contents = (const char*)[content UTF8String]; 32 | cfile.Length = strlen((const char*)[content UTF8String]); 33 | 34 | // typechecking engine 35 | NSString *result = @""; 36 | 37 | NSInteger count = stringArray.count; 38 | if (count == 0) { 39 | fprintf(stderr, "No arguments provided\n"); 40 | return result; 41 | } 42 | 43 | NSInteger argCount = count - 1; 44 | char *args[argCount]; 45 | 46 | for (NSInteger i = 0; i < argCount; i++) { 47 | NSString *str = stringArray[i]; 48 | if (str) { 49 | args[i] = strdup([str UTF8String]); 50 | } else { 51 | fprintf(stderr, "Nil argument at index %ld\n", (long)i); 52 | return result; 53 | } 54 | } 55 | 56 | CXIndex index = clang_createIndex(0, 0); 57 | if (!index) { 58 | fprintf(stderr, "Failed to create libclang index\n"); 59 | return result; 60 | } 61 | 62 | CXTranslationUnit tu = clang_parseTranslationUnit(index, filename, (const char* const*)args, argCount, &cfile, 1, CXTranslationUnit_None); 63 | 64 | if (!tu) { 65 | fprintf(stderr, "Failed to parse %s\n", filename); 66 | } else { 67 | result = process_diagnostics(tu, filename); 68 | clang_disposeTranslationUnit(tu); 69 | } 70 | 71 | clang_disposeIndex(index); 72 | 73 | for (NSInteger i = 0; i < argCount; i++) { 74 | free(args[i]); 75 | } 76 | 77 | #if debug 78 | printf("[libcheck] %s\n", [result UTF8String]); 79 | #endif 80 | 81 | return result; 82 | } 83 | -------------------------------------------------------------------------------- /Essentials/libdycall/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # libdycall 4 | # Meow :3 5 | # Created by SeanIsNotAConstant on October the 12th 2024 6 | # 7 | 8 | # config 9 | SHELL := /var/jb/bin/sh 10 | CC := clang 11 | CF := -target arm64-apple-ios15 -arch arm64 12 | SDKROOT := sdk 13 | 14 | # finding all C and Objective-C files 15 | CFILES := $(shell find . -name "*.c") 16 | MFILES := $(shell find . -name '*.m') 17 | 18 | # compiling them to libsean16 19 | # fishy patch 20 | uuid := uuid 21 | 22 | all: compile bind 23 | 24 | compile: 25 | @if [ -d tmp ]; then \ 26 | rm -rf tmp; \ 27 | mkdir tmp tmp/out tmp/lib; \ 28 | else \ 29 | mkdir tmp tmp/out tmp/lib; \ 30 | fi 31 | @for file in $(CFILES); do \ 32 | $(CC) -isysroot $(SDKROOT) $(CF) -c $$file -o "tmp/out/$$($(uuid)).o"; \ 33 | done 34 | @for file in $(MFILES); do \ 35 | $(CC) -isysroot $(SDKROOT) $(CF) -c $$file -o "tmp/out/$$($(uuid)).o"; \ 36 | done 37 | 38 | bind: 39 | @ar rcs tmp/lib/libdycall.a tmp/out/*.o 40 | 41 | clean: 42 | @rm -rf tmp 43 | -------------------------------------------------------------------------------- /Essentials/libdycall/dyexec.m: -------------------------------------------------------------------------------- 1 | // 2 | // dyexec.m 3 | // 4 | // Created by SeanIsNotAConstant on 15.10.24 5 | // 6 | 7 | #import 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "hooker.h" 16 | #include "thread.h" 17 | 18 | int hooked = 0; 19 | 20 | /** 21 | * @brief This function is for dybinary execution 22 | * 23 | */ 24 | int dyexec(NSString *dylibPath, 25 | NSString *arguments) 26 | { 27 | dyargs data; 28 | 29 | data.handle = dlopen([dylibPath UTF8String], RTLD_LAZY); 30 | if (!data.handle) { 31 | fprintf(stderr, "[!] error: %s\n", dlerror()); 32 | return -1; 33 | } 34 | 35 | dlerror(); 36 | 37 | hooker(); 38 | 39 | //argv prepare 40 | NSArray *components = [arguments componentsSeparatedByString:@" "]; 41 | data.argc = (int)[components count]; 42 | data.argv = (char **)malloc((data.argc + 1) * sizeof(char *)); 43 | for (int i = 0; i < data.argc; i++) { 44 | data.argv[i] = strdup([components[i] UTF8String]); 45 | } 46 | data.argv[data.argc] = NULL; 47 | 48 | //threadripper approach (exit loop bypass) 49 | pthread_t thread; 50 | if (pthread_create(&thread, NULL, threadripper, (void *)&data) != 0) { 51 | fprintf(stderr, "[!] error creating thread\n"); 52 | return 1; 53 | } 54 | sleep(1); 55 | void *status; 56 | pthread_join(thread, &status); 57 | 58 | //if reference count wont hit 0 it wont free 59 | dlclose(data.handle); 60 | unhooker(); 61 | 62 | for (int i = 0; i < data.argc; i++) free(data.argv[i]); 63 | free(data.argv); 64 | 65 | return (intptr_t)status; 66 | } 67 | -------------------------------------------------------------------------------- /Essentials/libdycall/dyfree.m: -------------------------------------------------------------------------------- 1 | // under construction!!! 2 | 3 | #include 4 | #include 5 | 6 | void listdylibs() 7 | { 8 | uint32_t count = _dyld_image_count(); 9 | for (uint32_t i = 0; i < count; i++) { 10 | const char* name = _dyld_get_image_name(i); 11 | const struct mach_header* header = _dyld_get_image_header(i); 12 | printf("Library: %s, Address: %p\n", name, header); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Essentials/libdycall/dylock.m: -------------------------------------------------------------------------------- 1 | #import 2 | #include 3 | #include 4 | #include 5 | 6 | //avoid dylocking twice! 7 | void *handle; 8 | 9 | /** 10 | * @brief This function is to lock a certain dybinary or dylib to be dlclosed 11 | * 12 | */ 13 | void dyunlock() 14 | { 15 | dlclose(handle); 16 | handle = NULL; 17 | } 18 | 19 | /** 20 | * @brief This function is to unlock a with dylock() locked dylib 21 | * 22 | */ 23 | void dylock(NSString *dylibPath) 24 | { 25 | if(handle == NULL) { 26 | handle = dlopen([dylibPath UTF8String], RTLD_LAZY); 27 | } else { 28 | dyunlock(); 29 | handle = dlopen([dylibPath UTF8String], RTLD_LAZY); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Essentials/libdycall/fishhook.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Facebook, Inc. 2 | // All rights reserved. 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are met: 5 | // * Redistributions of source code must retain the above copyright notice, 6 | // this list of conditions and the following disclaimer. 7 | // * Redistributions in binary form must reproduce the above copyright notice, 8 | // this list of conditions and the following disclaimer in the documentation 9 | // and/or other materials provided with the distribution. 10 | // * Neither the name Facebook nor the names of its contributors may be used to 11 | // endorse or promote products derived from this software without specific 12 | // prior written permission. 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | #ifndef fishhook_h 25 | #define fishhook_h 26 | 27 | #include 28 | #include 29 | 30 | #if !defined(FISHHOOK_EXPORT) 31 | #define FISHHOOK_VISIBILITY __attribute__((visibility("hidden"))) 32 | #else 33 | #define FISHHOOK_VISIBILITY __attribute__((visibility("default"))) 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif //__cplusplus 39 | 40 | /* 41 | * A structure representing a particular intended rebinding from a symbol 42 | * name to its replacement 43 | */ 44 | struct rebinding { 45 | const char *name; 46 | void *replacement; 47 | void **replaced; 48 | }; 49 | 50 | /* 51 | * For each rebinding in rebindings, rebinds references to external, indirect 52 | * symbols with the specified name to instead point at replacement for each 53 | * image in the calling process as well as for all future images that are loaded 54 | * by the process. If rebind_functions is called more than once, the symbols to 55 | * rebind are added to the existing list of rebindings, and if a given symbol 56 | * is rebound more than once, the later rebinding will take precedence. 57 | */ 58 | FISHHOOK_VISIBILITY 59 | int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel); 60 | 61 | /* 62 | * Rebinds as above, but only in the specified image. The header should point 63 | * to the mach-o header, the slide should be the slide offset. Others as above. 64 | */ 65 | FISHHOOK_VISIBILITY 66 | int rebind_symbols_image(void *header, 67 | intptr_t slide, 68 | struct rebinding rebindings[], 69 | size_t rebindings_nel); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif //__cplusplus 74 | 75 | #endif //fishhook_h 76 | -------------------------------------------------------------------------------- /Essentials/libdycall/hooker.c: -------------------------------------------------------------------------------- 1 | // 2 | // hooker.c 3 | // memory 4 | // 5 | // Created by fridakitten on 30.10.24. 6 | // 7 | 8 | #include "fishhook.h" 9 | #include 10 | #include 11 | #include 12 | 13 | static bool isSpying = false; 14 | static malloc_zone_t *zone; 15 | 16 | static void* (*original_malloc)(size_t size) = NULL; 17 | static void* (*original_calloc)(size_t num, size_t size) = NULL; 18 | static void* (*original_realloc)(void *pointer, size_t size) = NULL; 19 | static void (*original_free)(void *pointer) = NULL; 20 | 21 | static void (*original_exit)(int) = NULL; 22 | static int (*original_atexit)(void (*func)()) = NULL; 23 | 24 | extern void dy_exit(int status); 25 | extern int dy_atexit(void (*func)()); 26 | 27 | int hookerhelper(const char *victim, void *function, void **bunkerfunc) 28 | { 29 | struct rebinding rebound = 30 | { 31 | .name = victim, 32 | .replacement = function, 33 | .replaced = (void**)bunkerfunc 34 | }; 35 | 36 | struct rebinding rebindings[] = 37 | { 38 | rebound, 39 | }; 40 | 41 | return rebind_symbols(rebindings, sizeof(rebindings) / sizeof(rebindings[0])); 42 | } 43 | 44 | void* malloc_bind(size_t size) 45 | { 46 | return malloc_zone_malloc(zone, size); 47 | } 48 | 49 | void* calloc_bind(size_t num, size_t size) 50 | { 51 | return malloc_zone_calloc(zone, num, size); 52 | } 53 | 54 | void* realloc_bind(void *pointer, size_t size) 55 | { 56 | return malloc_zone_realloc(zone, pointer, size); 57 | } 58 | 59 | void free_bind(void *pointer) 60 | { 61 | malloc_zone_free(zone, pointer); 62 | } 63 | 64 | void unhooker(void) 65 | { 66 | if(!isSpying) 67 | { 68 | zone = malloc_create_zone(0, 0); 69 | //hookerhelper("malloc", malloc_bind, (void**)&original_malloc); 70 | //hookerhelper("calloc", calloc_bind, (void**)&original_calloc); 71 | //hookerhelper("realloc", realloc_bind, (void**)&original_realloc); 72 | //hookerhelper("free", free_bind, (void**)&original_free); 73 | hookerhelper("exit", dy_exit, (void**)&original_exit); 74 | hookerhelper("atexit", dy_atexit, (void**)&original_atexit); 75 | isSpying = true; 76 | } 77 | } 78 | 79 | void hooker(void) 80 | { 81 | if(isSpying) 82 | { 83 | isSpying = false; 84 | //hookerhelper("malloc", original_malloc, NULL); 85 | //hookerhelper("calloc", original_calloc, NULL); 86 | //hookerhelper("realloc", original_realloc, NULL); 87 | //hookerhelper("free", original_free, NULL); 88 | hookerhelper("exit", original_exit, NULL); 89 | hookerhelper("atexit", original_atexit, NULL); 90 | malloc_destroy_zone(zone); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Essentials/libdycall/hooker.h: -------------------------------------------------------------------------------- 1 | // 2 | // hooker.h 3 | // libdycall 4 | // 5 | // Created by SeanIsNotAConstant on 15.10.24 6 | // 7 | 8 | #ifndef HOOKER_H 9 | #define HOOKER_H 10 | 11 | /** 12 | * @brief Set up the hooks 13 | * 14 | * This function hooks certain symbols like exit and atexit to make a dylib behave like a binariy 15 | * For example instead of calling real exit it would call our own implementation of it 16 | */ 17 | int hooker(void); 18 | 19 | /** 20 | * @brief Remove the hooks. 21 | * 22 | * When your done with your actions id recommend you to call unhooker() in order to make your process 23 | * behave normally again 24 | * 25 | */ 26 | int unhooker(void); 27 | 28 | #endif // HOOKER_H 29 | -------------------------------------------------------------------------------- /Essentials/libdycall/sdk: -------------------------------------------------------------------------------- 1 | ../../SDK -------------------------------------------------------------------------------- /Essentials/libdycall/symbols/exit.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /** 6 | * @brief This function holds the function pointer specified by a dybinary using atexit() 7 | * 8 | */ 9 | typedef void (*atexit_func)(void); 10 | atexit_func registered_func = NULL; 11 | 12 | /** 13 | * @brief This function is not meant to be called. Its our own implementation of the function for our hooker 14 | * 15 | */ 16 | void dy_atexit(atexit_func func) 17 | { 18 | registered_func = func; 19 | } 20 | 21 | /** 22 | * @brief This function is not meant to be called. Its our own implementation of the function for our hooker 23 | * 24 | */ 25 | void dy_exit(int status) 26 | { 27 | if (registered_func) { 28 | registered_func(); 29 | } 30 | 31 | pthread_exit((void*)(intptr_t)status); 32 | } 33 | -------------------------------------------------------------------------------- /Essentials/libdycall/thread.c: -------------------------------------------------------------------------------- 1 | // 2 | // threadripper.c 3 | // 4 | // Created by SeanIsNotAConstant on 15.10.24 5 | // 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "thread.h" 12 | 13 | /** 14 | * @brief This function seperates the main symbol behaviour of the dybinary and the binary 15 | * 16 | * We use this as a exitloop bypass 17 | */ 18 | void *threadripper(void *arg) 19 | { 20 | dyargs *data = (dyargs *)arg; 21 | void *handle = data->handle; 22 | 23 | int (*dylib_main)(int, char**) = dlsym(handle, "main"); 24 | char *error = dlerror(); 25 | if (error != NULL) { 26 | fprintf(stderr, "[!] error: %s\n", error); 27 | pthread_exit(NULL); 28 | return NULL; 29 | } 30 | 31 | int status = dylib_main(data->argc, data->argv); 32 | 33 | pthread_exit((void*)(intptr_t)status); 34 | return NULL; 35 | } 36 | -------------------------------------------------------------------------------- /Essentials/libdycall/thread.h: -------------------------------------------------------------------------------- 1 | // 2 | // thread.h 3 | // libdycall 4 | // 5 | // Created by SeanIsNotAConstant on 15.10.24 6 | // 7 | 8 | #ifndef THREAD_H 9 | #define THREAD_H 10 | 11 | /** 12 | * @brief This Struct holds the args of the threadripper 13 | */ 14 | typedef struct { 15 | void *handle; 16 | char **argv; 17 | int argc; 18 | } dyargs; 19 | 20 | /** 21 | * @brief This function seperates the main symbol behaviour of the dybinary and the binary 22 | * 23 | * We use this as a exitloop bypass 24 | */ 25 | void *threadripper(void *arg); 26 | 27 | #endif // THREAD_H 28 | -------------------------------------------------------------------------------- /Essentials/libfcm/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # libfcm 4 | # Meow :3 5 | # Created by SeanIsNotAConstant on October the 12th 2024 6 | # 7 | 8 | # config 9 | SHELL := /var/jb/bin/sh 10 | SDKROOT := ./sdk 11 | CC := clang 12 | CF := -target arm64-apple-ios15 -arch arm64 13 | 14 | # finding all C and Objective-C files 15 | CFILES := $(shell find . -name "*.c") 16 | MFILES := $(shell find . -name '*.m') 17 | 18 | # compiling them to libsean16 19 | # fishy patch 20 | uuid := uuid 21 | 22 | all: compile bind 23 | 24 | compile: 25 | @if [ -d tmp ]; then \ 26 | rm -rf tmp; \ 27 | mkdir tmp tmp/out tmp/lib; \ 28 | else \ 29 | mkdir tmp tmp/out tmp/lib; \ 30 | fi 31 | @for file in $(CFILES); do \ 32 | $(CC) -isysroot $(SDKROOT) $(CF) -c $$file -o "tmp/out/$$($(uuid)).o"; \ 33 | done 34 | @for file in $(MFILES); do \ 35 | $(CC) -isysroot $(SDKROOT) $(CF) -c $$file -o "tmp/out/$$($(uuid)).o"; \ 36 | done 37 | 38 | bind: 39 | @ar rcs tmp/lib/libfcm.a tmp/out/*.o 40 | 41 | clean: 42 | @rm -rf tmp 43 | -------------------------------------------------------------------------------- /Essentials/libfcm/fload.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | extern NSString* contgen(void); 5 | 6 | /** 7 | * @brief This function is for downloading files online 8 | * 9 | */ 10 | void fdownload(NSString *urlString, NSString *destinationPath) { 11 | // Prepare to download 12 | NSURL *url = [NSURL URLWithString:urlString]; 13 | NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; 14 | NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:nil delegateQueue:nil]; 15 | 16 | // Semaphore 17 | dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); 18 | 19 | // Download Task 20 | printf("downloading \"%s\"\n", [urlString UTF8String]); 21 | NSURLSessionDownloadTask *downloadTask = [session downloadTaskWithURL:url completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error) { 22 | if (error) { 23 | printf("error: download failed: %s\n", [[error localizedDescription] UTF8String]); 24 | dispatch_semaphore_signal(semaphore); 25 | return; // Exit early if there is an error 26 | } 27 | 28 | // Determine the destination path 29 | NSString *finalDestinationPath = destinationPath; 30 | if (![finalDestinationPath isAbsolutePath]) { 31 | // If the destination path is relative, use the Documents directory 32 | NSString *documentsDirectory = contgen(); 33 | finalDestinationPath = [documentsDirectory stringByAppendingPathComponent:destinationPath]; 34 | } 35 | 36 | // Move File 37 | NSError *fileError; 38 | NSFileManager *fileManager = [NSFileManager defaultManager]; 39 | 40 | // Check if destination file already exists 41 | if ([fileManager fileExistsAtPath:finalDestinationPath]) { 42 | printf("Warning: file already exists at destination path. Overwriting.\n"); 43 | [fileManager removeItemAtPath:finalDestinationPath error:nil]; // Optionally remove existing file 44 | } 45 | 46 | BOOL success = [fileManager moveItemAtURL:location toURL:[NSURL fileURLWithPath:finalDestinationPath] error:&fileError]; 47 | 48 | if (!success) { 49 | printf("error: moving file failed: %s\n", [[fileError localizedDescription] UTF8String]); 50 | } else { 51 | printf("File moved to: %s\n", [finalDestinationPath UTF8String]); 52 | } 53 | 54 | dispatch_semaphore_signal(semaphore); 55 | }]; 56 | 57 | [downloadTask resume]; 58 | 59 | dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); 60 | printf("done :3\n"); 61 | } 62 | -------------------------------------------------------------------------------- /Essentials/libfcm/proc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | typedef struct { 9 | pid_t *list; 10 | uint64_t count; 11 | } pid_list_t; 12 | 13 | pid_list_t getChilds(pid_t ppid) { 14 | pid_list_t list; 15 | size_t length; 16 | struct kinfo_proc *procs = NULL; 17 | int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 }; 18 | 19 | if (sysctl(mib, 4, NULL, &length, NULL, 0) == -1) { 20 | perror("sysctl (size)"); 21 | exit(EXIT_FAILURE); 22 | } 23 | 24 | procs = malloc(length); 25 | if (procs == NULL) { 26 | perror("malloc"); 27 | exit(EXIT_FAILURE); 28 | } 29 | 30 | if (sysctl(mib, 4, procs, &length, NULL, 0) == -1) { 31 | perror("sysctl (data)"); 32 | free(procs); 33 | exit(EXIT_FAILURE); 34 | } 35 | 36 | int proc_count = length / sizeof(struct kinfo_proc); 37 | 38 | uint64_t child_count = 0; 39 | for (int i = 0; i < proc_count; i++) { 40 | if (procs[i].kp_eproc.e_ppid == ppid) { 41 | child_count++; 42 | } 43 | } 44 | 45 | list.list = calloc(child_count, sizeof(pid_t)); 46 | list.count = child_count; 47 | 48 | int j = 0; 49 | for (int i = 0; i < proc_count; i++) { 50 | if (procs[i].kp_eproc.e_ppid == ppid) { 51 | list.list[j++] = procs[i].kp_proc.p_pid; 52 | } 53 | } 54 | 55 | free(procs); 56 | return list; 57 | } 58 | 59 | void killallchilds(void) { 60 | pid_list_t list = getChilds(getpid()); 61 | 62 | for(uint64_t i = 0; i < list.count; i++) { 63 | if(list.list[i] != getpid()) { 64 | kill(list.list[i], SIGKILL); 65 | } 66 | } 67 | 68 | free(list.list); 69 | } 70 | -------------------------------------------------------------------------------- /Essentials/libfcm/sdk: -------------------------------------------------------------------------------- 1 | ../../SDK -------------------------------------------------------------------------------- /Essentials/libsean/Compiler/code.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define MAX_LINES 1000 6 | #define MAX_WORDS 6 7 | #define MAX_WORD_LENGTH 50 8 | #define MAX_LINE_LENGTH 256 9 | 10 | char *(*read_file(char *filename))[MAX_WORDS] { 11 | static char *content[MAX_LINES][MAX_WORDS]; 12 | FILE *file = fopen(filename, "r"); 13 | 14 | if (file == NULL) { 15 | printf("Error: Could not open file.\n"); 16 | return NULL; 17 | } 18 | 19 | char line[MAX_LINE_LENGTH]; 20 | int line_number = 0; 21 | 22 | while (fgets(line, sizeof(line), file) != NULL && line_number < MAX_LINES) { 23 | char *word; 24 | int word_number = 0; 25 | 26 | word = strtok(line, " \t\n"); 27 | while (word != NULL && word_number < MAX_WORDS) { 28 | content[line_number][word_number] = malloc(strlen(word) + 1); 29 | strcpy(content[line_number][word_number], word); 30 | 31 | word_number++; 32 | word = strtok(NULL, " \t\n"); 33 | } 34 | 35 | for (int i = word_number; i < MAX_WORDS; i++) { 36 | content[line_number][i] = NULL; 37 | } 38 | 39 | line_number++; 40 | } 41 | 42 | fclose(file); 43 | return content; 44 | } 45 | 46 | void free_content(char *content[MAX_LINES][MAX_WORDS]) { 47 | for (int i = 0; i < MAX_LINES; i++) { 48 | for (int j = 0; j < MAX_WORDS; j++) { 49 | if (content[i][j] != NULL) { 50 | free(content[i][j]); 51 | content[i][j] = NULL; 52 | } 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Essentials/libsean/Compiler/code.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define MAX_LINES 1000 6 | #define MAX_WORDS 6 7 | #define MAX_WORD_LENGTH 50 8 | #define MAX_LINE_LENGTH 256 9 | 10 | char *(*read_file(char *filename))[MAX_WORDS]; 11 | void free_content(char *content[MAX_LINES][MAX_WORDS]); 12 | -------------------------------------------------------------------------------- /Essentials/libsean/Compiler/compiler.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | uint8_t** sean16compiler(NSString *arguments); 4 | -------------------------------------------------------------------------------- /Essentials/libsean/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # Sean16 SOC for iOS 4 | # Meow :3 5 | # Created by SeanIsNotAConstant on October the 12th 2024 6 | # 7 | 8 | # config 9 | SHELL := /var/jb/bin/sh 10 | SDKROOT := ./sdk 11 | CC := clang 12 | CF := -target arm64-apple-ios15 -arch arm64 -ISOC -ICompiler 13 | 14 | # finding all C and Objective-C files 15 | CFILES := $(shell find . -name "*.c") 16 | MFILES := $(shell find . -name '*.m') 17 | 18 | # compiling them to libsean16 19 | # fishy patch 20 | uuid := uuid 21 | 22 | all: compile bind 23 | 24 | compile: 25 | @if [ -d tmp ]; then \ 26 | rm -rf tmp; \ 27 | mkdir tmp tmp/out tmp/lib; \ 28 | else \ 29 | mkdir tmp tmp/out tmp/lib; \ 30 | fi 31 | @for file in $(CFILES); do \ 32 | $(CC) -isysroot $(SDKROOT) $(CF) -ISOC -c $$file -o "tmp/out/$$($(uuid)).o"; \ 33 | done 34 | @for file in $(MFILES); do \ 35 | $(CC) -isysroot $(SDKROOT) $(CF) -ISOC -c $$file -o "tmp/out/$$($(uuid)).o"; \ 36 | done 37 | 38 | bind: 39 | @ar rcs tmp/lib/libsean.a tmp/out/*.o 40 | 41 | clean: 42 | @rm -rf tmp 43 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Bootloader/bootloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // kernel.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #ifndef kernel_h 9 | #define kernel_h 10 | 11 | #include 12 | #include "proc.h" 13 | 14 | void bootloader(uint8_t binmap[1000][6]); 15 | 16 | #endif /* kernel_h */ 17 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Bootloader/bootloader.m: -------------------------------------------------------------------------------- 1 | // 2 | // kernel.c 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #include "../../Sean16.h" 9 | #include "bootloader.h" 10 | #import 11 | #import 12 | #import 13 | 14 | extern void *execute(void *arg); 15 | 16 | void bootloader(uint8_t binmap[1000][6]) { 17 | // clear my screen 18 | clearScreen(); 19 | 20 | if(!fs_check()) { 21 | printf("[soc-bootloader-chip] initialising block device\n"); 22 | fs_init(); 23 | printf("[soc-bootloader-chip] formating block device\n"); 24 | fs_format(); 25 | printf("[soc-bootloader-chip] creating test file\n"); 26 | fs_cfile("test.txt", "Hello, Sean16"); 27 | printf("[soc-bootloader-chip] received file content: %s\n", fs_rfile("test.txt")); 28 | fs_dfile("test.txt"); 29 | } else { 30 | printf("[soc-bootloader-chip] block device is already initialised\n"); 31 | } 32 | 33 | // INIT 34 | printf("[soc-bootloader-chip] initialising mouse\n"); 35 | TouchTracker *mouse = getTracker(NULL); 36 | [mouse startTracking]; 37 | 38 | // fork process 39 | printf("[soc-bootloader-chip] forking kernel process\n"); 40 | proc *child_task = proc_fork(binmap); 41 | if(child_task == NULL) { 42 | printf("[soc-bootloader-chip] forking process failed\n"); 43 | return; 44 | } 45 | 46 | // peripherials mapping 47 | printf("[soc-bootloader-chip] mapping peripherals\n"); 48 | *((CGPoint **)&child_task->page[2]->memory[0][0]) = [mouse getPos]; 49 | *((NSInteger **)&child_task->page[2]->memory[0][1]) = [mouse getBtn]; 50 | 51 | // executing process 52 | printf("[soc-bootloader-chip] executing kernel process\n"); 53 | execute((void*)child_task); 54 | 55 | // DEINIT 56 | printf("[soc-bootloader-chip] process has finished execution\n"); 57 | printf("[soc-bootloader-chip] deinitialising mouse\n"); 58 | [mouse stopTracking]; 59 | 60 | // killing task 61 | printf("[soc-bootloader-chip] freeing process\n"); 62 | proc_kill(child_task); 63 | } 64 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Bootloader/proc.c: -------------------------------------------------------------------------------- 1 | // 2 | // proc.c 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #include "proc.h" 9 | #include 10 | 11 | static proc *processes[UINT16_MAX]; 12 | 13 | static uint16_t pidn = 0; 14 | 15 | proc* proc_fork(uint8_t binmap[1000][6]) { 16 | proc *pid = malloc(sizeof(proc)); 17 | 18 | pid->pid = pidn; 19 | pid->state = 1; 20 | pid->page[0] = genpage(); 21 | pid->page[1] = genpage(); 22 | pid->page[2] = genpage(); 23 | 24 | if(pid->page[0] == NULL) { 25 | return NULL; 26 | } else if(pid->page[1] == NULL) { 27 | freepage(pid->page[0]); 28 | return NULL; 29 | } else if(pid->page[2] == NULL) { 30 | freepage(pid->page[0]); 31 | freepage(pid->page[1]); 32 | return NULL; 33 | } 34 | 35 | for(int i = 0; 6 > i; i++) { 36 | for(int j = 0; 1024 > j; j++) { 37 | *pid->page[0]->memory[i][j] = binmap[i][j]; 38 | } 39 | } 40 | 41 | processes[pidn] = pid; 42 | pidn++; 43 | 44 | return pid; 45 | } 46 | 47 | void proc_kill(proc *process) { 48 | uint16_t pidt = process->pid; 49 | 50 | freepage(processes[pidt]->page[0]); 51 | freepage(processes[pidt]->page[1]); 52 | freepage(processes[pidt]->page[2]); 53 | 54 | free(processes[pidt]); 55 | } 56 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Bootloader/proc.h: -------------------------------------------------------------------------------- 1 | // 2 | // proc.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #ifndef proc_h 9 | #define proc_h 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | typedef struct { 18 | uint8_t pid; // process identifier 19 | uint8_t state; // 0 = not running / 1 = running / 2 = paused / 3 = killed 20 | pthread_t thread; // processes thread; 21 | page_t *page[126]; // process pages 22 | } proc; 23 | 24 | proc* proc_fork(uint8_t binmap[1000][6]); 25 | void proc_kill(proc *process); 26 | 27 | #endif /* proc_h */ 28 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/CPU/cpu.h: -------------------------------------------------------------------------------- 1 | // 2 | // cpu.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 04.10.24. 6 | // 7 | 8 | #ifndef cpu_h 9 | #define cpu_h 10 | 11 | // CPU - Main 12 | #define EXT 0x00 13 | #define STO 0x01 14 | #define ADD 0x02 15 | #define SUB 0x03 16 | #define MUL 0x04 17 | #define DIV 0x05 18 | #define DSP 0x06 //DEBUG INSTRUCTION 19 | #define JMP 0x07 20 | #define IFQ 0x08 21 | #define RAN 0x0A 22 | 23 | // CPU - Peripherals 24 | #define MUS 0x09 25 | 26 | // CPU - Clocl 27 | #define SSP 0xB0 28 | #define NSP 0xB1 29 | 30 | // GPU - Main 31 | #define GPX 0xA0 32 | #define GDL 0xA1 33 | #define GDC 0xA2 34 | #define GCS 0xA3 35 | #define GGC 0xA4 36 | 37 | void *execute(void *arg); 38 | 39 | #endif /* cpu_h */ 40 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/CPU/cpu.m: -------------------------------------------------------------------------------- 1 | // 2 | // Sean16.c 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #include "../Sean16.h" 9 | #include "peripheral.h" 10 | #include "rdrand.h" 11 | #include "cpu.h" 12 | #include 13 | #include 14 | #import 15 | 16 | static uint16_t reg[S_CPU_REGISTER_MAX]; 17 | static uint16_t dummyreg[5]; 18 | static uint8_t cpu_signal = 0; 19 | 20 | void send_cpu(uint8_t signal) 21 | { 22 | cpu_signal = signal; 23 | } 24 | 25 | uint16_t* getPointer(uint16_t value, uint8_t quad) 26 | { 27 | if (value < 65) { 28 | return ®[value]; 29 | } else { 30 | dummyreg[quad] = value - 65; 31 | return &dummyreg[quad]; 32 | } 33 | } 34 | 35 | void evaluate(int *i, int mode, int reg1, int reg2, int jmpaddr) 36 | { 37 | if(mode == 0) { // EQUALS 38 | if(reg1 == reg2) { 39 | *i = jmpaddr - 1; 40 | } 41 | } else if(mode == 1) { 42 | if(reg1 > reg2) { 43 | *i = jmpaddr - 1; 44 | } 45 | } else if(mode == 2) { 46 | if(reg1 < reg2) { 47 | *i = jmpaddr - 1; 48 | } 49 | } else if(mode == 3) { 50 | if(reg1 != reg2) { 51 | *i = jmpaddr - 1; 52 | } 53 | } 54 | } 55 | 56 | void *execute(void *arg) 57 | { 58 | cpu_signal = 0; 59 | 60 | proc *proccess = (proc *)arg; 61 | 62 | for(int i = 0; i < S_CPU_REGISTER_MAX; i++) { 63 | reg[i] = 0; 64 | } 65 | 66 | uint16_t *ptr1; 67 | uint16_t *ptr2; 68 | uint16_t *ptr3; 69 | uint16_t *ptr4; 70 | uint16_t *ptr5; 71 | uint8_t instruction; 72 | 73 | printf("[cpu] initialised\n"); 74 | printf("[cpu] executing\n"); 75 | 76 | for(int i = 0; i < 1000; i++) { 77 | if(cpu_signal != 0) { 78 | return NULL; 79 | } 80 | 81 | instruction = *(proccess->page[0]->memory[i][0]); 82 | 83 | ptr1 = getPointer(*(proccess->page[0]->memory[i][1]), 1); 84 | ptr2 = getPointer(*(proccess->page[0]->memory[i][2]), 2); 85 | ptr3 = getPointer(*(proccess->page[0]->memory[i][3]), 3); 86 | ptr4 = getPointer(*(proccess->page[0]->memory[i][4]), 4); 87 | ptr5 = getPointer(*(proccess->page[0]->memory[i][5]), 5); 88 | 89 | switch(instruction) { 90 | case EXT: printf("[cpu] exited on line %d\n", i); return 0; 91 | case STO: *ptr1 = *ptr2; break; 92 | case ADD: *ptr1 += *ptr2; break; 93 | case SUB: *ptr1 -= *ptr2; break; 94 | case MUL: *ptr1 *= *ptr2; break; 95 | case DIV: *ptr1 /= *ptr2; break; 96 | case DSP: printf("[cpu] %d\n", *ptr1); break; 97 | case JMP: i = *ptr1 -1; break; 98 | case IFQ: evaluate(&i, *ptr1, *ptr2, *ptr3, *ptr4); break; 99 | case MUS: periphalMUS(proccess->page[2], ptr1, ptr2, ptr3); break; 100 | case RAN: rdrand(ptr1, *ptr2, *ptr3); break; 101 | case GPX: usleep(50); setpixel(*ptr1, *ptr2, *ptr3); break; 102 | case GDL: usleep(50); drawLine(*ptr1, *ptr2, *ptr3, *ptr4, *ptr5); break; 103 | case GDC: usleep(50); drawCharacter(*ptr1, *ptr2, *ptr3, *ptr4); break; 104 | case GCS: usleep(50); clearScreen(); break; 105 | case GGC: usleep(50); *ptr1 = getColorOfPixel(*ptr2, *ptr3); break; 106 | case SSP: sleep(*ptr1); break; 107 | case NSP: usleep(*ptr1 * *ptr2 * *ptr3); break; 108 | default: printf("[cpu] 0x%02x is illegal\n", i); return NULL; 109 | } 110 | } 111 | 112 | return NULL; 113 | } 114 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/CPU/peripheral.h: -------------------------------------------------------------------------------- 1 | // 2 | // peripheral.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 01.10.24. 6 | // 7 | 8 | #import "../../Sean16.h" 9 | #import 10 | #import 11 | 12 | void periphalMUS(page_t *periphals, uint16_t *x, uint16_t *y, uint16_t *btn); 13 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/CPU/peripheral.m: -------------------------------------------------------------------------------- 1 | // 2 | // peripheral.m 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 01.10.24. 6 | // 7 | 8 | #import "peripheral.h" 9 | 10 | void periphalMUS(page_t *periphals, uint16_t *x, uint16_t *y, uint16_t *btn) { 11 | CGPoint *mouseptr = *((CGPoint **)&periphals->memory[0][0]); 12 | NSInteger *btnptr = *((NSInteger **)&periphals->memory[0][1]); 13 | 14 | // getting values 15 | *x = (uint16_t)mouseptr->x; 16 | *y = (uint16_t)mouseptr->y; 17 | *btn = *btnptr; 18 | 19 | // reset btnptr 20 | *btnptr = 0; 21 | } 22 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/CPU/rdrand.c: -------------------------------------------------------------------------------- 1 | // 2 | // rdrand.c 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 03.10.24. 6 | // 7 | 8 | #include "rdrand.h" 9 | #include 10 | 11 | void rdrand(uint16_t *ptr, uint16_t min, uint16_t max) { 12 | if (min > max) { 13 | uint16_t temp = min; 14 | min = max; 15 | max = temp; 16 | } 17 | uint16_t rand_val = arc4random_uniform(max - min + 1) + min; 18 | *ptr = rand_val; 19 | } 20 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/CPU/rdrand.h: -------------------------------------------------------------------------------- 1 | // 2 | // rdrand.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 03.10.24. 6 | // 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #ifndef rdrand_h 14 | #define rdrand_h 15 | 16 | void rdrand(uint16_t *ptr, uint16_t min, uint16_t max); 17 | 18 | #endif /* rdrand_h */ 19 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/GPU/gpu.h: -------------------------------------------------------------------------------- 1 | // 2 | // gpu.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 27.09.24. 6 | // 7 | 8 | #ifndef gpu_h 9 | #define gpu_h 10 | 11 | void clearScreen(void); 12 | void setpixel(int x, int y, uint8_t color); 13 | uint8_t getColorOfPixel(uint8_t x, uint8_t y); 14 | void drawLine(int x0, int y0, int x1, int y1, uint8_t color); 15 | void drawCharacter(uint8_t x, uint8_t y, char ascii, uint8_t color); 16 | 17 | #endif /* gpu_h */ 18 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Peripherals/Display/Display.h: -------------------------------------------------------------------------------- 1 | // 2 | // Display.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 27.09.24. 6 | // 7 | 8 | #import 9 | 10 | @interface MyScreenEmulatorView : UIView 11 | 12 | - (instancetype)initWithFrame:(CGRect)frame screenWidth:(NSInteger)width screenHeight:(NSInteger)height; 13 | - (void)setPixelAtX:(NSInteger)x y:(NSInteger)y colorIndex:(NSUInteger)colorIndex; 14 | - (UIColor *)colorAtPixelX:(NSInteger)x y:(NSInteger)y; 15 | - (NSInteger)colorIndexAtPixelX:(NSInteger)x y:(NSInteger)y; 16 | - (void)clear; 17 | 18 | @end 19 | 20 | MyScreenEmulatorView *getEmulator(void); 21 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Peripherals/Mouse/Mouse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mouse.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 05.10.24. 6 | // 7 | 8 | #import 9 | 10 | @interface TouchTracker : NSObject 11 | 12 | @property (nonatomic, assign) CGPoint touchPosition; 13 | @property (nonatomic, assign) NSInteger lastTouchState; 14 | 15 | - (instancetype)initWithView:(UIView *)view scale:(CGFloat)scale; 16 | - (void)startTracking; 17 | - (void)stopTracking; 18 | - (CGPoint*)getPos; 19 | - (NSInteger*)getBtn; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/Peripherals/Mouse/Mouse.m: -------------------------------------------------------------------------------- 1 | // 2 | // Mouse.m 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 05.10.24. 6 | // 7 | 8 | #import "Mouse.h" 9 | 10 | @interface TouchTracker () 11 | 12 | @property (nonatomic, strong) UIView *trackedView; 13 | @property (nonatomic, assign) BOOL isTrackingPaused; 14 | @property (nonatomic, assign) BOOL touchHidden; 15 | @property (nonatomic, assign) CGFloat scaleFactor; // New property for scaling 16 | 17 | @end 18 | 19 | @implementation TouchTracker 20 | 21 | - (instancetype)initWithView:(UIView *)view scale:(CGFloat)scale { 22 | self = [super init]; 23 | if (self) { 24 | _touchPosition = CGPointMake(0, 0); 25 | _isTrackingPaused = YES; // Initially paused 26 | _lastTouchState = 0; 27 | _trackedView = view; 28 | _scaleFactor = scale; 29 | 30 | // Gesture recognizer for touch events 31 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; 32 | [view addGestureRecognizer:panGesture]; 33 | 34 | // Tap gesture recognizer for touch events 35 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; 36 | [view addGestureRecognizer:tapGesture]; 37 | } 38 | return self; 39 | } 40 | 41 | - (void)setScaleFactor:(CGFloat)scaleFactor { 42 | _scaleFactor = scaleFactor; 43 | } 44 | 45 | - (void)startTracking { 46 | if (!self.isTrackingPaused) { 47 | return; // Already tracking 48 | } 49 | 50 | self.isTrackingPaused = NO; 51 | self.touchHidden = NO; // Ensure the touch is visible 52 | } 53 | 54 | - (void)stopTracking { 55 | self.isTrackingPaused = YES; 56 | self.touchHidden = YES; // Optionally hide touch indicator 57 | } 58 | 59 | - (CGPoint*)getPos { 60 | return &_touchPosition; 61 | } 62 | 63 | - (NSInteger*)getBtn { 64 | return &_lastTouchState; 65 | } 66 | 67 | - (void)handlePan:(UIPanGestureRecognizer *)gesture { 68 | if (self.isTrackingPaused) return; 69 | 70 | CGPoint location = [gesture locationInView:self.trackedView]; 71 | [self updateTouchPosition:location]; 72 | } 73 | 74 | - (void)handleTap:(UITapGestureRecognizer *)gesture { 75 | if (self.isTrackingPaused) return; 76 | 77 | CGPoint location = [gesture locationInView:self.trackedView]; 78 | self.lastTouchState = 2; // Represents a touch 79 | [self updateTouchPosition:location]; 80 | } 81 | 82 | - (void)updateTouchPosition:(CGPoint)location { 83 | // Ensure the touch position is within the view bounds 84 | if (CGRectContainsPoint(self.trackedView.bounds, location)) { 85 | // Adjust the touch position based on the scale factor 86 | CGPoint scaledLocation = CGPointMake(location.x / self.scaleFactor, location.y / self.scaleFactor); 87 | 88 | // Update the touch position with the scaled value 89 | self.touchPosition = scaledLocation; 90 | 91 | // Optional: Log or handle the touch position 92 | //NSLog(@"Touch position: (%.2f, %.2f)", scaledLocation.x, scaledLocation.y); 93 | } 94 | } 95 | 96 | @end 97 | 98 | static TouchTracker *touchTrackerInstance = nil; 99 | 100 | TouchTracker *getTracker(void *arg) { 101 | // Ensure arg is a valid UIView pointer 102 | UIView *view = (__bridge UIView *)arg; 103 | 104 | if (touchTrackerInstance == nil) { 105 | CGRect screenSize = [[UIScreen mainScreen] bounds]; 106 | CGFloat screenWidth = screenSize.size.width; 107 | CGFloat screenHeight = screenSize.size.height; 108 | 109 | touchTrackerInstance = [[TouchTracker alloc] initWithView:view scale:(screenWidth / 254.0)]; 110 | } 111 | 112 | return touchTrackerInstance; 113 | } -------------------------------------------------------------------------------- /Essentials/libsean/SOC/RAM/ram.c: -------------------------------------------------------------------------------- 1 | // 2 | // ram.c 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #include "ram.h" 9 | 10 | uint8_t RAMDISK[S_RAMSIZE_MAX]; 11 | uint16_t current_page = 0; 12 | uint32_t current_addr = 0; 13 | 14 | typedef struct FreePageNode { 15 | page_t *page; 16 | struct FreePageNode *next; 17 | } FreePageNode; 18 | 19 | static FreePageNode *free_pages = NULL; 20 | 21 | page_t* genpage(void) 22 | { 23 | if (free_pages != NULL) { 24 | FreePageNode *node = free_pages; 25 | page_t *page = node->page; 26 | free_pages = free_pages->next; 27 | free(node); 28 | for (int i = 0; i < 6; i++) { 29 | for (int j = 0; j < 1024; j++) { 30 | *(page->memory[i][j]) = 0; 31 | } 32 | } 33 | printf("[ram] reusing page %d\n", page->id); 34 | return page; 35 | } else if (current_addr + (1024 * 6) > S_RAMSIZE_MAX) { 36 | return NULL; 37 | } 38 | 39 | page_t *page = malloc(sizeof(page_t)); 40 | if (page == NULL) { 41 | printf("[ram] ram fault\n"); 42 | return NULL; 43 | } 44 | 45 | page->id = current_page; 46 | 47 | for (int i = 0; i < 6; i++) { 48 | for (int j = 0; j < 1024; j++) { 49 | page->memory[i][j] = &RAMDISK[current_addr]; 50 | current_addr++; 51 | } 52 | } 53 | 54 | printf("[ram] %'d bytes left (%.2f MB) <- addr %d\n", 55 | S_RAMSIZE_MAX - current_addr, 56 | (S_RAMSIZE_MAX - current_addr) / (1024.0 * 1024.0), 57 | current_addr); 58 | 59 | current_page += 1; 60 | return page; 61 | } 62 | 63 | void freepage(page_t *page) 64 | { 65 | FreePageNode *node = malloc(sizeof(FreePageNode)); 66 | if (node == NULL) { 67 | printf("[ram] Unable to free page: Out of memory\n"); 68 | return; 69 | } 70 | node->page = page; 71 | node->next = free_pages; 72 | free_pages = node; 73 | printf("[ram] page %d freed\n", page->id); 74 | } 75 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/RAM/ram.h: -------------------------------------------------------------------------------- 1 | // 2 | // ram.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 27.09.24. 6 | // 7 | 8 | #ifndef ram_h 9 | #define ram_h 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define S_RAMSIZE_MAX 100000 17 | 18 | typedef struct { 19 | uint16_t id; 20 | uint8_t *memory[1024][6]; 21 | } page_t; 22 | 23 | page_t* genpage(void); 24 | void freepage(page_t *page); 25 | 26 | #endif /* ram_h */ 27 | -------------------------------------------------------------------------------- /Essentials/libsean/SOC/VFS/mgr.m: -------------------------------------------------------------------------------- 1 | // 2 | // fs-init.m 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 05.10.24. 6 | // 7 | 8 | #import "fs.h" 9 | 10 | VirtualFileSystem *vfs; 11 | 12 | // check function 13 | uint8_t fs_check(void) { 14 | if(vfs == NULL) { 15 | return 0; 16 | } 17 | 18 | return 1; 19 | } 20 | 21 | // head functions 22 | void fs_init(void) { 23 | if(vfs == NULL) { 24 | // Get the path to the app's Documents directory in the app container 25 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 26 | NSString *documentsDirectory = [paths firstObject]; 27 | 28 | // Path to the virtual file system file 29 | NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"virtualFS.dat"]; 30 | 31 | NSUInteger fsSize = 10 * 1024 * 1024; // 10 MB virtual file system size 32 | vfs = [[VirtualFileSystem alloc] initWithFilePath:filePath size:fsSize]; 33 | [vfs formatFileSystem]; 34 | } 35 | } 36 | 37 | void fs_format(void) { 38 | if(vfs != NULL) { 39 | [vfs formatFileSystem]; 40 | } 41 | } 42 | 43 | // management functions 44 | void fs_mkdir(char *path) { 45 | if(vfs != NULL) { 46 | vfs_mkdir(vfs.rootDirectory, [NSString stringWithFormat:@"%s", path]); 47 | } 48 | } 49 | 50 | void fs_rmdir(char *path) { 51 | if(vfs != NULL) { 52 | vfs_rmdir(vfs.rootDirectory, [NSString stringWithFormat:@"%s", path]); 53 | } 54 | } 55 | 56 | void fs_cfile(char *path, char *content) { 57 | if(vfs != NULL) { 58 | vfs_create_file(vfs.rootDirectory, [NSString stringWithFormat:@"%s", path], [[NSString stringWithFormat:@"%s", content] dataUsingEncoding:NSUTF8StringEncoding]); 59 | } 60 | } 61 | 62 | void fs_dfile(char *path) { 63 | if(vfs != NULL) { 64 | vfs_delete_file(vfs.rootDirectory, [NSString stringWithFormat:@"%s", path]); 65 | } 66 | } 67 | 68 | const char* fs_rfile(char *path) { 69 | if(vfs != NULL) { 70 | NSData *readContent = vfs_read_file(vfs.rootDirectory, [NSString stringWithFormat:@"%s", path]); 71 | NSString *content = [[NSString alloc] initWithData:readContent encoding:NSUTF8StringEncoding]; 72 | return [content UTF8String]; 73 | } 74 | 75 | return NULL; 76 | } 77 | -------------------------------------------------------------------------------- /Essentials/libsean/Sean16.h: -------------------------------------------------------------------------------- 1 | // 2 | // Sean16.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 05.10.24. 6 | // 7 | 8 | #ifndef Sean16_h 9 | #define Sean16_h 10 | 11 | #import 12 | #import 13 | #import 14 | #import 15 | 16 | #include 17 | #include 18 | 19 | void kickstart(NSString *path); 20 | TouchTracker *getTracker(void *arg); 21 | 22 | #define S_CPU_REGISTER_MAX 64 23 | //#define S_RAMSIZE_MAX 10000000 24 | 25 | #endif /* Sean16_h */ 26 | -------------------------------------------------------------------------------- /Essentials/libsean/kickstart.m: -------------------------------------------------------------------------------- 1 | // 2 | // kickstart.c 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 26.09.24. 6 | // 7 | 8 | #import 9 | 10 | #include "Sean16.h" 11 | #include "libasmfile.h" 12 | #include 13 | #include 14 | 15 | void kickstart(NSString *path) { 16 | uint8_t **asmData = sean16compiler([NSString stringWithFormat:@"sean16cmp %@ void", path]); 17 | 18 | if (asmData == NULL) { 19 | return; 20 | } 21 | 22 | uint8_t binmap[1000][6] = {0}; 23 | 24 | for (int i = 0; i < 1000; i++) { 25 | if (asmData[i] != NULL) { 26 | memcpy(binmap[i], asmData[i], sizeof(binmap[i])); 27 | } 28 | } 29 | 30 | for (size_t i = 0; i < 6; ++i) { 31 | free(asmData[i]); 32 | } 33 | 34 | free(asmData); 35 | 36 | bootloader(binmap); 37 | } 38 | -------------------------------------------------------------------------------- /Essentials/libsean/libasmfile.c: -------------------------------------------------------------------------------- 1 | // 2 | // libasmfile.c 3 | // Sean16Compiler 4 | // 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define MAX_INSTRUCTIONS 1000 11 | #define MAX_ARGS 6 12 | 13 | uint8_t** readasm(const char *filename) 14 | { 15 | uint8_t **array = (uint8_t **)malloc(MAX_INSTRUCTIONS * sizeof(uint8_t *)); 16 | if (array == NULL) { 17 | perror("Error allocating memory for rows"); 18 | return NULL; 19 | } 20 | 21 | for (int i = 0; i < MAX_INSTRUCTIONS; i++) { 22 | array[i] = (uint8_t *)malloc(MAX_ARGS * sizeof(uint8_t)); 23 | if (array[i] == NULL) { 24 | perror("Error allocating memory for columns"); 25 | for (int j = 0; j < i; j++) { 26 | free(array[j]); 27 | } 28 | free(array); 29 | return NULL; 30 | } 31 | } 32 | 33 | FILE *file = fopen(filename, "rb"); 34 | if (file == NULL) { 35 | perror("Error opening file"); 36 | for (int i = 0; i < MAX_INSTRUCTIONS; i++) { 37 | free(array[i]); 38 | } 39 | free(array); 40 | return NULL; 41 | } 42 | 43 | for (int i = 0; i < MAX_INSTRUCTIONS; i++) { 44 | if (fread(array[i], sizeof(uint8_t), MAX_ARGS, file) != MAX_ARGS) { 45 | if (feof(file)) { 46 | printf("Warning: End of file reached before reading all data.\n"); 47 | } else if (ferror(file)) { 48 | perror("Error reading file"); 49 | } 50 | break; 51 | } 52 | } 53 | 54 | fclose(file); 55 | 56 | return array; 57 | } 58 | 59 | void storeasm(const char *filename, uint8_t *values, size_t size) 60 | { 61 | FILE *file = fopen(filename, "wb"); 62 | if (file == NULL) { 63 | perror("Error opening file"); 64 | return; 65 | } 66 | 67 | size_t written = fwrite(values, sizeof(uint8_t), size, file); 68 | if (written != size) { 69 | perror("Error writing to file"); 70 | } 71 | 72 | fclose(file); 73 | } 74 | -------------------------------------------------------------------------------- /Essentials/libsean/libasmfile.h: -------------------------------------------------------------------------------- 1 | // 2 | // libasmfile.h 3 | // Sean16CPU 4 | // 5 | // Created by Frida Boleslawska on 02.10.24. 6 | // 7 | 8 | #ifndef libasmfile_h 9 | #define libasmfile_h 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #define MAX_INSTRUCTIONS 1000 16 | #define MAX_ARGS 6 17 | 18 | uint8_t** readasm(const char *filename); 19 | void storeasm(const char *filename, uint8_t *values, size_t size); 20 | 21 | #endif /* libasmfile_h */ 22 | -------------------------------------------------------------------------------- /Essentials/libsean/sdk: -------------------------------------------------------------------------------- 1 | ../../SDK -------------------------------------------------------------------------------- /FCM/Generic.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | // Basically the "bootup" of FridaCodeManager 4 | 5 | // fatal error handling 6 | func exitWithError(_ message: String) -> Never { 7 | fatalError(message) 8 | } 9 | 10 | // jbroot environment 11 | #if jailbreak 12 | let jbroot: String = { 13 | let preroot = String(cString: libroot_dyn_get_jbroot_prefix()) 14 | if FileManager.default.fileExists(atPath: preroot) { 15 | return preroot 16 | } else if let altroot = altroot(inPath: "/var/containers/Bundle/Application")?.path { 17 | return altroot 18 | } else { 19 | exitWithError("failed to determine jbroot") 20 | } 21 | }() 22 | #elseif trollstore 23 | let jbroot: String = "\(Bundle.main.bundlePath)/toolchain" 24 | #endif 25 | 26 | // global environment 27 | let global_container: String = { 28 | guard let path = contgen() else { 29 | exitWithError("failed to generate global container") 30 | } 31 | return path 32 | }() 33 | 34 | let global_documents = "\(global_container)/Documents" 35 | 36 | #if !stock 37 | let global_sdkpath = "\(global_container)/.sdk" 38 | #else 39 | let global_sdkpath = "\(global_documents)/.sdk" 40 | #endif 41 | 42 | let changelog: String = "v2.0.alpha_5 \"iPad + Code Editor Update\"\n\nApp\n-> optimized the overall code\n-> added copy button to console\n-> removing Wiki for now\n-> disabled auto correction on project creation popup\n\nCode Editor\n-> removing highlighting cache\n-> fixed backspace in space spacing mode\n-> added auto curly-braces, braces and string completion." 43 | let global_version: String = "v2.0.alpha_5" 44 | 45 | // compatibiloty checks 46 | let isiOS16: Bool = ProcessInfo.processInfo.isOperatingSystemAtLeast(OperatingSystemVersion(majorVersion: 16, minorVersion: 0, patchVersion: 0)) 47 | 48 | let isPad: Bool = { 49 | if UIDevice.current.userInterfaceIdiom == .pad { 50 | return true 51 | } else { 52 | return false 53 | } 54 | }() 55 | -------------------------------------------------------------------------------- /FCM/Main.swift: -------------------------------------------------------------------------------- 1 | /* 2 | main.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import SwiftUI 32 | 33 | @main 34 | struct MyApp: App { 35 | init() { 36 | UIInit(type: 0) 37 | 38 | if !UserDefaults.standard.bool(forKey: "UPDFIX_001") { 39 | setTheme(0) 40 | storeTheme() 41 | UserDefaults.standard.set(true, forKey: "UPDFIX_001") 42 | } 43 | 44 | if !UserDefaults.standard.bool(forKey: "UPDFIX_002") { 45 | UserDefaults.standard.set(0, forKey: "tabmode") 46 | UserDefaults.standard.set(4, forKey: "tabspacing") 47 | UserDefaults.standard.set(true, forKey: "UPDFIX_002") 48 | } 49 | 50 | if !UserDefaults.standard.bool(forKey: "UPDFIX_003") { 51 | UserDefaults.standard.set(true, forKey: "CEAutocomplete") 52 | UserDefaults.standard.set(true, forKey: "UPDFIX_003") 53 | } 54 | } 55 | 56 | var body: some Scene { 57 | WindowGroup { 58 | RootView() 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /FCM/ToolKit/AltRootToolKit.swift: -------------------------------------------------------------------------------- 1 | /* 2 | altroot.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import Foundation 32 | 33 | func altroot(inPath path: String) -> URL? { 34 | do { 35 | let contents = try FileManager.default.contentsOfDirectory(atPath: path) 36 | 37 | for item in contents { 38 | if item.hasPrefix(".jbroot-"), let folderURL = URL(string: path)?.appendingPathComponent(item) { 39 | return folderURL 40 | } 41 | } 42 | } catch { 43 | print("Error while searching for .jbroot folder: \(error.localizedDescription)") 44 | } 45 | return URL(fileURLWithPath: "/") 46 | } 47 | -------------------------------------------------------------------------------- /FCM/ToolKit/Compiling/API/api.swift: -------------------------------------------------------------------------------- 1 | /* 2 | api.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import Foundation 32 | 33 | func apicall(_ text: String,_ proj:Project, _ shell: Bool) -> String { 34 | var ret = text 35 | ret = rsc(repla(ret.replacingOccurrences(of: "", with: "1.2") 36 | .replacingOccurrences(of: "", with: "\(global_version)") 37 | .replacingOccurrences(of: "", with: "\(proj.BundleID)") 38 | .replacingOccurrences(of: "", with: "\(proj.Executable)") 39 | .replacingOccurrences(of: "", with: ghost()) 40 | .replacingOccurrences(of: "", with: gcpu()) 41 | .replacingOccurrences(of: "", with: garch()) 42 | .replacingOccurrences(of: "", with: gmodel()) 43 | .replacingOccurrences(of: "", with: gos()) 44 | .replacingOccurrences(of: "", with: gosver()) 45 | .replacingOccurrences(of: "", with: "\(proj.ProjectPath)") 46 | .replacingOccurrences(of: "", with: "\(Bundle.main.bundlePath)/include") 47 | .replacingOccurrences(of: "", with: "\(global_documents)/../"))) 48 | 49 | return ret 50 | } 51 | 52 | func repla(_ inputString: String) -> String { 53 | // Split the string into lines 54 | let lines = inputString.split(separator: "\n") 55 | 56 | // Trim each line and store the results 57 | let trimmedLines = lines.map { $0.trimmingCharacters(in: .whitespaces) } 58 | 59 | // Join the trimmed lines with " ; " as the delimiter 60 | return trimmedLines.joined(separator: " ; ") 61 | } 62 | 63 | func rsc(_ inputString: String) -> String { 64 | var trimmedString = inputString.trimmingCharacters(in: .whitespacesAndNewlines) 65 | 66 | if trimmedString.hasPrefix("; ") { 67 | trimmedString.removeFirst() 68 | } 69 | 70 | if trimmedString.hasSuffix(" ;") { 71 | trimmedString.removeLast() 72 | } 73 | 74 | return trimmedString 75 | } 76 | -------------------------------------------------------------------------------- /FCM/ToolKit/Compiling/API/data/tag.swift: -------------------------------------------------------------------------------- 1 | /* 2 | tag.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import Foundation 32 | import UIKit 33 | 34 | struct ext { 35 | let build: String 36 | let build_sub: String 37 | let bef: String 38 | let aft: String 39 | let ign: String 40 | } 41 | 42 | func tags(_ inputString: String,_ tag: String) -> String { 43 | do { 44 | let regex = try NSRegularExpression(pattern: "<\(tag)>(.*?)", options: .dotMatchesLineSeparators) 45 | if let match = regex.firstMatch(in: inputString, options: [], range: NSRange(location: 0, length: inputString.utf16.count)) { 46 | if let range = Range(match.range(at: 1), in: inputString) { 47 | return String(inputString[range]) 48 | } 49 | } 50 | } catch { 51 | print("Error creating regular expression: \(error.localizedDescription)") 52 | } 53 | 54 | return "" 55 | } 56 | -------------------------------------------------------------------------------- /FCM/ToolKit/Compiling/API/load.swift: -------------------------------------------------------------------------------- 1 | /* 2 | load.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | func load(_ file: String) -> String { 32 | do { 33 | return try String(contentsOfFile: file) 34 | } catch { 35 | return "" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /FCM/ToolKit/Compiling/API/run.swift: -------------------------------------------------------------------------------- 1 | /* 2 | run.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | func api(_ text: String,_ Project:Project) -> ext { 32 | //api class 33 | let apiclass: String = tags(text,"api") 34 | 35 | //version Definition 36 | //lets you choose what version of the api you wanna use 37 | let usever = tags(apiclass,"version") 38 | 39 | //initialise stuff 40 | var (build, build_sub, before, after, ignore) = ("", "", "", "", "") 41 | 42 | //subclasses 43 | if usever == "1.2" { 44 | 45 | } 46 | if usever == "1.1" { 47 | (build, build_sub, before, after, ignore) = (tags(apiclass,"build"), tags(apiclass,"build-object"),tags(apiclass,"exec-before"), tags(apiclass,"exec-after"), tags(apiclass,"compiler-ignore-content")) 48 | } else { 49 | //translation to old API 50 | (build, build_sub, before, after, ignore) = (tags(apiclass,"build"), tags(apiclass,"build"),tags(apiclass,"exec-before"), tags(apiclass,"exec-after"), tags(apiclass,"compiler-ignore-content")) 51 | } 52 | 53 | return ext(build: apicall(build,Project,false), build_sub: apicall(build_sub,Project,false), bef: apicall(before,Project,true), aft: apicall(after,Project,true), ign: apicall(ignore,Project,false)) 54 | } 55 | -------------------------------------------------------------------------------- /FCM/ToolKit/Compiling/Sean16.swift: -------------------------------------------------------------------------------- 1 | 2 | func runtime_sean16(_ project: Project) -> Void { 3 | kickstart("\(project.ProjectPath)/main.asm") 4 | } 5 | -------------------------------------------------------------------------------- /FCM/ToolKit/FeedbackToolKit.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | let generator = UINotificationFeedbackGenerator() 4 | 5 | //Haptic Feedback 6 | func haptfeedback(_ type: Int) -> Void { 7 | switch(type) { 8 | case 1: 9 | generator.notificationOccurred(.success) 10 | return 11 | case 2: 12 | generator.notificationOccurred(.error) 13 | return 14 | default: 15 | return 16 | } 17 | } 18 | 19 | //Alert Feedback 20 | func ShowAlert(_ alert: UIAlertController) -> Void { 21 | DispatchQueue.main.async { 22 | guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, 23 | let keyWindow = windowScene.keyWindow, 24 | let rootViewController = keyWindow.rootViewController else { 25 | return 26 | } 27 | 28 | // Find the topmost view controller to present the alert from 29 | var topController = rootViewController 30 | while let presentedController = topController.presentedViewController { 31 | topController = presentedController 32 | } 33 | topController.present(alert, animated: true, completion: nil) 34 | } 35 | } 36 | 37 | func DismissAlert(completion: (() -> Void)? = nil) { 38 | DispatchQueue.main.async { 39 | guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, 40 | let keyWindow = windowScene.keyWindow, 41 | let rootViewController = keyWindow.rootViewController else { 42 | completion?() 43 | return 44 | } 45 | 46 | var topController = rootViewController 47 | while let presentedController = topController.presentedViewController { 48 | topController = presentedController 49 | } 50 | 51 | topController.dismiss(animated: true) { 52 | completion?() 53 | } 54 | } 55 | } 56 | 57 | func showAlert(with message: String) { 58 | // Create the alert controller 59 | let alert = UIAlertController(title: "", message: message, preferredStyle: .alert) 60 | 61 | // Create the OK action 62 | let okAction = UIAlertAction(title: "Close", style: .default, handler: nil) 63 | 64 | // Add the action to the alert 65 | alert.addAction(okAction) 66 | 67 | // Present the alert 68 | ShowAlertAdv(alert) 69 | } 70 | 71 | func ShowAlertAdv(_ alert: UIAlertController) { 72 | DispatchQueue.main.async { 73 | guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, 74 | let keyWindow = windowScene.keyWindow, 75 | let rootViewController = keyWindow.rootViewController else { 76 | return 77 | } 78 | 79 | // Find the topmost view controller to present the alert from 80 | var topController = rootViewController 81 | while let presentedController = topController.presentedViewController { 82 | topController = presentedController 83 | } 84 | topController.present(alert, animated: true, completion: nil) 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /FCM/ToolKit/FontToolKit.swift: -------------------------------------------------------------------------------- 1 | /* 2 | Font.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import UIKit 32 | 33 | func guif() -> [String] { 34 | var fontFamilies = UIFont.familyNames 35 | fontFamilies.sort { (family1, family2) in 36 | if family1.lowercased() == "menlo" { 37 | return true 38 | } else if family2.lowercased() == "menlo" { 39 | return false 40 | } 41 | return family1.lowercased() < family2.lowercased() 42 | } 43 | return fontFamilies 44 | } 45 | 46 | func gsuffix(from fileName: String) -> String { 47 | let trimmedFileName = fileName.replacingOccurrences(of: " ", with: "") 48 | let suffix = URL(string: trimmedFileName)?.pathExtension 49 | return suffix ?? "" 50 | } 51 | -------------------------------------------------------------------------------- /FCM/ToolKit/LogToolKit.swift: -------------------------------------------------------------------------------- 1 | /* 2 | LogToolKit.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | func climessenger(_ title: String,_ text: String,_ command: String? = "",_ uid: uid_t? = 501,_ env: [String]? = []) -> Int { 32 | let marks: Int = (36 - title.count) / 2 33 | let slice = String(repeating: "+", count: marks) 34 | let command = command ?? "echo" 35 | var code = 0 36 | if command.isEmpty { 37 | print("\(slice) \(title) \(slice)\n\(text)\n++++++++++++++++++++++++++++++++++++++\n ") 38 | } else { 39 | print("\(slice) \(title) \(slice)") 40 | #if !stock 41 | code = shell("\(command)",uid: (uid ?? 501), env: (env ?? [])) 42 | #else 43 | print("shell symbol is not supported on stock") 44 | #endif 45 | print("++++++++++++++++++++++++++++++++++++++\n ") 46 | } 47 | return code 48 | } 49 | -------------------------------------------------------------------------------- /FCM/ToolKit/NSRangeToolKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSRangeKit.swift 3 | // Editor 4 | // 5 | // Created by fridakitten on 31.10.24. 6 | // 7 | 8 | import Foundation 9 | import UIKit 10 | 11 | func findRanges(of word: String, in text: String) -> [NSRange] { 12 | let nsText = NSString(string: text) 13 | var ranges: [NSRange] = [] 14 | 15 | var searchRange = NSRange(location: 0, length: nsText.length) 16 | 17 | while true { 18 | let range = nsText.range(of: word, options: [], range: searchRange) 19 | 20 | if range.location == NSNotFound { 21 | break 22 | } 23 | 24 | ranges.append(range) 25 | 26 | let newLocation = range.location + range.length 27 | searchRange = NSRange(location: newLocation, length: nsText.length - newLocation) 28 | } 29 | 30 | return ranges 31 | } 32 | 33 | func setSelectedTextRange(for textView: UITextView, with askedRange: NSRange) { 34 | guard let text = textView.text, 35 | askedRange.location != NSNotFound, 36 | askedRange.location + askedRange.length <= text.count else { 37 | return 38 | } 39 | 40 | let caretRange = NSRange(location: askedRange.location + askedRange.length, length: 0) 41 | 42 | let startPosition = textView.position(from: textView.beginningOfDocument, offset: caretRange.location) 43 | let endPosition = textView.position(from: startPosition!, offset: 0) 44 | 45 | let textRange = textView.textRange(from: startPosition!, to: endPosition!) 46 | textView.selectedTextRange = textRange 47 | } 48 | 49 | func visualRangeRect(in textView: UITextView, for textRange: NSRange) -> CGRect? { 50 | guard textRange.location != NSNotFound, 51 | textRange.location + textRange.length <= textView.textStorage.length else { 52 | return nil 53 | } 54 | 55 | let layoutManager = textView.layoutManager 56 | let textContainer = textView.textContainer 57 | let glyphRange = layoutManager.glyphRange(forCharacterRange: textRange, actualCharacterRange: nil) 58 | 59 | var rect = layoutManager.boundingRect(forGlyphRange: glyphRange, in: textContainer) 60 | 61 | rect.origin.x += textView.textContainerInset.left 62 | rect.origin.y += textView.textContainerInset.top 63 | 64 | return rect 65 | } 66 | 67 | func currentLine(in textView: UITextView) -> String? { 68 | guard let text = textView.text, let selectedRange = textView.selectedTextRange else { 69 | return nil 70 | } 71 | 72 | let caretPosition = selectedRange.start 73 | let textBeforeCaret = text[.. Int { 85 | guard !word.isEmpty, text.hasPrefix(word) else { 86 | return 0 87 | } 88 | 89 | var count = 0 90 | var index = text.startIndex 91 | 92 | while text[index...].hasPrefix(word) { 93 | count += 1 94 | index = text.index(index, offsetBy: word.count) 95 | 96 | if index >= text.endIndex { 97 | break 98 | } 99 | } 100 | 101 | return count 102 | } 103 | -------------------------------------------------------------------------------- /FCM/ToolKit/SwitchToolKit.swift: -------------------------------------------------------------------------------- 1 | /* 2 | TrampolineSwitch.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import SwiftUI 32 | 33 | extension Binding where Value: Equatable { 34 | private func trampolineIfNeeded(to: Value, via: Value) { 35 | if wrappedValue == to { 36 | wrappedValue = via 37 | DispatchQueue.main.asyncAfter(deadline: .now()+0.2, execute: { 38 | wrappedValue = to 39 | }) 40 | } else { 41 | wrappedValue = to 42 | } 43 | } 44 | } 45 | 46 | extension Binding where Value == Bool { 47 | private func trampolineIfNeeded(to: Value) { 48 | trampolineIfNeeded(to: to, via: !to) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /FCM/UI/FluidGradient/CGPoint+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGPoint+Extensions.swift 3 | // 4 | // 5 | // Created by João Gabriel Pozzobon dos Santos on 03/10/22. 6 | // 7 | 8 | import CoreGraphics 9 | 10 | extension CGPoint { 11 | /// Build a point from an origin and a displacement 12 | func displace(by point: CGPoint = .init(x: 0.0, y: 0.0)) -> CGPoint { 13 | return CGPoint(x: self.x+point.x, 14 | y: self.y+point.y) 15 | } 16 | 17 | /// Caps the point to the unit space 18 | func capped() -> CGPoint { 19 | return CGPoint(x: max(min(x, 1), 0), 20 | y: max(min(y, 1), 0)) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /FCM/UI/FluidGradient/ResizableLayer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ResizableLayer.swift 3 | // ResizableLayer 4 | // 5 | // Created by João Gabriel Pozzobon dos Santos on 03/10/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// An implementation of ``CALayer`` that resizes its sublayers 11 | public class ResizableLayer: CALayer { 12 | override init() { 13 | super.init() 14 | #if os(OSX) 15 | autoresizingMask = [.layerWidthSizable, .layerHeightSizable] 16 | #endif 17 | sublayers = [] 18 | } 19 | 20 | public override init(layer: Any) { 21 | super.init(layer: layer) 22 | } 23 | 24 | required init?(coder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | 28 | public override func layoutSublayers() { 29 | super.layoutSublayers() 30 | sublayers?.forEach { layer in 31 | layer.frame = self.frame 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /FCM/UI/Popup/Items/ButtonBar.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct POButtonBar: View { 4 | let cancel: () -> Void 5 | let confirm: () -> Void 6 | var body: some View { 7 | HStack { 8 | Button(action: { 9 | cancel() 10 | }, label: { 11 | Text("Cancel") 12 | }) 13 | .frame(width: 80, height: 36) 14 | .background(Color(.systemBackground).opacity(0.7)) 15 | .foregroundColor(.primary) 16 | .cornerRadius(10) 17 | Spacer() 18 | Button(action: { 19 | confirm() 20 | }, label: { 21 | Text("Confirm") 22 | }) 23 | .frame(width: 80, height: 36) 24 | .background(Color(.systemBackground).opacity(0.7)) 25 | .foregroundColor(.primary) 26 | .cornerRadius(10) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /FCM/UI/Popup/Items/Header.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct POHeader: View { 4 | var title: String 5 | 6 | var body: some View { 7 | HStack { 8 | Text(title) 9 | .font(.system(size: 25, weight: .bold, design: .default)) 10 | .foregroundColor(.primary) 11 | Spacer() 12 | } 13 | } 14 | } 15 | 16 | struct POBHeader: View { 17 | @Binding var title: String 18 | 19 | var body: some View { 20 | HStack { 21 | Text(title) 22 | .font(.system(size: 25, weight: .bold, design: .default)) 23 | .foregroundColor(.primary) 24 | Spacer() 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /FCM/UI/Popup/Items/Picker.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct PickerItems: Identifiable { 4 | let id: Int 5 | let name: String 6 | } 7 | 8 | struct PickerArrays: Identifiable { 9 | let id: UUID = UUID() 10 | let title: String 11 | let items: [PickerItems] 12 | } 13 | 14 | struct POPicker: View { 15 | let function: () -> Void 16 | 17 | var title: String 18 | var arrays: [PickerArrays] 19 | @Binding var type: Int 20 | 21 | var body: some View { 22 | HStack { 23 | VStack { 24 | HStack { 25 | Spacer().frame(width: 10) 26 | Text(title) 27 | .foregroundColor(.primary) 28 | Spacer() 29 | Picker("", selection: $type) { 30 | if isiOS16 { 31 | ForEach(arrays) { item in 32 | Section(header: Text(item.title)) { 33 | ForEach(item.items) { subItem in 34 | Text(subItem.name).tag(subItem.id) 35 | } 36 | } 37 | } 38 | } else { 39 | ForEach(arrays.reversed()) { item in 40 | Section { 41 | ForEach(item.items.reversed()) { subItem in 42 | Text("\(subItem.name) (\(item.title))").tag(subItem.id) 43 | } 44 | } 45 | } 46 | } 47 | } 48 | .pickerStyle(MenuPickerStyle()) 49 | Spacer() 50 | } 51 | } 52 | .frame(height: 36) 53 | .background(Color(.systemBackground).opacity(0.7)) 54 | .foregroundColor(.primary) 55 | .accentColor(.secondary) 56 | .cornerRadius(10) 57 | 58 | Spacer() 59 | 60 | Button(action: { 61 | function() 62 | }, label: { 63 | Text("Submit") 64 | .frame(width: 80, height: 36) 65 | .background(Color(.systemBackground).opacity(0.7)) 66 | .foregroundColor(.primary) 67 | .cornerRadius(10) 68 | }) 69 | } 70 | .frame(height: 36) 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /FCM/UI/Popup/Items/TextField.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct POTextField: View { 4 | var title: String 5 | @Binding var content: String 6 | 7 | var body: some View { 8 | TextField(title, text: $content) 9 | .frame(height: 36) 10 | .padding(.horizontal, 10) 11 | .background(Color(.systemBackground).opacity(0.7)) 12 | .cornerRadius(10) 13 | .autocapitalization(.none) 14 | .disableAutocorrection(true) 15 | .keyboardType(.asciiCapable) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/ProjectManagement/MacroManager.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class MacroManager { 4 | private var plistData: [String: Any] = [:] 5 | var plistPath: String = "" 6 | 7 | func getCurrentMacro() -> String? { 8 | return plistData["CMacro"] as? String 9 | } 10 | 11 | func setCurrentMacro(to newMacro: String) { 12 | plistData["CMacro"] = newMacro 13 | } 14 | 15 | func getAllMacros() -> [String] { 16 | guard let macroDict = plistData["Macro"] as? [String: Any] else { 17 | return [] 18 | } 19 | return Array(macroDict.keys) 20 | } 21 | 22 | func addMacro(_ macroName: String) { 23 | var macroDict = plistData["Macro"] as? [String: Any] ?? [:] 24 | macroDict[macroName] = [:] 25 | plistData["Macro"] = macroDict 26 | } 27 | 28 | func removeMacro(_ macroName: String) { 29 | var macroDict = plistData["Macro"] as? [String: Any] ?? [:] 30 | macroDict.removeValue(forKey: macroName) 31 | plistData["Macro"] = macroDict 32 | } 33 | 34 | func loadPlist() { 35 | do { 36 | let plistData = try Data(contentsOf: URL(fileURLWithPath: plistPath)) 37 | if let plistDictionary = try PropertyListSerialization.propertyList(from: plistData, format: nil) as? [String: Any] { 38 | self.plistData = plistDictionary 39 | } 40 | } catch { 41 | } 42 | } 43 | 44 | func savePlist() { 45 | if let plistURL = URL(string: "file://\(plistPath)") { 46 | do { 47 | let plistData = try PropertyListSerialization.data(fromPropertyList: self.plistData, format: .xml, options: 0) 48 | try plistData.write(to: plistURL) 49 | print("Plist saved successfully to Documents directory.") 50 | } catch { 51 | print("Error saving plist: \(error)") 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/ProjectManagement/Sean16Stuff.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | let serialQueue = DispatchQueue.global(qos: .background) 4 | let screenSize = UIScreen.main.bounds 5 | let screenWidth = screenSize.width 6 | let screenHeight = screenSize.height 7 | 8 | struct ScreenEmulator: UIViewRepresentable { 9 | func makeUIView(context: Context) -> UIView { 10 | guard let screenEmulator = getEmulator() else { 11 | return UIView() 12 | } 13 | _ = getTracker(UnsafeMutableRawPointer(Unmanaged.passUnretained(screenEmulator).toOpaque())) 14 | return screenEmulator 15 | } 16 | 17 | func updateUIView(_ uiView: UIView, context: Context) -> Void { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/Cleaner/CleanerBundleMain.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct Cleaner: View { 4 | var body: some View { 5 | List { 6 | Button(action: { 7 | clean(1) 8 | }) { 9 | Label("Clean Module Cache", systemImage: "trash.fill") 10 | } 11 | Button(action: { 12 | clean(2) 13 | }) { 14 | Label("Clean Temporary Data", systemImage: "trash.fill") 15 | } 16 | } 17 | .navigationTitle("Cleaner") 18 | .navigationBarTitleDisplayMode(.inline) 19 | } 20 | 21 | private func clean(_ arg: Int) { 22 | DispatchQueue.global(qos: .utility).async { 23 | ShowAlert(UIAlertController(title: "Cleaning", message: "", preferredStyle: .alert)) 24 | let path: String = { 25 | switch(arg) { 26 | case 1: 27 | return "\(global_documents)/../.cache" 28 | case 2: 29 | return "\(global_documents)/../tmp" 30 | default: 31 | return "\(global_documents)/../.cache" 32 | } 33 | }() 34 | if FileManager.default.fileExists(atPath: path) { 35 | do { 36 | try adv_rm( atPath: path) 37 | } catch { 38 | } 39 | } 40 | DismissAlert() 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/DumpLog/DumpLogBundleMain.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct DumpLogBundleMain: View { 4 | var body: some View { 5 | List { 6 | Button("Dump Log") { 7 | mainlogSystem.dumpLog() 8 | } 9 | Button("Clear Log") { 10 | mainlogSystem.clearLog() 11 | } 12 | Button("Test Print") { 13 | print("meow meow") 14 | } 15 | } 16 | .navigationTitle("DumpLog") 17 | .navigationBarTitleDisplayMode(.inline) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/Experimental/ExperimentalSettingsBundle.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import Foundation 3 | 4 | struct ExperimentalSettingsBundle: View { 5 | //@AppStorage("CETypechecking") var typecheck: Bool = false 6 | @AppStorage("GIT_ENABLED") var enabled: Bool = false 7 | @AppStorage("GIT_TOKEN") var token: String = "" 8 | var body: some View { 9 | List { 10 | /*Section(header: Text("Code Editor")) { 11 | Toggle("Typecheck Code", isOn: $typecheck) 12 | }*/ 13 | Section(header: Text("GitHub")) { 14 | Toggle("Enabled", isOn: $enabled) 15 | if enabled { 16 | SecureField("Token", text: $token) 17 | } 18 | } 19 | NavigationLink(destination: DumpLogBundleMain()) { 20 | Label("Logging System (DEBUG)", systemImage: "doc.fill") 21 | } 22 | } 23 | .navigationTitle("Experimental") 24 | .navigationBarTitleDisplayMode(.inline) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/SDKHUBBundleMain.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import Foundation 3 | 4 | struct SDKDownload: View { 5 | @State private var sdks: [String] = ["9.3","10.3","11.4","12.4","13.7","14.5","15.6","16.5"] 6 | @State private var listid: UUID = UUID() 7 | var body: some View { 8 | List { 9 | ForEach(sdks, id:\.self) { item in 10 | if !FileManager.default.fileExists(atPath: "\(global_sdkpath)/iPhoneOS\(item).sdk") { 11 | Button( action: { 12 | download(item) 13 | }) { 14 | Label("iOS \(item)", systemImage: "arrow.down") 15 | } 16 | } else { 17 | Button( action: { 18 | remove(item) 19 | }) { 20 | Label("iOS \(item)", systemImage: "trash.fill") 21 | } 22 | } 23 | } 24 | } 25 | .navigationTitle("SDK Hub") 26 | .navigationBarTitleDisplayMode(.inline) 27 | .id(listid) 28 | } 29 | 30 | private func download(_ sdk: String) -> Void { 31 | DispatchQueue.global(qos: .utility).async { 32 | ShowAlert(UIAlertController(title: "Downloading SDK", message: "", preferredStyle: .alert)) 33 | cfolder(atPath: "\(global_sdkpath)") 34 | fdownload("https://raw.githubusercontent.com/fridakitten/FridaCodeManager/main/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS\(sdk).zip", "tmp/sdk.zip") 35 | if libzip_unzip("\(global_container)/tmp/sdk.zip","\(global_sdkpath)") != 0 { 36 | // back then we did ran download tasks unnecessarily as root 37 | #if jailbreak 38 | shell("chown mobile \(global_sdkpath)", uid: 0) 39 | #elseif trollstore 40 | shell("chown mobile:mobile \(global_sdkpath)", uid: 0) 41 | #endif 42 | libzip_unzip("\(global_container)/tmp/sdk.zip","\(global_sdkpath)") 43 | } 44 | _ = rm("\(global_container)/tmp/sdk.zip") 45 | listid = UUID() 46 | DismissAlert() 47 | } 48 | } 49 | 50 | private func remove(_ sdk: String) -> Void { 51 | DispatchQueue.global(qos: .utility).async { 52 | ShowAlert(UIAlertController(title: "Removing SDK", message: "", preferredStyle: .alert)) 53 | // some people might have downloaded SDKs in the past that got unnecessarily stored as root 54 | if rm("\(global_sdkpath)/iPhoneOS\(sdk).sdk") != 0 { 55 | #if !stock 56 | shell("rm -rf \(global_sdkpath)/iPhoneOS\(sdk).sdk", uid: 0) 57 | #endif 58 | } 59 | listid = UUID() 60 | DismissAlert() 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/build.sh: -------------------------------------------------------------------------------- 1 | git clone https://github.com/theos/sdks 2 | cd sdks 3 | 4 | zip -r iPhoneOS11.4.sdk iOS11.4.zip 5 | 6 | cd .. -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/iOS11.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS11.4.zip -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/iOS12.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS12.4.zip -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/iOS13.7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS13.7.zip -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/iOS14.5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS14.5.zip -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/iOS15.6.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS15.6.zip -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/SDKHub/sdk/iOS16.5.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/seanistethered/FridaCodeManager/83e40ee17bdde150d715c1f7d07427ef8908e394/FCM/UI/TabBar/Settings/SDKHub/sdk/iOS16.5.zip -------------------------------------------------------------------------------- /FCM/UI/TabBar/Settings/Spacing/SpacingSettingsBundle.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import SwiftUI 3 | 4 | struct SpacingSettingsBundle: View { 5 | @AppStorage("tabmode") var mode: Int = 0 6 | @AppStorage("tabspacing") var spacing: Int = 4 7 | 8 | var body: some View { 9 | List { 10 | Section(header: Text("Mode")) { 11 | Picker("", selection: $mode) { 12 | Text("tab").tag(0) 13 | Text("spaces").tag(1) 14 | } 15 | .pickerStyle(SegmentedPickerStyle()) 16 | } 17 | if mode == 1 { 18 | Stepper("Spaces: \(spacing)", value: $spacing, in: 2...8) 19 | } 20 | } 21 | .navigationTitle("Spacing") 22 | .navigationBarTitleDisplayMode(.inline) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Wiki/ParsedView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View.swift 3 | // 4 | // Created by SeanIsNotAConstant on 07.11.24 5 | // 6 | 7 | import SwiftUI 8 | 9 | struct XMLDetailView: View { 10 | let title: String 11 | let filePath: String 12 | @State private var hierarchy: Hierarchy? 13 | 14 | var body: some View { 15 | ScrollView() { 16 | Spacer().frame(height: 10) 17 | if let hierarchy = hierarchy { 18 | ForEach(hierarchy.sections) { section in 19 | VStack(alignment: .leading, spacing: 5) { 20 | HStack() { 21 | Spacer().frame(width: 10) 22 | Text(section.name).font(.system(size: 20.0, weight: .bold)) 23 | Spacer() 24 | } 25 | ForEach(section.items) { item in 26 | switch item { 27 | case .text(let textItem): 28 | HStack() { 29 | Spacer().frame(width: 20) 30 | TextLabel(text: textItem) 31 | Spacer() 32 | } 33 | case .navLink(let navLinkItem): 34 | HStack() { 35 | Spacer().frame(width: 20) 36 | NavigationLink(destination: XMLDetailView(title: navLinkItem.title, filePath: navLinkItem.filePath)) { 37 | Text(navLinkItem.title) 38 | .foregroundColor(Color(UIColor.systemBlue)) 39 | } 40 | Spacer() 41 | } 42 | case .breakSpace(let breakItem): 43 | Spacer().frame(height: breakItem.spacing) 44 | } 45 | } 46 | } 47 | Spacer().frame(height: 30) 48 | } 49 | } 50 | Spacer() 51 | } 52 | .onAppear { 53 | loadXMLData(from: filePath) 54 | } 55 | .navigationTitle(title) 56 | .navigationBarTitleDisplayMode(.inline) 57 | } 58 | 59 | func loadXMLData(from relativePath: String) { 60 | guard let baseUrl = URL(string: "https://raw.githubusercontent.com/fridakitten/FridaWikiXMLRepo/main/main.xml"), 61 | let url = URL(string: relativePath, relativeTo: baseUrl) else { return } 62 | 63 | URLSession.shared.dataTask(with: url) { data, response, error in 64 | guard let data = data, error == nil else { return } 65 | 66 | DispatchQueue.main.async { 67 | hierarchy = parseXML(data: data) 68 | } 69 | }.resume() 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /FCM/UI/TabBar/Wiki/Wiki.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct WikiView: View { 4 | var body: some View { 5 | NavigationView() { 6 | XMLDetailView(title: "Wiki", filePath: "https://raw.githubusercontent.com/fridakitten/FridaWikiXMLRepo/main/main.xml") 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /FCM/UI/UIAppeareance.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | func UIInit(type: Int) -> Void { 4 | switch type { 5 | case 0: 6 | let navigationBarAppearance = UINavigationBarAppearance() 7 | navigationBarAppearance.backgroundColor = UIColor.systemBackground 8 | let titleAttributes = [NSAttributedString.Key.foregroundColor: UIColor.label] 9 | navigationBarAppearance.titleTextAttributes = titleAttributes 10 | let buttonAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] 11 | navigationBarAppearance.buttonAppearance.normal.titleTextAttributes = buttonAttributes 12 | let backItemAppearance = UIBarButtonItemAppearance() 13 | backItemAppearance.normal.titleTextAttributes = [.foregroundColor : UIColor.label] 14 | navigationBarAppearance.backButtonAppearance = backItemAppearance 15 | UINavigationBar.appearance().standardAppearance = navigationBarAppearance 16 | UINavigationBar.appearance().compactAppearance = navigationBarAppearance 17 | UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance 18 | let appearance = UITabBarAppearance() 19 | appearance.configureWithOpaqueBackground() 20 | appearance.backgroundColor = UIColor.systemBackground 21 | UITabBar.appearance().standardAppearance = appearance 22 | UITabBar.appearance().scrollEdgeAppearance = appearance 23 | return 24 | case 1: 25 | let navigationBarAppearance = UINavigationBarAppearance() 26 | navigationBarAppearance.configureWithDefaultBackground() 27 | UINavigationBar.appearance().standardAppearance = navigationBarAppearance 28 | UINavigationBar.appearance().compactAppearance = navigationBarAppearance 29 | UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance 30 | return 31 | default: 32 | return 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /FCM/UI/UIBackgroundHack.swift: -------------------------------------------------------------------------------- 1 | /* 2 | UIBackgroundHack.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import SwiftUI 32 | 33 | struct BackgroundClearView: UIViewRepresentable { 34 | func makeUIView(context: Context) -> UIView { 35 | let view = UIView() 36 | 37 | DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { 38 | view.superview?.superview?.backgroundColor = .clear 39 | } 40 | 41 | return view 42 | } 43 | 44 | func updateUIView(_ uiView: UIView, context: Context) {} 45 | } 46 | -------------------------------------------------------------------------------- /FCM/UI/UISymbolView.swift: -------------------------------------------------------------------------------- 1 | /* 2 | SymbolView.swift 3 | 4 | Copyright (C) 2023, 2024 SparkleChan and SeanIsTethered 5 | Copyright (C) 2024 fridakitten 6 | 7 | This file is part of FridaCodeManager. 8 | 9 | FridaCodeManager is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | FridaCodeManager is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with FridaCodeManager. If not, see . 21 | 22 | ______ _ _ _____ __ _ ______ _ _ _ 23 | | ___| (_) | | / ___| / _| | | ___| | | | | (_) 24 | | |_ _ __ _ __| | __ _ \ `--. ___ | |_| |___ ____ _ _ __ ___ | |_ ___ _ _ _ __ __| | __ _| |_ _ ___ _ __ 25 | | _| '__| |/ _` |/ _` | `--. \/ _ \| _| __\ \ /\ / / _` | '__/ _ \ | _/ _ \| | | | '_ \ / _` |/ _` | __| |/ _ \| '_ \ 26 | | | | | | | (_| | (_| | /\__/ / (_) | | | |_ \ V V / (_| | | | __/ | || (_) | |_| | | | | (_| | (_| | |_| | (_) | | | | 27 | \_| |_| |_|\__,_|\__,_| \____/ \___/|_| \__| \_/\_/ \__,_|_| \___| \_| \___/ \__,_|_| |_|\__,_|\__,_|\__|_|\___/|_| |_| 28 | Founded by. Sean Boleslawski, Benjamin Hornbeck and Lucienne Salim in 2023 29 | */ 30 | 31 | import SwiftUI 32 | import UIKit 33 | 34 | struct SFSymbolView: View { 35 | var body: some View { 36 | List { 37 | NavigationLink( destination: SFSymbolListView(symbols: gSFSymbols())) { 38 | Text("All") 39 | } 40 | Section(header: Text("categories")) { 41 | NavigationLink( destination: SFSymbolListView(symbols: gcommunication())) { 42 | Label("Communication",systemImage: "bubble.left.and.bubble.right.fill") 43 | } 44 | NavigationLink( destination: SFSymbolListView(symbols: gweather())) { 45 | Label("Weather",systemImage: "cloud.moon.rain.fill") 46 | } 47 | NavigationLink( destination: SFSymbolListView(symbols: gdevices())) { 48 | Label("Devices",systemImage: "airpodspro") 49 | } 50 | NavigationLink( destination: SFSymbolListView(symbols: gconnectivity())) { 51 | Label("Connectivity",systemImage: "network") 52 | } 53 | NavigationLink( destination: SFSymbolListView(symbols: gnature())) { 54 | Label("Nature",systemImage: "leaf.fill") 55 | } 56 | } 57 | } 58 | .listStyle(InsetGroupedListStyle()) 59 | .navigationBarTitle("SFSymbols") 60 | .navigationBarTitleDisplayMode(.inline) 61 | } 62 | } 63 | 64 | struct SFSymbolListView: View { 65 | @State var symbols: [String] 66 | var body: some View { 67 | List(symbols, id: \.self) { symbolName in 68 | Button( action: { 69 | copyToClipboard(text: symbolName) 70 | }){ 71 | HStack { 72 | Image(systemName: symbolName) 73 | .frame(width: 30, height: 30) 74 | Spacer() 75 | Text(symbolName) 76 | } 77 | } 78 | } 79 | .navigationBarTitle("SFSymbols") 80 | .navigationBarTitleDisplayMode(.inline) 81 | .listStyle(InsetGroupedListStyle()) 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /FCM/bridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // bridge.h 3 | // FridaCodeManager 4 | // 5 | // Created by SeanIsNotAConstant on 21.10.24 6 | // 7 | 8 | #ifndef BRIDGE_H 9 | #define BRIDGE_H 10 | 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | 21 | //sean16 architecture 22 | #import 23 | #import 24 | 25 | #endif // BRIDGE_H 26 | -------------------------------------------------------------------------------- /FCM/ent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | application-identifier 6 | com.sparklechan.Swifty 7 | UIFileSharingEnabled 8 | 9 | com.apple.private.security.no-sandbox 10 | 11 | platform-application 12 | 13 | com.apple.private.security.container-manager 14 | 15 | com.apple.private.MobileContainerManager.allowed 16 | 17 | com.apple.private.security.storage.AppBundles 18 | 19 | com.apple.private.security.storage.AppDataContainers 20 | 21 | com.apple.private.security.storage.containers 22 | 23 | com.apple.rootless.volume.Preboot 24 | 25 | com.apple.security.exception.files.absolute-path.read-write 26 | 27 | com.apple.security.exception.iokit-user-client-class 28 | 29 | IOSurfaceRootUserClient 30 | AGXDeviceUserClient 31 | 32 | com.apple.private.persona-mgmt 33 | 34 | dynamic-codesigning 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FridaCodeManager (Deprecated FR) 2 | 3 | PROJECT IS OFFICIALLY DEPRECATED 4 | WAIT ON [NYXIAN](https://github.com/seanistethered/NyxianProject) 5 | 6 | ## Purpose 7 | FridaCodeManager was made to offer a easy way to code, compile and install iOS apps on jailbroken iPhones. 8 | 9 | ## Compatibility 10 | The app is fully supported on rootless and roothide jailbroken iOS and iPadOS from version 15.0 up to 18.3.1. It's also partially supported on [Trollstore](https://github.com/opa334/TrollStore) iDevices from version 15.0 up to 17.6.1. A version of FridaCodeManager supporting usual iDevices is in progress. 11 | 12 | ## Tested Devices 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
iDeviceiOS Version
iPhone 6siOS 15.8.2
iPhone 7iOS 15.6
iPhone XiOS 15.0
iPhone 11iOS 16.5
iPhone 14 ProiOS 17.0
iPad 7th geniPadOS 17.6.1
iPad 7th geniPadOS 18.2
48 |
49 | 50 | ## Credits 51 | #### Main 52 | - FridaDEV: [https://github.com/fridakitten](https://github.com/fridakitten) 53 | - AppInstalleriOS: [https://github.com/AppInstalleriOSGH](https://github.com/AppInstalleriOSGH) 54 | - RootHideDev: [https://github.com/roothider](https://github.com/roothider) 55 | - Manuel Chakravarty: [https://github.com/mchakravarty](https://github.com/mchakravarty) 56 | - Ayame Yumemi: [https://github.com/ayayame09](https://github.com/ayayame09) 57 | - Jonah Butler (Sora): [https://github.com/jonahnm](https://github.com/jonahnm) 58 | #### Side Kicks 59 | - Opa334: [https://github.com/opa334](https://github.com/opa334) 60 | - TheOS: [https://github.com/theos](https://github.com/theos) 61 | #### Others 62 | - Chariz: [https://github.com/chariz](https://github.com/chariz) 63 | --------------------------------------------------------------------------------