
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* stdio_sync_filebuf<char, std::char_traits<char> >::overflow(int) */

int __thiscall
stdio_sync_filebuf<char,std::char_traits<char>>::overflow
          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)

{
  int iVar1;
  
  if (param_1 != -1) {
    iVar1 = putc(param_1,*(FILE **)(this + 0x20));
    return iVar1;
  }
  iVar1 = fflush(*(FILE **)(this + 0x20));
  return -(uint)(iVar1 != 0);
}



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

int FUN_0021c700(int param_1,int param_2)

{
  int iVar1;
  
  if (param_2 != -1) {
    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));
    return iVar1;
  }
  iVar1 = fflush(*(FILE **)(param_1 + 0x20));
  return -(uint)(iVar1 != 0);
}


PUSH EBX
CALL 0x00035840
ADD EBX,0x1728fa
SUB ESP,0x8
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x14]
MOV EDX,dword ptr [EDX + 0x20]
CMP EAX,-0x1
JZ 0x0021c738
SUB ESP,0x8
PUSH EDX
PUSH EAX
CALL 0x00029950
ADD ESP,0x10
ADD ESP,0x8
POP EBX
RET
SUB ESP,0xc
PUSH EDX
CALL 0x00029480
ADD ESP,0x10
TEST EAX,EAX
SETNZ AL
ADD ESP,0x8
MOVZX EAX,AL
POP EBX
NEG EAX
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_0021c700(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}\n\n" comment (function_definition "int FUN_0021c700(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}" primitive_type (function_declarator "FUN_0021c700(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }" if (parenthesized_expression "(param_2 != -1)" ( (binary_expression "param_2 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }" { (expression_statement "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));" (assignment_expression "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20))" identifier = (call_expression "putc(param_2,*(FILE **)(param_1 + 0x20))" identifier (argument_list "(param_2,*(FILE **)(param_1 + 0x20))" ( identifier , (pointer_expression "*(FILE **)(param_1 + 0x20)" * (cast_expression "(FILE **)(param_1 + 0x20)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = fflush(*(FILE **)(param_1 + 0x20));" (assignment_expression "iVar1 = fflush(*(FILE **)(param_1 + 0x20))" identifier = (call_expression "fflush(*(FILE **)(param_1 + 0x20))" identifier (argument_list "(*(FILE **)(param_1 + 0x20))" ( (pointer_expression "*(FILE **)(param_1 + 0x20)" * (cast_expression "(FILE **)(param_1 + 0x20)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) )))) ;) (return_statement "return -(uint)(iVar1 != 0);" return (unary_expression "-(uint)(iVar1 != 0)" - (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* stdio_sync_filebuf<char, std::char_traits<char> >::overflow(int) */\n\nint __thiscall\nstdio_sync_filebuf<char,std::char_traits<char>>::overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = putc(param_1,*(FILE **)(this + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(this + 0x20));\n  return -(uint)(iVar1 != 0);\n}\n\n" comment comment (declaration "int __thiscall\nstdio_sync_filebuf<char,std::char_traits<char>>::overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)\n\n{\n  int iVar1;" primitive_type (ms_call_modifier "__thiscall" __thiscall) identifier (ERROR "<char" < primitive_type) , (ERROR "std::char_traits<char>>::overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)\n\n{\n  int" identifier : : identifier < primitive_type >> : : (function_declarator "overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)" identifier (parameter_list "(stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)" ( (parameter_declaration "stdio_sync_filebuf" type_identifier) (ERROR "<char" < primitive_type) , (parameter_declaration "std::char_traits<char>> *this" type_identifier (ERROR "::char_traits<char>>" : : identifier < primitive_type >>) (pointer_declarator "*this" * identifier)) , (parameter_declaration "int param_1" primitive_type identifier) ))) { primitive_type) identifier ;) (if_statement "if (param_1 != -1) {\n    iVar1 = putc(param_1,*(FILE **)(this + 0x20));\n    return iVar1;\n  }" if (parenthesized_expression "(param_1 != -1)" ( (binary_expression "param_1 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = putc(param_1,*(FILE **)(this + 0x20));\n    return iVar1;\n  }" { (expression_statement "iVar1 = putc(param_1,*(FILE **)(this + 0x20));" (assignment_expression "iVar1 = putc(param_1,*(FILE **)(this + 0x20))" identifier = (call_expression "putc(param_1,*(FILE **)(this + 0x20))" identifier (argument_list "(param_1,*(FILE **)(this + 0x20))" ( identifier , (pointer_expression "*(FILE **)(this + 0x20)" * (cast_expression "(FILE **)(this + 0x20)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x20)" ( (binary_expression "this + 0x20" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = fflush(*(FILE **)(this + 0x20));" (assignment_expression "iVar1 = fflush(*(FILE **)(this + 0x20))" identifier = (call_expression "fflush(*(FILE **)(this + 0x20))" identifier (argument_list "(*(FILE **)(this + 0x20))" ( (pointer_expression "*(FILE **)(this + 0x20)" * (cast_expression "(FILE **)(this + 0x20)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x20)" ( (binary_expression "this + 0x20" identifier + number_literal) )))) )))) ;) (return_statement "return -(uint)(iVar1 != 0);" return (unary_expression "-(uint)(iVar1 != 0)" - (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )))) ;) (ERROR "}" }))
(translation_unit "int FUN_0021c700(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}\n\n" (function_definition "int FUN_0021c700(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}" primitive_type (function_declarator "FUN_0021c700(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }" if (parenthesized_expression "(param_2 != -1)" ( (binary_expression "param_2 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }" { (expression_statement "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));" (assignment_expression "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20))" identifier = (call_expression "putc(param_2,*(FILE **)(param_1 + 0x20))" identifier (argument_list "(param_2,*(FILE **)(param_1 + 0x20))" ( identifier , (pointer_expression "*(FILE **)(param_1 + 0x20)" * (cast_expression "(FILE **)(param_1 + 0x20)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = fflush(*(FILE **)(param_1 + 0x20));" (assignment_expression "iVar1 = fflush(*(FILE **)(param_1 + 0x20))" identifier = (call_expression "fflush(*(FILE **)(param_1 + 0x20))" identifier (argument_list "(*(FILE **)(param_1 + 0x20))" ( (pointer_expression "*(FILE **)(param_1 + 0x20)" * (cast_expression "(FILE **)(param_1 + 0x20)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) )))) ;) (return_statement "return -(uint)(iVar1 != 0);" return (unary_expression "-(uint)(iVar1 != 0)" - (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (return_statement return (unary_expression - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT != LIT) )))) ;) })))
(function_definition "int FUN_0021c700(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}" (primitive_type "int") (function_declarator "FUN_0021c700(int param_1,int param_2)" (identifier "FUN_0021c700") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x20));\n  return -(uint)(iVar1 != 0);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(param_2 != -1)" (( "(") (binary_expression "param_2 != -1" (identifier "param_2") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));\n    return iVar1;\n  }" ({ "{") (expression_statement "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));" (assignment_expression "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20))" (identifier "iVar1") (= "=") (call_expression "putc(param_2,*(FILE **)(param_1 + 0x20))" (identifier "putc") (argument_list "(param_2,*(FILE **)(param_1 + 0x20))" (( "(") (identifier "param_2") (, ",") (pointer_expression "*(FILE **)(param_1 + 0x20)" (* "*") (cast_expression "(FILE **)(param_1 + 0x20)" (( "(") (type_descriptor "FILE **" (type_identifier "FILE") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")")))) () ")")))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "iVar1 = fflush(*(FILE **)(param_1 + 0x20));" (assignment_expression "iVar1 = fflush(*(FILE **)(param_1 + 0x20))" (identifier "iVar1") (= "=") (call_expression "fflush(*(FILE **)(param_1 + 0x20))" (identifier "fflush") (argument_list "(*(FILE **)(param_1 + 0x20))" (( "(") (pointer_expression "*(FILE **)(param_1 + 0x20)" (* "*") (cast_expression "(FILE **)(param_1 + 0x20)" (( "(") (type_descriptor "FILE **" (type_identifier "FILE") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")")))) () ")")))) (; ";")) (return_statement "return -(uint)(iVar1 != 0);" (return "return") (unary_expression "-(uint)(iVar1 != 0)" (- "-") (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* stdio_sync_filebuf<char, std::char_traits<char> >::overflow(int) */

int __thiscall
stdio_sync_filebuf<char,std::char_traits<char>>::overflow
          (stdio_sync_filebuf<char,std::char_traits<char>> *var_3,int var_1)

{
  int var_5;
  
  if (var_1 != -1) {
    var_5 = var_2(var_1,*(type_1 **)(var_3 + 0x20));
    return var_5;
  }
  var_5 = var_4(*(type_1 **)(var_3 + 0x20));
  return -(uint)(var_5 != 0);
}


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

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

int MASKED(int param_1,int param_2)

{
  int iVar1;
  
  if (param_2 != -1) {
    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x20));
    return iVar1;
  }
  iVar1 = fflush(*(FILE **)(param_1 + 0x20));
  return -(uint)(iVar1 != 0);
}

