retdec
llvm-cbe
retdec | llvm-cbe | |
---|---|---|
6 | 14 | |
7,786 | 794 | |
0.8% | 1.4% | |
7.0 | 6.5 | |
2 days ago | 13 days ago | |
C++ | C++ | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
retdec
-
need help with an old game trainer
found something called retdec @ https://github.com/avast/retdec
-
How to compile to make reverse engineering easy?
RetDec
-
rust to c complication?
https://github.com/avast/retdec (multiple machine code formats to C/C++)
-
CDDC 2022 in Thailand Outfield
// // This file was generated by the Retargetable Decompiler // Website: https://retdec.com // Copyright (c) Retargetable Decompiler // #include #include #include #include // ------------------------ Structures ------------------------ struct _IO_FILE { int32_t e0; }; // ------------------- Function Prototypes -------------------- int64_t __do_global_dtors_aux(void); int64_t __libc_csu_fini(void); int64_t __libc_csu_init(int64_t a1, int64_t a2, int64_t a3); int64_t _fini(void); int64_t _init(void); int64_t _start(int64_t a1, int64_t a2, int64_t a3, int64_t a4); int64_t deregister_tm_clones(void); int64_t frame_dummy(void); int32_t function_7b0(char * s1, char * s2, int32_t n); int32_t function_7c0(int64_t * ptr, int32_t size, int32_t n, struct _IO_FILE * stream); int32_t function_7d0(struct _IO_FILE * stream); void function_7e0(void); int32_t function_7f0(char * format, ...); char * function_800(char * s, int32_t n, struct _IO_FILE * stream); int32_t function_810(struct _IO_FILE * stream, char * buf, int32_t modes, int32_t n); struct _IO_FILE * function_820(char * filename, char * modes); void function_830(char * s); void function_840(int32_t status); void function_850(int64_t * d); int64_t readflag(void); int64_t register_tm_clones(void); // --------------------- Global Variables --------------------- int64_t g1 = 2400; // 0x200d70 int64_t g2 = 2336; // 0x200d78 struct _IO_FILE * g3 = NULL; // 0x201020 struct _IO_FILE * g4 = NULL; // 0x201030 char g5 = 0; // 0x201038 char * g6; // 0x201040 int32_t g7 = 0; // 0x400 int32_t g8; // ------------------------ Functions ------------------------- // Address range: 0x788 - 0x79f int64_t _init(void) { int64_t result = 0; // 0x796 if (*(int64_t *)0x200fe8 != 0) { // 0x798 __gmon_start__(); result = &g8; } // 0x79a return result; } // Address range: 0x7b0 - 0x7b6 int32_t function_7b0(char * s1, char * s2, int32_t n) { // 0x7b0 return strncmp(s1, s2, n); } // Address range: 0x7c0 - 0x7c6 int32_t function_7c0(int64_t * ptr, int32_t size, int32_t n, struct _IO_FILE * stream) { // 0x7c0 return fread(ptr, size, n, stream); } // Address range: 0x7d0 - 0x7d6 int32_t function_7d0(struct _IO_FILE * stream) { // 0x7d0 return fclose(stream); } // Address range: 0x7e0 - 0x7e6 void function_7e0(void) { // 0x7e0 __stack_chk_fail(); } // Address range: 0x7f0 - 0x7f6 int32_t function_7f0(char * format, ...) { // 0x7f0 return printf(format); } // Address range: 0x800 - 0x806 char * function_800(char * s, int32_t n, struct _IO_FILE * stream) { // 0x800 return fgets(s, n, stream); } // Address range: 0x810 - 0x816 int32_t function_810(struct _IO_FILE * stream, char * buf, int32_t modes, int32_t n) { // 0x810 return setvbuf(stream, buf, modes, n); } // Address range: 0x820 - 0x826 struct _IO_FILE * function_820(char * filename, char * modes) { // 0x820 return fopen(filename, modes); } // Address range: 0x830 - 0x836 void function_830(char * s) { // 0x830 perror(s); } // Address range: 0x840 - 0x846 void function_840(int32_t status) { // 0x840 exit(status); } // Address range: 0x850 - 0x856 void function_850(int64_t * d) { // 0x850 __cxa_finalize(d); } // Address range: 0x860 - 0x88b int64_t _start(int64_t a1, int64_t a2, int64_t a3, int64_t a4) { // 0x860 int64_t v1; // 0x860 __libc_start_main(2518, (int32_t)a4, (char **)&v1, (void (*)())2816, (void (*)())2928, (void (*)())a3); __asm_hlt(); // UNREACHABLE } // Address range: 0x890 - 0x8c2 int64_t deregister_tm_clones(void) { // 0x890 return (int64_t)&g3; } // Address range: 0x8d0 - 0x912 int64_t register_tm_clones(void) { // 0x8d0 return 0; } // Address range: 0x920 - 0x95a int64_t __do_global_dtors_aux(void) { // 0x920 if (g5 != 0) { // 0x958 int64_t result; // 0x920 return result; } // 0x929 if (*(int64_t *)0x200ff8 != 0) { // 0x937 __cxa_finalize((int64_t *)*(int64_t *)0x201008); } int64_t result2 = deregister_tm_clones(); // 0x943 g5 = 1; return result2; } // Address range: 0x960 - 0x96a int64_t frame_dummy(void) { // 0x960 return register_tm_clones(); } // Address range: 0x96a - 0x9d6 int64_t readflag(void) { struct _IO_FILE * file = fopen("flag", "rb"); // 0x980 if (file != NULL) { // 0x9a6 fread((int64_t *)&g6, (int32_t)&g7, 1, file); fclose(file); return 0; } // 0x990 perror("[-] flag file "); exit(0); // UNREACHABLE } // Address range: 0x9d6 - 0xaf7 int main(int argc, char ** argv) { int64_t v1 = __readfsqword(40); // 0x9e1 setvbuf(g3, NULL, 1, 0); setvbuf(g4, NULL, 1, 0); readflag(); printf("[+] password => %p\n", (int64_t *)"P4s$w0rD"); int64_t str; // bp-1048, 0x9d6 fgets((char *)&str, (int32_t)&g7, g4); printf((char *)&str); if (strncmp("P4s$w0rD", "weakpass", 8) != 0) { // 0xac4 printf("[!] password is %s\n", "P4s$w0rD"); } else { // 0xaaa printf("[+] %s", (char *)&g6); } int64_t result = 0; // 0xaee if (v1 != __readfsqword(40)) { // 0xaf0 __stack_chk_fail(); result = &g8; } // 0xaf5 return result; } // Address range: 0xb00 - 0xb65 int64_t __libc_csu_init(int64_t a1, int64_t a2, int64_t a3) { int64_t result = _init(); // 0xb2c if ((int64_t)&g2 - (int64_t)&g1 >> 3 == 0) { // 0xb56 return result; } int64_t v1 = 0; // 0xb34 while (v1 + 1 != (int64_t)&g2 - (int64_t)&g1 >> 3) { // 0xb40 v1++; } // 0xb56 return result; } // Address range: 0xb70 - 0xb72 int64_t __libc_csu_fini(void) { // 0xb70 int64_t result; // 0xb70 return result; } // Address range: 0xb74 - 0xb7d int64_t _fini(void) { // 0xb74 int64_t result; // 0xb74 return result; } // --------------- Dynamically Linked Functions --------------- // void __cxa_finalize(void * d); // void __gmon_start__(void); // int __libc_start_main(int *(main)(int, char **, char **), int argc, char ** ubp_av, void(* init)(void), void(* fini)(void), void(* rtld_fini)(void), void(* stack_end)); // void __stack_chk_fail(void); // void exit(int status); // int fclose(FILE * stream); // char * fgets(char * restrict s, int n, FILE * restrict stream); // FILE * fopen(const char * restrict filename, const char * restrict modes); // size_t fread(void * restrict ptr, size_t size, size_t n, FILE * restrict stream); // void perror(const char * s); // int printf(const char * restrict format, ...); // int setvbuf(FILE * restrict stream, char * restrict buf, int modes, size_t n); // int strncmp(const char * s1, const char * s2, size_t n); // --------------------- Meta-Information --------------------- // Detected compiler/packer: gcc (7.5.0) // Detected functions: 22
- Old C code – how to upgrade it?
- RetDec – retargetable machine-code decompiler based on LLVM
llvm-cbe
-
Ask HN: LLVM vs. C
So how does the LLVM C backend work then?
https://github.com/JuliaHubOSS/llvm-cbe
-
rust to c complication?
One alternative worth mentioning, though, would be the LLVM C Backend maintained by the Julia community.
-
Programming language that compiles to clean C89 or C99?
If you drop "easily" and "human" (/s) from your requirements list, then the C backend for LLVM might work. Then you can choose any programming language you want that has LLVM 10-compatible frontend.
-
Easy way to convert a C++ library into straight C ?
If you really must have something that compiles in C (e.g. for a platform where you only have a C compiler) there's an LLVM backend that outputs C code: https://github.com/JuliaComputingOSS/llvm-cbe
- Snowman native code to C/C++ decompiler for x86/x86_64/ARM
-
Can Rust do every low level stuff C/C++ do?
You can convert llvm bitcode to C and then use C compiler, there is such project https://github.com/JuliaComputingOSS/llvm-cbe .
-
lipstick: a Rust-like syntax frontend for C
I'm really surprised that the LLVM C backends have continually been resurrected then abandoned over the years. It's a good solution to this sort of thing and would enable a lot of cool stuff like Rust to weird embedded platforms. The most recent one is the Julia backend: https://github.com/JuliaComputingOSS/llvm-cbe
-
C++ to C converter?
Check this project out: https://github.com/JuliaComputingOSS/llvm-cbe.
-
Show HN: prometeo – a Python-to-C transpiler for high-performance computing
Well IMO it can definitely be rewritten in Julia, and to an easier degree than python since Julia allows hooking into the compiler pipeline at many areas of the stack. It's lispy an built from the ground up for codegen, with libraries like (https://github.com/JuliaSymbolics/Metatheory.jl) that provide high level pattern matching with e-graphs. The question is whether it's worth your time to learn Julia to do so.
You could also do it at the LLVM level: https://github.com/JuliaComputingOSS/llvm-cbe
For interesting takes on that, you can see https://github.com/JuliaLinearAlgebra/Octavian.jl which relies on loopvectorization.jl to do transforms on Julia AST beyond what LLVM does. Because of that, Octavian.jl beats openblas on many linalg benchmarks
-
Writing a SQLite clone from scratch in C
You can try your luck with the "resurrected" C backend: https://github.com/JuliaComputingOSS/llvm-cbe
I don't understand why I see so many requests for LLVM-based languages to change around their backend or IR, that seems to be a huge amount of work for comparatively little benefit. The correct thing to do there is to just add support for those to LLVM.
What are some alternatives?
copycat - A concatenative language on Scheme
mrustc - Alternative rust compiler (re-implementation)
stoical - An ancient forth like language
nim-esp8266-sdk - Nim wrapper for the ESP8266 NON-OS SDK
unwebpack-sourcemap - Extract uncompiled, uncompressed SPA code from Webpack source maps.
llvm-project - Fork of LLVM with Xtensa specific patches. To be upstreamed.
stoical-mentoring
prometeo - An experimental Python-to-C transpiler and domain specific language for embedded high-performance computing
mstoical - MStoical - a Forth like language, but better
ulisp - A version of the Lisp programming language for ATmega-based Arduino boards.
oscp - Designed for automated enumeration for ethical hacking and penetration testing
acados - Fast and embedded solvers for nonlinear optimal control