Skip to content

Commit 4099677

Browse files
committed
Finish pretty much everything else
1 parent 61a24d7 commit 4099677

13 files changed

Lines changed: 796 additions & 558 deletions

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ Resets the name of every function in IDA's database. Does not include library or
4242

4343
Imports netprops and owner classes as structs and struct members into IDA's DB. Only works with the XML file provided by sm_dump_netprops_xml. Datatables only work most of the time. You should also use the proper netprop dump for your OS, or else you will be very confused.
4444

45-
You also have the option of importing vtables from the found classes into IDA. This is a bit more sane than the **vtable_structs.py** script, but only works on classes with netprops.
46-
4745

4846
### sigfind.py ###
4947

@@ -55,7 +53,7 @@ Takes a SourceMod (or any) signature and jumps you to the function it's for. If
5553
Makes SourceMod ready signatures for every function in IDA's database. Yes, this will take a long, long time. Requires PyYAML so you'll need to `pip install pyyaml`. You have the option of only generating signatures for typed functions so this works very well with the Symbol Smasher.
5654

5755

58-
### structaligner.py ###
56+
### structfiller.py ###
5957

6058
Sanitizes undefined struct members as if IDA had parsed a header file. Each structure will have its undefined members replaced with a one-byte-sized member in order to prevent pseudocode from falling apart. Only makes sense to use it after running the netprop importer.
6159

distfromfunc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ def main():
1717
funcname = idaapi.get_name(func.start_ea)
1818
demangled = idaapi.demangle_name(funcname, idc.get_inf_attr(idc.INF_SHORT_DN))
1919
print(f"{demangled or funcname}:")
20-
print(f"Offset from {func.start_ea:08X} to {addr:08X} = {addr - func.start_ea} ({addr - func.start_ea:#x})")
20+
print(f"Offset from {func.start_ea:08X} to {addr:08X} = {addr - func.start_ea} ({addr - func.start_ea:#X})")
2121

2222
main()

gamedata_checker.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def checksig(sig):
4141
# segments is fine
4242
if endea == idc.BADADDR or endea < segstart + s.size():
4343
endea = segstart + s.size()
44-
break
4544

4645
count = 0
4746
addr = 0
@@ -319,10 +318,4 @@ def main():
319318

320319
print(s)
321320

322-
# if os == "windows" and kv.get("Offsets"):
323-
# print("Offset checking is not supported on Windows binaries")
324-
325-
# idaapi.ask_form("Validated\nCheck console for output")
326-
idaapi.beep()
327-
328321
main()

makesig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def is_good_sig(sig, mask):
1919
# segments is fine
2020
if endea == idc.BADADDR or endea < segstart + s.size():
2121
endea = segstart + s.size()
22-
break
2322

2423
count = 0
2524
addr = 0
25+
# Ever just deprecate something and provide 0 documentation on what to use instead?
2626
addr = idaapi.find_binary(addr, endea, search, 0, idc.SEARCH_DOWN|idc.SEARCH_NEXT)
2727
while addr != idc.BADADDR:
2828
count = count + 1

makesigfromhere.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def is_good_sig(sig, mask):
2828
# segments is fine
2929
if endea == idc.BADADDR or endea < segstart + s.size():
3030
endea = segstart + s.size()
31-
break
3231

3332
count = 0
3433
addr = 0
@@ -60,7 +59,8 @@ def is_good_sig(sig, mask):
6059
# return count == 1
6160

6261
def makesig(ea, sz=-1):
63-
name = idc.get_name(ea, idaapi.GN_VISIBLE)
62+
func = idaapi.get_func(ea)
63+
name = idc.get_name(func.start_ea, idaapi.GN_VISIBLE)
6464

6565
sig = ""
6666
mask = ""
@@ -124,7 +124,7 @@ def makesig(ea, sz=-1):
124124

125125
print("==================================================")
126126
print(
127-
f"Signature for {name}:\n"
127+
f"Signature for {name} + {ea - func.start_ea} ({ea - func.start_ea:#x}):\n"
128128
f"{'Mask:':<{align}} {mask}\n"
129129
f"{'Bytes:':<{align}} {sig}\n"
130130
f"{wildcarded}"

nameresetter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def main():
88
segend = idaapi.getseg(segstart).end_ea
99
for fea in idautils.Functions(segstart, segend):
1010
flags = idaapi.get_full_flags(fea)
11-
if not (flags & idaapi.FF_NAME):
11+
if not (flags & idc.FF_NAME):
1212
continue
1313

1414
fflags = idc.get_func_attr(fea, idc.FUNCATTR_FLAGS)

0 commit comments

Comments
 (0)