Skip to content

Commit

Permalink
Added changes ot asm_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ltjones18 committed May 12, 2017
1 parent cf14f19 commit d674a98
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dev/feature_extraction/cpc/asm_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@
arg_reg_xmm1 + arg_reg_xmm2 + arg_reg_xmm3 + arg_reg_xmm4 +\
arg_reg_xmm5 + arg_reg_xmm6 + arg_reg_xmm7

reg_a = ['rax', 'eax', 'ax', 'ah', 'al']

#-------------------------------------
#Basic arg finding
#-------------------------------------
Expand All @@ -356,6 +358,11 @@ def remove_prefixes(mnemonic):
new = re.sub('lock', '', new)
return new.strip()

def is_reg_a(opnd):
if opnd in reg_a:
return True
return False

def is_mov(mnemonic):
if mov_prefix in mnemonic:
return True
Expand Down Expand Up @@ -390,6 +397,9 @@ def is_jmp(mnemonic):
return True
return False

def is_jump(mnemonic):
return is_jcc(mnemonic) or is_jmp(mnemonic)

def is_ret(mnemonic):
mnemonic = remove_prefixes(mnemonic)
if mnemonic in ret_insts:
Expand Down

0 comments on commit d674a98

Please sign in to comment.