Scratchbook

Das Leben ist immer anders als die Realität.

AdobeMalwareClassifier.py

Claude, 5. April 2012, 12:00 Uhr

Adobe versucht sich an der Erkennung von Windows-Viren.

AdobeMalwareClassifier.py

# Program to classify unknown Win32 binaries (EXEs or DLLs) into
# 0 = CLEAN
# 1 = DIRTY

DEBUG = 0;
isDirty = 0;
 
[]
 
else:
    if input.IatRVA <= 94208:
        if input.NumberOfSections <= 5:
            if input.ExportSize <= 0:
                if input.NumberOfSections <= 4:
                    if input.IatRVA <= 13504:
                        if input.ImageVersion <= 353:
                            if input.NumberOfSections <= 3:
                                if input.IatRVA <= 6144:
                                    if input.IatRVA <= 2048:
                                        if input.ResourceSize <= 934:
                                            isDirty = 1
                                        else:
                                            if input.VirtualSize2 <= 2728:
                                                isDirty = 0
                                            else:
                                                isDirty = 1
                                    else:
                                        if input.VirtualSize2 <= 496:
                                            isDirty = 1
                                        else:
                                            isDirty = 0
                                else:
                                    isDirty = 0
                            else:
                                if input.DebugSize <= 41: # debug here
                                    if input.ResourceSize <= 22720:
                                        if input.IatRVA <= 2048:
                                            isDirty = 1
                                        else:
                                            if input.VirtualSize2 <= 46:
                                                isDirty = 0
                                            else:
                                                isDirty = 1
                                    else:
                                            if input.VirtualSize2 <= 43030:
                                                if input.ResourceSize <= 3898348:
                                                    if input.IatRVA <= 2048:
                                                        isDirty = 1
                                                    else:
                                                        isDirty = 0
                                                else:
                                                    isDirty = 1
                                            else:
                                                isDirty = 0
                                else:
                                    isDirty = 0
                        else:
                            isDirty = 0
 
[]
 
return isDirty
# Might need to add a isDirty = 0 statement if tree results in unclassified result