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

int so_peercred(int fd,int *pid,int *uid,int *gid)

{
  int iVar1;
  int iVar2;
  int in_GS_OFFSET;
  socklen_t crlen;
  ucred cr;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  crlen = 0xc;
  iVar2 = getsockopt(fd,1,0x11,&cr,&crlen);
  if (iVar2 == 0) {
    *pid = cr.pid;
    *uid = cr.uid;
    *gid = cr.gid;
  }
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return (uint)(iVar2 == 0);
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

bool FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)

{
  int iVar1;
  int in_GS_OFFSET;
  socklen_t local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x68ae9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_30 = 0xc;
  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);
  if (iVar1 == 0) {
    *param_2 = local_2c;
    *param_3 = local_28;
    *param_4 = local_24;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1 == 0;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006f2a0();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00014980
ADD EBX,0x40287
SUB ESP,0x38
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x28],EAX
XOR EAX,EAX
LEA EAX,[ESP + 0x18]
MOV EBP,dword ptr [ESP + 0x50]
MOV EDI,dword ptr [ESP + 0x54]
MOV ESI,dword ptr [ESP + 0x58]
MOV dword ptr [ESP + 0x18],0xc
PUSH EAX
LEA EAX,[ESP + 0x20]
PUSH EAX
PUSH 0x11
PUSH 0x1
PUSH dword ptr [ESP + 0x5c]
CALL 0x00014260
ADD ESP,0x20
XOR EDX,EDX
TEST EAX,EAX
JNZ 0x00068b4a
MOV EAX,dword ptr [ESP + 0x10]
MOV EDX,0x1
MOV dword ptr [EBP],EAX
MOV EAX,dword ptr [ESP + 0x14]
MOV dword ptr [EDI],EAX
MOV EAX,dword ptr [ESP + 0x18]
MOV dword ptr [ESI],EAX
MOV ECX,dword ptr [ESP + 0x1c]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,EDX
JNZ 0x00068b61
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
CALL 0x0006f2a0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nbool FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006f2a0();\n}\n\n" comment (function_definition "bool FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006f2a0();\n}" primitive_type (function_declarator "FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)" identifier (parameter_list "(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006f2a0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "socklen_t local_30;" type_identifier identifier ;) (declaration "undefined4 local_2c;" type_identifier identifier ;) (declaration "undefined4 local_28;" type_identifier identifier ;) (declaration "undefined4 local_24;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x68ae9;" (assignment_expression "uStack_14 = 0x68ae9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(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 "local_30 = 0xc;" (assignment_expression "local_30 = 0xc" identifier = number_literal) ;) (expression_statement "iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);" (assignment_expression "iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30)" identifier = (call_expression "getsockopt(param_1,1,0x11,&local_2c,&local_30)" identifier (argument_list "(param_1,1,0x11,&local_2c,&local_30)" ( identifier , number_literal , number_literal , (pointer_expression "&local_2c" & identifier) , (pointer_expression "&local_30" & identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }" { (expression_statement "*param_2 = local_2c;" (assignment_expression "*param_2 = local_2c" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "*param_3 = local_28;" (assignment_expression "*param_3 = local_28" (pointer_expression "*param_3" * identifier) = identifier) ;) (expression_statement "*param_4 = local_24;" (assignment_expression "*param_4 = local_24" (pointer_expression "*param_4" * identifier) = identifier) ;) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(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 iVar1 == 0;\n  }" { (return_statement "return iVar1 == 0;" return (binary_expression "iVar1 == 0" identifier == number_literal) ;) })) comment (expression_statement "FUN_0006f2a0();" (call_expression "FUN_0006f2a0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint so_peercred(int fd,int *pid,int *uid,int *gid)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  socklen_t crlen;\n  ucred cr;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  crlen = 0xc;\n  iVar2 = getsockopt(fd,1,0x11,&cr,&crlen);\n  if (iVar2 == 0) {\n    *pid = cr.pid;\n    *uid = cr.uid;\n    *gid = cr.gid;\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (uint)(iVar2 == 0);\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "int so_peercred(int fd,int *pid,int *uid,int *gid)\n\n{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  socklen_t crlen;\n  ucred cr;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  crlen = 0xc;\n  iVar2 = getsockopt(fd,1,0x11,&cr,&crlen);\n  if (iVar2 == 0) {\n    *pid = cr.pid;\n    *uid = cr.uid;\n    *gid = cr.gid;\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (uint)(iVar2 == 0);\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "so_peercred(int fd,int *pid,int *uid,int *gid)" identifier (parameter_list "(int fd,int *pid,int *uid,int *gid)" ( (parameter_declaration "int fd" primitive_type identifier) , (parameter_declaration "int *pid" primitive_type (pointer_declarator "*pid" * identifier)) , (parameter_declaration "int *uid" primitive_type (pointer_declarator "*uid" * identifier)) , (parameter_declaration "int *gid" primitive_type (pointer_declarator "*gid" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  socklen_t crlen;\n  ucred cr;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  crlen = 0xc;\n  iVar2 = getsockopt(fd,1,0x11,&cr,&crlen);\n  if (iVar2 == 0) {\n    *pid = cr.pid;\n    *uid = cr.uid;\n    *gid = cr.gid;\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (uint)(iVar2 == 0);\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "socklen_t crlen;" type_identifier identifier ;) (declaration "ucred cr;" type_identifier 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 "crlen = 0xc;" (assignment_expression "crlen = 0xc" identifier = number_literal) ;) (expression_statement "iVar2 = getsockopt(fd,1,0x11,&cr,&crlen);" (assignment_expression "iVar2 = getsockopt(fd,1,0x11,&cr,&crlen)" identifier = (call_expression "getsockopt(fd,1,0x11,&cr,&crlen)" identifier (argument_list "(fd,1,0x11,&cr,&crlen)" ( identifier , number_literal , number_literal , (pointer_expression "&cr" & identifier) , (pointer_expression "&crlen" & identifier) )))) ;) (if_statement "if (iVar2 == 0) {\n    *pid = cr.pid;\n    *uid = cr.uid;\n    *gid = cr.gid;\n  }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    *pid = cr.pid;\n    *uid = cr.uid;\n    *gid = cr.gid;\n  }" { (expression_statement "*pid = cr.pid;" (assignment_expression "*pid = cr.pid" (pointer_expression "*pid" * identifier) = (field_expression "cr.pid" identifier . field_identifier)) ;) (expression_statement "*uid = cr.uid;" (assignment_expression "*uid = cr.uid" (pointer_expression "*uid" * identifier) = (field_expression "cr.uid" identifier . field_identifier)) ;) (expression_statement "*gid = cr.gid;" (assignment_expression "*gid = cr.gid" (pointer_expression "*gid" * identifier) = (field_expression "cr.gid" identifier . field_identifier)) ;) })) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (uint)(iVar2 == 0);\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 (uint)(iVar2 == 0);\n  }" { (return_statement "return (uint)(iVar2 == 0);" return (call_expression "(uint)(iVar2 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) ))) ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "bool FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    \n  FUN_0006f2a0();\n}\n\n" (function_definition "bool FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    \n  FUN_0006f2a0();\n}" primitive_type (function_declarator "FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)" identifier (parameter_list "(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "undefined4 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    \n  FUN_0006f2a0();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "socklen_t local_30;" type_identifier identifier ;) (declaration "undefined4 local_2c;" type_identifier identifier ;) (declaration "undefined4 local_28;" type_identifier identifier ;) (declaration "undefined4 local_24;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x68ae9;" (assignment_expression "uStack_14 = 0x68ae9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(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 "local_30 = 0xc;" (assignment_expression "local_30 = 0xc" identifier = number_literal) ;) (expression_statement "iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);" (assignment_expression "iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30)" identifier = (call_expression "getsockopt(param_1,1,0x11,&local_2c,&local_30)" identifier (argument_list "(param_1,1,0x11,&local_2c,&local_30)" ( identifier , number_literal , number_literal , (pointer_expression "&local_2c" & identifier) , (pointer_expression "&local_30" & identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }" { (expression_statement "*param_2 = local_2c;" (assignment_expression "*param_2 = local_2c" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "*param_3 = local_28;" (assignment_expression "*param_3 = local_28" (pointer_expression "*param_3" * identifier) = identifier) ;) (expression_statement "*param_4 = local_24;" (assignment_expression "*param_4 = local_24" (pointer_expression "*param_4" * identifier) = identifier) ;) })) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(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 iVar1 == 0;\n  }" { (return_statement "return iVar1 == 0;" return (binary_expression "iVar1 == 0" identifier == number_literal) ;) })) (expression_statement "FUN_0006f2a0();" (call_expression "FUN_0006f2a0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (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 = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , LIT , (pointer_expression & IDENT) , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * 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 (binary_expression IDENT == LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "bool FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)\n\n{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    \n  FUN_0006f2a0();\n}" (primitive_type "bool") (function_declarator "FUN_00068ae0(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)" (identifier "FUN_00068ae0") (parameter_list "(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 *param_3" (type_identifier "undefined4") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "undefined4 *param_4" (type_identifier "undefined4") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int in_GS_OFFSET;\n  socklen_t local_30;\n  undefined4 local_2c;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x68ae9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_30 = 0xc;\n  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);\n  if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }\n                    \n  FUN_0006f2a0();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "socklen_t local_30;" (type_identifier "socklen_t") (identifier "local_30") (; ";")) (declaration "undefined4 local_2c;" (type_identifier "undefined4") (identifier "local_2c") (; ";")) (declaration "undefined4 local_28;" (type_identifier "undefined4") (identifier "local_28") (; ";")) (declaration "undefined4 local_24;" (type_identifier "undefined4") (identifier "local_24") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x68ae9;" (assignment_expression "uStack_14 = 0x68ae9" (identifier "uStack_14") (= "=") (number_literal "0x68ae9")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (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 "local_30 = 0xc;" (assignment_expression "local_30 = 0xc" (identifier "local_30") (= "=") (number_literal "0xc")) (; ";")) (expression_statement "iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);" (assignment_expression "iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30)" (identifier "iVar1") (= "=") (call_expression "getsockopt(param_1,1,0x11,&local_2c,&local_30)" (identifier "getsockopt") (argument_list "(param_1,1,0x11,&local_2c,&local_30)" (( "(") (identifier "param_1") (, ",") (number_literal "1") (, ",") (number_literal "0x11") (, ",") (pointer_expression "&local_2c" (& "&") (identifier "local_2c")) (, ",") (pointer_expression "&local_30" (& "&") (identifier "local_30")) () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    *param_2 = local_2c;\n    *param_3 = local_28;\n    *param_4 = local_24;\n  }" ({ "{") (expression_statement "*param_2 = local_2c;" (assignment_expression "*param_2 = local_2c" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "local_2c")) (; ";")) (expression_statement "*param_3 = local_28;" (assignment_expression "*param_3 = local_28" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (identifier "local_28")) (; ";")) (expression_statement "*param_4 = local_24;" (assignment_expression "*param_4 = local_24" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (identifier "local_24")) (; ";")) (} "}"))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return iVar1 == 0;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (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 iVar1 == 0;\n  }" ({ "{") (return_statement "return iVar1 == 0;" (return "return") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "FUN_0006f2a0();" (call_expression "FUN_0006f2a0()" (identifier "FUN_0006f2a0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

int function_1(int fd,int *pid,int *uid,int *gid)

{
  int var_4;
  int var_3;
  int var_1;
  type_1 crlen;
  type_2 cr;
  
  var_4 = *(int *)(var_1 + 0x14);
  crlen = 0xc;
  var_3 = var_2(fd,1,0x11,&cr,&crlen);
  if (var_3 == 0) {
    *pid = cr.pid;
    *uid = cr.uid;
    *gid = cr.gid;
  }
  if (var_4 == *(int *)(var_1 + 0x14)) {
    return (uint)(var_3 == 0);
  }
                    /* WARNING: Subroutine does not return */
  var_5();
}


(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: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (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: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (pointer_expression argument: (identifier)) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (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 (binary_expression left: (identifier) right: (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

bool MASKED(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)

{
  int iVar1;
  int in_GS_OFFSET;
  socklen_t local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x68ae9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_30 = 0xc;
  iVar1 = getsockopt(param_1,1,0x11,&local_2c,&local_30);
  if (iVar1 == 0) {
    *param_2 = local_2c;
    *param_3 = local_28;
    *param_4 = local_24;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar1 == 0;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006f2a0();
}

