Exemplo n.º 1
0
def evaluate(sourceCode):
    addressList = tools.findAddresses(sourceCode)

    if addressList and findConstant(addressList, sourceCode) and sourceCode.find("emit") != -1:
        sequentialTransfer, count1, count2 = tools.detectTransfer(sourceCode)
        return sequentialTransfer
    return []
Exemplo n.º 2
0
def evaluate(sourceCode):
    flag = False
    addressList = tools.findAddresses(sourceCode)
    if addressList:
        flagPublic, varNames = findPublic(addressList, sourceCode)
        if flagPublic:
            for varName in varNames:
                if findAssign(sourceCode, varName):
                    flag = True
    if flag:
        sequentialTransfer, count1, count2 = tools.detectTransfer(sourceCode)
        return sequentialTransfer
    return []
Exemplo n.º 3
0
def evaluate(sourceCode):
    addressList = tools.findAddresses(sourceCode)
    if addressList:
        variableList = findVariables(addressList, sourceCode)
        if variableList:
            startFun, endFun, _ = tools.detectFunction(sourceCode)
            assignedVariables = findAssign(sourceCode, startFun, endFun,
                                           variableList)
            conditionVariable = []
            for variable in assignedVariables:
                cmpCondition = re.compile(
                    "if[\t\n\r ]*[(][^;]*[=\t\n\r( ]%s[^;]*[)][^;]*;" %
                    re.escape(variable))
                condition = cmpCondition.findall(sourceCode)
                if condition and variable not in conditionVariable:
                    conditionVariable.append(variable)
            if conditionVariable:
                return True
    return False
Exemplo n.º 4
0
def evaluate(sourceCode):
    addressList = tools.findAddresses(sourceCode)
    validList, total, lower, valid = findLowerCase(addressList)
    return lower, valid