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

share_xchannel_message * share_xchannel_add_message(share_xchannel *xc,int type,int len)

{
  share_xchannel_message *psVar1;
  
  psVar1 = (share_xchannel_message *)safemalloc(len + 0x10,1);
  psVar1->datalen = len;
  psVar1->data = (uchar *)(psVar1 + 1);
  psVar1->type = type;
  if (xc->msgtail != (share_xchannel_message *)0x0) {
    xc->msgtail->next = psVar1;
    psVar1->next = (share_xchannel_message *)0x0;
    xc->msgtail = psVar1;
    return psVar1;
  }
  xc->msghead = psVar1;
  psVar1->next = (share_xchannel_message *)0x0;
  xc->msgtail = psVar1;
  return psVar1;
}



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

void FUN_0005e980(int param_1,undefined4 param_2,int param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);
  puVar1[3] = param_3;
  puVar1[2] = puVar1 + 4;
  puVar1[1] = param_2;
  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {
    **(undefined4 **)(param_1 + 0x14) = puVar1;
    *puVar1 = 0;
    *(undefined4 **)(param_1 + 0x14) = puVar1;
    return;
  }
  *(undefined4 **)(param_1 + 0x10) = puVar1;
  *puVar1 = 0;
  *(undefined4 **)(param_1 + 0x14) = puVar1;
  return;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDI,dword ptr [ESP + 0x18]
CALL 0x00014980
ADD EBX,0x4a3e4
MOV ESI,dword ptr [ESP + 0x10]
LEA EAX,[EDI + 0x10]
SUB ESP,0x8
PUSH 0x1
PUSH EAX
CALL 0x0001a9c0
LEA EDX,[EAX + 0x10]
MOV dword ptr [EAX + 0xc],EDI
MOV dword ptr [EAX + 0x8],EDX
MOV EDX,dword ptr [ESP + 0x24]
ADD ESP,0x10
MOV dword ptr [EAX + 0x4],EDX
MOV EDX,dword ptr [ESI + 0x14]
TEST EDX,EDX
JZ 0x0005e9d0
MOV dword ptr [EDX],EAX
MOV dword ptr [EAX],0x0
MOV dword ptr [ESI + 0x14],EAX
POP EBX
POP ESI
POP EDI
RET
MOV dword ptr [ESI + 0x10],EAX
MOV dword ptr [EAX],0x0
MOV dword ptr [ESI + 0x14],EAX
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_0005e980(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}\n\n" comment (function_definition "void FUN_0005e980(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" primitive_type (function_declarator "FUN_0005e980(int param_1,undefined4 param_2,int param_3)" identifier (parameter_list "(int param_1,undefined4 param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (expression_statement "puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);" (assignment_expression "puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1)" identifier = (cast_expression "(undefined4 *)FUN_0001a9c0(param_3 + 0x10,1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001a9c0(param_3 + 0x10,1)" identifier (argument_list "(param_3 + 0x10,1)" ( (binary_expression "param_3 + 0x10" identifier + number_literal) , number_literal ))))) ;) (expression_statement "puVar1[3] = param_3;" (assignment_expression "puVar1[3] = param_3" (subscript_expression "puVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar1[2] = puVar1 + 4;" (assignment_expression "puVar1[2] = puVar1 + 4" (subscript_expression "puVar1[2]" identifier [ number_literal ]) = (binary_expression "puVar1 + 4" identifier + number_literal)) ;) (expression_statement "puVar1[1] = param_2;" (assignment_expression "puVar1[1] = param_2" (subscript_expression "puVar1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }" if (parenthesized_expression "(*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0)" ( (binary_expression "*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }" { (expression_statement "**(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "**(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "**(undefined4 **)(param_1 + 0x14)" * (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) = identifier) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })) (expression_statement "*(undefined4 **)(param_1 + 0x10) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x10) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x10)" * (cast_expression "(undefined4 **)(param_1 + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = 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\nshare_xchannel_message * share_xchannel_add_message(share_xchannel *xc,int type,int len)\n\n{\n  share_xchannel_message *psVar1;\n  \n  psVar1 = (share_xchannel_message *)safemalloc(len + 0x10,1);\n  psVar1->datalen = len;\n  psVar1->data = (uchar *)(psVar1 + 1);\n  psVar1->type = type;\n  if (xc->msgtail != (share_xchannel_message *)0x0) {\n    xc->msgtail->next = psVar1;\n    psVar1->next = (share_xchannel_message *)0x0;\n    xc->msgtail = psVar1;\n    return psVar1;\n  }\n  xc->msghead = psVar1;\n  psVar1->next = (share_xchannel_message *)0x0;\n  xc->msgtail = psVar1;\n  return psVar1;\n}\n\n" comment comment (function_definition "share_xchannel_message * share_xchannel_add_message(share_xchannel *xc,int type,int len)\n\n{\n  share_xchannel_message *psVar1;\n  \n  psVar1 = (share_xchannel_message *)safemalloc(len + 0x10,1);\n  psVar1->datalen = len;\n  psVar1->data = (uchar *)(psVar1 + 1);\n  psVar1->type = type;\n  if (xc->msgtail != (share_xchannel_message *)0x0) {\n    xc->msgtail->next = psVar1;\n    psVar1->next = (share_xchannel_message *)0x0;\n    xc->msgtail = psVar1;\n    return psVar1;\n  }\n  xc->msghead = psVar1;\n  psVar1->next = (share_xchannel_message *)0x0;\n  xc->msgtail = psVar1;\n  return psVar1;\n}" type_identifier (pointer_declarator "* share_xchannel_add_message(share_xchannel *xc,int type,int len)" * (function_declarator "share_xchannel_add_message(share_xchannel *xc,int type,int len)" identifier (parameter_list "(share_xchannel *xc,int type,int len)" ( (parameter_declaration "share_xchannel *xc" type_identifier (pointer_declarator "*xc" * identifier)) , (parameter_declaration "int type" primitive_type identifier) , (parameter_declaration "int len" primitive_type identifier) )))) (compound_statement "{\n  share_xchannel_message *psVar1;\n  \n  psVar1 = (share_xchannel_message *)safemalloc(len + 0x10,1);\n  psVar1->datalen = len;\n  psVar1->data = (uchar *)(psVar1 + 1);\n  psVar1->type = type;\n  if (xc->msgtail != (share_xchannel_message *)0x0) {\n    xc->msgtail->next = psVar1;\n    psVar1->next = (share_xchannel_message *)0x0;\n    xc->msgtail = psVar1;\n    return psVar1;\n  }\n  xc->msghead = psVar1;\n  psVar1->next = (share_xchannel_message *)0x0;\n  xc->msgtail = psVar1;\n  return psVar1;\n}" { (declaration "share_xchannel_message *psVar1;" type_identifier (pointer_declarator "*psVar1" * identifier) ;) (expression_statement "psVar1 = (share_xchannel_message *)safemalloc(len + 0x10,1);" (assignment_expression "psVar1 = (share_xchannel_message *)safemalloc(len + 0x10,1)" identifier = (cast_expression "(share_xchannel_message *)safemalloc(len + 0x10,1)" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(len + 0x10,1)" identifier (argument_list "(len + 0x10,1)" ( (binary_expression "len + 0x10" identifier + number_literal) , number_literal ))))) ;) (expression_statement "psVar1->datalen = len;" (assignment_expression "psVar1->datalen = len" (field_expression "psVar1->datalen" identifier -> field_identifier) = identifier) ;) (expression_statement "psVar1->data = (uchar *)(psVar1 + 1);" (assignment_expression "psVar1->data = (uchar *)(psVar1 + 1)" (field_expression "psVar1->data" identifier -> field_identifier) = (cast_expression "(uchar *)(psVar1 + 1)" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(psVar1 + 1)" ( (binary_expression "psVar1 + 1" identifier + number_literal) )))) ;) (expression_statement "psVar1->type = type;" (assignment_expression "psVar1->type = type" (field_expression "psVar1->type" identifier -> field_identifier) = identifier) ;) (if_statement "if (xc->msgtail != (share_xchannel_message *)0x0) {\n    xc->msgtail->next = psVar1;\n    psVar1->next = (share_xchannel_message *)0x0;\n    xc->msgtail = psVar1;\n    return psVar1;\n  }" if (parenthesized_expression "(xc->msgtail != (share_xchannel_message *)0x0)" ( (binary_expression "xc->msgtail != (share_xchannel_message *)0x0" (field_expression "xc->msgtail" identifier -> field_identifier) != (cast_expression "(share_xchannel_message *)0x0" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    xc->msgtail->next = psVar1;\n    psVar1->next = (share_xchannel_message *)0x0;\n    xc->msgtail = psVar1;\n    return psVar1;\n  }" { (expression_statement "xc->msgtail->next = psVar1;" (assignment_expression "xc->msgtail->next = psVar1" (field_expression "xc->msgtail->next" (field_expression "xc->msgtail" identifier -> field_identifier) -> field_identifier) = identifier) ;) (expression_statement "psVar1->next = (share_xchannel_message *)0x0;" (assignment_expression "psVar1->next = (share_xchannel_message *)0x0" (field_expression "psVar1->next" identifier -> field_identifier) = (cast_expression "(share_xchannel_message *)0x0" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "xc->msgtail = psVar1;" (assignment_expression "xc->msgtail = psVar1" (field_expression "xc->msgtail" identifier -> field_identifier) = identifier) ;) (return_statement "return psVar1;" return identifier ;) })) (expression_statement "xc->msghead = psVar1;" (assignment_expression "xc->msghead = psVar1" (field_expression "xc->msghead" identifier -> field_identifier) = identifier) ;) (expression_statement "psVar1->next = (share_xchannel_message *)0x0;" (assignment_expression "psVar1->next = (share_xchannel_message *)0x0" (field_expression "psVar1->next" identifier -> field_identifier) = (cast_expression "(share_xchannel_message *)0x0" ( (type_descriptor "share_xchannel_message *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "xc->msgtail = psVar1;" (assignment_expression "xc->msgtail = psVar1" (field_expression "xc->msgtail" identifier -> field_identifier) = identifier) ;) (return_statement "return psVar1;" return identifier ;) })))
(translation_unit "void FUN_0005e980(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}\n\n" (function_definition "void FUN_0005e980(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" primitive_type (function_declarator "FUN_0005e980(int param_1,undefined4 param_2,int param_3)" identifier (parameter_list "(int param_1,undefined4 param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (expression_statement "puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);" (assignment_expression "puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1)" identifier = (cast_expression "(undefined4 *)FUN_0001a9c0(param_3 + 0x10,1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001a9c0(param_3 + 0x10,1)" identifier (argument_list "(param_3 + 0x10,1)" ( (binary_expression "param_3 + 0x10" identifier + number_literal) , number_literal ))))) ;) (expression_statement "puVar1[3] = param_3;" (assignment_expression "puVar1[3] = param_3" (subscript_expression "puVar1[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar1[2] = puVar1 + 4;" (assignment_expression "puVar1[2] = puVar1 + 4" (subscript_expression "puVar1[2]" identifier [ number_literal ]) = (binary_expression "puVar1 + 4" identifier + number_literal)) ;) (expression_statement "puVar1[1] = param_2;" (assignment_expression "puVar1[1] = param_2" (subscript_expression "puVar1[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }" if (parenthesized_expression "(*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0)" ( (binary_expression "*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }" { (expression_statement "**(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "**(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "**(undefined4 **)(param_1 + 0x14)" * (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) ))))) = identifier) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })) (expression_statement "*(undefined4 **)(param_1 + 0x10) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x10) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x10)" * (cast_expression "(undefined4 **)(param_1 + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" * (cast_expression "(undefined4 **)(param_1 + 0x14)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , LIT ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return ;) })))
(function_definition "void FUN_0005e980(int param_1,undefined4 param_2,int param_3)\n\n{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0005e980(int param_1,undefined4 param_2,int param_3)" (identifier "FUN_0005e980") (parameter_list "(int param_1,undefined4 param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  \n  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);\n  puVar1[3] = param_3;\n  puVar1[2] = puVar1 + 4;\n  puVar1[1] = param_2;\n  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }\n  *(undefined4 **)(param_1 + 0x10) = puVar1;\n  *puVar1 = 0;\n  *(undefined4 **)(param_1 + 0x14) = puVar1;\n  return;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (expression_statement "puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);" (assignment_expression "puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1)" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)FUN_0001a9c0(param_3 + 0x10,1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001a9c0(param_3 + 0x10,1)" (identifier "FUN_0001a9c0") (argument_list "(param_3 + 0x10,1)" (( "(") (binary_expression "param_3 + 0x10" (identifier "param_3") (+ "+") (number_literal "0x10")) (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "puVar1[3] = param_3;" (assignment_expression "puVar1[3] = param_3" (subscript_expression "puVar1[3]" (identifier "puVar1") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "param_3")) (; ";")) (expression_statement "puVar1[2] = puVar1 + 4;" (assignment_expression "puVar1[2] = puVar1 + 4" (subscript_expression "puVar1[2]" (identifier "puVar1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "puVar1 + 4" (identifier "puVar1") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "puVar1[1] = param_2;" (assignment_expression "puVar1[1] = param_2" (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "param_2")) (; ";")) (if_statement "if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }" (if "if") (parenthesized_expression "(*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0)" (( "(") (binary_expression "*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    **(undefined4 **)(param_1 + 0x14) = puVar1;\n    *puVar1 = 0;\n    *(undefined4 **)(param_1 + 0x14) = puVar1;\n    return;\n  }" ({ "{") (expression_statement "**(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "**(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "**(undefined4 **)(param_1 + 0x14)" (* "*") (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")"))))) (= "=") (identifier "puVar1")) (; ";")) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (= "=") (identifier "puVar1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "*(undefined4 **)(param_1 + 0x10) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x10) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x10)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x10)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "puVar1")) (; ";")) (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 **)(param_1 + 0x14) = puVar1;" (assignment_expression "*(undefined4 **)(param_1 + 0x14) = puVar1" (pointer_expression "*(undefined4 **)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 **)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (= "=") (identifier "puVar1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

type_1 * function_1(type_2 *xc,int type,int var_2)

{
  type_1 *var_3;
  
  var_3 = (type_1 *)var_1(var_2 + 0x10,1);
  var_3->datalen = var_2;
  var_3->data = (type_3 *)(var_3 + 1);
  var_3->type = type;
  if (xc->msgtail != (type_1 *)0x0) {
    xc->msgtail->next = var_3;
    var_3->next = (type_1 *)0x0;
    xc->msgtail = var_3;
    return var_3;
  }
  xc->msghead = var_3;
  var_3->next = (type_1 *)0x0;
  xc->msgtail = var_3;
  return var_3;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (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)) (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (return_statement))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (return_statement))))

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

void MASKED(int param_1,undefined4 param_2,int param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0001a9c0(param_3 + 0x10,1);
  puVar1[3] = param_3;
  puVar1[2] = puVar1 + 4;
  puVar1[1] = param_2;
  if (*(undefined4 **)(param_1 + 0x14) != (undefined4 *)0x0) {
    **(undefined4 **)(param_1 + 0x14) = puVar1;
    *puVar1 = 0;
    *(undefined4 **)(param_1 + 0x14) = puVar1;
    return;
  }
  *(undefined4 **)(param_1 + 0x10) = puVar1;
  *puVar1 = 0;
  *(undefined4 **)(param_1 + 0x14) = puVar1;
  return;
}

