Skip to content

Commit

Permalink
"Overwrite all" in SyncBromaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjustin000 committed Jan 11, 2025
1 parent afc238a commit 1e3deb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bindings/2.2074/GeometryDash.bro
Original file line number Diff line number Diff line change
Expand Up @@ -19698,7 +19698,7 @@ class SmartTemplateCell : TableViewCell {
SmartTemplateCell(char const*, float, float);

virtual bool init() = win 0x3c7f0, m1 0x1f57a0, imac 0x246ed0, ios 0x1158f0;
virtual void draw() = win 0xad7f0, imac 0x246fa0, m1 0x1f585c, ios 0x1159a0;
virtual void draw() = win 0xad710, imac 0x246fa0, m1 0x1f585c, ios 0x1159a0;

void loadFromObject(GJSmartTemplate*) = win 0xbd8c0, imac 0x23b400;
void onClick(cocos2d::CCObject* sender) = win 0xbdda0;
Expand Down
8 changes: 6 additions & 2 deletions scripts/ghidra/SyncBromaScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public SignatureImport promoted(SignatureImport to) {
}
}

boolean overwriteAll = false;

private SignatureImport importSignatureFromBroma(Address addr, Broma.Function fun, boolean force, boolean ignoreReturnType) throws Exception {
final var name = fun.getName();
final var className = fun.parent.name.value;
Expand Down Expand Up @@ -192,11 +194,12 @@ private SignatureImport importSignatureFromBroma(Address addr, Broma.Function fu
!force &&
data.getSymbol().getSource() == SourceType.USER_DEFINED &&
!data.getName(true).equals(fullName) &&
!(data.getComment() != null && data.getComment().contains("NOTE: Merged with " + fullName))
!(data.getComment() != null && data.getComment().contains("NOTE: Merged with " + fullName)) &&
!overwriteAll
) {
int choice = askContinueConflict(
"Function has a different name",
List.of("Add to merged functions list", "Overwrite Ghidra name"),
List.of("Add to merged functions list", "Overwrite Ghidra name", "Overwrite all"),
"The function {0} at {1} from Broma already has the name " +
"{2} in Ghidra - is this function merged with that?",
fullName, Long.toHexString(addr.getOffset()), data.getName(true)
Expand All @@ -209,6 +212,7 @@ private SignatureImport importSignatureFromBroma(Address addr, Broma.Function fu
wrapper.printfmt("Added {0} to merged function list for {1}", fullName, data.getName(true));
return SignatureImport.ADDED_MERGED;
}
overwriteAll = choice == 2;
}

if (data.getSymbol().getSource() != SourceType.USER_DEFINED) {
Expand Down

0 comments on commit 1e3deb0

Please sign in to comment.