Class: Pwnlib::ABI::ABI

Inherits:
Object
  • Object
show all
Extended by:
Context
Defined in:
lib/pwnlib/abi.rb

Overview

A super class for recording registers and stack’s information.

Direct Known Subclasses

SyscallABI

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regs, align, stack_pointer, cdq_pair: nil) ⇒ ABI

Returns a new instance of ABI.



15
16
17
18
19
20
# File 'lib/pwnlib/abi.rb', line 15

def initialize(regs, align, stack_pointer, cdq_pair: nil)
  @register_arguments = regs
  @arg_alignment = align
  @stack_pointer = stack_pointer
  @cdq_pair = cdq_pair
end

Instance Attribute Details

#arg_alignmentObject (readonly)

Returns the value of attribute arg_alignment.



11
12
13
# File 'lib/pwnlib/abi.rb', line 11

def arg_alignment
  @arg_alignment
end

#cdq_pairObject (readonly)

Only used for x86, to specify the eax, edx pair.



13
14
15
# File 'lib/pwnlib/abi.rb', line 13

def cdq_pair
  @cdq_pair
end

#register_argumentsObject (readonly)

Returns the value of attribute register_arguments.



11
12
13
# File 'lib/pwnlib/abi.rb', line 11

def register_arguments
  @register_arguments
end

#stack_pointerObject (readonly)

Returns the value of attribute stack_pointer.



11
12
13
# File 'lib/pwnlib/abi.rb', line 11

def stack_pointer
  @stack_pointer
end

Class Method Details

.defaultObject



23
24
25
# File 'lib/pwnlib/abi.rb', line 23

def default
  DEFAULT[arch_key]
end

.syscallObject



27
28
29
# File 'lib/pwnlib/abi.rb', line 27

def syscall
  SYSCALL[arch_key]
end