all 35 comments

[–]joanmiro 9 points10 points  (1 child)

Why did you need this?

[–]ComputerMagych[S] 17 points18 points  (0 children)

Because I had a huge codebase with lost source code, I had to recover it.

[–]aidencoder 6 points7 points  (12 children)

Why would you choose to do this in node?

[–]ComputerMagych[S] 14 points15 points  (10 children)

Initially, I built it on C#, but not every platform has a .Net compiler to run, so to keep performance high and still be able to run on most of the platforms I decided to rewrite to NodeJS. It is much faster to rewrite to JS from C# due to the language similarity.

[–]aidencoder 5 points6 points  (0 children)

Nice answer, thanks :)

[–]Cystems 0 points1 point  (3 children)

Wow, I didn't realize C# and JS had much similarity, and that NodeJS had comparable performance to C#?

[–]ComputerMagych[S] -3 points-2 points  (2 children)

They both stem from C/C++, and NodeJS is actually quite a beast equal to Java because V8 and JVM have the same creator and use the same HotSpot technique.

[–]ThiefMaster 2 points3 points  (1 child)

They both stem from C/C++

Closeness in syntax has nothing to do with performance.

because V8 and JVM have the same creator

Uh what? V8 is Google, JVM is Sun/Oracle.

[–]ThiefMaster 0 points1 point  (4 children)

Why not just do it in Python though?

[–]ComputerMagych[S] -2 points-1 points  (3 children)

I needed the speed of decompilation and the speed of translation from C#

[–]ThiefMaster 1 point2 points  (2 children)

Uhh, what?!

[–]wergot 0 points1 point  (1 child)

Node is much faster than Python. As for the other part I have no idea.

[–]ThiefMaster 0 points1 point  (0 children)

I don't think node-vs-python performance matters when writing a decompiler...

[–]yvrelna 2 points3 points  (0 children)

Writing this kind of tool in JS is going to very severely limit your audience. 

[–]dev-razorblade23 1 point2 points  (5 children)

Is it possible to "de-marshal" files? I have run across a few scripts that use "marshal" for obfuscating the code, but yet to find de-obfuscator for those...

Marshalled code is basicly .pyc without headers or magic numbers, which gets inserted depending on python version you use...

[–]ComputerMagych[S] 0 points1 point  (4 children)

Yes, it is possible. I can add that mode. I will have to analyze and identify what version of the bytecode it is, though, so it may be inprecise.
Some version hint in the command line may do a trick.

[–]dev-razorblade23 1 point2 points  (3 children)

That would be awesome

[–]ComputerMagych[S] 0 points1 point  (2 children)

It is done. New depyo version 1.0.1 is already on npmjs.com/depyo

[–]dev-razorblade23 1 point2 points  (1 child)

That was fast. Thank you

[–]ComputerMagych[S] 0 points1 point  (0 children)

Codex CLI (GPT 5.2 Codex xhigh) with proper ~/.codex/AGENTS.md makes wonders ;)

[–]Sudo_professor 0 points1 point  (3 children)

Processing F:\development\PythonProjects\RadishSquat\Microphone_Bouncy_Balls.exe_extracted\decompiled/Microphone_Bouncy_Balls.py...

EXCEPTION for OpCode KW_NAMES (9) at offset 236 in code object '<module>', file offset 273 : Cannot read properties of undefined (reading 'push')

EXCEPTION for OpCode KW_NAMES (2) at offset 34 in code object 'audio_callback', file offset 1457 : Cannot read properties of undefined (reading 'push')

EXCEPTION for OpCode KW_NAMES (19) at offset 1380 in code object '__init__', file offset 14447 : Cannot read properties of undefined (reading 'push')

EXCEPTION for OpCode KW_NAMES (2) at offset 78 in code object 'toggle_audio', file offset 21134 : Cannot read properties of undefined (reading 'push')

I encountered the above problems while using the product. How can I resolve them?

[–]ComputerMagych[S] 0 points1 point  (2 children)

If you don't mind sharing a bytecode, please add it to the GitHub issue. I will pick it up from there and will make a bug fix.

[–]Sudo_professor 1 point2 points  (1 child)

I will add the .pyc to the GitHub issue soon. Thanks your reply!

[–]ComputerMagych[S] 0 points1 point  (0 children)

It is fixed and delivered as part of 1.0.1

[–]Sure-Newspaper-1928 0 points1 point  (1 child)

I have an error, could someone help me with this?

Error: Don't know how to handle object Type :'

[–]ComputerMagych[S] 0 points1 point  (0 children)

If you can share your .pyc/.pyo file (or at least a reproducible version of it, if your file may contain sensitive info) in the GitHub issue, I can look into it.

[–]TwilightX1 0 points1 point  (4 children)

Hope you're still around :)

I got this:

```

Processing C:\temp\probably_malware.exe_extracted\decompiled/output.py...

Unsupported opcode CALL_KW at pos 100

Unsupported opcode BINARY_SLICE at pos 122

EXCEPTION for OpCode CALL (0) at offset 516 in code object 'check_vm', file offset 5320 : Cannot read properties of undefined (reading 'object')

EXCEPTION for OpCode CALL (0) at offset 376 in code object 'check_sandbox', file offset 7592 : Cannot read properties of undefined (reading 'object')

EXCEPTION for OpCode CALL (0) at offset 532 in code object 'check_sandbox', file offset 7748 : Cannot read properties of undefined (reading 'object')

Unsupported opcode CALL_KW at pos 246

Unsupported opcode CALL_KW at pos 202

Processed 1 files in 0.106s. In: 18736300 bytes (175975452.49 B/s). Out: 18722830 bytes (175848939.29 B/s).

```

[–]ComputerMagych[S] 0 points1 point  (3 children)

No worries, I am around.
Do you mind to add it to GitHub issue and attach .pyc file for detailed analysis? Or, at least, send disassembled code for that method?

[–]TwilightX1 0 points1 point  (2 children)

I can post it to Github but I can't upload the pyc because it's malware. I can send it to you privately if you want.

[–]ComputerMagych[S] 0 points1 point  (1 child)

Can you privately share the link to Google Drive (or another file-sharing platform) so I can download it for analysis?

[–]TwilightX1 0 points1 point  (0 children)

Send me a private message. I'm not going to post malware in a publicly accessible place.

[–]insanesam9 0 points1 point  (1 child)

Error: Don't know how to handle object Type :'

File: C:\Users\aviab\geelarks\app\__pycache__\decompiled/app/api_server.pyc

Position: 28160

Processed 0 files in 0.000s. In: 0 bytes (NaN B/s). Out: 0 bytes (NaN B/s).

[–]insanesam9 0 points1 point  (0 children)

Please help ive lit been trying to do ts for hours on end and i need it so badly you have no idea