ROSE  0.10.7.0
BinaryCallingConvention.h
1 #ifndef ROSE_BinaryAnalysis_CallingConvention_H
2 #define ROSE_BinaryAnalysis_CallingConvention_H
3 
4 #include <rosePublicConfig.h>
5 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
6 
7 #include <BaseSemantics2.h>
8 #include <BinaryVariables.h>
9 #include <Partitioner2/BasicTypes.h>
10 #include <Registers.h>
11 #include <RegisterParts.h>
12 
13 #include <boost/serialization/access.hpp>
14 #include <boost/serialization/set.hpp>
15 #include <boost/serialization/string.hpp>
16 #include <boost/serialization/vector.hpp>
17 #include <Sawyer/SharedObject.h>
18 #include <Sawyer/SharedPointer.h>
19 
20 namespace Rose {
21 namespace BinaryAnalysis {
22 
23 // Forwards
24 class Disassembler;
25 
36 namespace CallingConvention {
37 
41 void initDiagnostics();
42 
47 
49 // Miscellaneous small types
51 
57 };
58 
63 };
64 
70 };
71 
72 
74 // ParameterLocation
76 
86  #undef ABSOLUTE
88 public:
90  enum Type {
95  };
96 
97 private:
98  Type type_;
99  RegisterDescriptor reg_; // The argument register, or the stack base register.
100  union {
101  int64_t offset_; // Offset from stack base register for stack-based locations.
102  rose_addr_t va_; // Absolute address
103  };
104 
105 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
106 private:
107  friend class boost::serialization::access;
108 
109  template<class S>
110  void serialize(S &s, const unsigned /*version*/) {
111  s & BOOST_SERIALIZATION_NVP(type_);
112  s & BOOST_SERIALIZATION_NVP(reg_);
113  if (STACK==type_) {
114  s & BOOST_SERIALIZATION_NVP(offset_);
115  } else {
116  s & BOOST_SERIALIZATION_NVP(va_);
117  }
118  }
119 #endif
120 
121 public:
128  : type_(NO_LOCATION), offset_(0) {}
129 
132  : type_(REGISTER), reg_(reg), offset_(0) {}
133 
136  : type_(STACK), reg_(reg), offset_(offset) {}
137 
139  explicit ParameterLocation(rose_addr_t va)
140  : type_(ABSOLUTE), va_(va) {}
141 
143  Type type() const { return type_; }
144 
148  bool isValid() const {
149  return type() != NO_LOCATION;
150  }
151 
158  return reg_;
159  }
160 
166  int64_t offset() const {
167  return STACK == type_ ? offset_ : (int64_t)0;
168  }
169 
174  rose_addr_t address() const {
175  return ABSOLUTE == type_ ? va_ : (rose_addr_t)0;
176  }
177 
181  bool operator==(const ParameterLocation &other) const {
182  return type_ == other.type_ && reg_ == other.reg_ && offset_ == other.offset_; // &va_ == &offset_
183  }
184 
188  bool operator!=(const ParameterLocation &other) const {
189  return type_ != other.type_ || reg_ != other.reg_ || offset_ != other.offset_; // &va_ == &offset_
190  }
191 
195  void print(std::ostream &out, const RegisterDictionary *regdict) const {
196  print(out, RegisterNames(regdict));
197  }
198  void print(std::ostream &out, const RegisterNames &regnames) const {
199  switch (type_) {
200  case NO_LOCATION: out <<"nowhere"; break;
201  case REGISTER: out <<regnames(reg_); break;
202  case STACK: out <<"mem[" <<regnames(reg_) <<"+" <<offset_ <<"]"; break;
203  case ABSOLUTE: out <<"mem[" <<StringUtility::addrToString(va_) <<"]"; break;
204  }
205  }
208 };
209 
210 
212 // Definition
214 
217 
222 public:
225 
226 private:
227  std::string name_; // Official short name of the convention, like "stdcall".
228  std::string comment_; // Long name, like "Windows Borland x86-32 fastcall"
229  size_t wordWidth_; // Natural width word size in bits
230  const RegisterDictionary *regDict_; // Register dictionary used when this definition was created
231  std::vector<ParameterLocation> inputParameters_; // Input (inc. in-out) parameters; additional stack-based are implied
232  std::vector<ParameterLocation> outputParameters_; // Return values and output parameters.
233  StackParameterOrder stackParameterOrder_; // Order of arguments on the stack
234  RegisterDescriptor stackPointerRegister_; // Base pointer for implied stack parameters
235  size_t nonParameterStackSize_; // Size in bytes of non-parameter stack area
236  size_t stackAlignment_; // Stack alignment in bytes (zero means unknown)
237  StackDirection stackDirection_; // Direction that stack grows from a PUSH operation
238  StackCleanup stackCleanup_; // Who cleans up stack parameters?
239  ParameterLocation thisParameter_; // Object pointer for calling conventions that are object methods
240  std::set<RegisterDescriptor> calleeSavedRegisters_; // Register that the callee must restore before returning
241  std::set<RegisterDescriptor> scratchRegisters_; // Caller-saved registers
242 
243 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
244 private:
245  friend class boost::serialization::access;
246 
247  template<class S>
248  void serialize(S &s, const unsigned /*version*/) {
249  s & BOOST_SERIALIZATION_NVP(name_);
250  s & BOOST_SERIALIZATION_NVP(comment_);
251  s & BOOST_SERIALIZATION_NVP(wordWidth_);
252  s & BOOST_SERIALIZATION_NVP(regDict_);
253  s & BOOST_SERIALIZATION_NVP(inputParameters_);
254  s & BOOST_SERIALIZATION_NVP(outputParameters_);
255  s & BOOST_SERIALIZATION_NVP(stackParameterOrder_);
256  s & BOOST_SERIALIZATION_NVP(stackPointerRegister_);
257  s & BOOST_SERIALIZATION_NVP(nonParameterStackSize_);
258  s & BOOST_SERIALIZATION_NVP(stackAlignment_);
259  s & BOOST_SERIALIZATION_NVP(stackDirection_);
260  s & BOOST_SERIALIZATION_NVP(stackCleanup_);
261  s & BOOST_SERIALIZATION_NVP(thisParameter_);
262  s & BOOST_SERIALIZATION_NVP(calleeSavedRegisters_);
263  s & BOOST_SERIALIZATION_NVP(scratchRegisters_);
264  }
265 #endif
266 
267 protected:
272  : wordWidth_(0), regDict_(NULL), stackParameterOrder_(ORDER_UNSPECIFIED), nonParameterStackSize_(0),
273  stackAlignment_(0), stackDirection_(GROWS_DOWN), stackCleanup_(CLEANUP_UNSPECIFIED) {}
274 
280  Definition(size_t wordWidth, const std::string &name, const std::string &comment, const RegisterDictionary *regDict)
281  : name_(name), comment_(comment), wordWidth_(wordWidth), regDict_(regDict), stackParameterOrder_(ORDER_UNSPECIFIED),
282  nonParameterStackSize_(0), stackAlignment_(0), stackDirection_(GROWS_DOWN), stackCleanup_(CLEANUP_UNSPECIFIED) {
283  ASSERT_require2(0 == (wordWidth & 7) && wordWidth > 0, "word size must be a positive multiple of eight");
284  }
285 
286 public:
288  static Ptr instance(size_t wordWidth, const std::string &name, const std::string &comment, const RegisterDictionary *regs) {
289  return Ptr(new Definition(wordWidth, name, comment, regs));
290  }
291 
292 public:
296  static Ptr x86_32bit_cdecl();
297  static Ptr x86_64bit_cdecl();
298  static Ptr x86_32bit_stdcall();
299  static Ptr x86_64bit_stdcall();
300  static Ptr x86_32bit_fastcall();
301  static Ptr x86_64bit_sysv();
302  static Ptr ppc_32bit_ibm();
308  static Ptr x86_cdecl(const RegisterDictionary*);
309  static Ptr x86_stdcall(const RegisterDictionary*);
310  static Ptr x86_fastcall(const RegisterDictionary*);
311  static Ptr ppc_ibm(const RegisterDictionary*);
319  const RegisterDictionary* registerDictionary() const { return regDict_; }
320  void registerDictionary(const RegisterDictionary *d) { regDict_ = d; }
331  const std::string& name() const { return name_; }
332  void name(const std::string &s) { name_ = s; }
342  const std::string& comment() const { return comment_; }
343  void comment(const std::string &s) { comment_ = s; }
355  size_t wordWidth() const { return wordWidth_; }
356  void wordWidth(size_t nBits) {
357  ASSERT_require2(nBits > 0 && 0 == (nBits & 7), "word size must be a positive multiple of eight");
358  wordWidth_ = nBits;
359  }
368  thisParameter_ = ParameterLocation();
369  }
370 
375  const std::vector<ParameterLocation>& inputParameters() const { return inputParameters_; }
376 
379 
384  void clearInputParameters() { inputParameters_.clear(); }
385 
395  }
396  void appendInputParameter(RegisterDescriptor reg, int64_t offset) {
398  }
399  void appendInputParameter(rose_addr_t va) {
401  }
408  const std::vector<ParameterLocation>& outputParameters() const { return outputParameters_; }
409 
412 
417  void clearOutputParameters() { outputParameters_.clear(); }
418 
430  }
431  void appendOutputParameter(RegisterDescriptor reg, int64_t offset) {
433  }
434  void appendOutputParameter(rose_addr_t va) {
436  }
449  StackParameterOrder stackParameterOrder() const { return stackParameterOrder_; }
450  void stackParameterOrder(StackParameterOrder x) { stackParameterOrder_ = x; }
460  const RegisterDescriptor stackPointerRegister() const { return stackPointerRegister_; }
461  void stackPointerRegister(RegisterDescriptor r) { stackPointerRegister_ = r; }
471  size_t nonParameterStackSize() const {
472  return nonParameterStackSize_;
473  }
474  void nonParameterStackSize(size_t nBytes) {
475  nonParameterStackSize_ = nBytes;
476  }
486  StackDirection stackDirection() const { return stackDirection_; }
487  void stackDirection(StackDirection x) { stackDirection_ = x; }
497  StackCleanup stackCleanup() const { return stackCleanup_; }
498  void stackCleanup(StackCleanup x) { stackCleanup_ = x; }
507  size_t stackAlignment() const { return stackAlignment_; }
508  void stackAlignment(size_t nBytes) { stackAlignment_ = nBytes; }
525  const ParameterLocation& thisParameter() const { return thisParameter_; }
526  void thisParameter(const ParameterLocation &x) { thisParameter_ = x; }
529  }
530  void thisParameter(RegisterDescriptor reg, int64_t offset) {
531  thisParameter(ParameterLocation(reg, offset));
532  }
533  void thisParameter(rose_addr_t va) {
535  }
549  const std::set<RegisterDescriptor>& calleeSavedRegisters() const { return calleeSavedRegisters_; }
550  std::set<RegisterDescriptor>& calleeSavedRegisters() { return calleeSavedRegisters_; }
555 
563  const std::set<RegisterDescriptor>& scratchRegisters() const { return scratchRegisters_; }
564  std::set<RegisterDescriptor>& scratchRegisters() { return scratchRegisters_; }
569 
580 
585  void print(std::ostream&, const RegisterDictionary *regDict = NULL) const;
586 };
587 
588 
590 // Dictionary
592 
594 typedef std::vector<Definition::Ptr> Dictionary;
595 
597 const Dictionary& dictionaryAmd64();
598 
600 const Dictionary& dictionaryArm64();
601 
603 const Dictionary& dictionaryM68k();
604 
606 const Dictionary& dictionaryMips();
607 
609 const Dictionary& dictionaryPowerpc32();
610 
612 const Dictionary& dictionaryPowerpc64();
613 
615 const Dictionary& dictionaryX86();
616 
617 
619 // Analysis
621 
625 class Analysis {
626 private:
628  const RegisterDictionary *regDict_; // Names for the register parts
629  Definition::Ptr defaultCc_; // Default calling convention for called functions
630 
631  bool hasResults_; // Are the following data members initialized?
632  bool didConverge_; // Are the following data members valid (else only approximations)?
633  RegisterParts restoredRegisters_; // Registers accessed but restored
634  RegisterParts inputRegisters_; // Registers that serve as possible input parameters
635  RegisterParts outputRegisters_; // Registers that hold possible return values
636  Variables::StackVariables inputStackParameters_; // Stack variables serving as function inputs
637  Variables::StackVariables outputStackParameters_; // Stack variables serving as possible return values
638  Sawyer::Optional<int64_t> stackDelta_; // Change in stack across entire function
639  // Don't forget to update clearResults() and serialize() if you add more.
640 
641 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
642 private:
643  friend class boost::serialization::access;
644 
645  template<class S>
646  void serialize(S &s, const unsigned /*version*/) {
647  s & BOOST_SERIALIZATION_NVP(cpu_);
648  s & BOOST_SERIALIZATION_NVP(regDict_);
649  s & BOOST_SERIALIZATION_NVP(defaultCc_);
650  s & BOOST_SERIALIZATION_NVP(hasResults_);
651  s & BOOST_SERIALIZATION_NVP(didConverge_);
652  s & BOOST_SERIALIZATION_NVP(restoredRegisters_);
653  s & BOOST_SERIALIZATION_NVP(inputRegisters_);
654  s & BOOST_SERIALIZATION_NVP(outputRegisters_);
655  s & BOOST_SERIALIZATION_NVP(inputStackParameters_);
656  s & BOOST_SERIALIZATION_NVP(outputStackParameters_);
657  s & BOOST_SERIALIZATION_NVP(stackDelta_);
658  }
659 #endif
660 
661 public:
668  : regDict_(NULL), hasResults_(false), didConverge_(false) {}
669 
673  explicit Analysis(Disassembler *d)
674  : regDict_(NULL), hasResults_(false), didConverge_(false) {
675  init(d);
676  }
677 
685  : cpu_(cpu), regDict_(NULL), hasResults_(false), didConverge_(false) {}
686 
694  Definition::Ptr defaultCallingConvention() const { return defaultCc_; }
695  void defaultCallingConvention(const Definition::Ptr &x) { defaultCc_ = x; }
704 
709  bool hasResults() const { return hasResults_; }
710 
715  bool didConverge() const { return didConverge_; }
716 
721  void clearResults();
722 
727  void clearNonResults();
728 
736  const RegisterDictionary* registerDictionary() const { return regDict_; }
737  void registerDictionary(const RegisterDictionary *d) { regDict_ = d; }
744  const RegisterParts& calleeSavedRegisters() const { return restoredRegisters_; }
745 
750  const RegisterParts& inputRegisters() const { return inputRegisters_; }
751 
756  const RegisterParts& outputRegisters() const { return outputRegisters_; }
757 
761  const Variables::StackVariables& inputStackParameters() const { return inputStackParameters_; }
762 
766  const Variables::StackVariables& outputStackParameters() const { return outputStackParameters_; }
767 
772  Sawyer::Optional<int64_t> stackDelta() const { return stackDelta_; }
773 
777  bool match(const Definition::Ptr&) const;
778 
784  Dictionary match(const Dictionary&) const;
785 
790  void print(std::ostream&, bool multiLine=false) const;
791 
792 private:
793  // Finish constructing
794  void init(Disassembler*);
795 
796  // Recompute the restoredRegisters_ data member.
797  void updateRestoredRegisters(const InstructionSemantics2::BaseSemantics::StatePtr &initialState,
799 
800  // Recompute the inputRegisters_ data member after updateRestoredRegisters is computed.
801  void updateInputRegisters(const InstructionSemantics2::BaseSemantics::StatePtr &state);
802 
803  // Recompute the outputRegisters_ data member after updateRestoredRegisters is computed.
804  void updateOutputRegisters(const InstructionSemantics2::BaseSemantics::StatePtr &state);
805 
806  // Recompute the input and output stack variables
807  void updateStackParameters(const Partitioner2::FunctionPtr &function,
810 
811  // Recomputes the stack delta
812  void updateStackDelta(const InstructionSemantics2::BaseSemantics::StatePtr &initialState,
814 };
815 
817 // Free functions
819 
820 std::ostream& operator<<(std::ostream&, const Definition&);
821 std::ostream& operator<<(std::ostream&, const Analysis&);
822 
823 } // namespace
824 } // namespace
825 } // namespace
826 
827 #endif
828 #endif
void print(std::ostream &out, const RegisterNames &regnames) const
Print location.
void thisParameter(rose_addr_t va)
Property: Object pointer parameter.
size_t wordWidth() const
Property: Word size in bits.
const Dictionary & dictionaryX86()
Common calling conventions for 32-bit x86.
const std::vector< ParameterLocation > & outputParameters() const
Property: List of output parameters.
void registerDictionary(const RegisterDictionary *d)
Property: Register dictionary.
StackParameterOrder stackParameterOrder() const
Property: Stack parameter order.
size_t stackAlignment() const
Property: Stack alignment.
const Dictionary & dictionaryM68k()
Common calling conventions for m68k.
void print(std::ostream &out, const RegisterDictionary *regdict) const
Print location.
StackDirection stackDirection() const
Property: Direction that stack grows for a push operation.
The called function pops all stack parameters.
const Variables::StackVariables & outputStackParameters() const
Output stack parameters.
void wordWidth(size_t nBits)
Property: Word size in bits.
void stackDirection(StackDirection x)
Property: Direction that stack grows for a push operation.
void appendInputParameter(const ParameterLocation &)
Append input parameter.
RegisterDescriptor reg() const
Register part of location.
static Ptr x86_32bit_cdecl()
Returns a predefined, cached calling convention.
const RegisterDictionary * registerDictionary() const
Property: Register dictionary.
void appendOutputParameter(rose_addr_t va)
Append output parameter.
Sawyer::SharedPointer< class Definition > DefinitionPtr
Reference counting pointer to calling convention definition.
void registerDictionary(const RegisterDictionary *d)
Property: Register dictionary.
Collection of streams.
Definition: Message.h:1600
static Ptr x86_32bit_stdcall()
Allocating constructor.
static Ptr ppc_32bit_ibm()
Allocating constructor.
void thisParameter(RegisterDescriptor reg, int64_t offset)
Property: Object pointer parameter.
ParameterLocation(RegisterDescriptor reg)
Constructs a parameter in a register location.
ParameterLocation(RegisterDescriptor reg, int64_t offset)
Constructs a parameter at a register-relative memory address.
void thisParameter(const ParameterLocation &x)
Property: Object pointer parameter.
const Dictionary & dictionaryPowerpc64()
Common calling conventions for PowerPC-64.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
const Dictionary & dictionaryArm64()
Common calling conventions for ARM.
StackDirection
The direction in which the stack grows.
Analysis(Disassembler *d)
Construct an analyzer using a specified disassembler.
bool operator!=(const ParameterLocation &other) const
Inequality.
const Dictionary & dictionaryAmd64()
Common calling conventions for amd64 (x86-64).
void appendInputParameter(rose_addr_t va)
Append input parameter.
Definition::Ptr defaultCallingConvention() const
Property: Default calling convention.
void thisParameter(RegisterDescriptor reg)
Property: Object pointer parameter.
void stackCleanup(StackCleanup x)
Property: Who pops stack parameters.
rose_addr_t address() const
Fixed address location.
Main namespace for the ROSE library.
RegisterParts inputRegisterParts() const
Compute the set of input registers.
RegisterParts scratchRegisterParts() const
Computes the set of scratch registers.
Holds a set of registers without regard for register boundaries.
Definition: RegisterParts.h:28
StackCleanup stackCleanup() const
Property: Who pops stack parameters.
static Ptr x86_fastcall(const RegisterDictionary *)
Constructs a new pre-defined calling convention based on a register dictionary.
Sawyer::Optional< int64_t > stackDelta() const
Concrete stack delta.
bool hasResults() const
Whether a function has been analyzed.
Sawyer::SharedPointer< Definition > Ptr
Reference counting pointer to calling convention definition.
const ParameterLocation & thisParameter() const
Property: Object pointer parameter.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
void comment(const std::string &s)
Property: Full name of calling convention.
const RegisterParts & calleeSavedRegisters() const
Callee-saved registers.
void stackParameterOrder(StackParameterOrder x)
Property: Stack parameter order.
const RegisterParts & inputRegisters() const
Input registers.
void print(std::ostream &, bool multiLine=false) const
Print information about the analysis results.
const Dictionary & dictionaryPowerpc32()
Common calling conventions for PowerPC-32.
bool operator==(const ParameterLocation &other) const
Equality.
std::vector< Definition::Ptr > Dictionary
A ordered collection of calling convention definitions.
const Dictionary & dictionaryMips()
Common calling conventions for MIPS.
void appendOutputParameter(const ParameterLocation &)
Append output parameter.
static Ptr x86_cdecl(const RegisterDictionary *)
Constructs a new pre-defined calling convention based on a register dictionary.
static Ptr instance(size_t wordWidth, const std::string &name, const std::string &comment, const RegisterDictionary *regs)
Allocating constructor.
const Variables::StackVariables & inputStackParameters() const
Input stack parameters.
const std::set< RegisterDescriptor > & calleeSavedRegisters() const
Property: Callee-saved registers.
Describes (part of) a physical CPU register.
void appendInputParameter(RegisterDescriptor reg)
Append input parameter.
ROSE_UTIL_API std::string addrToString(uint64_t value, size_t nbits=0)
Convert a virtual address to a string.
void nonParameterStackSize(size_t nBytes)
Property: Size of non-parameter stack area.
StackParameterOrder
The order that arguments are pushed onto the stack.
bool isValid() const
Predicate to determine if location is valid.
bool didConverge() const
Whether the analysis results are valid.
std::set< RegisterDescriptor > & scratchRegisters()
Property: Scratch registers.
Sawyer::Message::Facility mlog
Facility for diagnostic output.
Prints a register name even when no dictionary is available or when the dictionary doesn't contain an...
Definition: Registers.h:373
void appendInputParameter(RegisterDescriptor reg, int64_t offset)
Append input parameter.
void analyzeFunction(const Partitioner2::Partitioner &, const Sawyer::SharedPointer< Partitioner2::Function > &)
Analyze one function.
void print(std::ostream &, const RegisterDictionary *regDict=NULL) const
Print detailed information about this calling convention.
size_t nonParameterStackSize() const
Property: Size of non-parameter stack area.
Analysis(const InstructionSemantics2::BaseSemantics::DispatcherPtr &cpu)
Construct an analysis using a specified dispatcher.
static Ptr x86_stdcall(const RegisterDictionary *)
Constructs a new pre-defined calling convention based on a register dictionary.
RegisterParts outputRegisterParts() const
Computes the set of output registers.
bool match(const Definition::Ptr &) const
Determine whether a definition matches.
const RegisterDescriptor stackPointerRegister() const
Property: Register for implied stack parameters.
RegisterParts getUsedRegisterParts() const
Returns all registers mentioned in this definition.
const RegisterParts & outputRegisters() const
Output registers.
static Ptr x86_64bit_cdecl()
Allocating constructor.
void name(const std::string &s)
Property: Short name of calling convention.
Stack parameters pushed left to right (Pascal order).
ParameterLocation(rose_addr_t va)
Constructs a parameter at a fixed memory address.
StackCleanup
Who is responsible for popping stack parameters.
const RegisterDictionary * registerDictionary() const
Property: Register dictionary.
Base class for reference counted objects.
Definition: SharedObject.h:64
void clearNonResults()
Clears everything but results.
void initDiagnostics()
Initialize diagnostics.
void clearResults()
Clear analysis results.
const std::vector< ParameterLocation > & inputParameters() const
Property: Enumerated input parameters.
Stack parameters pushed right to left (C order).
void clearInputParameters()
Erase enumerated input parameters.
void appendOutputParameter(RegisterDescriptor reg)
Append output parameter.
const std::string & name() const
Property: Short name of calling convention.
void stackAlignment(size_t nBytes)
Property: Stack alignment.
Stack parameter cleanup is unknown or unspecified.
Definition(size_t wordWidth, const std::string &name, const std::string &comment, const RegisterDictionary *regDict)
Allocating constructor.
Defines registers available for a particular architecture.
Definition: Registers.h:38
Stack parameter order is unknown or unspecified.
RegisterParts calleeSavedRegisterParts() const
Compute the set of callee-saved registers.
void defaultCallingConvention(const Definition::Ptr &x)
Property: Default calling convention.
const std::string & comment() const
Property: Full name of calling convention.
const std::set< RegisterDescriptor > & scratchRegisters() const
Property: Scratch registers.
static Ptr x86_32bit_fastcall()
Allocating constructor.
Partitions instructions into basic blocks and functions.
Definition: Partitioner.h:321
static Ptr x86_64bit_sysv()
Allocating constructor.
Virtual base class for instruction disassemblers.
Definition: Disassembler.h:50
static Ptr x86_64bit_stdcall()
Allocating constructor.
std::set< RegisterDescriptor > & calleeSavedRegisters()
Property: Callee-saved registers.
static Ptr ppc_ibm(const RegisterDictionary *)
Constructs a new pre-defined calling convention based on a register dictionary.
void stackPointerRegister(RegisterDescriptor r)
Property: Register for implied stack parameters.
void appendOutputParameter(RegisterDescriptor reg, int64_t offset)
Append output parameter.