binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

add StructureBuilder missing python methods

Open rbran opened this issue 10 months ago • 1 comments

rbran avatar Apr 22 '24 17:04 rbran

Could the non-mutable setters be problematic? What if the user hold a reference to the builder (or internals) before a setter call?

Maybe a code like this could cause problems:

let builder: StructureBuilder = todo!();
let members = builder.members();
builder.clear_members();
for member in members.iter() {
 ...
}

This could be solved by having all the setters functions require &mut self and return an Array tied to the self lifetime. Or simply clone all the members and return a Vec<StructureMember> instead.

rbran avatar Apr 22 '24 17:04 rbran

This isn't building locally for me... Complaining about CoreArrayWrapper not accepting a lifetime parameter. Not sure why it works in CI, though. I'll look into this more later.

ElykDeer avatar May 09 '24 16:05 ElykDeer

This was written before the GAT PR, I'll fix this.

rbran avatar May 09 '24 17:05 rbran

@KyleMiles Fixed.

rbran avatar May 09 '24 17:05 rbran