{"id":18688766,"url":"https://github.com/noraj/sigsegv2.reverse_6","last_synced_at":"2025-11-08T04:30:30.139Z","repository":{"id":86822660,"uuid":"225737397","full_name":"noraj/SigSegV2.reverse_6","owner":"noraj","description":"A reverse challenge that was available during SigSegV2 CTF (2019)","archived":false,"fork":false,"pushed_at":"2019-12-03T23:33:55.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T01:26:23.042Z","etag":null,"topics":["bytecode","challenge","ctf","disassembly","misc","reverse-engineering","rtfm","ruby","sigsegv2"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noraj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-03T23:32:03.000Z","updated_at":"2024-03-11T13:37:02.000Z","dependencies_parsed_at":"2023-06-26T00:15:22.792Z","dependency_job_id":null,"html_url":"https://github.com/noraj/SigSegV2.reverse_6","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FSigSegV2.reverse_6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FSigSegV2.reverse_6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FSigSegV2.reverse_6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noraj%2FSigSegV2.reverse_6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noraj","download_url":"https://codeload.github.com/noraj/SigSegV2.reverse_6/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239549153,"owners_count":19657534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bytecode","challenge","ctf","disassembly","misc","reverse-engineering","rtfm","ruby","sigsegv2"],"created_at":"2024-11-07T10:38:17.159Z","updated_at":"2025-11-08T04:30:30.109Z","avatar_url":"https://github.com/noraj.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby bytecode reverse engineering/disassembly\n\n## Version\n\nDate        | Author                  | Contact               | Version | Comment\n---         | ---                     | ---                   | ---     | ---\n27/10/2019  | noraj (Alexandre ZANNI) | noraj#0833 on discord | 1.0     | Document creation\n\n## Information\n\nInformation displayed for CTF players:\n\n+ **Name of the challenge** / **Nom du challenge**: `Matz 2.3`\n+ **Category** / **Catégorie**: `Reverse`\n+ **Internet**: not needed\n+ **Difficulty** / **Difficulté**: easy / facile\n\n### Description\n\n```\nHaaaaa the script was removed by SIben, only this weird file is left :/\nHelppppppp me!\n\nFlag format: sigsegv{flag}\n\nauthor: [noraj](https://pwn.by/noraj/)\n```\n\n### Hints\n\n- Hint1: Ruby\n- Hint2: bytecode\n\n## Integration\n\nJust share the `.rbc` file.\n\n## Solving\n\n### Author solution\n\n- `.rb` (Ruby) --\u003e `.rbc` same as `.py` (Python) --\u003e `.pyc`, the c stands for compiled\n- `.rbc` is some ruby bytecode\n- (The title `Matz 2.3` can help; *Matz* is the ruby creator's nickname and `2.3` is the ruby version where bytecode compilation was introduced)\n- OSINT skill: *How to compile Ruby?*: https://stackoverflow.com/questions/5902334/how-to-compile-ruby/44613584#44613584\n- OSINT skill: *RubyVM::InstructionSequence*: https://ruby-doc.org/core-2.6.5/RubyVM/InstructionSequence.html\n- disassemble the bytecode in human readble instructions (use `load.rb`)\n\nObtains something like that:\n\n```\n$ ruby load.rb \n== disasm: #\u003cISeq:\u003cmain\u003e@script.rb:1 (1,0)-(44,19)\u003e (catch: FALSE)\nlocal table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])\n[ 1] a198563@0\n0000 newarray                     0                                   (   1)[Li]\n0002 setlocal_WC_0                a198563@0\n0004 getlocal_WC_0                a198563@0                           (   2)[Li]\n0006 putobject                    29\n0008 putobject                    116\n0010 opt_aset                     \u003ccallinfo!mid:[]=, argc:2, ARGS_SIMPLE\u003e, \u003ccallcache\u003e\n0013 pop\n0014 getlocal_WC_0                a198563@0                           (   3)[Li]\n0016 putobject                    16\n0018 putobject                    99\n0020 opt_aset                     \u003ccallinfo!mid:[]=, argc:2, ARGS_SIMPLE\u003e, \u003ccallcache\u003e\n0023 pop\n0024 getlocal_WC_0                a198563@0                           (   4)[Li]\n0026 putobject                    31\n0028 putobject                    95\n0030 opt_aset                     \u003ccallinfo!mid:[]=, argc:2, ARGS_SIMPLE\u003e, \u003ccallcache\u003e\n...\n```\n\n`a198563` is the array name, `29` is the array index, `116` is the value assigned to it.\n\nRetrieve all values. You will end with something like in `script.rb`.\n\nThen transform the array of int into ASCII text:\n\n```ruby\nputs a198563.map{|i| i.chr}.join\n```\n\n## Flag\n\n`sigsegv{you_c4n_c0mp1le_ruby_t0_bytec0de}`\n\n## SigSegV2\n\nA reverse challenge that was available during SigSegV2 CTF (2019).\n\n8 teams on 36 flaged this challenge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoraj%2Fsigsegv2.reverse_6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoraj%2Fsigsegv2.reverse_6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoraj%2Fsigsegv2.reverse_6/lists"}