Hnfull / Intensio-Obfuscator

Obfuscate a python code 2.x and 3.x
MIT License
624 stars 129 forks source link

Obfuscation causes Syntax-Error #62

Open janandreschweiger opened 3 years ago

janandreschweiger commented 3 years ago

Bug

Description

The obfuscated version of my source code causes a syntax-error. The Obfuscator fails for the following line of code: IN: cdigit = len([c for c in word if c.isdigit()]) OUT: zFeioDlTfpYzSUvOgZUZkltsoFUoTyWf = len([DlzmRlHwmevoQIWABRncFEjrQCwpUGPV for TQJeesOlSujVTdJULoVophDyNCzrbekb .isdigit()])

Versions:

Obfuscator: latest Python: 3.6

IN:

Please consider that the following method is part of a class:

def getTag(self, word, i):  # kind of word (d...digit, etc.)
    try:
        w2 = word.replace(",","")
        float(w2)
        return "d"
    except:
        cdigit = len([c for c in word if c.isdigit()])  #  <-- SYNTAX ERROR
        calpha = len([c for c in word if c.isalpha()])
        if ( cdigit > 0 and calpha > 0 ) or (cdigit == 0 and calpha == 0) or len([c for c in word if c in self.exclude]) > 1:
            return "u"
        if len(word) == len([c for c in word if c.isupper()]):
            return "a"
        if len([c for c in word if c.isupper()]) == 1 and len(word) > 1 and word[0].isupper() and i > 0:
            return "n"
    return "p"

OUT:

def rzSyVhBVEtYbwOdUJpPlGuKTELGZLLAW(self, word, lwTFncXIDEvaMsvohjjyGvChmPPvYclH):  
    try:
        EcYkWhLIPYBGxqIypaxXfWDwtJkOadjI = word.replace(",","")
        float(EcYkWhLIPYBGxqIypaxXfWDwtJkOadjI)
        return "d"
    except:
zFeioDlTfpYzSUvOgZUZkltsoFUoTyWf = len([DlzmRlHwmevoQIWABRncFEjrQCwpUGPV for TQJeesOlSujVTdJULoVophDyNCzrbekb .isdigit()])  #  <--- SYNTAX ERROR
        IZwUazDdasETcJKDoUwuWMpACRmTUJEs = len([DlzmRlHwmevoQIWABRncFEjrQCwpUGPV for TQJeesOlSujVTdJULoVophDyNCzrbekb .isalpha()])
        if ( zFeioDlTfpYzSUvOgZUZkltsoFUoTyWf > 0 and IZwUazDdasETcJKDoUwuWMpACRmTUJEs > 0 ) or (zFeioDlTfpYzSUvOgZUZkltsoFUoTyWf == 0 and IZwUazDdasETcJKDoUwuWMpACRmTUJEs == 0) or len([DlzmRlHwmevoQ$
            return "u"
        if len(word) == len([DlzmRlHwmevoQIWABRncFEjrQCwpUGPV for TQJeesOlSujVTdJULoVophDyNCzrbekb .isupper()]):
            return "a"
        if len([DlzmRlHwmevoQIWABRncFEjrQCwpUGPV for TQJeesOlSujVTdJULoVophDyNCzrbekb .isupper()]) == 1 and len(word) > 1 and word[0].isupper() and lwTFncXIDEvaMsvohjjyGvChmPPvYclH > 0:
            return "n"
    return "p"

Command

intensio-obfuscator -i ./in -o ./out -mlen lower -ind 4 -rts