kmeisthax / retrogram

Binary program analysis toolkit
7 stars 1 forks source link

Repeated manual entrypoint creation results in incorrect label parenting #4

Open kmeisthax opened 3 years ago

kmeisthax commented 3 years ago

When a new parent label is created in between a parent and it's child, the child's parent is not updated to the new parent.

Example: In Telefang, disassemble $A2A - this creates a child block at $A3D. Then disassemble $A34 - the label .LOC_A3D will still be parented to ENTER_A2A despite not being actually local anymore.

More generally we should enforce a restriction that all local labels must be parented to the last parent block; and furthermore prevent creation of local labels on symbols that have nonlocal crossreferences. Some assemblers do not allow you to use non-local symbols as global symbols (e.g. ENTER_A34.LOC_A3D)