miasm
Reverse engineering framework
test_chandler Namespace Reference

Variables

string text_1
 
string text_2
 
 base_types = CTypeAMD64_unk()
 
 types_ast = CAstTypes()
 
 types_mngr = CTypesManagerNotPacked(types_ast, base_types)
 
 obj = types_mngr.get_objc(type_id)
 
 void_ptr = types_mngr.void_ptr
 
 obj_dummy = types_mngr.get_objc(CTypeId("dummy"))
 
 obj_int = types_mngr.get_objc(CTypeId("int"))
 
 obj_uint = types_mngr.get_objc(CTypeId("unsigned", "int"))
 
 obj_long = types_mngr.get_objc(CTypeId("long"))
 
 obj_array1 = types_mngr.get_objc(CTypeId("array1"))
 
 obj_array2 = types_mngr.get_objc(CTypeId("array2"))
 
 obj_array3 = types_mngr.get_objc(CTypeId("array3"))
 
 obj_array4 = types_mngr.get_objc(CTypeId("array4"))
 
 obj_charint = types_mngr.get_objc(CTypeUnion("char_int"))
 
 obj_test = types_mngr.get_objc(CTypePtr(CTypeId("Test")))
 
 ptr_test = ExprId("ptr_Test", 64)
 
 obj_recurse = types_mngr.get_objc(CTypePtr(CTypeStruct("recurse")))
 
 obj_recurse_bis = types_mngr.get_objc(CTypePtr(CTypeStruct("recurse")))
 
 set_test = set([obj_recurse, obj_recurse_bis])
 
 ptr_recurse = ExprId("ptr_recurse", 64)
 
 obj_test_st = types_mngr.get_objc(CTypeStruct("test_st"))
 
 obj_test_context = types_mngr.get_objc(CTypeStruct("test_context"))
 
dictionary expr_types
 
dictionary c_context
 
list tests
 
 mychandler = CHandler(types_mngr, expr_types=expr_types, C_types=c_context)
 
 exprc2expr = ExprCToExpr(expr_types, types_mngr)
 
 result = set(result)
 
 expr_c = mychandler.expr_to_c(expr)
 
 types = mychandler.expr_to_types(expr)
 
 target_type = mychandler.expr_to_types(expr)
 
 access_c_gen = ExprToAccessC(expr_types, types_mngr)
 
 computed = set()
 
 parsed_expr = mychandler.c_to_expr(out_str)
 
 parsed_type = mychandler.c_to_type(out_str)
 
 ast = parse_access(out_str)
 
 access_c = ast_get_c_access_expr(ast, c_context)
 
 parsed_expr_bis
 
 parsed_type_bis
 
 parsed_expr_3
 
 parsed_type_3
 
 expr_new1 = expr_simp(parsed_expr)
 
 expr_new2 = expr_simp(expr)
 

Detailed Description

Regression test for objc
* ast parsed C to C Miasm expression
* C Miasm expression to native expression
* Miasm expression to type

Variable Documentation

◆ access_c

test_chandler.access_c = ast_get_c_access_expr(ast, c_context)

◆ access_c_gen

test_chandler.access_c_gen = ExprToAccessC(expr_types, types_mngr)

◆ ast

test_chandler.ast = parse_access(out_str)

◆ base_types

test_chandler.base_types = CTypeAMD64_unk()

◆ c_context

dictionary test_chandler.c_context
Initial value:
1 = {ptr_test.name: obj_test,
2  ptr_recurse.name: obj_recurse}

◆ computed

test_chandler.computed = set()

◆ expr_c

test_chandler.expr_c = mychandler.expr_to_c(expr)

◆ expr_new1

test_chandler.expr_new1 = expr_simp(parsed_expr)

◆ expr_new2

test_chandler.expr_new2 = expr_simp(expr)

◆ expr_types

dictionary test_chandler.expr_types
Initial value:
1 = {ptr_test: set([obj_test]),
2  ptr_recurse: set([obj_recurse])}

◆ exprc2expr

test_chandler.exprc2expr = ExprCToExpr(expr_types, types_mngr)

◆ mychandler

test_chandler.mychandler = CHandler(types_mngr, expr_types=expr_types, C_types=c_context)

◆ obj

test_chandler.obj = types_mngr.get_objc(type_id)

◆ obj_array1

test_chandler.obj_array1 = types_mngr.get_objc(CTypeId("array1"))

◆ obj_array2

test_chandler.obj_array2 = types_mngr.get_objc(CTypeId("array2"))

◆ obj_array3

test_chandler.obj_array3 = types_mngr.get_objc(CTypeId("array3"))

◆ obj_array4

test_chandler.obj_array4 = types_mngr.get_objc(CTypeId("array4"))

◆ obj_charint

test_chandler.obj_charint = types_mngr.get_objc(CTypeUnion("char_int"))

◆ obj_dummy

test_chandler.obj_dummy = types_mngr.get_objc(CTypeId("dummy"))

◆ obj_int

test_chandler.obj_int = types_mngr.get_objc(CTypeId("int"))

◆ obj_long

test_chandler.obj_long = types_mngr.get_objc(CTypeId("long"))

◆ obj_recurse

test_chandler.obj_recurse = types_mngr.get_objc(CTypePtr(CTypeStruct("recurse")))

◆ obj_recurse_bis

test_chandler.obj_recurse_bis = types_mngr.get_objc(CTypePtr(CTypeStruct("recurse")))

◆ obj_test

test_chandler.obj_test = types_mngr.get_objc(CTypePtr(CTypeId("Test")))

◆ obj_test_context

test_chandler.obj_test_context = types_mngr.get_objc(CTypeStruct("test_context"))

◆ obj_test_st

test_chandler.obj_test_st = types_mngr.get_objc(CTypeStruct("test_st"))

◆ obj_uint

test_chandler.obj_uint = types_mngr.get_objc(CTypeId("unsigned", "int"))

◆ parsed_expr

test_chandler.parsed_expr = mychandler.c_to_expr(out_str)

◆ parsed_expr_3

test_chandler.parsed_expr_3

◆ parsed_expr_bis

test_chandler.parsed_expr_bis

◆ parsed_type

test_chandler.parsed_type = mychandler.c_to_type(out_str)

◆ parsed_type_3

test_chandler.parsed_type_3

◆ parsed_type_bis

test_chandler.parsed_type_bis

◆ ptr_recurse

test_chandler.ptr_recurse = ExprId("ptr_recurse", 64)

◆ ptr_test

test_chandler.ptr_test = ExprId("ptr_Test", 64)

◆ result

test_chandler.result = set(result)

◆ set_test

test_chandler.set_test = set([obj_recurse, obj_recurse_bis])

◆ target_type

test_chandler.target_type = mychandler.expr_to_types(expr)

◆ tests

list test_chandler.tests

◆ text_1

string test_chandler.text_1

◆ text_2

string test_chandler.text_2
Initial value:
1 = """
2 struct test_context {
3  int a;
4  struct test_st test;
5  int b;
6 };
7 
8 """

◆ types

test_chandler.types = mychandler.expr_to_types(expr)

◆ types_ast

test_chandler.types_ast = CAstTypes()

◆ types_mngr

test_chandler.types_mngr = CTypesManagerNotPacked(types_ast, base_types)

◆ void_ptr

test_chandler.void_ptr = types_mngr.void_ptr