Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
binwalk
Commits
1dd5c421
Unverified
Commit
1dd5c421
authored
Sep 19, 2018
by
devttys0
Committed by
GitHub
Sep 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #320 from bmourit/patch-1
Support for IDA versions >= 7.0
parents
886e9697
d378ff2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
9 deletions
+102
-9
binida.py
src/scripts/binida.py
+102
-9
No files found.
src/scripts/binida.py
View file @
1dd5c421
import
idc
import
idaapi
import
binwalk
if
idaapi
.
IDA_SDK_VERSION
<=
695
:
import
idc
import
idaapi
import
binwalk
if
idaapi
.
IDA_SDK_VERSION
>=
700
:
import
ida_idc
import
ida_idaapi
import
binwalk
from
idaapi
import
*
else
:
pass
# use 'try' here for compatibility with older API
# use Actions API for handlers
try
:
class
OpHandler
(
idaapi
.
action_handler_t
):
def
__init__
(
self
):
idaapi
.
action_handler_t
.
__init__
(
self
)
def
activate
(
self
,
ctx
):
arg
=
None
a
=
binwalk_t
()
a
.
opcode_scan
(
arg
)
return
1
def
update
(
self
,
ctx
):
return
idaapi
.
AST_ENABLE_ALWAYS
except
AttributeError
:
pass
# use 'try' here for compatibility with older API
# use Actions API for handlers
try
:
class
SigHandler
(
idaapi
.
action_handler_t
):
def
__init__
(
self
):
idaapi
.
action_handler_t
.
__init__
(
self
)
def
activate
(
self
,
ctx
):
arg
=
None
b
=
binwalk_t
()
b
.
signature_scan
(
arg
)
return
1
def
update
(
self
,
ctx
):
return
idaapi
.
AST_ENABLE_ALWAYS
except
AttributeError
:
pass
class
binwalk_t
(
idaapi
.
plugin_t
):
flags
=
0
...
...
@@ -11,15 +55,64 @@ class binwalk_t(idaapi.plugin_t):
wanted_hotkey
=
""
def
init
(
self
):
self
.
menu_context_1
=
idaapi
.
add_menu_item
(
"Search/"
,
"binwalk opcodes"
,
""
,
0
,
self
.
opcode_scan
,
(
None
,))
self
.
menu_context_2
=
idaapi
.
add_menu_item
(
"Search/"
,
"binwalk signatures"
,
""
,
0
,
self
.
signature_scan
,
(
None
,))
if
idaapi
.
IDA_SDK_VERSION
<=
695
:
self
.
menu_context_1
=
idaapi
.
add_menu_item
(
"Search/"
,
"binwalk opcodes"
,
""
,
0
,
self
.
opcode_scan
,
(
None
,))
self
.
menu_context_2
=
idaapi
.
add_menu_item
(
"Search/"
,
"binwalk signatures"
,
""
,
0
,
self
.
signature_scan
,
(
None
,))
if
idaapi
.
IDA_SDK_VERSION
>=
700
:
# populate action menus
action_desc
=
idaapi
.
action_desc_t
(
'my:opaction'
,
# action name. This acts like an ID and must be unique
'Binwalk opcodes'
,
# text for this action
OpHandler
(),
# the action handler
''
,
# optional shortcut key
'Binwalk opcodes'
,
# optional action tooltip for menus/toolbar
)
# Register the action
idaapi
.
register_action
(
action_desc
)
idaapi
.
attach_action_to_menu
(
'Search/'
,
'my:opaction'
,
idaapi
.
SETMENU_APP
)
# populate action menus
action_desc
=
idaapi
.
action_desc_t
(
'my:sigaction'
,
'Binwalk signatures'
,
SigHandler
(),
''
,
'Binwalk signatures'
,
)
# Register the action
idaapi
.
register_action
(
action_desc
)
idaapi
.
attach_action_to_menu
(
'Search/'
,
'my:sigaction'
,
idaapi
.
SETMENU_APP
)
else
:
pass
return
idaapi
.
PLUGIN_KEEP
def
term
(
self
):
idaapi
.
del_menu_item
(
self
.
menu_context_1
)
idaapi
.
del_menu_item
(
self
.
menu_context_2
)
if
idaapi
.
IDA_SDK_VERSION
<=
695
:
idaapi
.
del_menu_item
(
self
.
menu_context_1
)
idaapi
.
del_menu_item
(
self
.
menu_context_2
)
if
idaapi
.
IDA_SDK_VERSION
>=
700
:
idaapi
.
detach_action_from_menu
(
'Search/'
,
'my:opaction'
)
idaapi
.
detach_action_from_menu
(
'Search/'
,
'my:sigaction'
)
else
:
pass
return
None
def
run
(
self
,
arg
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment