miasm
Reverse engineering framework
test_types Namespace Reference

Classes

class  A
 
class  Anon
 
class  B
 
class  BitStruct
 
class  ContStruct
 
class  InStruct
 
class  MyStruct
 
class  MyStruct2
 
class  OtherStruct
 
class  UnhealthyIdeas
 
class  UniStruct
 

Variables

 loc_db = LocationDB()
 
 jitter = Machine("x86_32").jitter(loc_db, "python")
 
int addr = 0x1000
 
int size = 0x1000
 
int addr_str = 0x1100
 
int addr_str2 = 0x1200
 
int addr_str3 = 0x1300
 
 mstruct = MyStruct(jitter.vm, addr)
 Creation Use manual allocation with explicit addr for the first example. More...
 
 num
 Fields are read from the virtual memory. More...
 
 memval = struct.unpack("I", jitter.vm.get_mem(mstruct.get_addr(), 4))[0]
 
 my_heap = heap()
 Memset sets the whole structure. More...
 
 other = OtherStruct(jitter.vm)
 Setup for Ptr tests the addr field can now be omitted since allocator is set. More...
 
 foo
 
 val
 Basic usage. More...
 
 other2 = OtherStruct(jitter.vm)
 Deref assignment. More...
 
 deref
 
 alloc_addr
 Same stuff for Ptr to MemField. More...
 
 i
 
 memstr = Str().lval(jitter.vm, addr_str)
 Basic tests. More...
 
 memstr2 = Str().lval(jitter.vm, addr_str2)
 Other address, same value, same encoding. More...
 
 memstr3 = Str("utf16").lval(jitter.vm, addr_str3)
 Same value, other encoding. More...
 
 memarray = Array(Num("I")).lval(jitter.vm, alloc_addr)
 
 s = bytes(memarray)
 
 memsarray = Array(Num("I"), 10).lval(jitter.vm)
 Slice assignment. More...
 
 ms2 = MyStruct2(jitter.vm)
 
 s2
 RawStruct. More...
 
 array2 = Array(Num("B"), 10).lval(jitter.vm)
 Field assignment (MemSizedArray) More...
 
 cont = ContStruct(jitter.vm)
 
 one
 
 bar
 
 last
 
 uni = UniStruct(jitter.vm)
 
 bit = BitStruct(jitter.vm)
 
 f1_1
 
 f2_5
 
 f3_8
 
 flags_num
 
int p_size = Ptr("I", Void()).size
 
 ideas = UnhealthyIdeas(jitter.vm)
 
 pself
 
 ppself
 
 pppself
 
 a = A(jitter.vm)
 
 b = B(jitter.vm)
 
 MemInt = Num("I").lval
 
 MemShort = Num("H").lval
 
 dword = MemInt(jitter.vm)
 
 MemPtrVoid = Ptr("I", Void()).lval
 
 p = MemPtrVoid(jitter.vm)
 
 anon = Anon(jitter.vm)
 
 b2
 
 c1
 
 c2
 
 d
 
 arr_t = Array(Num("H"))
 

Variable Documentation

◆ a

test_types.a = A(jitter.vm)

◆ addr

int test_types.addr = 0x1000

◆ addr_str

int test_types.addr_str = 0x1100

◆ addr_str2

int test_types.addr_str2 = 0x1200

◆ addr_str3

int test_types.addr_str3 = 0x1300

◆ alloc_addr

test_types.alloc_addr
Initial value:
1 = my_heap.vm_alloc(jitter.vm,
2  mstruct.get_type().get_field_type("i")
3  .dst_type.size)

Same stuff for Ptr to MemField.

◆ anon

test_types.anon = Anon(jitter.vm)

◆ arr_t

test_types.arr_t = Array(Num("H"))

◆ array2

test_types.array2 = Array(Num("B"), 10).lval(jitter.vm)

Field assignment (MemSizedArray)

◆ b

test_types.b = B(jitter.vm)

◆ b2

test_types.b2

◆ bar

test_types.bar

◆ bit

test_types.bit = BitStruct(jitter.vm)

◆ c1

test_types.c1

◆ c2

test_types.c2

◆ cont

test_types.cont = ContStruct(jitter.vm)

◆ d

test_types.d

◆ deref

test_types.deref

◆ dword

test_types.dword = MemInt(jitter.vm)

◆ f1_1

test_types.f1_1

◆ f2_5

test_types.f2_5

◆ f3_8

test_types.f3_8

◆ flags_num

test_types.flags_num

◆ foo

test_types.foo

◆ i

test_types.i

◆ ideas

test_types.ideas = UnhealthyIdeas(jitter.vm)

◆ jitter

test_types.jitter = Machine("x86_32").jitter(loc_db, "python")

◆ last

test_types.last

◆ loc_db

test_types.loc_db = LocationDB()

◆ memarray

test_types.memarray = Array(Num("I")).lval(jitter.vm, alloc_addr)

◆ MemInt

test_types.MemInt = Num("I").lval

◆ MemPtrVoid

test_types.MemPtrVoid = Ptr("I", Void()).lval

◆ memsarray

test_types.memsarray = Array(Num("I"), 10).lval(jitter.vm)

Slice assignment.

◆ MemShort

test_types.MemShort = Num("H").lval

◆ memstr

test_types.memstr = Str().lval(jitter.vm, addr_str)

Basic tests.

◆ memstr2

test_types.memstr2 = Str().lval(jitter.vm, addr_str2)

Other address, same value, same encoding.

◆ memstr3

test_types.memstr3 = Str("utf16").lval(jitter.vm, addr_str3)

Same value, other encoding.

◆ memval

test_types.memval = struct.unpack("I", jitter.vm.get_mem(mstruct.get_addr(), 4))[0]

◆ ms2

test_types.ms2 = MyStruct2(jitter.vm)

◆ mstruct

test_types.mstruct = MyStruct(jitter.vm, addr)

Creation Use manual allocation with explicit addr for the first example.

◆ my_heap

test_types.my_heap = heap()

Memset sets the whole structure.

◆ num

test_types.num

Fields are read from the virtual memory.

Field assignment modifies virtual memory

◆ one

test_types.one

◆ other

test_types.other = OtherStruct(jitter.vm)

Setup for Ptr tests the addr field can now be omitted since allocator is set.

◆ other2

test_types.other2 = OtherStruct(jitter.vm)

Deref assignment.

◆ p

test_types.p = MemPtrVoid(jitter.vm)

◆ p_size

int test_types.p_size = Ptr("I", Void()).size

◆ pppself

test_types.pppself

◆ ppself

test_types.ppself

◆ pself

test_types.pself

◆ s

test_types.s = bytes(memarray)

◆ s2

test_types.s2

RawStruct.

Array Basic checks

Subscript assignment

Field assignment (list)

◆ size

int test_types.size = 0x1000

◆ uni

test_types.uni = UniStruct(jitter.vm)

◆ val

test_types.val

Basic usage.

Ptr(Str()) manipulations.