Successor to CageTheUnicorn, now with performance exceeding that of maple syrup.
Go to file
misson20000 9b5b231345
Merge pull request #22 from maci0/master
Add Dockerfile and info how to run Mephisto from docker
2017-12-13 14:18:10 -08:00
ipcdefs updates and such from private 2017-11-05 11:15:26 -08:00
ipcimpl Added ipcimpl for am and hid. 2017-12-06 17:44:25 -05:00
.dir-locals.el updates and such from private 2017-11-05 11:15:26 -08:00
.gitignore add .gitignore 2017-10-01 17:51:03 -07:00
.travis.yml Merge branch 'master' into master 2017-11-15 20:11:07 -05:00
Cpu.cpp use different printf format on macos 2017-11-14 20:42:20 -05:00
Cpu.h updates and such from private 2017-11-05 11:15:26 -08:00
Ctu.cpp updates and such from private 2017-11-05 11:15:26 -08:00
Ctu.h use different printf format on macos 2017-11-14 20:42:20 -05:00
DEPS.txt updates and such from private 2017-11-05 11:15:26 -08:00
Dockerfile add library path, use current uid at runtime, so homedir is accessible 2017-12-13 23:13:32 +01:00
GdbStub.cpp Handle sending thread signal from breakpoint 2017-12-10 21:49:14 +01:00
GdbStub.h Tell GDB about the threads, allow switching between them when single stepping 2017-12-06 00:53:14 +01:00
genallipc.py updates and such from private 2017-11-05 11:15:26 -08:00
generateIpcStubs.py updates and such from private 2017-11-05 11:15:26 -08:00
idparser.py Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
Ipc.cpp updates and such from private 2017-11-05 11:15:26 -08:00
Ipc.h updates and such from private 2017-11-05 11:15:26 -08:00
IpcBridge.cpp Removed tuple literal syntax. Sad panda. 2017-09-22 12:03:08 -06:00
IpcBridge.h Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
ipcclient.py updates and such from private 2017-11-05 11:15:26 -08:00
KObject.h Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
LICENSE.txt Added license. 2017-09-21 20:46:13 -06:00
Lisparser.cpp Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
Lisparser.h Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
main.cpp updates and such from private 2017-11-05 11:15:26 -08:00
Makefile python2 2017-10-03 07:58:57 -04:00
Mmio.cpp updates and such from private 2017-11-05 11:15:26 -08:00
Mmio.h updates and such from private 2017-11-05 11:15:26 -08:00
Nxo.cpp remove some debug output from stupid linker 2017-10-11 22:15:33 -07:00
Nxo.h initial nro support 2017-10-01 17:48:51 -07:00
optionparser.h Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
partialparser.py Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
README.md add library path, use current uid at runtime, so homedir is accessible 2017-12-13 23:13:32 +01:00
requirements.txt Update readme commands 2017-09-22 13:06:28 -04:00
Svc.cpp Set return value for SleepThread when yielding 2017-12-10 21:49:14 +01:00
Svc.h Set return value for SvcWaitProcessWideKeyAtomic 2017-12-10 21:49:14 +01:00
Sync.cpp Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
Sync.h updates and such from private 2017-11-05 11:15:26 -08:00
ThreadManager.cpp Avoid segfault when single stepping into an SVC 2017-12-10 21:49:14 +01:00
ThreadManager.h Tell GDB about the threads, allow switching between them when single stepping 2017-12-06 00:53:14 +01:00
wireprotocol.txt updates and such from private 2017-11-05 11:15:26 -08:00

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