A lightweight and simpling iOS binary decryptor

Overview

FoulDecrypt

It's available in my Cydia repo: http://repo.misty.moe

FlexDecrypt's source code is pretty FAT, bundling the whole swift runtime to just achieve a simple mremap_encrypted.

And at the same time, foulplay independently found the same approach, and implemented it in a much more simple way.

I recompiled the foulplay for iOS, and a wrapper flexdecrypt2 for flexdecrypt.

All credits goes to @meme and @JohnCoates.

Issues
  • How to add support for iOS 13 (< 13.4)

    How to add support for iOS 13 (< 13.4)

    Hey! You did an amazing job! Thank you so much! Could you help me add support for iOS 13? How exactly do I get the correct offsets for structures in kernstructs.hpp?

    opened by zx500xl 4
  • How to run it from PC?

    How to run it from PC?

    My environment:

    • Device: iPhone 7 GSM
    • iOS: 14.6
    • Jailbreak: checkra1n
    • PC: Mac

    How to dump ipa from mac CLI?

    Your project doesn't have any instructions. Please provide anything.

    opened by vadimszzz 2
  • Decrypting fails with mmap: Operation not permitted

    Decrypting fails with mmap: Operation not permitted

    I wanted to try this nice tool and used the binary of the Youtube ipa package. However, I get the following error:

    BA:~ root# fouldecrypt -v YouTube yt-dc
    21:47:10.764865	mapping input file: YouTube
    21:47:10.766114	mapping output file: yt-dc
    21:47:10.767689	copying original data of size 0xe184c0...
    21:47:10.778300	    not fat binary, directly decrypting it!
    21:47:10.778339	    finding encryption_info segment in slide...
    21:47:10.778347	        found encryption_info segment at offset ba8
    21:47:10.778352	    decrypting encrypted data...
    21:47:10.778357	        Going to decrypt crypt page: off 0x4000 size 0x868000 cryptid 1, cpuType 100000c cpuSubType 0
    21:47:10.778408	        Already 16k aligned, directly go ahead :)
    21:47:10.778424	-->> 16k-aligned mmaping(0x0, 0x868000, 5, 0x2, 3, 0x4000)
    mmap: Operation not permitted
    21:47:10.778652	<<-- 16k-aligned mmaping(0x0, 0x868000, 5, 0x2, 3, 0x4000) = 0xffffffffffffffff
    21:47:10.778662	<<-- unprotect mremap_encrypted(0xffffffffffffffff, 0x868000, 1, 0x100000c, 0x0)
    mremap_encrypted: Invalid argument
    21:47:10.778694	-->> unprotect mremap_encrypted(0xffffffffffffffff, 0x868000, 1, 0x100000c, 0x0) = -1
    

    I am using an iPhone 6s with iOS 14,2 and fouldecrypt 0.0.3 from your repo. Do you have an idea what the problem is? Thanks in advance

    opened by marzzzello 2
  • Add GitHub CI

    Add GitHub CI

    Use git tag v1.1.1 to issue a new release, GitHub will do the rest for you.

    If you wanna test github-action without actually publishing the artifact, use a new action-test branch

    opened by ChiChou 0
  • Not working properly on iOS 14.8.1 with checkra1n

    Not working properly on iOS 14.8.1 with checkra1n

    When trying to decrypt anything on an iPhone 7 Plus on iOS 14.8.1 jailbroken with checkra1n, this error shows up, both with the TFP0 and the libkrw versions. image flexdecrypt and appdecrypt work fine however with the same device/setup.

    opened by AuroraWright 0
  • Fix ignored error code

    Fix ignored error code

    Previously, getting decryption failure would be ignored and return code 0 (success) even though it is not:

    mremap_encrypted: Operation not permitted
    <continues>
    <code 0>
    

    This PR checks for the return code of mremap_encrypted, and if errored, cancels decryption and propagates it back to the shell.

    opened by ViRb3 0
  • iOS 13 arm64e support is broken

    iOS 13 arm64e support is broken

    Apparently the arm64e identifier changed between iOS 13 and iOS 14: https://www.reddit.com/r/jailbreak/comments/rk7n8l/help_diskprobe_error_incompatible_cpusubtype/hp93y9x/

    I encountered the same message as the OP in the linked post. Googling led me to that post.

    iPhone SE 2 iOS 13.7 unc0ver 6.0.0

    opened by jack980517 12
  • Support for iOS 14.5

    Support for iOS 14.5

    Hi there! While trying out fouldecrypt on iOS 14.5 using the AltStore -> Fugu14 -> unc0ver Jailbreak on an iPhone XR I wasn't able to get fouldecrypt running successfully. Here's the log output of one attempt:

    10:29:21.123326	mapping input file: /private/var/containers/Bundle/Application/7384EA7D-A396-4A76-88B6-F102431E33D9_tmp/Discord.app/Discord
    10:29:21.128509	mapping output file: /private/var/containers/Bundle/Application/7384EA7D-A396-4A76-88B6-F102431E33D9_tmp/Discord.app/Discord
    10:29:21.435733	copying original data of size 0x158c1d0...
    10:29:21.454366	    not fat binary, directly decrypting it!
    10:29:21.454458	    finding encryption_info segment in slide...
    10:29:21.454467	        found encryption_info segment at offset 10f8
    10:29:21.454476	    decrypting encrypted data...
    10:29:21.454481	        Going to decrypt crypt page: off 0x356000 size 0x1000 cryptid 1, cpuType 100000c cpuSubType 0
    10:29:21.454505	        Not 16k aligned, trying to do the hack :O
    Error attempting to load plugin /usr/lib/libkrw/libFugu14Krw.dylib: dlopen(/usr/lib/libkrw/libFugu14Krw.dylib, 5): no suitable image found.  Did find:
    	/usr/lib/libkrw/libFugu14Krw.dylib: incompatible cpu-subtype: 0x00000000 in /usr/lib/libkrw/libFugu14Krw.dylib
    	/usr/lib/libkrw/libFugu14Krw.dylib: stat() failed with errno=60
    10:29:21.750269	        successfully initialized kerninfra!
    10:29:21.750393	            processing file off 354000-357000, curPage len: 3000, inPageStart: 2000, inPageEnd: 3000
    10:29:21.750489	-->> directly 16k-aligned mmap mmaping(0x0, 0x3000, 5, 0x2, 4, 0x354000)
    10:29:21.752934	<<-- directly 16k-aligned mmap mmaping(0x0, 0x3000, 5, 0x2, 4, 0x354000) = 0x1027fc000
    10:29:21.752955	<<-- unprotect mremap_encrypted(0x1027fc000, 0x3000, 1, 0x100000c, 0x0)
    mremap_encrypted: Operation not permitted
    10:29:21.812483	-->> unprotect mremap_encrypted(0x1027fc000, 0x3000, 1, 0x100000c, 0x0) = -1
    

    Especially the part mentioning mentioning /usr/lib/libkrw/libFugu14Krw.dylib gave me the impression, that the issue may be related to the specific Fugu14 exploit method?

    opened by irworks 3
Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies.

Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.

