Package Libs :: Module immutils
[hide private]
[frames] | no frames]

Module immutils

source code

(c) Immunity, Inc. 2004-2007

Immunity Inc.

MOSDEF utils for non-CANVAS users

Classes [hide private]
  antifloatdict

Functions [hide private]
  __ignore(*args, **kargs)
  __retsamearg(arg)
  devlog(*args, **kargs)
  isdebug(*args, **kargs)
  warnings_safely_ignore(*args, **kargs)
  warning_restore(*args, **kargs)
  deprecate(*args, **kargs)
  uniqlist(arg)
  __MOSDEFimport__(*args)
  hasbadchar(word, badchars)
  check_bits_consistancy(bits)
  check_string_len(s, l, assertmsg="")
  split_int_bits(bits, i)
  split_int32(int32)
  int2list_bits(bits, i, swap=0)
  int2list32(int32, swap=0)
  int2str_bits(bits, i, swap=0)
  int2str32(int32, swap=0)
  int2str16(int16, swap=0)
  int2str32_swapped(int32)
  int2str16_swapped(int16)
  str2int_bits(bits, s)
  str2int_bits_swapped(bits, s)
  str2int16(s)
  str2int32(s)
  str2int64(s)
  str2int16_swapped(s)
  str2int32_swapped(s)
  str2int64_swapped(s)
  str2bigendian(astring)
oppposite of istr2int
  str2littleendian(astring)
  byteswap_bits(bits, i)
  byteswap_64(int64)
  byteswap_32(int32)
  byteswap_16(int16)
  hexprint(s)
  prettyprint(instring)
  c_array(data, desc=None)
  shellcode_dump(sc, align=0, alignpad=" ", alignmax=16, mode=None)
  dummywrite(fd, data)
we just want to write some data on any fd, opened or closed.
  warnmsg(msg)
  binary_string_bits(bits, i)
  binary_string_int8(int8)
  binary_string_int16(int16)
  binary_string_int32(int32)
  binary_string_int64(int64)
  binary_string_char(c)
  binary_string_short(s)
  binary_string_int(i)
  dInt(sint)
Turns sint into an int, hopefully python's int() doesn't handle negatives with base 0 well
  binary_from_string(astr, bits=None)
returns [1,0,0,0,0,0,0,0] from "€"
  b(mystr)
  hexdump(buf)
  prettyhexprint(s, length=8)
A nicely displayed hexdump as a string
  sint_is_signed(bits, c)
  uint_bits(bits, c)
  sint_bits(bits, c)
  fmt_bits(bits)
  uintfmt_bits(bits, c)
  sintfmt_bits(bits, c)
  bits(myint, maxbits=32)
counts the number of bits in an integer the slow way
  uint8(c)
  uint16(c)
  uint32(c)
  uint64(c)
  sint16(c)
  sint32(c)
  sint64(c)
  uint8fmt(c)
  uint16fmt(c)
  uint32fmt(c)
  uint64fmt(c)
  sint16fmt(c)
  sint32fmt(c)
  sint64fmt(c)
  IsInt(str)
Checks for integer, hex or no
  signedshort(i)
  big2int(big)
  int2uns(small)
  istr2halfword(astring)
  nstr2halfword(astring)
  intel_str2int(astring)
  istr2int(astring)
  halfword2istr(halfword)
  halfword2bstr(halfword)
  short2bigstr(short)
  intel_short(halfword)
  big_short(short)
  big_order(int32)
Opposite of str2bigendian
  intel_order(int32)
bijection of str2littleendian()
  print_binary(int32)
  decimal2binary(num)
  test(funcname)

Variables [hide private]
  __VERSION__ = '1.0'
  _MOSDEFimport_cachefailedimport = True
  _MOSDEFimport_hook = False
  _failed_imported_module_table = []
  goodchars = '.()~!#$%^&*()-=_/\\:<>'

Function Details [hide private]

__ignore(*args, **kargs)

source code 
None

__retsamearg(arg)

source code 
None

devlog(*args, **kargs)

source code 
None

isdebug(*args, **kargs)

source code 
None

warnings_safely_ignore(*args, **kargs)

source code 
None

warning_restore(*args, **kargs)

source code 
None

deprecate(*args, **kargs)

source code 
None

uniqlist(arg)

source code 
None

__MOSDEFimport__(*args)

source code 
None

hasbadchar(word, badchars)

