GithubHelp home page GithubHelp logo

gmh5225 / android-elf-rtti-obfuscator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ianusinferus/rtti-obfuscator

0.0 1.0 0.0 180 KB

C++ RTTI symbol obfuscator

License: BSD 3-Clause "New" or "Revised" License

C 61.23% C# 38.50% Batchfile 0.26%

android-elf-rtti-obfuscator's Introduction

RTTI Obfuscator

We may want to hide internal symbols in binary files built for a C++ project before we ship them, but strip/llvm-strip command can not strip all internal symbols. The most common internal symbols are RTTI(Run-time type information) symbols used for typeid and dynamic_cast operators.

RTTI symbols are generated for classes with a virtual table, and sometimes for lambda expressions.

On Linux/Android and in ELF files, they look like _ZTSSt19_Sp_make_shared_tag in the static symbol table with a string value like St19_Sp_make_shared_tag in ELF files. _ZTS refers to typeinfo name, and _ZTI refers to typeinfo structure, see Itanium C++ ABI.

This tool is used to obfuscate these symbols. Currently, the tool only applies to Linux/Android and ELF files.

Usage

Windows:

RttiObfuscator.exe elf list <InputFilePath>
RttiObfuscator.exe elf obfuscate <InputFilePath> <OutputFilePath>

Linux/MacOS:

Install mono and prefix mono in the prior commands.

Notice

clang will inline string literal into 16-byte bulk copies and intermediate value assignments with -O2, which will embed trailing chars into opcode (when char count is not a multiple of 16). gcc also has similar behavior.

This can be worked around by marking __attribute__((noinline)) on std::type_info::name(), or by wrapping all calls to typeid(T).name() with non_inline_str, where T is a compile-time-deterministic type and non_inline_str is as follows.

#if defined(_MSC_VER)
__declspec(noinline)
#else
__attribute__((noinline))
#endif
static const char * non_inline_str(const char * str) { return str; }

License

This software is licensed under 3-Clause BSD, see LICENSE.

For Reference\itanium-base.exp and Src\itanium-base.exp, they come from libcxxabi and subject to Apache License 2.0

For other contents in Reference, they come from third-party and subject to their specific licenses. This software is neither derived work nor combined work of them, their presence is only informational.

android-elf-rtti-obfuscator's People

Contributors

ianusinferus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.