예제 #1
0
def uisound_get_filenames(mo, f_sym, iphone_sound_sym, testValue):
    testValues = {testValue}
    exhaustedValues = set()
    startAddr = f_sym.addr

    thread = Thread(mo)
    thread.onBranch = UISoundOnBranchHolder(mo)
    
    instrSet = f_sym.isThumb
    fnmaps = {}
    
    while True:
        valueLeft = testValues - exhaustedValues
        if not valueLeft:
            break
        anyValue = valueLeft.pop()
        exhaustedValues.add(anyValue)

        thread.memory.set(iphone_sound_sym.addr, 1)
        (phoneSound, hasPhoneSound) = uisound_get_name_for_input(mo, thread, startAddr, anyValue, testValues, instrSet)

        if hasPhoneSound:            
            thread.memory.set(iphone_sound_sym.addr, 0)
            podSound = uisound_get_name_for_input(mo, thread, startAddr, anyValue, testValues, instrSet)[0]
        else:
            podSound = '-'
            
        if hasPhoneSound:
            fnmaps[anyValue] = [phoneSound, podSound, '-']
    
    return fnmaps
예제 #2
0
def uisound_get_filenames(mo, f_sym, iphone_sound_sym, testValue):
    testValues = {testValue}
    exhaustedValues = set()
    startAddr = f_sym.addr

    thread = Thread(mo)
    thread.onBranch = UISoundOnBranchHolder(mo)

    instrSet = f_sym.isThumb
    fnmaps = {}

    while True:
        valueLeft = testValues - exhaustedValues
        if not valueLeft:
            break
        anyValue = valueLeft.pop()
        exhaustedValues.add(anyValue)

        thread.memory.set(iphone_sound_sym.addr, 1)
        (phoneSound,
         hasPhoneSound) = uisound_get_name_for_input(mo, thread, startAddr,
                                                     anyValue, testValues,
                                                     instrSet)

        if hasPhoneSound:
            thread.memory.set(iphone_sound_sym.addr, 0)
            podSound = uisound_get_name_for_input(mo, thread, startAddr,
                                                  anyValue, testValues,
                                                  instrSet)[0]
        else:
            podSound = '-'

        if hasPhoneSound:
            fnmaps[anyValue] = [phoneSound, podSound, '-']

    return fnmaps
예제 #3
0
def uisound_fill_categories(mo, cat_addr, init_sym):
    thread = Thread(mo)
    thread.instructionSet = init_sym.isThumb
    thread.onBranch = UISoundCoreMediaOnBranch(mo)

    msa = mo.symbols.any
    mem = thread.memory
    tmg = mem.get
    tms = mem.set

    novol_sym = msa('name', '_gSystemSoundsWithNoVolumeAdjustment')
    if novol_sym:
        tms(novol_sym.addr, 1)
    tms(cat_addr, 0)

    thread.pc = init_sym.addr

    while thread.pcRaw != Return:
        thread.execute()
        catdict = tmg(cat_addr)
        if catdict:
            return tmg(catdict)

    return {}
예제 #4
0
def uisound_fill_categories(mo, cat_addr, init_sym):
    thread = Thread(mo)
    thread.instructionSet = init_sym.isThumb
    thread.onBranch = UISoundCoreMediaOnBranch(mo)
    
    msa = mo.symbols.any
    mem = thread.memory
    tmg = mem.get
    tms = mem.set
    
    novol_sym = msa('name', '_gSystemSoundsWithNoVolumeAdjustment')
    if novol_sym:
        tms(novol_sym.addr, 1)
    tms(cat_addr, 0)

    thread.pc = init_sym.addr
    
    while thread.pcRaw != Return:
        thread.execute()
        catdict = tmg(cat_addr)
        if catdict:
            return tmg(catdict)
    
    return {}