Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscation #3

Open
PyMaster22 opened this issue Oct 2, 2020 · 0 comments
Open

Obfuscation #3

PyMaster22 opened this issue Oct 2, 2020 · 0 comments

Comments

@PyMaster22
Copy link

This isn't an issue I have with it it's just something I found.

$code = ""
Object.instance_eval do
  def const_missing(s); $code << s.to_s; 0; end
  remove_const(:GC)  # Holy moly!
end
at_exit do
  dict = { "AT"=>"00", "CG"=>"01", "GC"=>"10", "TA"=>"11" }
  eval([$code.gsub(/../) {|s| dict[s] }].pack("b*"))
end

def doublehelix(src)
  dict = { "00"=>["A","T"], "01"=>["C","G"], "10"=>["G","C"], "11"=>["T","A"] }
  format = [[1,0], [0,2], [0,3], [0,4], [1,4], [2,4], [3,3], [4,2], [5,0]]
  format += format.reverse
  %(require "doublehelix"\n\n) + src.unpack("b*").first.gsub(/../) do |s|
    format << (offset, dist = format.shift)
    "" * offset + dict[s] * ("" * dist) + ""
  end
end```
I removed 4 characters and the output is shortened a lot.
The `Hello World` is now `ATATTAGCGCGCTAGCATGCTAGCTAATTAGCATCGCGATCGATCGATATCGATGCGCGCCGGCATTACGGCATTACGGCTATACGGCATATCGATTAGCGCGCTATACGGCCGATTAGCATTACGGCATGCCGGCGCATCGATCGATCGATGCCGCGAT`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant