def METHOD_NAME(pe, data):
    for pattern in RESOURCE_PATTERNS:
        mr = re.search(pattern, data)
        if mr:
            try:
                (resource_name_rva,) = unpack("=I", data[mr.start() + 2 : mr.start() + 6])
                rn_addr = pe.get_physical_by_rva(resource_name_rva - pe.NT_HEADERS.OPTIONAL_HEADER.ImageBase)
                resource_name = data[rn_addr : rn_addr + 4]
                resource_id = ord(unpack("c", data[mr.start() + 7])[0])
                if resource_id > 200:
                    resource_id = ord(unpack("c", data[mr.start() + 8])[0])
                if resource_id == 104:
                    resource_id = ord(unpack("c", data[mr.start() + 21])[0])
                break
            except Exception:
                return
    if not mr:
        sys.exit("[!] Resource id not found")
    for idx in pe.DIRECTORY_ENTRY_RESOURCE.entries:
        if str(idx.name) in str(resource_name):
            for entry in idx.directory.entries:
                if entry.id == resource_id:
                    try:
                        data_rva = entry.directory.entries[0].data.struct.OffsetToData
                        size = entry.directory.entries[0].data.struct.Size
                        rc_data = pe.get_memory_mapped_image()[data_rva : data_rva + size]
                    except Exception:
                        return
    return rc_data