Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gaasedelen committed Sep 15, 2020
2 parents fb6b33e + 1453a9d commit 9f2480d
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 239 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ You can view these individual trees by right clicking an instruction and selecti

As this is the initial release, there will probably a number of small quirks and bugs. Here are a few known issues at the time of release:

* While sync'd with hexrays, cursor mapping can get wonky if focused on microcode that gets optimized away
* When opening the Sub-instruction Graph, window/tab focus can change unexpectedly
* Microcode Explorer does not dock to the top-level far right compartment on Linux?
* Switching between multiple Pseudocode windows in different functions might cause problems
Expand Down
12 changes: 6 additions & 6 deletions plugins/lucid/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class LucidCore(object):

PLUGIN_NAME = "Lucid"
PLUGIN_VERSION = "0.1.0"
PLUGIN_VERSION = "0.1.1"
PLUGIN_AUTHORS = "Markus Gaasedelen"
PLUGIN_DATE = "2020"

Expand Down Expand Up @@ -110,8 +110,8 @@ def interactive_view_microcode(self, ctx=None):
# it but at the current IDA cursor address
#

if self.explorer and self.explorer.visible():
self.explorer.decompile(current_address)
if self.explorer and self.explorer.view.visible:
self.explorer.select_function(current_address)
return

# no microcode window in use, create a new one and show it
Expand Down Expand Up @@ -205,7 +205,7 @@ def test(self):
for address in list(idautils.Functions()):

print("0x%08X: DECOMPILING" % address)
self.explorer.decompile(address)
self.explorer.select_function(address)
self.explorer.view.refresh()

# change the codeview to a starting maturity levels
Expand All @@ -214,7 +214,7 @@ def test(self):

# select each line in the current 'starting' maturity context
for idx, line in enumerate(self.explorer.model.mtext.lines):
self.explorer.select_pos(idx, 0, 0)
self.explorer.select_position(idx, 0, 0)

#
maturity_traversal = get_mmat_levels()
Expand All @@ -228,4 +228,4 @@ def test(self):
#time.sleep(0.05)

self.explorer.select_maturity(get_mmat_name(src_maturity))


6 changes: 3 additions & 3 deletions plugins/lucid/microtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# to the rendered microcode text.
#

# TODO: ehh this should probably get refactored out, lmao
# TODO: ehh this should probably get refactored out
MAGIC_BLK_INFO = 0x1230
MAGIC_BLK_EDGE = 0x1231
MAGIC_BLK_UDNR = 0x1232
Expand Down Expand Up @@ -737,8 +737,8 @@ def translate_instruction_position(position, mtext_src, mtext_dst):
Translate an instruction position from one mtext to another.
"""
line_num, x, y = position
token_src = mtext_src.get_token_at_pos(line_num, x)
address_src = mtext_src.get_address_at_pos(line_num, x)
token_src = mtext_src.get_token_at_position(line_num, x)
address_src = mtext_src.get_address_at_position(line_num, x)

#
# find all the lines in the destination text that claim to contain the
Expand Down
4 changes: 2 additions & 2 deletions plugins/lucid/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ def tagged_text(self):
# Textual APIs
#-------------------------------------------------------------------------

def get_token_at_pos(self, line_num, x_index):
def get_token_at_position(self, line_num, x_index):
"""
Return the token at the given text position.
"""
if not(0 <= line_num < len(self.lines)):
return None
return self.lines[line_num].get_token_at_index(x_index)

def get_address_at_pos(self, line_num, x_index):
def get_address_at_position(self, line_num, x_index):
"""
Return the mapped address of the given text position.
"""
Expand Down
Loading

0 comments on commit 9f2480d

Please sign in to comment.