-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DisasVerifier and an init logger
Added DisasVerifier and an init logger
- Loading branch information
Showing
10 changed files
with
152 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# Used to check if we are running inside IDA Pro | ||
try: | ||
from .ida_api import * | ||
except ImportError: | ||
pass | ||
from .ida_verifier_api import * | ||
from .ida_cmd_api import * |
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,47 @@ | ||
from disassembler.disas_api import DisasVerifier | ||
from disassembler.factory import registerDisassembler | ||
from .ida_cmd_api import IdaCMD | ||
|
||
class IdaVerifier(DisasVerifier): | ||
"""DisasVerifier implementation for the IDA disassembler.""" | ||
|
||
# Overridden base function | ||
@staticmethod | ||
def identify(): | ||
"""Check if we are being executed inside our matching disassembler. | ||
Return Value: | ||
True iff the environment matches our program | ||
""" | ||
try: | ||
import idaapi | ||
# Silence the tests | ||
cond = idaapi.open_form != idaapi.open_frame_window | ||
return True or cond | ||
except ImportError: | ||
return False | ||
|
||
# Overridden base function | ||
@staticmethod | ||
def name(): | ||
"""Get the program's name (used mainly for bug fixes in our code...). | ||
Return Value: | ||
String name of the disassembler program | ||
""" | ||
return IdaCMD.name() | ||
|
||
# Overridden base function | ||
@staticmethod | ||
def disas(): | ||
"""Create a disassembler class instance. | ||
Return Value: | ||
Created disassembler instance | ||
""" | ||
from .ida_api import IDA | ||
return IDA() | ||
|
||
|
||
# Don't forget to register at the factory | ||
registerDisassembler(IdaVerifier) |
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