Successor to CageTheUnicorn, now with performance exceeding that of maple syrup.
Go to file
2018-02-28 21:34:11 -08:00
ipcdefs Update auto.id 2018-02-11 04:21:23 +01:00
ipcimpl mac build fix 2018-02-28 14:29:22 -08: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 add .gitignore 2017-10-01 17:51:03 -07:00
.gitmodules make unicorn a submodule and static link it to make our binaries easier to run 2018-02-28 21:34:11 -08: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 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 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
genallipc.py updates and such from private 2017-11-05 11:15:26 -08:00
generateIpcStubs.py Close host file handle when IFile is closed. Implement destructor in stub-gen 2018-02-28 16:33:54 +01:00
idparser.py Initial commit. Mephisto lives. 2017-09-21 20:38:04 -06:00
Ipc.cpp Handle case where the handle got closed in messageAsync 2018-02-15 02:07:40 +01: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 Merge remote-tracking branch 'roblabla/feature-kiploader' 2018-02-28 13:42:16 -08:00
Makefile make unicorn a submodule and static link it to make our binaries easier to run 2018-02-28 21:34:11 -08: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 fix printf format on Svc::ExitProcess for mac builds 2018-02-23 20:06:03 -08:00
Svc.h Merge branch 'master' of github.com:reswitched/Mephisto 2018-01-15 22:48:48 -08: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