×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Problem with pyobfuscate

    I took a very simple code I've written and tried to pyobfuscate it. Got this error note, just below the URL. Any ideas what it means? How to fix something?

    The "KeyError: draw_count" mentioned on last row refers to a function in the script.

    http://jouni.miettunen.googlepages.com/countdown

    Code:
    C:\temp>pyobfuscate-0.3\pyobfuscate CountDown.py > test.py
    Traceback (most recent call last):
      File "C:\temp\pyobfuscate-0.3\pyobfuscate.py", line 8, in <module>
        execfile(root)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 1101, in <module>
        main()
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 1078, in main
        cw = CSTWalker(source_no_encoding, pae.pubapi)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 125, in __init__
        self.walk(elements, [self.symtab])
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 189, in walk
        self.handle_funcdef(elements, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 232, in handle_funcdef
        self.walk(node, symtabs + [functab])
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 187, in walk
        self.handle_power(elements, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 662, in handle_power
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 205, in walk
        self.handle_trailer(elements, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 493, in handle_trailer
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 209, in walk
        self.handle_argument(elements, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 601, in handle_argument
        self.walk(node, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 211, in walk
        self.handle_lambdef(elements, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 616, in handle_lambdef
        self.walk(node, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 214, in walk
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 187, in walk
        self.handle_power(elements, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 662, in handle_power
        self.walk(node, symtabs, functioncall)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 203, in walk
        self.handle_atom(elements, symtabs)
      File "C:\temp\pyobfuscate-0.3\pyobfuscate", line 431, in handle_atom
        s = tab.lookup(id)
      File "C:\Python25\lib\symtable.py", line 110, in lookup
        flags = self._table.symbols[name]
    KeyError: 'draw_count'
    Cheers,

    --jouni

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Problem with pyobfuscate

    Just some additional info: managed to pyobfuscate "rolabol.py", installed on hardware and run. It works partially, but not fully: got error about "UnboundLocalError: local variable ... referenced before assignment".

    I guess if I want to use pyobfuscate, then I need to code in certain specific way. Does anyone know any such tips? Using version 0.3.

    Wondering,

    --jouni

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    77

    Re: Problem with pyobfuscate

    Using pyobfuscate I encountered two pitfalls:
    - each 'import' statement had do be on it's own line (not comma seperated)
    - special charcters in unicode strings (e.g. Umlauts ä,ö,ü,...) had to be encoded (e.g. ö -> \u00f6)

    HTH Martin

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: Problem with pyobfuscate

    Quote Originally Posted by dehlerm View Post
    Using pyobfuscate I encountered two pitfalls:
    - each 'import' statement had do be on it's own line (not comma seperated)
    - special charcters in unicode strings (e.g. Umlauts ä,ö,ü,...) had to be encoded (e.g. ö -> \u00f6)
    Thanx for tips, but I'm clean with both already. Have to be something else.. Also noticed that pyobfuscate didn't remove all comment lines, so there's something definitely wrong.

    Just realized that it's a non-pys60 python app! I could use some real Python IDE with a real Debugger

    Cheers,

    --jouni

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  5. wireless problem
    By sash_mca in forum Mobile Web Site Development
    Replies: 0
    Last Post: 2003-06-06, 11:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •