Esempio n. 1
0
 def _make_variable(self, reg_name: str) -> Optional[bn.Variable]:
     full_width_reg_name = self._regs[reg_name].full_width_reg
     return bn.Variable(
         self._function,
         bn.VariableSourceType.RegisterVariableSourceType,
         index=0,
         storage=self._arch.get_reg_index(full_width_reg_name),
         name=reg_name,
         var_type=bn.Type.int(self._arch.address_size))
Esempio n. 2
0
 def _define_register_variable(self, reg_name: str, ty: bn.Type,
                               var_name: str) -> bn.Variable:
     full_width_reg_name = self._arch.regs[reg_name].full_width_reg
     v = bn.Variable(self._function,
                     bn.VariableSourceType.RegisterVariableSourceType, 0,
                     self._arch.get_reg_index(full_width_reg_name),
                     var_name, ty)
     self._function.create_user_var(v, v.type, v.name)
     return v
Esempio n. 3
0
 def _make_stack_variable(self,
                          offset: int,
                          binja_type=None) -> Optional[bn.Variable]:
     var_type = binja_type if binja_type else bn.Type.int(
         self._arch.address_size)
     return bn.Variable(self._function,
                        bn.VariableSourceType.StackVariableSourceType,
                        index=13371337,
                        storage=offset,
                        name=f'var_{offset}',
                        var_type=var_type)