Skip to content

make_signature_for_function : Full image bytearray is rebuilt on every uniqueness check #398

Description

@rm-NoobInCoding

This line

buf = InMemoryBuffer.load(mode=InMemoryBuffer.LoadMode.SEGMENTS)

calls InMemoryBuffer.load(mode=SEGMENTS) inside _find_all_simd. _load_segments iterates every segment and does idaapi.get_bytes(...) + bytearray.extend(...). For a 5 MB image that's a fresh 5 MB allocation + copy per is_unique call, per instruction added to the growing signature.

A typical function needs 5–40 instructions worth of growth before becoming unique and we do tens of full image rebuilds per signature.
I would like to work on a PR to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions