-
Notifications
You must be signed in to change notification settings - Fork 37
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
Possible bug in assembler.py #3
Comments
Yes, ideally the bytecode_simplifier/assembler.py Lines 84 to 86 in 42f4e3e
The As for the second question, there's no need to change the argument. For instructions which reference another instruction such as bytecode_simplifier/instruction.py Lines 4 to 23 in 42f4e3e
This is done during the disassembling step in function I would like to continue development but I haven't checked PjOrion lately. So the code is out of date and maybe a lot of changes need to be made to make it working. If you're interested in working on this then I can help. |
Thank you, your help would be very useful. As far as I'm concerned, pjorion hasn't changed at least the outer layers structure, judging by the signature I met in the file and the v1 signature checked by your tool. |
Actually, now that I've completed implementing and fixing this stuff, I can see it doesn't work now). Pjorion has the code for inner eval zlib-ed inside its code. I'm currently trying to think of another method of deobfuscation. Running a pyc through my edited version of this makes it break when launched. If anyone still wants it, I can upload it. |
IIRC there were multiple layers. It was possible to unwrap the layers by bytecode tracing. I had built a tool for this Once we get to the final innermost layer we could then run |
Oh, thanks, I shall try that |
Nope, they don't leave line numbers and break if they're added(. I have another idea, but I can't really implement it: What if you could just compile a custom cpython2.7 with |
Nice idea. That's similar to what See:
Python has a |
Wow, thanks. Although, my system is a giant mess, so it's gonna be quite a struggle to compile that or even launch the precompiled one (UPD. Already failed)). But still, thanks a lot. I just managed to fix my linux vm, so hopefully I can now install zlib, at least |
You know, now that I think of it... BigWorld must be inside the wot's distribution of python. Could there be a way to modify an existing build's debug-ness? Or, more likely, embed a precompiled module into another build? Combine them, basically. |
Yep, BigWorld is a part of wot engine. Maybe there's a way to fake the presence of the BigWorld module so that atleast it runs. This may help: |
Yes, I've already tried it, but pj seems to perform some more complex checks, as with a fake module it just freezes endlessly. That is why I want to communicate with either a perfect copy of; or the legitimate BigWorld. If extraction isn't an option, I guess some kind of RPC-receiver wot mod with RPC-transmitter fake BigWorld could work |
Just an update. The RPC idea is possible but I haven't tested it. Here I was able to fake the presence of the Put the |
And the reason why a fake Which means we do not need to have a modded version of Python with tracing support. |
Wow, that is great news. I just came back online, sorry for late responce. I'll try to implement or find an automated python dumper, and will report here on my results. Also, I just realized I shoul probably upload my update to bytecode-simplifier, I'll try my best to do it today. Your assistance was really helpful, thanks again |
I made a pull request |
Thanks for the PR! |
!!Thankyou fou your bytecode_simplifier fix ,and Do you have a solution about BigWorld |
No, sorry, I don't yet have one. I'll try to return to that soon, but I currently have a lot of exams, so I can't promise anything |
Update: yesterday I finally took the time to fully deal with unwrapping, and it somewhat worked. Now I have a simple pjorion-protected file (which I can upload, if anyone needs), but now I'm having to deal with bytecode-simplifier's actual problems. First of all, some deprecated/unavaivable features of networkx are used, which I had to replace, and it all seemed fine. But nowt seems to get stuck at simplifying basic blocks (or at least it runs long enough for me to get bored). I'm unsure if that's my fault or simplifier's, so I would really love to get feedback from @extremecoders-re on this. If you need my pyc, I won't be able to provide it until maybe 9 hours from now, but after that it's all yours |
Disassembler.py on line 214 adds the same node to the graph twice - that might be the cause, will test as soon as I get to my pc (a.k.a. 9h later) |
I'm slightly concerned by the following lines in the assembler.py:
This modifies the opcode value without changing the mnemonic, and, more importnantly, the argument - I suppose this should at least add the current instruction's offset to the arg.
P.S. A bit of a backstory:
I'm currently trying to add the support of EXTENDED_ARG stuff, but for that I need to understand the principles of the whole app. The idea I came up with is just to interpret them with the following opcode as one big opcode 6 bytes long, and after that come the details. I started this because I'm trying to decompile one obfuscated wot mod, so I'm simultaneously facing both the BigWorld and EXTENDED_ARG problems, and I have actually figured out some interesting solutions, but I could really use better understanding of the obfuscation.
Also I'm intrested in whether the author, @extremecoders-re is still maintaining this project and if he is interested in continuing the development?
The text was updated successfully, but these errors were encountered: