Closed rockingdice closed 4 months ago
grab your openai token and start talking using REST API to chatgpt? become a gpt promt engineer or so... but this is a manual activity IMHO
I'm not sure how this stuff could be combined with old-school pycdc?
@greenozon well I'm not a fan of AI so I said I prefer to use pycdc. But here's my thoughts: pycdc is not working properly for JUMP_FORWARD in my case, it could be a rare case, that some patterns of python code are not well handled/considered. But I don't have the source code, so from pyc bytecode only, it's hard to find the real problem. We have to find the original pattern of py codes first.
The key point is, manually recovering the specific py code is hard for us, but not for AI. AI can generate py code from pyc bytecodes, although it may or may not work, if we can get some py codes to generate the same bytecodes, we could reproduce the problem. If we could reproduce the problem we could improve the pycdc as well. The final goal is to make pycdc better.
Uncompyle6 is awesome, but it has a fundamental problem in the way it handles control flow. In the early days of Python when there was little optimization and code was generated in a very template-oriented way, figuring out control flow-structures could be done by simply looking at code patterns.
Over the years more code optimization, specifically around handling jumps has made it harder to support detecting control flow strictly from code patterns. This was noticed as far back as Python 2.4 (2004) but since this is a difficult problem, so far it hasn't been tackled in a satisfactory way.
Quoted from https://github.com/rocky/python-decompile3, I think the problem is the same.
well, even if AI will somehow help out with generating python code out from pycdas/opcodes you'll not have any clue how to code it inside the C++ code, aren't you?
hey, crazy idea came to my mind - how about ask AI to add the missed C++ code into pycdc? will it eat all the GH repo and make a genius outcomes??? :)
I don't expect AI to do all of the work, but at least, we should keep open minds. Thanks for your time, I'll close this one and hope this could inspire someone.
from an interesting video: https://www.youtube.com/watch?v=RTsMgC36xMU
I know chatgpt can generate a better py code from bytecodes generated by pycdas. But it's still a lot of human work to "chat" with it, so I prefer to use pycdc instead. But what we are facing, is the control flow, which is more complicated to cover each corner case. So can we just use AI to decompile those bytecodes and then analyze the cases to improve pycdc?