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

char * __regparm3 template_in_dir(char *path)

{
  char *pcVar1;
  size_t __n;
  char *__dest;
  
  pcVar1 = strrchr(path,0x2f);
  if (pcVar1 == (char *)0x0) {
    pcVar1 = (char *)xmalloc(9);
    __dest = pcVar1;
  }
  else {
    __n = (int)pcVar1 - (int)path;
    __dest = (char *)xmalloc(__n + 0xb);
    memcpy(__dest,path,__n);
    __dest[__n] = '/';
    pcVar1 = __dest + __n + 1;
  }
  builtin_strncpy(pcVar1,"stXXXXXX",9);
  return __dest;
}



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

undefined4 * __regparm3 FUN_00012290(char *param_1)

{
  char *pcVar1;
  size_t __n;
  undefined4 *__dest;
  undefined4 *puVar2;
  
  pcVar1 = strrchr(param_1,0x2f);
  if (pcVar1 == (char *)0x0) {
    puVar2 = (undefined4 *)xmalloc(9);
    __dest = puVar2;
  }
  else {
    __n = (int)pcVar1 - (int)param_1;
    __dest = (undefined4 *)xmalloc(__n + 0xb);
    memcpy(__dest,param_1,__n);
    *(undefined1 *)((int)__dest + __n) = 0x2f;
    puVar2 = (undefined4 *)((int)__dest + __n + 1);
  }
  *puVar2 = 0x58587473;
  puVar2[1] = 0x58585858;
  *(undefined1 *)(puVar2 + 2) = 0;
  return __dest;
}


PUSH EBP
PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x00011ca0
ADD EBX,0x6d65
SUB ESP,0x14
PUSH 0x2f
PUSH EAX
CALL 0x00011380
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00012300
SUB EAX,EDI
SUB ESP,0xc
MOV ESI,EAX
LEA EAX,[EAX + 0xb]
PUSH EAX
CALL 0x000111b0
ADD ESP,0xc
PUSH ESI
MOV EBP,EAX
PUSH EDI
PUSH EAX
CALL 0x000110b0
MOV byte ptr [EBP + ESI*0x1],0x2f
LEA EAX,[EBP + ESI*0x1 + 0x1]
ADD ESP,0x10
MOV dword ptr [EAX],0x58587473
MOV dword ptr [EAX + 0x4],0x58585858
MOV byte ptr [EAX + 0x8],0x0
ADD ESP,0xc
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH 0x9
CALL 0x000111b0
ADD ESP,0x10
MOV EBP,EAX
JMP 0x000122dc
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * __regparm3 FUN_00012290(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  undefined4 *__dest;\n  undefined4 *puVar2;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }\n  *puVar2 = 0x58587473;\n  puVar2[1] = 0x58585858;\n  *(undefined1 *)(puVar2 + 2) = 0;\n  return __dest;\n}\n\n" comment (ERROR "undefined4 * __regparm3 FUN_00012290(char *param_1)" (binary_expression "undefined4 * __regparm3 FUN_00012290(char *param_1)" identifier * (ERROR "__regparm3" identifier) (call_expression "FUN_00012290(char *param_1)" identifier (argument_list "(char *param_1)" ( (binary_expression "char *param_1" identifier * identifier) ))))) (compound_statement "{\n  char *pcVar1;\n  size_t __n;\n  undefined4 *__dest;\n  undefined4 *puVar2;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }\n  *puVar2 = 0x58587473;\n  puVar2[1] = 0x58585858;\n  *(undefined1 *)(puVar2 + 2) = 0;\n  return __dest;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "undefined4 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (expression_statement "pcVar1 = strrchr(param_1,0x2f);" (assignment_expression "pcVar1 = strrchr(param_1,0x2f)" identifier = (call_expression "strrchr(param_1,0x2f)" identifier (argument_list "(param_1,0x2f)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }" { (expression_statement "puVar2 = (undefined4 *)xmalloc(9);" (assignment_expression "puVar2 = (undefined4 *)xmalloc(9)" identifier = (cast_expression "(undefined4 *)xmalloc(9)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(9)" identifier (argument_list "(9)" ( number_literal ))))) ;) (expression_statement "__dest = puVar2;" (assignment_expression "__dest = puVar2" identifier = identifier) ;) }) (else_clause "else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" else (compound_statement "{\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" { (expression_statement "__n = (int)pcVar1 - (int)param_1;" (assignment_expression "__n = (int)pcVar1 - (int)param_1" identifier = (binary_expression "(int)pcVar1 - (int)param_1" (cast_expression "(int)pcVar1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "__dest = (undefined4 *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (undefined4 *)xmalloc(__n + 0xb)" identifier = (cast_expression "(undefined4 *)xmalloc(__n + 0xb)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 0xb)" identifier (argument_list "(__n + 0xb)" ( (binary_expression "__n + 0xb" 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 ))) ;) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0x2f;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0x2f" (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 "puVar2 = (undefined4 *)((int)__dest + __n + 1);" (assignment_expression "puVar2 = (undefined4 *)((int)__dest + __n + 1)" identifier = (cast_expression "(undefined4 *)((int)__dest + __n + 1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + __n + 1)" ( (binary_expression "(int)__dest + __n + 1" (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + number_literal) )))) ;) }))) (expression_statement "*puVar2 = 0x58587473;" (assignment_expression "*puVar2 = 0x58587473" (pointer_expression "*puVar2" * identifier) = number_literal) ;) (expression_statement "puVar2[1] = 0x58585858;" (assignment_expression "puVar2[1] = 0x58585858" (subscript_expression "puVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*(undefined1 *)(puVar2 + 2) = 0;" (assignment_expression "*(undefined1 *)(puVar2 + 2) = 0" (pointer_expression "*(undefined1 *)(puVar2 + 2)" * (cast_expression "(undefined1 *)(puVar2 + 2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar2 + 2)" ( (binary_expression "puVar2 + 2" identifier + number_literal) )))) = number_literal) ;) (return_statement "return __dest;" return identifier ;) }))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * __regparm3 template_in_dir(char *path)\n\n{\n  char *pcVar1;\n  size_t __n;\n  char *__dest;\n  \n  pcVar1 = strrchr(path,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    __dest = pcVar1;\n  }\n  else {\n    __n = (int)pcVar1 - (int)path;\n    __dest = (char *)xmalloc(__n + 0xb);\n    memcpy(__dest,path,__n);\n    __dest[__n] = '/';\n    pcVar1 = __dest + __n + 1;\n  }\n  builtin_strncpy(pcVar1,"stXXXXXX",9);\n  return __dest;\n}\n\n" comment (function_definition "char * __regparm3 template_in_dir(char *path)\n\n{\n  char *pcVar1;\n  size_t __n;\n  char *__dest;\n  \n  pcVar1 = strrchr(path,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    __dest = pcVar1;\n  }\n  else {\n    __n = (int)pcVar1 - (int)path;\n    __dest = (char *)xmalloc(__n + 0xb);\n    memcpy(__dest,path,__n);\n    __dest[__n] = '/';\n    pcVar1 = __dest + __n + 1;\n  }\n  builtin_strncpy(pcVar1,"stXXXXXX",9);\n  return __dest;\n}" primitive_type (pointer_declarator "* __regparm3 template_in_dir(char *path)" * (ERROR "__regparm3" identifier) (function_declarator "template_in_dir(char *path)" identifier (parameter_list "(char *path)" ( (parameter_declaration "char *path" primitive_type (pointer_declarator "*path" * identifier)) )))) (compound_statement "{\n  char *pcVar1;\n  size_t __n;\n  char *__dest;\n  \n  pcVar1 = strrchr(path,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    __dest = pcVar1;\n  }\n  else {\n    __n = (int)pcVar1 - (int)path;\n    __dest = (char *)xmalloc(__n + 0xb);\n    memcpy(__dest,path,__n);\n    __dest[__n] = '/';\n    pcVar1 = __dest + __n + 1;\n  }\n  builtin_strncpy(pcVar1,"stXXXXXX",9);\n  return __dest;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (expression_statement "pcVar1 = strrchr(path,0x2f);" (assignment_expression "pcVar1 = strrchr(path,0x2f)" identifier = (call_expression "strrchr(path,0x2f)" identifier (argument_list "(path,0x2f)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    __dest = pcVar1;\n  }\n  else {\n    __n = (int)pcVar1 - (int)path;\n    __dest = (char *)xmalloc(__n + 0xb);\n    memcpy(__dest,path,__n);\n    __dest[__n] = '/';\n    pcVar1 = __dest + __n + 1;\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    pcVar1 = (char *)xmalloc(9);\n    __dest = pcVar1;\n  }" { (expression_statement "pcVar1 = (char *)xmalloc(9);" (assignment_expression "pcVar1 = (char *)xmalloc(9)" identifier = (cast_expression "(char *)xmalloc(9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(9)" identifier (argument_list "(9)" ( number_literal ))))) ;) (expression_statement "__dest = pcVar1;" (assignment_expression "__dest = pcVar1" identifier = identifier) ;) }) (else_clause "else {\n    __n = (int)pcVar1 - (int)path;\n    __dest = (char *)xmalloc(__n + 0xb);\n    memcpy(__dest,path,__n);\n    __dest[__n] = '/';\n    pcVar1 = __dest + __n + 1;\n  }" else (compound_statement "{\n    __n = (int)pcVar1 - (int)path;\n    __dest = (char *)xmalloc(__n + 0xb);\n    memcpy(__dest,path,__n);\n    __dest[__n] = '/';\n    pcVar1 = __dest + __n + 1;\n  }" { (expression_statement "__n = (int)pcVar1 - (int)path;" (assignment_expression "__n = (int)pcVar1 - (int)path" identifier = (binary_expression "(int)pcVar1 - (int)path" (cast_expression "(int)pcVar1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)path" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "__dest = (char *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (char *)xmalloc(__n + 0xb)" identifier = (cast_expression "(char *)xmalloc(__n + 0xb)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 0xb)" identifier (argument_list "(__n + 0xb)" ( (binary_expression "__n + 0xb" identifier + number_literal) ))))) ;) (expression_statement "memcpy(__dest,path,__n);" (call_expression "memcpy(__dest,path,__n)" identifier (argument_list "(__dest,path,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "__dest[__n] = '/';" (assignment_expression "__dest[__n] = '/'" (subscript_expression "__dest[__n]" identifier [ identifier ]) = (char_literal "'/'" ' character ')) ;) (expression_statement "pcVar1 = __dest + __n + 1;" (assignment_expression "pcVar1 = __dest + __n + 1" identifier = (binary_expression "__dest + __n + 1" (binary_expression "__dest + __n" identifier + identifier) + number_literal)) ;) }))) (expression_statement "builtin_strncpy(pcVar1,"stXXXXXX",9);" (call_expression "builtin_strncpy(pcVar1,"stXXXXXX",9)" identifier (argument_list "(pcVar1,"stXXXXXX",9)" ( identifier , (string_literal ""stXXXXXX"" " string_content ") , number_literal ))) ;) (return_statement "return __dest;" return identifier ;) })))
(translation_unit "undefined4 * __regparm3 FUN_00012290(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  undefined4 *__dest;\n  undefined4 *puVar2;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }\n  *puVar2 = 0x58587473;\n  puVar2[1] = 0x58585858;\n  *(undefined1 *)(puVar2 + 2) = 0;\n  return __dest;\n}\n\n" (ERROR "undefined4 * __regparm3 FUN_00012290(char *param_1)" (binary_expression "undefined4 * __regparm3 FUN_00012290(char *param_1)" identifier * (ERROR "__regparm3" identifier) (call_expression "FUN_00012290(char *param_1)" identifier (argument_list "(char *param_1)" ( (binary_expression "char *param_1" identifier * identifier) ))))) (compound_statement "{\n  char *pcVar1;\n  size_t __n;\n  undefined4 *__dest;\n  undefined4 *puVar2;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }\n  *puVar2 = 0x58587473;\n  puVar2[1] = 0x58585858;\n  *(undefined1 *)(puVar2 + 2) = 0;\n  return __dest;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "undefined4 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (expression_statement "pcVar1 = strrchr(param_1,0x2f);" (assignment_expression "pcVar1 = strrchr(param_1,0x2f)" identifier = (call_expression "strrchr(param_1,0x2f)" identifier (argument_list "(param_1,0x2f)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }" { (expression_statement "puVar2 = (undefined4 *)xmalloc(9);" (assignment_expression "puVar2 = (undefined4 *)xmalloc(9)" identifier = (cast_expression "(undefined4 *)xmalloc(9)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(9)" identifier (argument_list "(9)" ( number_literal ))))) ;) (expression_statement "__dest = puVar2;" (assignment_expression "__dest = puVar2" identifier = identifier) ;) }) (else_clause "else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" else (compound_statement "{\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" { (expression_statement "__n = (int)pcVar1 - (int)param_1;" (assignment_expression "__n = (int)pcVar1 - (int)param_1" identifier = (binary_expression "(int)pcVar1 - (int)param_1" (cast_expression "(int)pcVar1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "__dest = (undefined4 *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (undefined4 *)xmalloc(__n + 0xb)" identifier = (cast_expression "(undefined4 *)xmalloc(__n + 0xb)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 0xb)" identifier (argument_list "(__n + 0xb)" ( (binary_expression "__n + 0xb" 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 ))) ;) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0x2f;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0x2f" (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 "puVar2 = (undefined4 *)((int)__dest + __n + 1);" (assignment_expression "puVar2 = (undefined4 *)((int)__dest + __n + 1)" identifier = (cast_expression "(undefined4 *)((int)__dest + __n + 1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + __n + 1)" ( (binary_expression "(int)__dest + __n + 1" (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + number_literal) )))) ;) }))) (expression_statement "*puVar2 = 0x58587473;" (assignment_expression "*puVar2 = 0x58587473" (pointer_expression "*puVar2" * identifier) = number_literal) ;) (expression_statement "puVar2[1] = 0x58585858;" (assignment_expression "puVar2[1] = 0x58585858" (subscript_expression "puVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*(undefined1 *)(puVar2 + 2) = 0;" (assignment_expression "*(undefined1 *)(puVar2 + 2) = 0" (pointer_expression "*(undefined1 *)(puVar2 + 2)" * (cast_expression "(undefined1 *)(puVar2 + 2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar2 + 2)" ( (binary_expression "puVar2 + 2" identifier + number_literal) )))) = number_literal) ;) (return_statement "return __dest;" return identifier ;) }))
(translation_unit (ERROR (binary_expression IDENT * (ERROR IDENT) (call_expression IDENT (argument_list ( (binary_expression IDENT * IDENT) ))))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) 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 (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (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 (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) + LIT) )))) ;) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (return_statement return IDENT ;) }))
(ERROR "undefined4 * __regparm3 FUN_00012290(char *param_1)" (binary_expression "undefined4 * __regparm3 FUN_00012290(char *param_1)" (identifier "undefined4") (* "*") (ERROR "__regparm3" (identifier "__regparm3")) (call_expression "FUN_00012290(char *param_1)" (identifier "FUN_00012290") (argument_list "(char *param_1)" (( "(") (binary_expression "char *param_1" (identifier "char") (* "*") (identifier "param_1")) () ")"))))) (compound_statement "{\n  char *pcVar1;\n  size_t __n;\n  undefined4 *__dest;\n  undefined4 *puVar2;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }\n  *puVar2 = 0x58587473;\n  puVar2[1] = 0x58585858;\n  *(undefined1 *)(puVar2 + 2) = 0;\n  return __dest;\n}" ({ "{") (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "undefined4 *__dest;" (type_identifier "undefined4") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (expression_statement "pcVar1 = strrchr(param_1,0x2f);" (assignment_expression "pcVar1 = strrchr(param_1,0x2f)" (identifier "pcVar1") (= "=") (call_expression "strrchr(param_1,0x2f)" (identifier "strrchr") (argument_list "(param_1,0x2f)" (( "(") (identifier "param_1") (, ",") (number_literal "0x2f") () ")")))) (; ";")) (if_statement "if (pcVar1 == (char *)0x0) {\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }\n  else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" (if "if") (parenthesized_expression "(pcVar1 == (char *)0x0)" (( "(") (binary_expression "pcVar1 == (char *)0x0" (identifier "pcVar1") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    puVar2 = (undefined4 *)xmalloc(9);\n    __dest = puVar2;\n  }" ({ "{") (expression_statement "puVar2 = (undefined4 *)xmalloc(9);" (assignment_expression "puVar2 = (undefined4 *)xmalloc(9)" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)xmalloc(9)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(9)" (identifier "xmalloc") (argument_list "(9)" (( "(") (number_literal "9") () ")"))))) (; ";")) (expression_statement "__dest = puVar2;" (assignment_expression "__dest = puVar2" (identifier "__dest") (= "=") (identifier "puVar2")) (; ";")) (} "}")) (else_clause "else {\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" (else "else") (compound_statement "{\n    __n = (int)pcVar1 - (int)param_1;\n    __dest = (undefined4 *)xmalloc(__n + 0xb);\n    memcpy(__dest,param_1,__n);\n    *(undefined1 *)((int)__dest + __n) = 0x2f;\n    puVar2 = (undefined4 *)((int)__dest + __n + 1);\n  }" ({ "{") (expression_statement "__n = (int)pcVar1 - (int)param_1;" (assignment_expression "__n = (int)pcVar1 - (int)param_1" (identifier "__n") (= "=") (binary_expression "(int)pcVar1 - (int)param_1" (cast_expression "(int)pcVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pcVar1")) (- "-") (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")))) (; ";")) (expression_statement "__dest = (undefined4 *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (undefined4 *)xmalloc(__n + 0xb)" (identifier "__dest") (= "=") (cast_expression "(undefined4 *)xmalloc(__n + 0xb)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(__n + 0xb)" (identifier "xmalloc") (argument_list "(__n + 0xb)" (( "(") (binary_expression "__n + 0xb" (identifier "__n") (+ "+") (number_literal "0xb")) () ")"))))) (; ";")) (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") () ")"))) (; ";")) (expression_statement "*(undefined1 *)((int)__dest + __n) = 0x2f;" (assignment_expression "*(undefined1 *)((int)__dest + __n) = 0x2f" (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 "0x2f")) (; ";")) (expression_statement "puVar2 = (undefined4 *)((int)__dest + __n + 1);" (assignment_expression "puVar2 = (undefined4 *)((int)__dest + __n + 1)" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)((int)__dest + __n + 1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)__dest + __n + 1)" (( "(") (binary_expression "(int)__dest + __n + 1" (binary_expression "(int)__dest + __n" (cast_expression "(int)__dest" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__dest")) (+ "+") (identifier "__n")) (+ "+") (number_literal "1")) () ")")))) (; ";")) (} "}")))) (expression_statement "*puVar2 = 0x58587473;" (assignment_expression "*puVar2 = 0x58587473" (pointer_expression "*puVar2" (* "*") (identifier "puVar2")) (= "=") (number_literal "0x58587473")) (; ";")) (expression_statement "puVar2[1] = 0x58585858;" (assignment_expression "puVar2[1] = 0x58585858" (subscript_expression "puVar2[1]" (identifier "puVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0x58585858")) (; ";")) (expression_statement "*(undefined1 *)(puVar2 + 2) = 0;" (assignment_expression "*(undefined1 *)(puVar2 + 2) = 0" (pointer_expression "*(undefined1 *)(puVar2 + 2)" (* "*") (cast_expression "(undefined1 *)(puVar2 + 2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar2 + 2)" (( "(") (binary_expression "puVar2 + 2" (identifier "puVar2") (+ "+") (number_literal "2")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return __dest;" (return "return") (identifier "__dest") (; ";")) (} "}"))

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

char * __regparm3 function_1(char *path)

{
  char *var_2;
  size_t var_4;
  char *var_6;
  
  var_2 = var_1(path,0x2f);
  if (var_2 == (char *)0x0) {
    var_2 = (char *)var_3(9);
    var_6 = var_2;
  }
  else {
    var_4 = (int)var_2 - (int)path;
    var_6 = (char *)var_3(var_4 + 0xb);
    var_5(var_6,path,var_4);
    var_6[var_4] = '/';
    var_2 = var_6 + var_4 + 1;
  }
  var_7(var_2,"stXXXXXX",9);
  return var_6;
}


(translation_unit (ERROR (binary_expression left: (identifier) (ERROR (identifier)) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))) (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (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 (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (identifier)) right: (number_literal))))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) 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: (identifier) right: (number_literal))))) right: (number_literal))) (return_statement (identifier))))

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

undefined4 * __regparm3 MASKED(char *param_1)

{
  char *pcVar1;
  size_t __n;
  undefined4 *__dest;
  undefined4 *puVar2;
  
  pcVar1 = strrchr(param_1,0x2f);
  if (pcVar1 == (char *)0x0) {
    puVar2 = (undefined4 *)xmalloc(9);
    __dest = puVar2;
  }
  else {
    __n = (int)pcVar1 - (int)param_1;
    __dest = (undefined4 *)xmalloc(__n + 0xb);
    memcpy(__dest,param_1,__n);
    *(undefined1 *)((int)__dest + __n) = 0x2f;
    puVar2 = (undefined4 *)((int)__dest + __n + 1);
  }
  *puVar2 = 0x58587473;
  puVar2[1] = 0x58585858;
  *(undefined1 *)(puVar2 + 2) = 0;
  return __dest;
}

