-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update spimdisasm version * configure_disassembler_section * lit4 and lit8 * ctor * vtables * black * capitalization * whoops * a bit of docs on the new sections * yeet
- Loading branch information
1 parent
8425949
commit ef71065
Showing
13 changed files
with
214 additions
and
34 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
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,28 @@ | ||
from typing import Optional | ||
|
||
from ..common.data import CommonSegData | ||
from ...disassembler.disassembler_section import DisassemblerSection | ||
|
||
|
||
class Ps2SegCtor(CommonSegData): | ||
"""Segment that contains pointers to C++ global data initialization functions""" | ||
|
||
def get_linker_section(self) -> str: | ||
return ".ctor" | ||
|
||
def get_section_flags(self) -> Optional[str]: | ||
return "a" | ||
|
||
def configure_disassembler_section( | ||
self, disassembler_section: DisassemblerSection | ||
) -> None: | ||
"Allows to configure the section before running the analysis on it" | ||
|
||
super().configure_disassembler_section(disassembler_section) | ||
|
||
section = disassembler_section.get_section() | ||
|
||
# We use s32 to make sure spimdisasm disassembles the data from this section as words/references to other symbols | ||
section.enableStringGuessing = False | ||
section.typeForOwnedSymbols = "s32" | ||
section.sizeForOwnedSymbols = 4 |
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,28 @@ | ||
from typing import Optional | ||
|
||
from ..common.data import CommonSegData | ||
from ...disassembler.disassembler_section import DisassemblerSection | ||
|
||
|
||
class Ps2SegLit4(CommonSegData): | ||
"""Segment that only contains single-precision floats""" | ||
|
||
def get_linker_section(self) -> str: | ||
return ".lit4" | ||
|
||
def get_section_flags(self) -> Optional[str]: | ||
return "wa" | ||
|
||
def configure_disassembler_section( | ||
self, disassembler_section: DisassemblerSection | ||
) -> None: | ||
"Allows to configure the section before running the analysis on it" | ||
|
||
super().configure_disassembler_section(disassembler_section) | ||
|
||
section = disassembler_section.get_section() | ||
|
||
# Tell spimdisasm this section only contains floats | ||
section.enableStringGuessing = False | ||
section.typeForOwnedSymbols = "f32" | ||
section.sizeForOwnedSymbols = 4 |
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,28 @@ | ||
from typing import Optional | ||
|
||
from ..common.data import CommonSegData | ||
from ...disassembler.disassembler_section import DisassemblerSection | ||
|
||
|
||
class Ps2SegLit8(CommonSegData): | ||
"""Segment that only contains double-precision floats""" | ||
|
||
def get_linker_section(self) -> str: | ||
return ".lit8" | ||
|
||
def get_section_flags(self) -> Optional[str]: | ||
return "wa" | ||
|
||
def configure_disassembler_section( | ||
self, disassembler_section: DisassemblerSection | ||
) -> None: | ||
"Allows to configure the section before running the analysis on it" | ||
|
||
super().configure_disassembler_section(disassembler_section) | ||
|
||
section = disassembler_section.get_section() | ||
|
||
# Tell spimdisasm this section only contains doubles | ||
section.enableStringGuessing = False | ||
section.typeForOwnedSymbols = "f64" | ||
section.sizeForOwnedSymbols = 8 |
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,27 @@ | ||
from typing import Optional | ||
|
||
from ..common.data import CommonSegData | ||
from ...disassembler.disassembler_section import DisassemblerSection | ||
|
||
|
||
class Ps2SegVtables(CommonSegData): | ||
"""Segment that contains a pointer to C++ vtables""" | ||
|
||
def get_linker_section(self) -> str: | ||
return ".vtables" | ||
|
||
def get_section_flags(self) -> Optional[str]: | ||
return "a" | ||
|
||
def configure_disassembler_section( | ||
self, disassembler_section: DisassemblerSection | ||
) -> None: | ||
"Allows to configure the section before running the analysis on it" | ||
|
||
super().configure_disassembler_section(disassembler_section) | ||
|
||
section = disassembler_section.get_section() | ||
|
||
# We use s32 to make sure spimdisasm disassembles the data from this section as words/references to other symbols | ||
section.enableStringGuessing = False | ||
section.typeForOwnedSymbols = "s32" |