forked from travisgoodspeed/md380tools
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'travis/master'
- Loading branch information
Showing
8 changed files
with
72 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/python | ||
|
||
# This is a janky little parser for converting symbol files from the | ||
# GNU LD format used in the MD380Tools project into the flat text | ||
# files expected by GHIDRA's ImportSymbolsScript.py. | ||
|
||
import sys; | ||
|
||
for l in sys.stdin: | ||
words=l.strip().split(); | ||
|
||
try: | ||
name=words[0]; | ||
adrstr=words[2]; | ||
adr=int(adrstr.strip(";"),16); | ||
|
||
#Fix up addresses in Flash that look like functions. | ||
if(adr&0xFF000000==0x08000000): | ||
adr=adr&~1; | ||
|
||
print("%s 0x%x" % (name, adr)) | ||
except: | ||
# Print warnings when our janky parser goes awry. | ||
if len(words)>0 and words[0]!="/*" and words[0]!="*/": | ||
print("#Warning in: %s\n"%words); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters