
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

char * xstrndup(char *s,size_t n)

{
  size_t __n;
  void *__dest;
  char *pcVar1;
  
  __n = strnlen(s,n);
  __dest = (void *)xmalloc(__n + 1);
  *(undefined1 *)((int)__dest + __n) = 0;
  pcVar1 = (char *)memcpy(__dest,s,__n);
  return pcVar1;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void FUN_0002e6e0(char *param_1,size_t param_2)

{
  size_t __n;
  void *__dest;
  
  __n = strnlen(param_1,param_2);
  __dest = (void *)xmalloc(__n + 1);
  *(undefined1 *)((int)__dest + __n) = 0;
  memcpy(__dest,param_1,__n);
  return;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDI,dword ptr [ESP + 0x10]
CALL 0x000166c0
ADD EBX,0x11914
SUB ESP,0x8
PUSH dword ptr [ESP + 0x1c]
PUSH EDI
CALL 0x000136a0
MOV ESI,EAX
LEA EAX,[EAX + 0x1]
MOV dword ptr [ESP],EAX
CALL 0x000132e0
ADD ESP,0xc
MOV byte ptr [EAX + ESI*0x1],0x0
PUSH ESI
PUSH EDI
PUSH EAX
CALL 0x00013130
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0002e6e0(char *param_1,size_t param_2)\n\n{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}\n\n" comment (function_definition "void FUN_0002e6e0(char *param_1,size_t param_2)\n\n{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}" primitive_type (function_declarator "FUN_0002e6e0(char *param_1,size_t param_2)" identifier (parameter_list "(char *param_1,size_t param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) ))) (compound_statement "{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}" { (declaration "size_t __n;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (expression_statement "__n = strnlen(param_1,param_2);" (assignment_expression "__n = strnlen(param_1,param_2)" identifier = (call_expression "strnlen(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "__dest = (void *)xmalloc(__n + 1);" (assignment_expression "__dest = (void *)xmalloc(__n + 1)" identifier = (cast_expression "(void *)xmalloc(__n + 1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 1)" identifier (argument_list "(__n + 1)" ( (binary_expression "__n + 1" identifier + number_literal) ))))) ;) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0" (pointer_expression "*(undefined1 *)((int)__dest + __n)" * (cast_expression "(undefined1 *)((int)__dest + __n)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + __n)" ( (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "memcpy(__dest,param_1,__n);" (call_expression "memcpy(__dest,param_1,__n)" identifier (argument_list "(__dest,param_1,__n)" ( identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * xstrndup(char *s,size_t n)\n\n{\n  size_t __n;\n  void *__dest;\n  char *pcVar1;\n  \n  __n = strnlen(s,n);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  pcVar1 = (char *)memcpy(__dest,s,__n);\n  return pcVar1;\n}\n\n" comment comment (function_definition "char * xstrndup(char *s,size_t n)\n\n{\n  size_t __n;\n  void *__dest;\n  char *pcVar1;\n  \n  __n = strnlen(s,n);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  pcVar1 = (char *)memcpy(__dest,s,__n);\n  return pcVar1;\n}" primitive_type (pointer_declarator "* xstrndup(char *s,size_t n)" * (function_declarator "xstrndup(char *s,size_t n)" identifier (parameter_list "(char *s,size_t n)" ( (parameter_declaration "char *s" primitive_type (pointer_declarator "*s" * identifier)) , (parameter_declaration "size_t n" primitive_type identifier) )))) (compound_statement "{\n  size_t __n;\n  void *__dest;\n  char *pcVar1;\n  \n  __n = strnlen(s,n);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  pcVar1 = (char *)memcpy(__dest,s,__n);\n  return pcVar1;\n}" { (declaration "size_t __n;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (expression_statement "__n = strnlen(s,n);" (assignment_expression "__n = strnlen(s,n)" identifier = (call_expression "strnlen(s,n)" identifier (argument_list "(s,n)" ( identifier , identifier )))) ;) (expression_statement "__dest = (void *)xmalloc(__n + 1);" (assignment_expression "__dest = (void *)xmalloc(__n + 1)" identifier = (cast_expression "(void *)xmalloc(__n + 1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 1)" identifier (argument_list "(__n + 1)" ( (binary_expression "__n + 1" identifier + number_literal) ))))) ;) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0" (pointer_expression "*(undefined1 *)((int)__dest + __n)" * (cast_expression "(undefined1 *)((int)__dest + __n)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + __n)" ( (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "pcVar1 = (char *)memcpy(__dest,s,__n);" (assignment_expression "pcVar1 = (char *)memcpy(__dest,s,__n)" identifier = (cast_expression "(char *)memcpy(__dest,s,__n)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,s,__n)" identifier (argument_list "(__dest,s,__n)" ( identifier , identifier , identifier ))))) ;) (return_statement "return pcVar1;" return identifier ;) })))
(translation_unit "void FUN_0002e6e0(char *param_1,size_t param_2)\n\n{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}\n\n" (function_definition "void FUN_0002e6e0(char *param_1,size_t param_2)\n\n{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}" primitive_type (function_declarator "FUN_0002e6e0(char *param_1,size_t param_2)" identifier (parameter_list "(char *param_1,size_t param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) ))) (compound_statement "{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}" { (declaration "size_t __n;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (expression_statement "__n = strnlen(param_1,param_2);" (assignment_expression "__n = strnlen(param_1,param_2)" identifier = (call_expression "strnlen(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "__dest = (void *)xmalloc(__n + 1);" (assignment_expression "__dest = (void *)xmalloc(__n + 1)" identifier = (cast_expression "(void *)xmalloc(__n + 1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 1)" identifier (argument_list "(__n + 1)" ( (binary_expression "__n + 1" identifier + number_literal) ))))) ;) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0" (pointer_expression "*(undefined1 *)((int)__dest + __n)" * (cast_expression "(undefined1 *)((int)__dest + __n)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + __n)" ( (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "memcpy(__dest,param_1,__n);" (call_expression "memcpy(__dest,param_1,__n)" identifier (argument_list "(__dest,param_1,__n)" ( identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) )))) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (return_statement return ;) })))
(function_definition "void FUN_0002e6e0(char *param_1,size_t param_2)\n\n{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0002e6e0(char *param_1,size_t param_2)" (identifier "FUN_0002e6e0") (parameter_list "(char *param_1,size_t param_2)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) () ")"))) (compound_statement "{\n  size_t __n;\n  void *__dest;\n  \n  __n = strnlen(param_1,param_2);\n  __dest = (void *)xmalloc(__n + 1);\n  *(undefined1 *)((int)__dest + __n) = 0;\n  memcpy(__dest,param_1,__n);\n  return;\n}" ({ "{") (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "void *__dest;" (primitive_type "void") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (expression_statement "__n = strnlen(param_1,param_2);" (assignment_expression "__n = strnlen(param_1,param_2)" (identifier "__n") (= "=") (call_expression "strnlen(param_1,param_2)" (identifier "strnlen") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (expression_statement "__dest = (void *)xmalloc(__n + 1);" (assignment_expression "__dest = (void *)xmalloc(__n + 1)" (identifier "__dest") (= "=") (cast_expression "(void *)xmalloc(__n + 1)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(__n + 1)" (identifier "xmalloc") (argument_list "(__n + 1)" (( "(") (binary_expression "__n + 1" (identifier "__n") (+ "+") (number_literal "1")) () ")"))))) (; ";")) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0" (pointer_expression "*(undefined1 *)((int)__dest + __n)" (* "*") (cast_expression "(undefined1 *)((int)__dest + __n)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)__dest + __n)" (( "(") (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__dest")) (+ "+") (identifier "__n")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "memcpy(__dest,param_1,__n);" (call_expression "memcpy(__dest,param_1,__n)" (identifier "memcpy") (argument_list "(__dest,param_1,__n)" (( "(") (identifier "__dest") (, ",") (identifier "param_1") (, ",") (identifier "__n") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

char * function_1(char *s,size_t n)

{
  size_t var_3;
  void *__dest;
  char *pcVar1;
  
  var_3 = var_1(s,n);
  __dest = (void *)var_2(var_3 + 1);
  *(type_1 *)((int)__dest + var_3) = 0;
  pcVar1 = (char *)var_4(__dest,s,var_3);
  return pcVar1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (identifier))))) right: (number_literal))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (return_statement))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void MASKED(char *param_1,size_t param_2)

{
  size_t __n;
  void *__dest;
  
  __n = strnlen(param_1,param_2);
  __dest = (void *)xmalloc(__n + 1);
  *(undefined1 *)((int)__dest + __n) = 0;
  memcpy(__dest,param_1,__n);
  return;
}

