A Transformice tool that helps you deobfuscate it.
The most basic usage, which will download the file:
detfm Transformice-clean.swf
You can also use a file from disk:
detfm -i Transformice.swf Transformice-clean.swf
It's also possible to use stdin as the input and stdout as the output by defining the input and output to -
respectively.
# Using stdin as the input:
detfm -i - Transformice-clean.swf
# Using stdout as the output:
detfm -i Transformice.swf -
This tool renames variables/classes/... to make it readable for a human being.
Most names are dynamics and can be configured using a config file with --config <file>
(or -c
).
You can dump the default config using --dump-config <file>
to the specified file.
By default, this utility uses multiple threads in order to speed up the process. You can specify the number of threads to use the -j
or --jobs
argument.
A value of 0 will use the appropriate number of threads available and a value of 1 will disable the multithreading and use a sequential approach instead.
You can define your own rules that matches a certain class using YAML files. You can find examples in the folder classdef
.
To enable this feature, you need to provide the tool the path to these files using the option --classdef
.
detfm --classdef ./classdef -i Transformice.swf Transformice-clean.swf
However, this is deprecated, and will be replaced in the future with a better alternative.
Few libraries are needed in order to this project to compile.
argparse
- Command-line parsercmakerc
- Bundle files into the executablefmt
- Python-like formatternlohmann
-json - JSON parseryaml
-cpp - YAML parserunpacker
- Unpack Transformice SWF fileswflib
- SWF parser
The dependencies will be installed automatically using vcpkg
However, it's required to build unpacker
and swflib
beforehands.
Install the dependencies and configure the CMake project. You'll need to provide the toolchain file to cmake in order to find the libraries.
mkdir build
cd build
cmake .. "-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake"
You can also provide additional directives, such as -Dswflib_DIR=[path to swflib]
to help cmake finding swflib or -DCMAKE_BUILD_TYPE=Release
to build in release mode.
Afterward, you'll be able to build the project:
cmake --build .
Docker images are provided in the docker
folder.
There are two different images:
debian-slim
- good compromise between size and featuresalpine
- minimal size but has several hacks to make the tool work correctly (and with good performances)
It's also a good example for building steps.