Package FuzzManager :: Package FTB :: Package Signatures :: Module RegisterHelper
[hide private]
[frames] | no frames]

Module RegisterHelper

source code

Helper methods around registers


Author: Christian Holler (:decoder)

License:

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Contact: choller@mozilla.com

Functions [hide private]
 
getRegisterPattern()
Return a pattern including all register names that are considered valid
source code
long
getStackPointer(registerMap)
Return the stack pointer value from the given register map
source code
long
getInstructionPointer(registerMap)
Return the instruction pointer value from the given register map
source code
long
getRegisterValue(register, registerMap)
Return the value of the specified register using the provided register map.
source code
int
getBitWidth(registerMap)
Return the bit width (32 or 64 bit) given the registers
source code
bool
isX86Compatible(registerMap)
Return true, if the the given registers are X86 compatible, such as x86 or x86-64.
source code
Variables [hide private]
  x86Registers = ['eax', 'ebx', 'ecx', 'edx', 'esi', 'edi', 'ebp...
  x64Registers = ['rax', 'rbx', 'rcx', 'rdx', 'rsi', 'rdi', 'rbp...
  armRegisters = ['r0', 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7'...
  x86OnlyRegisters = ['eip', 'r14', 'r15', 'rcx', 'r13', 'esp', ...
  validRegisters = {'ARM': ['r0', 'r1', 'r2', 'r3', 'r4', 'r5', ...
  __package__ = None
Function Details [hide private]

getStackPointer(registerMap)

source code 

Return the stack pointer value from the given register map

Parameters:
  • registerMap (map) - Map of register names to value
Returns: long
The value of the stack pointer

getInstructionPointer(registerMap)

source code 

Return the instruction pointer value from the given register map

Parameters:
  • registerMap (map) - Map of register names to value
Returns: long
The value of the instruction pointer

getRegisterValue(register, registerMap)

source code 

Return the value of the specified register using the provided register map. This method also works for getting lower register parts out of higher ones.

Parameters:
  • register (string) - The register to get the value for
  • registerMap (map) - Map of register names to values
Returns: long
The register value

getBitWidth(registerMap)

source code 

Return the bit width (32 or 64 bit) given the registers

Parameters:
  • registerMap (map) - Map of register names to value
Returns: int
The bit width

isX86Compatible(registerMap)

source code 

Return true, if the the given registers are X86 compatible, such as x86 or x86-64. ARM, PPC and your PDP-15 will fail this check and we don't support it right now.

Parameters:
  • registerMap (map) - Map of register names to value
Returns: bool
True if the architecture is X86 compatible, False otherwise

Variables Details [hide private]

x86Registers

Value:
['eax', 'ebx', 'ecx', 'edx', 'esi', 'edi', 'ebp', 'esp', 'eip']

x64Registers

Value:
['rax',
 'rbx',
 'rcx',
 'rdx',
 'rsi',
 'rdi',
 'rbp',
 'rsp',
...

armRegisters

Value:
['r0',
 'r1',
 'r2',
 'r3',
 'r4',
 'r5',
 'r6',
 'r7',
...

x86OnlyRegisters

Value:
['eip',
 'r14',
 'r15',
 'rcx',
 'r13',
 'esp',
 'rsp',
 'edi',
...

validRegisters

Value:
{'ARM': ['r0',
         'r1',
         'r2',
         'r3',
         'r4',
         'r5',
         'r6',
         'r7',
...