Skip to content
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

Error when using keyword argument and try structure #512

Open
zhou-tian-xing opened this issue Aug 16, 2024 · 0 comments
Open

Error when using keyword argument and try structure #512

zhou-tian-xing opened this issue Aug 16, 2024 · 0 comments

Comments

@zhou-tian-xing
Copy link

pycdc.exe test.pyc > decompiled_pycdc.py
Well, when I use pycdc.exe which I compiled only a few days ago, no error message appeared, and here's part of the result:

def send_thread():
    while None:
        for s in socks:
            
            try:
                s.send('f'.encode())
            continue
            except Exception:
                ex = None
                
                try:
                    log_text.insert(tk.END, f'''Send Exception: {ex}\n''')
                    socks.remove(s)
                    s.close()
                finally:
                    ex = None
                    del ex

                continue
-- skip --
def ...
    -- skip --
    MAX_CONN = None(conn_entry.get())
    buf = 'POST %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %d\r\nCookie: %s\r\n\r\n' % (PAGE, HOST, CONTENT_LENGTH, COOKIE)
    socks = []
    conn_th = threading.Thread(conn_thread, **('target',))
    send_th = threading.Thread(send_thread, **('target',))
    conn_th.start()
    send_th.start()
    -- skip --

In these places, there are clearly errors:

  • try - continue - except
  • ex = None
  • None(conn_entry.get())
  • conn_th = threading.Thread(conn_thread, **('target',))
  • send_th = threading.Thread(send_thread, **('target',))

By using uncompyle6, I am certain that the code here should be

def send_thread():
    while True:
        for s in socks:
            try:
                s.send("f".encode())
            except Exception as ex:
                try:
                    log_text.insert(tk.END, f"Send Exception: {ex}\n")
                    socks.remove(s)
                    s.close()
                finally:
                    ex = None
                    del ex

        time.sleep(1)
-- skip --
def ...
    -- skip --
    MAX_CONN = int(conn_entry.get())
    buf = "POST %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %d\r\nCookie: %s\r\n\r\n" % (
     PAGE, HOST, CONTENT_LENGTH, COOKIE)
    socks = []
    conn_th = threading.Thread(target=conn_thread)
    send_th = threading.Thread(target=send_thread)
    conn_th.start()
    send_th.start()
    -- skip --

I will attach the results of uncompyle6 (Tested and effective, corrected some of the string decoding errors), pycdc and pycdas to help solve the problem. Of course, the pyc file is also included.
decomplied.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant