Successor to CageTheUnicorn, now with performance exceeding that of maple syrup.
Go to file
Thog ed9905785f
Update SwIPC submodule
This also add enum and versioning support.
Please note that actual SwIPC master doesn't have parameters for
LaunchProcess (in pm:shel)
2018-08-16 09:47:24 +02:00
ipcimpl Update SwIPC submodule 2018-08-16 09:47:24 +02:00
SwIPC@9bb8420228 Update SwIPC submodule 2018-08-16 09:47:24 +02:00
unicorn@63b6417243 make unicorn a submodule and static link it to make our binaries easier to run 2018-02-28 21:34:11 -08:00
.dir-locals.el updates and such from private 2017-11-05 11:15:26 -08:00
.gitignore Make Mephisto uses SwIPC directly 2018-08-16 09:47:03 +02:00
.gitmodules Make Mephisto uses SwIPC directly 2018-08-16 09:47:03 +02:00
.travis.yml make unicorn a submodule and static link it to make our binaries easier to run 2018-02-28 21:34:11 -08:00
Cpu.cpp add --initialize-memory option to help catch uninitialized memory errors 2018-03-28 14:24:58 -07: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 Update SwIPC submodule 2018-08-16 09:47:24 +02:00
DEPS.txt updates and such from private 2017-11-05 11:15:26 -08:00
Dockerfile Simplify dockerfile some more, use current git clone during build context 2017-12-14 09:54:18 +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
generateIpcStubs.py Update SwIPC submodule 2018-08-16 09:47:24 +02:00
Ipc.cpp Make Mephisto uses SwIPC directly 2018-08-16 09:47:03 +02:00
Ipc.h Make Mephisto uses SwIPC directly 2018-08-16 09:47:03 +02: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 add --initialize-memory option to help catch uninitialized memory errors 2018-03-28 14:24:58 -07:00
Makefile Make Mephisto uses SwIPC directly 2018-08-16 09:47:03 +02: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 LONG_FMT -> LONGFMT 2018-02-28 14:02:44 -08:00
Nxo.h load kips 2018-02-11 04:21:10 +01: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 return correct error code on svcGetInfo instead of crashing 2018-07-17 23:25:52 -07:00
Svc.h add svcMap/UnmapPhysicalMemory 2018-05-16 12:23:58 -07: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 Revert "Revert "start NROs at nro+0x00 instead of nro+0x80 and don't preload x30" until reswitched/libtransistor#84 is merged" 2018-01-22 22:05:10 -08: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