Nano 3.4k Aug 6, 2022
Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies.

Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.

Nano 3.1k May 5, 2021
A lightweight, secure, easy-to-use crypto library suitable for constrained environments.

The Hydrogen library is a small, easy-to-use, hard-to-misuse cryptographic library. Features: Consistent high-level API, inspired by libsodium. Instea

Frank Denis 402 Aug 4, 2022
Finalists to the NIST lightweight cryptography competition

LWC Finalists This repository contains implementations of the 10 finalists in the NIST lightweight cryptography competition: ASCON, Elephant, GIFT-COF

null 30 Jun 3, 2022
x509cert is a tool and library for generating X.509 certificates and certificate requests.

x509cert is a tool and library for generating X.509 certificates and certificate requests. It is written in C99 and uses BearSSL to decode keys and compute signatures.

Michael Forney 9 Nov 25, 2021
HashLibPlus is a recommended C++11 hashing library that provides a fluent interface for computing hashes and checksums of strings, files, streams, bytearrays and untyped data to mention but a few.

HashLibPlus HashLibPlus is a recommended C++11 hashing library that provides a fluent interface for computing hashes and checksums of strings, files,

Telepati 7 Apr 11, 2022
Text-Crypt is a tool which encrypts and decrypts texts using a specific and certain key.

Text-Crypt is a tool which encrypts and decrypts texts using a specific and certain key. This tool uses Caesar Cypher Algorithm to encrypt and decrypt a given text.

AnonabdulJ 4 Dec 24, 2021
An open source, portable, easy to use, readable and flexible SSL library

README for Mbed TLS Mbed TLS is a C library that implements cryptographic primitives, X.509 certificate manipulation and the SSL/TLS and DTLS protocol

Arm Mbed 3.7k Jul 30, 2022
TLS/SSL and crypto library

Welcome to the OpenSSL Project OpenSSL is a robust, commercial-grade, full-featured Open Source Toolkit for the Transport Layer Security (TLS) protoco

OpenSSL 19k Jul 29, 2022
Library and command line tool to detect SHA-1 collision in a file

sha1collisiondetection Library and command line tool to detect SHA-1 collisions in files Copyright 2017 Marc Stevens [email protected] Distributed

Marc Stevens 1.2k Jul 25, 2022
Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

Tink A multi-language, cross-platform library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse. Ubuntu

Google 12.5k Aug 5, 2022
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Cossack Labs 1.6k Aug 5, 2022
MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).

MIRACL What is MIRACL? Multiprecision Integer and Rational Arithmetic Cryptographic Library – the MIRACL Crypto SDK – is a C software library that is

MIRACL 491 Aug 5, 2022
BTCU Wallet is the original Bitcoin Ultimatum client and it builds the backbone of the network.

The concept of BTCU is similar to the concept of the second cryptocurrency by capitalization - Ethereum.

Bitcoin Ultimatum (BTCU) 31 Jul 1, 2022
Ethereum miner with OpenCL, CUDA and stratum support

Ethminer is an Ethash GPU mining worker: with ethminer you can mine every coin which relies on an Ethash Proof of Work thus including Ethereum, Ethereum Classic, Metaverse, Musicoin, Ellaism, Pirl, Expanse and others. This is the actively maintained version of ethminer. It originates from cpp-ethereum project (where GPU mining has been discontinued) and builds on the improvements made in Genoil's fork. See FAQ for more details.

null 5.9k Jul 29, 2022
hashcat is the world's fastest and most advanced password recovery utility

hashcat is the world's fastest and most advanced password recovery utility, supporting five unique modes of attack for over 300 highly-optimized hashing algorithms. hashcat currently supports CPUs, GPUs, and other hardware accelerators on Linux, Windows, and macOS, and has facilities to help enable distributed password cracking.

null 15.1k Aug 4, 2022
PTHash is a C++ library implementing fast and compact minimal perfect hash functions

Fast and compact minimal perfect hash functions in C++.

Giulio Ermanno Pibiri 70 Aug 1, 2022