Exemplo n.º 1
0
 def breakCommand(self,cmd):
     cmdFields = seperateCmd(cmd)
     if len(cmdFields) ==0:
         print "asd"
     assert (len(cmdFields) >0)
     if len(cmdFields) == 1 :
         return {'nemonic':cmdFields[0],'nemonicWithDecoretors':" ".join(cmdFields[0:-1]),'ParamsList':[]}
     else:
         return {'nemonic':cmdFields[0],'nemonicWithDecoretors':" ".join(cmdFields[0:-1]),'ParamsList':cmdFields[-1].split(",")}
Exemplo n.º 2
0
def breakCommand(cmd):
    
    #cmd = "mov [esp+28h+var_28_firstPush],offset aDHelo"
    #cmd = "mov [esp+28h+var_28_firstPush],(offset aDHelo)"
    cmdFields = seperateCmd(cmd)
    
    operationWithArguments = cmdFields[0:-1]
    if not "," in cmdFields[-1]:
        return {'operation':operationWithArguments,'ParamsList':[cmdFields[-1]]}
    
    params = cmdFields[-1].split(",")
    operationWithArguments.extend(map(argumentToStr,params))
    
    # the map will strip [ and ]
    return {'operation':operationWithArguments,'ParamsList':map(lambda par:par[1:-1] if '[' in par else par,params)}
 def breakCommand(self, cmd):
     cmdFields = seperateCmd(cmd)
     if len(cmdFields) == 0:
         print "asd"
     assert (len(cmdFields) > 0)
     if len(cmdFields) == 1:
         return {
             'nemonic': cmdFields[0],
             'nemonicWithDecoretors': " ".join(cmdFields[0:-1]),
             'ParamsList': []
         }
     else:
         return {
             'nemonic': cmdFields[0],
             'nemonicWithDecoretors': " ".join(cmdFields[0:-1]),
             'ParamsList': cmdFields[-1].split(",")
         }
Exemplo n.º 4
0
def breakCommand(cmd):

    #cmd = "mov [esp+28h+var_28_firstPush],offset aDHelo"
    #cmd = "mov [esp+28h+var_28_firstPush],(offset aDHelo)"
    cmdFields = seperateCmd(cmd)

    operationWithArguments = cmdFields[0:-1]
    if not "," in cmdFields[-1]:
        return {
            'operation': operationWithArguments,
            'ParamsList': [cmdFields[-1]]
        }

    params = cmdFields[-1].split(",")
    operationWithArguments.extend(map(argumentToStr, params))

    # the map will strip [ and ]
    return {
        'operation': operationWithArguments,
        'ParamsList': map(lambda par: par[1:-1] if '[' in par else par, params)
    }