preprocess/asm_mips.py [14:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def isInt(s):
  try:
      int(s, 16)
      return True
  except ValueError:
      return False

def int2bits(x):
  return [int(b) for b in "{:064b}".format(np.abs(x))]

class Node(object):
  '''class for node

  In our graph, there are mainly three types of nodes:
    1. instruction nodes
      each instruction node comes with PC to match with dynamic features
    2. pseudo nodes for hierarchical structure inside each instruction
    3. variable / operand nodes, including register and constants
  '''

  def __init__(self, name, node_id, node_type, ins_id, pc=None, is_var=False):
    self.id = node_id
    self.type = node_type
    self.name = name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



preprocess/asm_obj.py [56:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def isInt(s):
  try:
      int(s, 16)
      return True
  except ValueError:
      return False

def int2bits(x):
  return [int(b) for b in "{:064b}".format(np.abs(x))]

class Node(object):
  '''class for node

  In our graph, there are mainly three types of nodes:
    1. instruction nodes
      each instruction node comes with PC to match with dynamic features
    2. pseudo nodes for hierarchical structure inside each instruction
    3. variable / operand nodes, including register and constants
  '''

  def __init__(self, name, node_id, node_type, ins_id, pc=None, is_var=False):
    self.id = node_id
    self.type = node_type
    self.name = name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



