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

sftp_packet * __regparm3 sftp_pkt_init(int pkt_type)

{
  int iVar1;
  sftp_packet *psVar2;
  char *pcVar3;
  uint uVar4;
  int in_GS_OFFSET;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  psVar2 = (sftp_packet *)safemalloc(1,0x14);
  psVar2->data = (char *)0x0;
  psVar2->savedpos = 0xffffffff;
  psVar2->length = 4;
  psVar2->maxlen = 0x104;
  pcVar3 = (char *)saferealloc((void *)0x0,0x104,1);
  psVar2->data = pcVar3;
  pcVar3 = pcVar3 + (psVar2->length - 4);
  pcVar3[0] = '\0';
  pcVar3[1] = '\0';
  pcVar3[2] = '\0';
  pcVar3[3] = '\0';
  uVar4 = psVar2->length;
  psVar2->length = uVar4 + 1;
  if ((int)psVar2->maxlen < (int)(uVar4 + 1)) {
    psVar2->maxlen = uVar4 + 0x101;
    pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1);
    psVar2->data = pcVar3;
    uVar4 = psVar2->length - 1;
  }
  else {
    pcVar3 = psVar2->data;
  }
  pcVar3[uVar4] = (char)pkt_type;
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return psVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

int * __regparm3 FUN_0002e5f0(undefined1 param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int in_GS_OFFSET;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  piVar2 = (int *)FUN_0001db90(1,0x14);
  *piVar2 = 0;
  piVar2[3] = -1;
  piVar2[1] = 4;
  piVar2[2] = 0x104;
  iVar3 = FUN_0001dc50(0,0x104,1);
  *piVar2 = iVar3;
  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;
  iVar3 = piVar2[1];
  piVar2[1] = iVar3 + 1;
  if (piVar2[2] < iVar3 + 1) {
    piVar2[2] = iVar3 + 0x101;
    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);
    *piVar2 = iVar4;
    iVar3 = piVar2[1] + -1;
  }
  else {
    iVar4 = *piVar2;
  }
  *(undefined1 *)(iVar4 + iVar3) = param_1;
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return piVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008d800();
}


PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x000149a0
ADD EBX,0x9e776
SUB ESP,0x18
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x14],EAX
XOR EAX,EAX
PUSH 0x14
PUSH 0x1
CALL 0x0001db90
ADD ESP,0xc
MOV dword ptr [EAX],0x0
MOV ESI,EAX
MOV dword ptr [EAX + 0xc],0xffffffff
MOV dword ptr [EAX + 0x4],0x4
MOV dword ptr [EAX + 0x8],0x104
PUSH 0x1
PUSH 0x104
PUSH 0x0
CALL 0x0001dc50
MOV EDX,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV dword ptr [ESI],EAX
MOV dword ptr [EAX + EDX*0x1 + -0x4],0x0
MOV EDX,dword ptr [ESI + 0x4]
LEA EAX,[EDX + 0x1]
MOV dword ptr [ESI + 0x4],EAX
CMP EAX,dword ptr [ESI + 0x8]
JG 0x0002e688
MOV EAX,dword ptr [ESI]
MOV ECX,EDI
MOV byte ptr [EAX + EDX*0x1],CL
MOV EAX,ESI
MOV ECX,dword ptr [ESP + 0xc]
XOR ECX,dword ptr GS:[0x14]
JNZ 0x0002e6ab
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0x4
ADD EDX,0x101
MOV dword ptr [ESI + 0x8],EDX
PUSH 0x1
PUSH EDX
PUSH dword ptr [ESI]
CALL 0x0001dc50
MOV ECX,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV dword ptr [ESI],EAX
LEA EDX,[ECX + -0x1]
JMP 0x0002e666
CALL 0x0008d800
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint * __regparm3 FUN_0002e5f0(undefined1 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}\n\n" comment (function_definition "int * __regparm3 FUN_0002e5f0(undefined1 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}" primitive_type (pointer_declarator "* __regparm3 FUN_0002e5f0(undefined1 param_1)" * (ERROR "__regparm3" identifier) (function_declarator "FUN_0002e5f0(undefined1 param_1)" identifier (parameter_list "(undefined1 param_1)" ( (parameter_declaration "undefined1 param_1" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "piVar2 = (int *)FUN_0001db90(1,0x14);" (assignment_expression "piVar2 = (int *)FUN_0001db90(1,0x14)" identifier = (cast_expression "(int *)FUN_0001db90(1,0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(1,0x14)" identifier (argument_list "(1,0x14)" ( number_literal , number_literal ))))) ;) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (expression_statement "piVar2[3] = -1;" (assignment_expression "piVar2[3] = -1" (subscript_expression "piVar2[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[1] = 4;" (assignment_expression "piVar2[1] = 4" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[2] = 0x104;" (assignment_expression "piVar2[2] = 0x104" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "iVar3 = FUN_0001dc50(0,0x104,1);" (assignment_expression "iVar3 = FUN_0001dc50(0,0x104,1)" identifier = (call_expression "FUN_0001dc50(0,0x104,1)" identifier (argument_list "(0,0x104,1)" ( number_literal , number_literal , number_literal )))) ;) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "*(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;" (assignment_expression "*(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0" (pointer_expression "*(undefined4 *)(iVar3 + -4 + piVar2[1])" * (cast_expression "(undefined4 *)(iVar3 + -4 + piVar2[1])" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -4 + piVar2[1])" ( (binary_expression "iVar3 + -4 + piVar2[1]" (binary_expression "iVar3 + -4" identifier + number_literal) + (subscript_expression "piVar2[1]" identifier [ number_literal ])) )))) = number_literal) ;) (expression_statement "iVar3 = piVar2[1];" (assignment_expression "iVar3 = piVar2[1]" identifier = (subscript_expression "piVar2[1]" identifier [ number_literal ])) ;) (expression_statement "piVar2[1] = iVar3 + 1;" (assignment_expression "piVar2[1] = iVar3 + 1" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (if_statement "if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }" if (parenthesized_expression "(piVar2[2] < iVar3 + 1)" ( (binary_expression "piVar2[2] < iVar3 + 1" (subscript_expression "piVar2[2]" identifier [ number_literal ]) < (binary_expression "iVar3 + 1" identifier + number_literal)) )) (compound_statement "{\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }" { (expression_statement "piVar2[2] = iVar3 + 0x101;" (assignment_expression "piVar2[2] = iVar3 + 0x101" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = (binary_expression "iVar3 + 0x101" identifier + number_literal)) ;) (expression_statement "iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);" (assignment_expression "iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1)" identifier = (call_expression "FUN_0001dc50(*piVar2,iVar3 + 0x101,1)" identifier (argument_list "(*piVar2,iVar3 + 0x101,1)" ( (pointer_expression "*piVar2" * identifier) , (binary_expression "iVar3 + 0x101" identifier + number_literal) , number_literal )))) ;) (expression_statement "*piVar2 = iVar4;" (assignment_expression "*piVar2 = iVar4" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "iVar3 = piVar2[1] + -1;" (assignment_expression "iVar3 = piVar2[1] + -1" identifier = (binary_expression "piVar2[1] + -1" (subscript_expression "piVar2[1]" identifier [ number_literal ]) + number_literal)) ;) }) (else_clause "else {\n    iVar4 = *piVar2;\n  }" else (compound_statement "{\n    iVar4 = *piVar2;\n  }" { (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) }))) (expression_statement "*(undefined1 *)(iVar4 + iVar3) = param_1;" (assignment_expression "*(undefined1 *)(iVar4 + iVar3) = param_1" (pointer_expression "*(undefined1 *)(iVar4 + iVar3)" * (cast_expression "(undefined1 *)(iVar4 + iVar3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + iVar3)" ( (binary_expression "iVar4 + iVar3" identifier + identifier) )))) = identifier) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return piVar2;\n  }" { (return_statement "return piVar2;" return identifier ;) })) comment (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsftp_packet * __regparm3 sftp_pkt_init(int pkt_type)\n\n{\n  int iVar1;\n  sftp_packet *psVar2;\n  char *pcVar3;\n  uint uVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  psVar2 = (sftp_packet *)safemalloc(1,0x14);\n  psVar2->data = (char *)0x0;\n  psVar2->savedpos = 0xffffffff;\n  psVar2->length = 4;\n  psVar2->maxlen = 0x104;\n  pcVar3 = (char *)saferealloc((void *)0x0,0x104,1);\n  psVar2->data = pcVar3;\n  pcVar3 = pcVar3 + (psVar2->length - 4);\n  pcVar3[0] = '\0';\n  pcVar3[1] = '\0';\n  pcVar3[2] = '\0';\n  pcVar3[3] = '\0';\n  uVar4 = psVar2->length;\n  psVar2->length = uVar4 + 1;\n  if ((int)psVar2->maxlen < (int)(uVar4 + 1)) {\n    psVar2->maxlen = uVar4 + 0x101;\n    pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1);\n    psVar2->data = pcVar3;\n    uVar4 = psVar2->length - 1;\n  }\n  else {\n    pcVar3 = psVar2->data;\n  }\n  pcVar3[uVar4] = (char)pkt_type;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return psVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (ERROR "sftp_packet * __regparm3 sftp_pkt_init(int pkt_type)" (binary_expression "sftp_packet * __regparm3 sftp_pkt_init(int pkt_type)" identifier * (ERROR "__regparm3" identifier) (call_expression "sftp_pkt_init(int pkt_type)" identifier (argument_list "(int pkt_type)" ( (ERROR "int" identifier) identifier ))))) (compound_statement "{\n  int iVar1;\n  sftp_packet *psVar2;\n  char *pcVar3;\n  uint uVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  psVar2 = (sftp_packet *)safemalloc(1,0x14);\n  psVar2->data = (char *)0x0;\n  psVar2->savedpos = 0xffffffff;\n  psVar2->length = 4;\n  psVar2->maxlen = 0x104;\n  pcVar3 = (char *)saferealloc((void *)0x0,0x104,1);\n  psVar2->data = pcVar3;\n  pcVar3 = pcVar3 + (psVar2->length - 4);\n  pcVar3[0] = '\0';\n  pcVar3[1] = '\0';\n  pcVar3[2] = '\0';\n  pcVar3[3] = '\0';\n  uVar4 = psVar2->length;\n  psVar2->length = uVar4 + 1;\n  if ((int)psVar2->maxlen < (int)(uVar4 + 1)) {\n    psVar2->maxlen = uVar4 + 0x101;\n    pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1);\n    psVar2->data = pcVar3;\n    uVar4 = psVar2->length - 1;\n  }\n  else {\n    pcVar3 = psVar2->data;\n  }\n  pcVar3[uVar4] = (char)pkt_type;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return psVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "sftp_packet *psVar2;" type_identifier (pointer_declarator "*psVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "psVar2 = (sftp_packet *)safemalloc(1,0x14);" (assignment_expression "psVar2 = (sftp_packet *)safemalloc(1,0x14)" identifier = (cast_expression "(sftp_packet *)safemalloc(1,0x14)" ( (type_descriptor "sftp_packet *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,0x14)" identifier (argument_list "(1,0x14)" ( number_literal , number_literal ))))) ;) (expression_statement "psVar2->data = (char *)0x0;" (assignment_expression "psVar2->data = (char *)0x0" (field_expression "psVar2->data" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "psVar2->savedpos = 0xffffffff;" (assignment_expression "psVar2->savedpos = 0xffffffff" (field_expression "psVar2->savedpos" identifier -> field_identifier) = number_literal) ;) (expression_statement "psVar2->length = 4;" (assignment_expression "psVar2->length = 4" (field_expression "psVar2->length" identifier -> field_identifier) = number_literal) ;) (expression_statement "psVar2->maxlen = 0x104;" (assignment_expression "psVar2->maxlen = 0x104" (field_expression "psVar2->maxlen" identifier -> field_identifier) = number_literal) ;) (expression_statement "pcVar3 = (char *)saferealloc((void *)0x0,0x104,1);" (assignment_expression "pcVar3 = (char *)saferealloc((void *)0x0,0x104,1)" identifier = (cast_expression "(char *)saferealloc((void *)0x0,0x104,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc((void *)0x0,0x104,1)" identifier (argument_list "((void *)0x0,0x104,1)" ( (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal ))))) ;) (expression_statement "psVar2->data = pcVar3;" (assignment_expression "psVar2->data = pcVar3" (field_expression "psVar2->data" identifier -> field_identifier) = identifier) ;) (expression_statement "pcVar3 = pcVar3 + (psVar2->length - 4);" (assignment_expression "pcVar3 = pcVar3 + (psVar2->length - 4)" identifier = (binary_expression "pcVar3 + (psVar2->length - 4)" identifier + (parenthesized_expression "(psVar2->length - 4)" ( (binary_expression "psVar2->length - 4" (field_expression "psVar2->length" identifier -> field_identifier) - number_literal) )))) ;) (expression_statement "pcVar3[0] = '\0';" (assignment_expression "pcVar3[0] = '\0'" (subscript_expression "pcVar3[0]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar3[1] = '\0';" (assignment_expression "pcVar3[1] = '\0'" (subscript_expression "pcVar3[1]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar3[2] = '\0';" (assignment_expression "pcVar3[2] = '\0'" (subscript_expression "pcVar3[2]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar3[3] = '\0';" (assignment_expression "pcVar3[3] = '\0'" (subscript_expression "pcVar3[3]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "uVar4 = psVar2->length;" (assignment_expression "uVar4 = psVar2->length" identifier = (field_expression "psVar2->length" identifier -> field_identifier)) ;) (expression_statement "psVar2->length = uVar4 + 1;" (assignment_expression "psVar2->length = uVar4 + 1" (field_expression "psVar2->length" identifier -> field_identifier) = (binary_expression "uVar4 + 1" identifier + number_literal)) ;) (if_statement "if ((int)psVar2->maxlen < (int)(uVar4 + 1)) {\n    psVar2->maxlen = uVar4 + 0x101;\n    pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1);\n    psVar2->data = pcVar3;\n    uVar4 = psVar2->length - 1;\n  }\n  else {\n    pcVar3 = psVar2->data;\n  }" if (parenthesized_expression "((int)psVar2->maxlen < (int)(uVar4 + 1))" ( (binary_expression "(int)psVar2->maxlen < (int)(uVar4 + 1)" (cast_expression "(int)psVar2->maxlen" ( (type_descriptor "int" primitive_type) ) (field_expression "psVar2->maxlen" identifier -> field_identifier)) < (cast_expression "(int)(uVar4 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(uVar4 + 1)" ( (binary_expression "uVar4 + 1" identifier + number_literal) )))) )) (compound_statement "{\n    psVar2->maxlen = uVar4 + 0x101;\n    pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1);\n    psVar2->data = pcVar3;\n    uVar4 = psVar2->length - 1;\n  }" { (expression_statement "psVar2->maxlen = uVar4 + 0x101;" (assignment_expression "psVar2->maxlen = uVar4 + 0x101" (field_expression "psVar2->maxlen" identifier -> field_identifier) = (binary_expression "uVar4 + 0x101" identifier + number_literal)) ;) (expression_statement "pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1);" (assignment_expression "pcVar3 = (char *)saferealloc(psVar2->data,uVar4 + 0x101,1)" identifier = (cast_expression "(char *)saferealloc(psVar2->data,uVar4 + 0x101,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(psVar2->data,uVar4 + 0x101,1)" identifier (argument_list "(psVar2->data,uVar4 + 0x101,1)" ( (field_expression "psVar2->data" identifier -> field_identifier) , (binary_expression "uVar4 + 0x101" identifier + number_literal) , number_literal ))))) ;) (expression_statement "psVar2->data = pcVar3;" (assignment_expression "psVar2->data = pcVar3" (field_expression "psVar2->data" identifier -> field_identifier) = identifier) ;) (expression_statement "uVar4 = psVar2->length - 1;" (assignment_expression "uVar4 = psVar2->length - 1" identifier = (binary_expression "psVar2->length - 1" (field_expression "psVar2->length" identifier -> field_identifier) - number_literal)) ;) }) (else_clause "else {\n    pcVar3 = psVar2->data;\n  }" else (compound_statement "{\n    pcVar3 = psVar2->data;\n  }" { (expression_statement "pcVar3 = psVar2->data;" (assignment_expression "pcVar3 = psVar2->data" identifier = (field_expression "psVar2->data" identifier -> field_identifier)) ;) }))) (expression_statement "pcVar3[uVar4] = (char)pkt_type;" (assignment_expression "pcVar3[uVar4] = (char)pkt_type" (subscript_expression "pcVar3[uVar4]" identifier [ identifier ]) = (cast_expression "(char)pkt_type" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return psVar2;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return psVar2;\n  }" { (return_statement "return psVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) }))
(translation_unit "int * __regparm3 FUN_0002e5f0(undefined1 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    \n  FUN_0008d800();\n}\n\n" (function_definition "int * __regparm3 FUN_0002e5f0(undefined1 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    \n  FUN_0008d800();\n}" primitive_type (pointer_declarator "* __regparm3 FUN_0002e5f0(undefined1 param_1)" * (ERROR "__regparm3" identifier) (function_declarator "FUN_0002e5f0(undefined1 param_1)" identifier (parameter_list "(undefined1 param_1)" ( (parameter_declaration "undefined1 param_1" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    \n  FUN_0008d800();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "piVar2 = (int *)FUN_0001db90(1,0x14);" (assignment_expression "piVar2 = (int *)FUN_0001db90(1,0x14)" identifier = (cast_expression "(int *)FUN_0001db90(1,0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(1,0x14)" identifier (argument_list "(1,0x14)" ( number_literal , number_literal ))))) ;) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (expression_statement "piVar2[3] = -1;" (assignment_expression "piVar2[3] = -1" (subscript_expression "piVar2[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[1] = 4;" (assignment_expression "piVar2[1] = 4" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[2] = 0x104;" (assignment_expression "piVar2[2] = 0x104" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "iVar3 = FUN_0001dc50(0,0x104,1);" (assignment_expression "iVar3 = FUN_0001dc50(0,0x104,1)" identifier = (call_expression "FUN_0001dc50(0,0x104,1)" identifier (argument_list "(0,0x104,1)" ( number_literal , number_literal , number_literal )))) ;) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "*(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;" (assignment_expression "*(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0" (pointer_expression "*(undefined4 *)(iVar3 + -4 + piVar2[1])" * (cast_expression "(undefined4 *)(iVar3 + -4 + piVar2[1])" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -4 + piVar2[1])" ( (binary_expression "iVar3 + -4 + piVar2[1]" (binary_expression "iVar3 + -4" identifier + number_literal) + (subscript_expression "piVar2[1]" identifier [ number_literal ])) )))) = number_literal) ;) (expression_statement "iVar3 = piVar2[1];" (assignment_expression "iVar3 = piVar2[1]" identifier = (subscript_expression "piVar2[1]" identifier [ number_literal ])) ;) (expression_statement "piVar2[1] = iVar3 + 1;" (assignment_expression "piVar2[1] = iVar3 + 1" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (if_statement "if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }" if (parenthesized_expression "(piVar2[2] < iVar3 + 1)" ( (binary_expression "piVar2[2] < iVar3 + 1" (subscript_expression "piVar2[2]" identifier [ number_literal ]) < (binary_expression "iVar3 + 1" identifier + number_literal)) )) (compound_statement "{\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }" { (expression_statement "piVar2[2] = iVar3 + 0x101;" (assignment_expression "piVar2[2] = iVar3 + 0x101" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = (binary_expression "iVar3 + 0x101" identifier + number_literal)) ;) (expression_statement "iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);" (assignment_expression "iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1)" identifier = (call_expression "FUN_0001dc50(*piVar2,iVar3 + 0x101,1)" identifier (argument_list "(*piVar2,iVar3 + 0x101,1)" ( (pointer_expression "*piVar2" * identifier) , (binary_expression "iVar3 + 0x101" identifier + number_literal) , number_literal )))) ;) (expression_statement "*piVar2 = iVar4;" (assignment_expression "*piVar2 = iVar4" (pointer_expression "*piVar2" * identifier) = identifier) ;) (expression_statement "iVar3 = piVar2[1] + -1;" (assignment_expression "iVar3 = piVar2[1] + -1" identifier = (binary_expression "piVar2[1] + -1" (subscript_expression "piVar2[1]" identifier [ number_literal ]) + number_literal)) ;) }) (else_clause "else {\n    iVar4 = *piVar2;\n  }" else (compound_statement "{\n    iVar4 = *piVar2;\n  }" { (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) }))) (expression_statement "*(undefined1 *)(iVar4 + iVar3) = param_1;" (assignment_expression "*(undefined1 *)(iVar4 + iVar3) = param_1" (pointer_expression "*(undefined1 *)(iVar4 + iVar3)" * (cast_expression "(undefined1 *)(iVar4 + iVar3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar4 + iVar3)" ( (binary_expression "iVar4 + iVar3" identifier + identifier) )))) = identifier) ;) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return piVar2;\n  }" { (return_statement "return piVar2;" return identifier ;) })) (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , LIT , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + (subscript_expression IDENT [ LIT ])) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) < (binary_expression IDENT + LIT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (binary_expression IDENT + LIT) , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "int * __regparm3 FUN_0002e5f0(undefined1 param_1)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    \n  FUN_0008d800();\n}" (primitive_type "int") (pointer_declarator "* __regparm3 FUN_0002e5f0(undefined1 param_1)" (* "*") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0002e5f0(undefined1 param_1)" (identifier "FUN_0002e5f0") (parameter_list "(undefined1 param_1)" (( "(") (parameter_declaration "undefined1 param_1" (type_identifier "undefined1") (identifier "param_1")) () ")")))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  piVar2 = (int *)FUN_0001db90(1,0x14);\n  *piVar2 = 0;\n  piVar2[3] = -1;\n  piVar2[1] = 4;\n  piVar2[2] = 0x104;\n  iVar3 = FUN_0001dc50(0,0x104,1);\n  *piVar2 = iVar3;\n  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;\n  iVar3 = piVar2[1];\n  piVar2[1] = iVar3 + 1;\n  if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }\n  *(undefined1 *)(iVar4 + iVar3) = param_1;\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }\n                    \n  FUN_0008d800();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "piVar2 = (int *)FUN_0001db90(1,0x14);" (assignment_expression "piVar2 = (int *)FUN_0001db90(1,0x14)" (identifier "piVar2") (= "=") (cast_expression "(int *)FUN_0001db90(1,0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001db90(1,0x14)" (identifier "FUN_0001db90") (argument_list "(1,0x14)" (( "(") (number_literal "1") (, ",") (number_literal "0x14") () ")"))))) (; ";")) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar2[3] = -1;" (assignment_expression "piVar2[3] = -1" (subscript_expression "piVar2[3]" (identifier "piVar2") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "-1")) (; ";")) (expression_statement "piVar2[1] = 4;" (assignment_expression "piVar2[1] = 4" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "4")) (; ";")) (expression_statement "piVar2[2] = 0x104;" (assignment_expression "piVar2[2] = 0x104" (subscript_expression "piVar2[2]" (identifier "piVar2") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0x104")) (; ";")) (expression_statement "iVar3 = FUN_0001dc50(0,0x104,1);" (assignment_expression "iVar3 = FUN_0001dc50(0,0x104,1)" (identifier "iVar3") (= "=") (call_expression "FUN_0001dc50(0,0x104,1)" (identifier "FUN_0001dc50") (argument_list "(0,0x104,1)" (( "(") (number_literal "0") (, ",") (number_literal "0x104") (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "*piVar2 = iVar3;" (assignment_expression "*piVar2 = iVar3" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar3")) (; ";")) (expression_statement "*(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;" (assignment_expression "*(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0" (pointer_expression "*(undefined4 *)(iVar3 + -4 + piVar2[1])" (* "*") (cast_expression "(undefined4 *)(iVar3 + -4 + piVar2[1])" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + -4 + piVar2[1])" (( "(") (binary_expression "iVar3 + -4 + piVar2[1]" (binary_expression "iVar3 + -4" (identifier "iVar3") (+ "+") (number_literal "-4")) (+ "+") (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar3 = piVar2[1];" (assignment_expression "iVar3 = piVar2[1]" (identifier "iVar3") (= "=") (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "piVar2[1] = iVar3 + 1;" (assignment_expression "piVar2[1] = iVar3 + 1" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "iVar3 + 1" (identifier "iVar3") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (piVar2[2] < iVar3 + 1) {\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }\n  else {\n    iVar4 = *piVar2;\n  }" (if "if") (parenthesized_expression "(piVar2[2] < iVar3 + 1)" (( "(") (binary_expression "piVar2[2] < iVar3 + 1" (subscript_expression "piVar2[2]" (identifier "piVar2") ([ "[") (number_literal "2") (] "]")) (< "<") (binary_expression "iVar3 + 1" (identifier "iVar3") (+ "+") (number_literal "1"))) () ")")) (compound_statement "{\n    piVar2[2] = iVar3 + 0x101;\n    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);\n    *piVar2 = iVar4;\n    iVar3 = piVar2[1] + -1;\n  }" ({ "{") (expression_statement "piVar2[2] = iVar3 + 0x101;" (assignment_expression "piVar2[2] = iVar3 + 0x101" (subscript_expression "piVar2[2]" (identifier "piVar2") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "iVar3 + 0x101" (identifier "iVar3") (+ "+") (number_literal "0x101"))) (; ";")) (expression_statement "iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);" (assignment_expression "iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1)" (identifier "iVar4") (= "=") (call_expression "FUN_0001dc50(*piVar2,iVar3 + 0x101,1)" (identifier "FUN_0001dc50") (argument_list "(*piVar2,iVar3 + 0x101,1)" (( "(") (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (, ",") (binary_expression "iVar3 + 0x101" (identifier "iVar3") (+ "+") (number_literal "0x101")) (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "*piVar2 = iVar4;" (assignment_expression "*piVar2 = iVar4" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar4")) (; ";")) (expression_statement "iVar3 = piVar2[1] + -1;" (assignment_expression "iVar3 = piVar2[1] + -1" (identifier "iVar3") (= "=") (binary_expression "piVar2[1] + -1" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (else_clause "else {\n    iVar4 = *piVar2;\n  }" (else "else") (compound_statement "{\n    iVar4 = *piVar2;\n  }" ({ "{") (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" (identifier "iVar4") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (} "}")))) (expression_statement "*(undefined1 *)(iVar4 + iVar3) = param_1;" (assignment_expression "*(undefined1 *)(iVar4 + iVar3) = param_1" (pointer_expression "*(undefined1 *)(iVar4 + iVar3)" (* "*") (cast_expression "(undefined1 *)(iVar4 + iVar3)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar4 + iVar3)" (( "(") (binary_expression "iVar4 + iVar3" (identifier "iVar4") (+ "+") (identifier "iVar3")) () ")")))) (= "=") (identifier "param_1")) (; ";")) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return piVar2;\n  }" (if "if") (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return piVar2;\n  }" ({ "{") (return_statement "return piVar2;" (return "return") (identifier "piVar2") (; ";")) (} "}"))) (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" (identifier "FUN_0008d800") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

type_1 * __regparm3 sftp_pkt_init(int pkt_type)

{
  int var_6;
  type_1 *psVar2;
  char *var_4;
  type_2 var_5;
  int var_1;
  
  var_6 = *(int *)(var_1 + 0x14);
  psVar2 = (type_1 *)var_2(1,0x14);
  psVar2->data = (char *)0x0;
  psVar2->savedpos = 0xffffffff;
  psVar2->length = 4;
  psVar2->maxlen = 0x104;
  var_4 = (char *)var_3((void *)0x0,0x104,1);
  psVar2->data = var_4;
  var_4 = var_4 + (psVar2->length - 4);
  var_4[0] = '\0';
  var_4[1] = '\0';
  var_4[2] = '\0';
  var_4[3] = '\0';
  var_5 = psVar2->length;
  psVar2->length = var_5 + 1;
  if ((int)psVar2->maxlen < (int)(var_5 + 1)) {
    psVar2->maxlen = var_5 + 0x101;
    var_4 = (char *)var_3(psVar2->data,var_5 + 0x101,1);
    psVar2->data = var_4;
    var_5 = psVar2->length - 1;
  }
  else {
    var_4 = psVar2->data;
  }
  var_4[var_5] = (char)pkt_type;
  if (var_6 == *(int *)(var_1 + 0x14)) {
    return psVar2;
  }
                    /* WARNING: Subroutine does not return */
  var_7();
}


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

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

int * __regparm3 MASKED(undefined1 param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int in_GS_OFFSET;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  piVar2 = (int *)FUN_0001db90(1,0x14);
  *piVar2 = 0;
  piVar2[3] = -1;
  piVar2[1] = 4;
  piVar2[2] = 0x104;
  iVar3 = FUN_0001dc50(0,0x104,1);
  *piVar2 = iVar3;
  *(undefined4 *)(iVar3 + -4 + piVar2[1]) = 0;
  iVar3 = piVar2[1];
  piVar2[1] = iVar3 + 1;
  if (piVar2[2] < iVar3 + 1) {
    piVar2[2] = iVar3 + 0x101;
    iVar4 = FUN_0001dc50(*piVar2,iVar3 + 0x101,1);
    *piVar2 = iVar4;
    iVar3 = piVar2[1] + -1;
  }
  else {
    iVar4 = *piVar2;
  }
  *(undefined1 *)(iVar4 + iVar3) = param_1;
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return piVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008d800();
}