source code 
None

check_bits_consistancy(bits)

source code 
None

check_string_len(s, l, assertmsg="")

source code 
None

split_int_bits(bits, i)

source code 
None

split_int32(int32)

source code 
None

int2list_bits(bits, i, swap=0)

source code 
None

int2list32(int32, swap=0)

source code 
None

int2str_bits(bits, i, swap=0)

source code 
None

int2str32(int32, swap=0)

source code 
None

int2str16(int16, swap=0)

source code 
None

int2str32_swapped(int32)

source code 
None

int2str16_swapped(int16)

source code 
None

str2int_bits(bits, s)

source code 
None

str2int_bits_swapped(bits, s)

source code 
None

str2int16(s)

source code 
None

str2int32(s)

source code 
None

str2int64(s)

source code 
None

str2int16_swapped(s)

source code 
None

str2int32_swapped(s)

source code 
None

str2int64_swapped(s)

source code 
None

str2bigendian(astring)

source code 
oppposite of istr2int

str2littleendian(astring)

source code 
None

byteswap_bits(bits, i)

source code 
None

byteswap_64(int64)

source code 
None

byteswap_32(int32)

source code 
None

byteswap_16(int16)

source code 
None

hexprint(s)

source code 
None

prettyprint(instring)

source code 
None

c_array(data, desc=None)

source code 
None

shellcode_dump(sc, align=0, alignpad=" ", alignmax=16, mode=None)

source code 
None

dummywrite(fd, data)

source code 
we just want to write some data on any fd, opened or closed.

warnmsg(msg)

source code 
None

binary_string_bits(bits, i)

source code 
None

binary_string_int8(int8)

source code 
None

binary_string_int16(int16)

source code 
None

binary_string_int32(int32)

source code 
None

binary_string_int64(int64)

source code 
None

binary_string_char(c)

source code 
None

binary_string_short(s)

source code 
None

binary_string_int(i)

source code 
None

dInt(sint)

source code 
Turns sint into an int, hopefully python's int() doesn't handle negatives with base 0 well

binary_from_string(astr, bits=None)

source code 
returns [1,0,0,0,0,0,0,0] from "€"

b(mystr)

source code 
None

hexdump(buf)

source code 
None

prettyhexprint(s, length=8)

source code 
A nicely displayed hexdump as a string

sint_is_signed(bits, c)

source code 
None

uint_bits(bits, c)

source code 
None

sint_bits(bits, c)

source code 
None

fmt_bits(bits)

source code 
None

uintfmt_bits(bits, c)

source code 
None

sintfmt_bits(bits, c)

source code 
None

bits(myint, maxbits=32)

source code 
counts the number of bits in an integer the slow way

uint8(c)

source code 
None

uint16(c)

source code 
None

uint32(c)

source code 
None

uint64(c)

source code 
None

sint16(c)

source code 
None

sint32(c)

source code 
None

sint64(c)

source code 
None

uint8fmt(c)

source code 
None

uint16fmt(c)

source code 
None

uint32fmt(c)

source code 
None

uint64fmt(c)

source code 
None

sint16fmt(c)

source code 
None

sint32fmt(c)

source code 
None

sint64fmt(c)

source code 
None

IsInt(str)

source code 
Checks for integer, hex or no

signedshort(i)

source code 
None

big2int(big)

source code 
None

int2uns(small)

source code 
None

istr2halfword(astring)

source code 
None

nstr2halfword(astring)

source code 
None

intel_str2int(astring)

source code 
None

istr2int(astring)

source code 
None

halfword2istr(halfword)

source code 
None

halfword2bstr(halfword)

source code 
None

short2bigstr(short)

source code 
None

intel_short(halfword)

source code 
None

big_short(short)

source code 
None

big_order(int32)

source code 
Opposite of str2bigendian

intel_order(int32)

source code 
bijection of str2littleendian()

print_binary(int32)

source code 
None

decimal2binary(num)

source code 
None

test(funcname)

source code 
None

Variables Details [hide private]

__VERSION__

None
Value:
'1.0'                                                                  
      

_MOSDEFimport_cachefailedimport

None
Value:
True                                                                   
      

_MOSDEFimport_hook

None
Value:
False                                                                  
      

_failed_imported_module_table

None
Value:
[]                                                                     
      

goodchars

None
Value:
'.()~!#$%^&*()-=_/\\:<>'