Exemple #1
0
def processInvokeMsg(stadynaAnalyser, stadynaMsg):
    logger.debug("Processing OP_METHOD_INVOKE message...")
    #call to str is required to omit 'u' symbol before the strings
    cls = str(stadynaMsg.get(consts.JSON_CLASS))
    method = str(stadynaMsg.get(consts.JSON_METHOD))
    prototype = str(stadynaMsg.get(consts.JSON_PROTO))
    #     cls = stadynaMsg.get(consts.JSON_CLASS)
    #     method = stadynaMsg.get(consts.JSON_METHOD)
    #     prototype = stadynaMsg.get(consts.JSON_PROTO)
    stack = utils.transformStack(stadynaMsg.get(consts.JSON_STACK))
    stadynaAnalyser.processInvoke(cls, method, prototype, stack)
    logger.debug("OP_METHOD_INVOKE message processed!")
Exemple #2
0
def processInvokeMsg(stadynaAnalyser, stadynaMsg):
    logger.debug("Processing OP_METHOD_INVOKE message...")
    #call to str is required to omit 'u' symbol before the strings
    cls = str(stadynaMsg.get(consts.JSON_CLASS))
    method = str(stadynaMsg.get(consts.JSON_METHOD))
    prototype = str(stadynaMsg.get(consts.JSON_PROTO))
#     cls = stadynaMsg.get(consts.JSON_CLASS)
#     method = stadynaMsg.get(consts.JSON_METHOD)
#     prototype = stadynaMsg.get(consts.JSON_PROTO)
    stack = utils.transformStack(stadynaMsg.get(consts.JSON_STACK))
    stadynaAnalyser.processInvoke(cls, method, prototype, stack)
    logger.debug("OP_METHOD_INVOKE message processed!")
Exemple #3
0
def processDexLoadMsg(device, resultsDirPath, stadynaAnalyser, stadynaMsg):
    logger.debug("Processing OP_DEX_LOAD message...")
    #call to str is required to omit 'u' symbol before the strings
    source = str(stadynaMsg.get(consts.JSON_DEX_SOURCE))
    output = str(stadynaMsg.get(consts.JSON_DEX_OUTPUT))
#     source = stadynaMsg.get(consts.JSON_DEX_SOURCE)
#     output = stadynaMsg.get(consts.JSON_DEX_OUTPUT)
    stack = utils.transformStack(stadynaMsg.get(consts.JSON_STACK))
    
    if not device.get_file(source, resultsDirPath):
        logger.error("Could not get file [%s] from the device for analysis!" % source)
        return
    
    _, fileName = os.path.split(source)
    anFilePath = os.path.join(resultsDirPath, fileName)
    if not (os.path.exists(anFilePath)):
        logger.error("There is no local file [%s] to analyse!" % anFilePath)
        return
    
    stadynaAnalyser.processDexLoad(anFilePath, source, output, stack)
    logger.debug("OP_DEX_LOAD message processed!")