better source path resolving

For some reason, nmake compiles produce different symbols. I wonder if this affects the accuracy of the decomp.
This commit is contained in:
itsmattkc 2023-06-18 20:26:24 -07:00
parent fbc382c182
commit f27efcd419

View File

@ -125,19 +125,23 @@ def get_wine_path(fn):
# Convert filename to Wine path
filename = get_wine_path(filename)
print('Looking for ' + filename + ' line ' + str(line))
#print('Looking for ' + filename + ' line ' + str(line))
addr = None
found = False
for i, s in enumerate(line_dump):
if s.startswith(' ' + filename):
lines = line_dump[i + 2].split()
if line == int(lines[0]):
# Found address
addr = int(lines[1], 16)
found = True
break
try:
sourcepath = s.split()[0]
if os.path.isfile(sourcepath) and os.path.samefile(sourcepath, filename):
lines = line_dump[i + 2].split()
if line == int(lines[0]):
# Found address
addr = int(lines[1], 16)
found = True
break
except IndexError:
pass
if found:
# Find size of function