Commit Graph

18 Commits

Author SHA1 Message Date
Dhruv Maroo
b66c9091cc Remove ELF specific section finding (no longer using .rodata)
* Now it searches the address set instead of getting the `.rodata`
      section (only for ELF)
    * See DMaroo/GhidRust#3 for more
2023-05-08 13:17:17 +05:30
Dhruv Maroo
08f9e914d2 Remove parens for if conditions 2023-04-28 01:31:07 +05:30
Dhruv Maroo
6b91c2564f Add better decompilation example's image in README 2023-04-27 04:21:32 +05:30
Dhruv Maroo
61d0e9b94a Add support for more statements
* If statements decompiled correctly
    * Unary expressions have neater decompilation
    * Break and continue statements
    * Comparison operators decompiled correctly
2023-04-26 23:50:32 +05:30
Dhruv Maroo
3095de7bbd Add decompilation logic for while and do-while statements 2023-04-26 08:42:43 +05:30
Dhruv Maroo
2891356e1b Add CContext to store context information while parsing
* For now, it is being used to denote whether to use a semicolon or
      not
2023-04-26 08:41:30 +05:30
Dhruv Maroo
f0f3d0d747 Add a separate formatter
* This would allow for custom formatting
    * Keeps the CVisitor simple
2023-04-26 08:40:45 +05:30
Dhruv Maroo
d317d6ff3c Add decompilation logic for array indexing
* Add parens while casting
    * Simplifies newline insertion and ";" insertion
2023-04-23 17:37:13 +05:30
Dhruv Maroo
425c633efe Add decompilation logic for more constructs
* Function calls decompiled correctly
    * Add boolean type and boolean constants in the grammar
    * Allow angled braces in identifier names
    * Overload the `transpile` to also allow input streams
    * Update the generate script accordingly
2023-04-23 17:11:26 +05:30
Dhruv Maroo
6debceb8b5 Add parsing and codegen for assignment and declaration 2023-04-23 17:11:26 +05:30
Dhruv Maroo
a206ec28f3 Add decompilation support for function arguments 2023-04-22 07:38:40 +05:30
Dhruv Maroo
c24ddf0a79 Remove unused functions and variables 2023-04-22 07:38:25 +05:30
Dhruv Maroo
59fef18c3a Make the decompiler plugin invoke the transpiler 2023-04-22 07:04:44 +05:30
Dhruv Maroo
c8231649a0 Use correct fucntion for the popup 2023-04-22 00:21:37 +05:30
Dhruv Maroo
8f7c12d3fe Add C to Rust transpiler
* Add grammar for C and transpile it to Rust code
  * Add `generate.sh` to generate the JavaCC and JJTree files
  * Update `build.sh`
2023-04-21 19:02:44 +05:30
Dhruv Maroo
32ce329db1 Add Rust decompiler widget plugin 2023-04-21 01:04:29 +05:30
Dhruv Maroo
27586dd822 Move RustStdAnalyzer and restructure directories 2023-04-21 01:04:06 +05:30
Dhruv Maroo
159b1377cf Add RustStdAnalyzer analyzer extension
* This extension uses an existing Function ID database to apply
    function signatures to Rust binaries (very useful in case of
    stripped binaries)
  * So this extension basically detects a Rust binary and auto-applies
    the correct `libstd` Rust function signatures, pretty cool
  * Plus, you can also add your own Function ID databases in the `data/`
    subdirectory if you want to apply even more signatures or, say,
    custom signatures
2023-04-14 06:00:17 +05:30