Successor to CageTheUnicorn, now with performance exceeding that of maple syrup.
Clone or download
Latest commit a3cedc2 Aug 16, 2018
Permalink
Failed to load latest commit information.
SwIPC @ 9bb8420 Update SwIPC submodule Aug 16, 2018
ipcimpl Update SwIPC submodule Aug 16, 2018
unicorn @ 63b6417 make unicorn a submodule and static link it to make our binaries easi… Mar 1, 2018
.dir-locals.el updates and such from private Nov 5, 2017
.gitignore Make Mephisto uses SwIPC directly Aug 16, 2018
.gitmodules Make Mephisto uses SwIPC directly Aug 16, 2018
.travis.yml make unicorn a submodule and static link it to make our binaries easi… Mar 1, 2018
Cpu.cpp add --initialize-memory option to help catch uninitialized memory errors Mar 28, 2018
Cpu.h updates and such from private Nov 5, 2017
Ctu.cpp updates and such from private Nov 5, 2017
Ctu.h Update SwIPC submodule Aug 16, 2018
DEPS.txt updates and such from private Nov 5, 2017
Dockerfile Simplify dockerfile some more, use current git clone during build con… Dec 14, 2017
GdbStub.cpp Handle sending thread signal from breakpoint Dec 10, 2017
GdbStub.h Tell GDB about the threads, allow switching between them when single … Dec 5, 2017
Ipc.cpp Merge pull request #31 from Thog/feature/swipc Aug 16, 2018
Ipc.h Make Mephisto uses SwIPC directly Aug 16, 2018
IpcBridge.cpp Removed tuple literal syntax. Sad panda. Sep 22, 2017
IpcBridge.h Initial commit. Mephisto lives. Sep 22, 2017
KObject.h Initial commit. Mephisto lives. Sep 22, 2017
LICENSE.txt Added license. Sep 22, 2017
Lisparser.cpp Initial commit. Mephisto lives. Sep 22, 2017
Lisparser.h Initial commit. Mephisto lives. Sep 22, 2017
Makefile Make Mephisto uses SwIPC directly Aug 16, 2018
Mmio.cpp updates and such from private Nov 5, 2017
Mmio.h updates and such from private Nov 5, 2017
Nxo.cpp nso: Do not try to decompress if segment isn't compressed Aug 16, 2018
Nxo.h load kips Feb 11, 2018
README.md add library path, use current uid at runtime, so homedir is accessible Dec 13, 2017
Svc.cpp return correct error code on svcGetInfo instead of crashing Jul 18, 2018
Svc.h add svcMap/UnmapPhysicalMemory May 16, 2018
Sync.cpp Initial commit. Mephisto lives. Sep 22, 2017
Sync.h updates and such from private Nov 5, 2017
ThreadManager.cpp Revert "Revert "start NROs at nro+0x00 instead of nro+0x80 and don't … Jan 23, 2018
ThreadManager.h Tell GDB about the threads, allow switching between them when single … Dec 5, 2017
generateIpcStubs.py Update SwIPC submodule Aug 16, 2018
ipcclient.py updates and such from private Nov 5, 2017
main.cpp add --initialize-memory option to help catch uninitialized memory errors Mar 28, 2018
optionparser.h Initial commit. Mephisto lives. Sep 22, 2017
partialparser.py Initial commit. Mephisto lives. Sep 22, 2017
requirements.txt Update readme commands Sep 22, 2017
wireprotocol.txt updates and such from private Nov 5, 2017

README.md

Mephisto

Build Status

Dependencies

All Platforms

ReSwitched unicorn fork:

git clone git@github.com:reswitched/unicorn.git
cd unicorn
UNICORN_ARCHS="aarch64" ./make.sh
sudo ./make.sh install

Python packages:

pip install -r requirements.txt

Ubuntu

Install Clang 5 from the LLVM PPA: http://apt.llvm.org/

You may need to update libc++ as well, if you get tuple errors.

OSX

Install llvm (will take a while)

brew install llvm --HEAD

Patch Makefile

diff --git a/Makefile b/Makefile
index e4c921b..4d53420 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CC := clang++-4.0
+CC := clang++

Running

Much like the original CageTheUnicorn, the default use of Mephisto is via the load files. Create a directory, e.g. ns23, and then copy in the NSO file(s). Create a file inside this, called load.meph with the following format:

(load-nso "main" 0x7100000000)
(run-from 0x7100000000)

Running it is then as simple as:

./ctu ns23

Alternatively, you can pass a single NSO file on the command line:

./ctu --load-nso ns23/main

See help for other info, e.g. enabling GDB support.

Run through Docker

First build the docker image, this may take some time

docker build -t reswitched/mephisto .

To run Mephisto it needs access to your NSO/NRO files, make sure to bind mount the location into the container.

Example:

docker run -ti --rm -p 24689:24689 -v $HOME:$HOME -u $UID reswitched/mephisto --load-nro $HOME/Coding/libtransistor/build/test/test_helloworld.nro

You can also create a bash alias.

alias ctu='docker run -ti --rm -p 24689:24689 -v $HOME:$HOME -u $UID reswitched/mephisto'

Now you can simply run ctu with your desired arguments. Example:

ctu --load-nro $HOME/Coding/libtransistor/build/test/test_helloworld.nro