Esempio n. 1
0
def unpack(data, verb, key):
    if key is not None:
        data = aes_decrypt(data, key)

    data = t.unpack(data, verb, chtstruct)

    result = []
    items = data["items"]

    for item in items:
        if item.id == item._cfgids['CFGID_OUTER_PAYLOAD'] and not item.data.startswith("MZ"):
            try:
                nested = unpack(item.data, verb, key)
                result += nested["items"]
            except ValueError:
                nested = unpack(item.data, verb, None)
                result += nested["items"]

        elif item.id == item._cfgids['CFGID_PAYLOAD'] and item.flags & item._flags['ITEMF_IS_PACKED_CONFIG']:
            nested = unpack(item.data, verb, None)
            result += nested["items"]
        elif item.id == item._cfgids['CFGID_INJECTS']:
            nested = unpack(item.data, verb, None)
            result += nested["items"]
        else:
            result.append(item)

    data['items'] = result

    return data
Esempio n. 2
0
def unpack(data, verb, key):
    if key is not None:
        data = aes_decrypt(data, key)

    data = t.unpack(data, verb, chtstruct)

    result = []
    items = data["items"]

    for item in items:
        if item.id == item._cfgids[
                'CFGID_OUTER_PAYLOAD'] and not item.data.startswith("MZ"):
            try:
                nested = unpack(item.data, verb, key)
                result += nested["items"]
            except ValueError:
                nested = unpack(item.data, verb, None)
                result += nested["items"]

        elif item.id == item._cfgids[
                'CFGID_PAYLOAD'] and item.flags & item._flags[
                    'ITEMF_IS_PACKED_CONFIG']:
            nested = unpack(item.data, verb, None)
            result += nested["items"]
        elif item.id == item._cfgids['CFGID_INJECTS']:
            nested = unpack(item.data, verb, None)
            result += nested["items"]
        else:
            result.append(item)

    data['items'] = result

    return data
Esempio n. 3
0
def unpack(data, verb, verify=False):
    return t.unpack(data, verb, zeus, verify)
Esempio n. 4
0
def unpack(data, verb):
    return t.unpack(data, verb, zeus)
Esempio n. 5
0
def unpack(data,verb,verify=False):
    return t.unpack(data,verb,zeus,verify)
Esempio n. 6
0
def unpack(data,verb):
    return t.unpack(data,verb,zeus)
Esempio n. 7
0
def unpack(data,verb):
    return t.unpack(data,verb,pz)