Giter Site home page Giter Site logo

libobf's Introduction

libobf

Forcing Weak Obfuscation Onto Developers™

libobf encourages and supports the use of non-alphanumeric letters to obfuscate code.

Note: Your code is difficult to read, but very easy to deobfuscate.

Examples

Example: Run-length encoding

_m = %i[to_s partition empty? unshift map]
_=$-o[?.][_,_m[0]]
a =->_{$-o[?.][_,_m[1],%r{(.)\1{0,}}]}
b =->_{$-o[?.][_,_m[2]]? []:(_=a[_];$-o[?.][b[_[$-o[?-]+$-o[?-]]],_m[3],_[$-o[?-]]])}
$-o[?+][b[_],[_m[4], ->_{[_[$-o[?_]],$-o[?.<<?.][$-o[?s<<??],_]]}]]

...and decoding

$-o[?.][_,:reduce,$-o[?s],->_,__{_+(__[$-o[?_]]*__[$-o[?-]])}]

More examples are available in examples/

Tips and Tricks

1. Even and Odd

number&1

If number&1 is 0, it is even If it is 1, it is odd.

It can be used like this:

number&1<1?even:odd

2. Calling $-o

For 2 characters+ keys, there are different ways to call them.

$-o[?.<<?.]
$-o['..']
$-o[%[..]] # and other %sym
$-o[%q[..]]
$-o[$-o[?s]+'..']
# etc

3. Obfuscating method calls

libobf provides methods for you to obfuscate your method names! Just fire up IRB and obfuscate your methods names!

irb> require 'libobf'
  => true
irb> $-o[?[]["map"]
  => (obfuscated)

Copy and paste them into source and you are ready to go!

m = [(obfuscated), (obfuscated), (obfuscated)]
Object.send($-o[?:][m[0]])

If you are lazy, you can also just map(&:$-o[?:]) over m

4. More method calling obfuscation

Ruby allows us to call [] using the ol' way, so let's do it!

$-o.[](?+).[](Kernel, [:puts, "hello"])

libobf's People

Contributors

skybirdsoar avatar

Stargazers

 avatar

Watchers

 avatar  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.