Package winappdbg :: Module textio :: Class HexInput
[hide private]
[frames] | no frames]

Class HexInput


Static functions for hexadecimal user input.

Instance Methods [hide private]

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods [hide private]
list( int )
integer_list_file(cls, filename)
Read a list of integers from a file.
list
mixed_list_file(cls, filename)
Read a list of mixed values from a file.
Static Methods [hide private]
int
integer(token)
Convert numeric strings into integers.
str
hexadecimal(token)
Convert a strip of hexadecimal numbers into binary data.
str
pattern(token)
Convert an hexadecimal search pattern into a POSIX regular expression.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

integer(token)
Static Method

 

Convert numeric strings into integers.

Parameters:
  • token (str) - String to parse.
Returns: int
Parsed integer value.

hexadecimal(token)
Static Method

 

Convert a strip of hexadecimal numbers into binary data.

Parameters:
  • token (str) - String to parse.
Returns: str
Parsed string value.

pattern(token)
Static Method

 

Convert an hexadecimal search pattern into a POSIX regular expression.

For example, the following pattern:

   "B8 0? ?0 ?? ??"

Would match the following data:

   "B8 0D F0 AD BA"    # mov eax, 0xBAADF00D
Parameters:
  • token (str) - String to parse.
Returns: str
Parsed string value.

integer_list_file(cls, filename)
Class Method

 

Read a list of integers from a file.

The file format is:

  • # begins comments
  • leading and trailing spaces are ignored
  • integers can be specified as:
    • decimal numbers ("100" is 100)
    • hexadecimal numbers ("0x100" is 256)
    • binary numbers ("0b100" is 4)
    • octal numbers ("0100" is 64)
Parameters:
  • filename (str) - Name of the file to read.
Returns: list( int )
List of integers read from file.

mixed_list_file(cls, filename)
Class Method

 

Read a list of mixed values from a file.

The file format is:

  • # begins comments
  • leading and trailing spaces are ignored
  • strings cannot span over a single line
  • integers can be specified as:
    • decimal numbers ("100" is 100)
    • hexadecimal numbers ("0x100" is 256)
    • binary numbers ("0b100" is 4)
    • octal numbers ("0100" is 64)
Parameters:
  • filename (str) - Name of the file to read.
Returns: list
List of integers and strings read from file.