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

size_t scrub_from_string(char *buf,size_t buflen)

{
  uint __n;
  char *pcVar1;
  
  __n = (int)scrub_string_end - (int)scrub_string;
  if (buflen < (uint)((int)scrub_string_end - (int)scrub_string)) {
    __n = buflen;
  }
  pcVar1 = scrub_string + __n;
  memcpy(buf,scrub_string,__n);
  scrub_string = pcVar1;
  return __n;
}



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

size_t FUN_0002c860(void *param_1,uint param_2)

{
  uint __n;
  int iVar1;
  
  __n = DAT_00088c3c - (int)DAT_00088c40;
  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {
    __n = param_2;
  }
  iVar1 = (int)DAT_00088c40 + __n;
  memcpy(param_1,DAT_00088c40,__n);
  DAT_00088c40 = (void *)iVar1;
  return __n;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EAX,dword ptr [ESP + 0x14]
CALL 0x00016000
ADD EBX,0x53794
MOV EDI,dword ptr [EBX + 0x8c40]
MOV ESI,dword ptr [EBX + 0x8c3c]
SUB ESI,EDI
CMP ESI,EAX
CMOVA ESI,EAX
SUB ESP,0x4
PUSH ESI
PUSH EDI
ADD EDI,ESI
PUSH dword ptr [ESP + 0x1c]
CALL 0x000140f0
ADD ESP,0x10
MOV dword ptr [EBX + 0x8c40],EDI
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsize_t FUN_0002c860(void *param_1,uint param_2)\n\n{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}\n\n" comment (function_definition "size_t FUN_0002c860(void *param_1,uint param_2)\n\n{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}" primitive_type (function_declarator "FUN_0002c860(void *param_1,uint param_2)" identifier (parameter_list "(void *param_1,uint param_2)" ( (parameter_declaration "void *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}" { (declaration "uint __n;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "__n = DAT_00088c3c - (int)DAT_00088c40;" (assignment_expression "__n = DAT_00088c3c - (int)DAT_00088c40" identifier = (binary_expression "DAT_00088c3c - (int)DAT_00088c40" identifier - (cast_expression "(int)DAT_00088c40" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }" if (parenthesized_expression "(param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40))" ( (binary_expression "param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)" identifier < (call_expression "(uint)(DAT_00088c3c - (int)DAT_00088c40)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(DAT_00088c3c - (int)DAT_00088c40)" ( (binary_expression "DAT_00088c3c - (int)DAT_00088c40" identifier - (cast_expression "(int)DAT_00088c40" ( (type_descriptor "int" primitive_type) ) identifier)) )))) )) (compound_statement "{\n    __n = param_2;\n  }" { (expression_statement "__n = param_2;" (assignment_expression "__n = param_2" identifier = identifier) ;) })) (expression_statement "iVar1 = (int)DAT_00088c40 + __n;" (assignment_expression "iVar1 = (int)DAT_00088c40 + __n" identifier = (binary_expression "(int)DAT_00088c40 + __n" (cast_expression "(int)DAT_00088c40" ( (type_descriptor "int" primitive_type) ) identifier) + identifier)) ;) (expression_statement "memcpy(param_1,DAT_00088c40,__n);" (call_expression "memcpy(param_1,DAT_00088c40,__n)" identifier (argument_list "(param_1,DAT_00088c40,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "DAT_00088c40 = (void *)iVar1;" (assignment_expression "DAT_00088c40 = (void *)iVar1" identifier = (cast_expression "(void *)iVar1" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) (return_statement "return __n;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nsize_t scrub_from_string(char *buf,size_t buflen)\n\n{\n  uint __n;\n  char *pcVar1;\n  \n  __n = (int)scrub_string_end - (int)scrub_string;\n  if (buflen < (uint)((int)scrub_string_end - (int)scrub_string)) {\n    __n = buflen;\n  }\n  pcVar1 = scrub_string + __n;\n  memcpy(buf,scrub_string,__n);\n  scrub_string = pcVar1;\n  return __n;\n}\n\n" comment comment (function_definition "size_t scrub_from_string(char *buf,size_t buflen)\n\n{\n  uint __n;\n  char *pcVar1;\n  \n  __n = (int)scrub_string_end - (int)scrub_string;\n  if (buflen < (uint)((int)scrub_string_end - (int)scrub_string)) {\n    __n = buflen;\n  }\n  pcVar1 = scrub_string + __n;\n  memcpy(buf,scrub_string,__n);\n  scrub_string = pcVar1;\n  return __n;\n}" primitive_type (function_declarator "scrub_from_string(char *buf,size_t buflen)" identifier (parameter_list "(char *buf,size_t buflen)" ( (parameter_declaration "char *buf" primitive_type (pointer_declarator "*buf" * identifier)) , (parameter_declaration "size_t buflen" primitive_type identifier) ))) (compound_statement "{\n  uint __n;\n  char *pcVar1;\n  \n  __n = (int)scrub_string_end - (int)scrub_string;\n  if (buflen < (uint)((int)scrub_string_end - (int)scrub_string)) {\n    __n = buflen;\n  }\n  pcVar1 = scrub_string + __n;\n  memcpy(buf,scrub_string,__n);\n  scrub_string = pcVar1;\n  return __n;\n}" { (declaration "uint __n;" type_identifier identifier ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (expression_statement "__n = (int)scrub_string_end - (int)scrub_string;" (assignment_expression "__n = (int)scrub_string_end - (int)scrub_string" identifier = (binary_expression "(int)scrub_string_end - (int)scrub_string" (cast_expression "(int)scrub_string_end" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)scrub_string" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (buflen < (uint)((int)scrub_string_end - (int)scrub_string)) {\n    __n = buflen;\n  }" if (parenthesized_expression "(buflen < (uint)((int)scrub_string_end - (int)scrub_string))" ( (binary_expression "buflen < (uint)((int)scrub_string_end - (int)scrub_string)" identifier < (call_expression "(uint)((int)scrub_string_end - (int)scrub_string)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)scrub_string_end - (int)scrub_string)" ( (binary_expression "(int)scrub_string_end - (int)scrub_string" (cast_expression "(int)scrub_string_end" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)scrub_string" ( (type_descriptor "int" primitive_type) ) identifier)) )))) )) (compound_statement "{\n    __n = buflen;\n  }" { (expression_statement "__n = buflen;" (assignment_expression "__n = buflen" identifier = identifier) ;) })) (expression_statement "pcVar1 = scrub_string + __n;" (assignment_expression "pcVar1 = scrub_string + __n" identifier = (binary_expression "scrub_string + __n" identifier + identifier)) ;) (expression_statement "memcpy(buf,scrub_string,__n);" (call_expression "memcpy(buf,scrub_string,__n)" identifier (argument_list "(buf,scrub_string,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "scrub_string = pcVar1;" (assignment_expression "scrub_string = pcVar1" identifier = identifier) ;) (return_statement "return __n;" return identifier ;) })))
(translation_unit "size_t FUN_0002c860(void *param_1,uint param_2)\n\n{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}\n\n" (function_definition "size_t FUN_0002c860(void *param_1,uint param_2)\n\n{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}" primitive_type (function_declarator "FUN_0002c860(void *param_1,uint param_2)" identifier (parameter_list "(void *param_1,uint param_2)" ( (parameter_declaration "void *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}" { (declaration "uint __n;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "__n = DAT_00088c3c - (int)DAT_00088c40;" (assignment_expression "__n = DAT_00088c3c - (int)DAT_00088c40" identifier = (binary_expression "DAT_00088c3c - (int)DAT_00088c40" identifier - (cast_expression "(int)DAT_00088c40" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }" if (parenthesized_expression "(param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40))" ( (binary_expression "param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)" identifier < (call_expression "(uint)(DAT_00088c3c - (int)DAT_00088c40)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(DAT_00088c3c - (int)DAT_00088c40)" ( (binary_expression "DAT_00088c3c - (int)DAT_00088c40" identifier - (cast_expression "(int)DAT_00088c40" ( (type_descriptor "int" primitive_type) ) identifier)) )))) )) (compound_statement "{\n    __n = param_2;\n  }" { (expression_statement "__n = param_2;" (assignment_expression "__n = param_2" identifier = identifier) ;) })) (expression_statement "iVar1 = (int)DAT_00088c40 + __n;" (assignment_expression "iVar1 = (int)DAT_00088c40 + __n" identifier = (binary_expression "(int)DAT_00088c40 + __n" (cast_expression "(int)DAT_00088c40" ( (type_descriptor "int" primitive_type) ) identifier) + identifier)) ;) (expression_statement "memcpy(param_1,DAT_00088c40,__n);" (call_expression "memcpy(param_1,DAT_00088c40,__n)" identifier (argument_list "(param_1,DAT_00088c40,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "DAT_00088c40 = (void *)iVar1;" (assignment_expression "DAT_00088c40 = (void *)iVar1" identifier = (cast_expression "(void *)iVar1" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) (return_statement "return __n;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) )))) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) ;) (return_statement return IDENT ;) })))
(function_definition "size_t FUN_0002c860(void *param_1,uint param_2)\n\n{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}" (primitive_type "size_t") (function_declarator "FUN_0002c860(void *param_1,uint param_2)" (identifier "FUN_0002c860") (parameter_list "(void *param_1,uint param_2)" (( "(") (parameter_declaration "void *param_1" (primitive_type "void") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  uint __n;\n  int iVar1;\n  \n  __n = DAT_00088c3c - (int)DAT_00088c40;\n  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }\n  iVar1 = (int)DAT_00088c40 + __n;\n  memcpy(param_1,DAT_00088c40,__n);\n  DAT_00088c40 = (void *)iVar1;\n  return __n;\n}" ({ "{") (declaration "uint __n;" (type_identifier "uint") (identifier "__n") (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (expression_statement "__n = DAT_00088c3c - (int)DAT_00088c40;" (assignment_expression "__n = DAT_00088c3c - (int)DAT_00088c40" (identifier "__n") (= "=") (binary_expression "DAT_00088c3c - (int)DAT_00088c40" (identifier "DAT_00088c3c") (- "-") (cast_expression "(int)DAT_00088c40" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "DAT_00088c40")))) (; ";")) (if_statement "if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {\n    __n = param_2;\n  }" (if "if") (parenthesized_expression "(param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40))" (( "(") (binary_expression "param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)" (identifier "param_2") (< "<") (call_expression "(uint)(DAT_00088c3c - (int)DAT_00088c40)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(DAT_00088c3c - (int)DAT_00088c40)" (( "(") (binary_expression "DAT_00088c3c - (int)DAT_00088c40" (identifier "DAT_00088c3c") (- "-") (cast_expression "(int)DAT_00088c40" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "DAT_00088c40"))) () ")")))) () ")")) (compound_statement "{\n    __n = param_2;\n  }" ({ "{") (expression_statement "__n = param_2;" (assignment_expression "__n = param_2" (identifier "__n") (= "=") (identifier "param_2")) (; ";")) (} "}"))) (expression_statement "iVar1 = (int)DAT_00088c40 + __n;" (assignment_expression "iVar1 = (int)DAT_00088c40 + __n" (identifier "iVar1") (= "=") (binary_expression "(int)DAT_00088c40 + __n" (cast_expression "(int)DAT_00088c40" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "DAT_00088c40")) (+ "+") (identifier "__n"))) (; ";")) (expression_statement "memcpy(param_1,DAT_00088c40,__n);" (call_expression "memcpy(param_1,DAT_00088c40,__n)" (identifier "memcpy") (argument_list "(param_1,DAT_00088c40,__n)" (( "(") (identifier "param_1") (, ",") (identifier "DAT_00088c40") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "DAT_00088c40 = (void *)iVar1;" (assignment_expression "DAT_00088c40 = (void *)iVar1" (identifier "DAT_00088c40") (= "=") (cast_expression "(void *)iVar1" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "iVar1"))) (; ";")) (return_statement "return __n;" (return "return") (identifier "__n") (; ";")) (} "}")))

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

size_t function_1(char *buf,size_t var_1)

{
  type_1 var_3;
  char *pcVar1;
  
  var_3 = (int)scrub_string_end - (int)var_2;
  if (var_1 < (type_1)((int)scrub_string_end - (int)var_2)) {
    var_3 = var_1;
  }
  pcVar1 = var_2 + var_3;
  var_4(buf,var_2,var_3);
  var_2 = pcVar1;
  return var_3;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier)))) (return_statement (identifier)))))

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

size_t MASKED(void *param_1,uint param_2)

{
  uint __n;
  int iVar1;
  
  __n = DAT_00088c3c - (int)DAT_00088c40;
  if (param_2 < (uint)(DAT_00088c3c - (int)DAT_00088c40)) {
    __n = param_2;
  }
  iVar1 = (int)DAT_00088c40 + __n;
  memcpy(param_1,DAT_00088c40,__n);
  DAT_00088c40 = (void *)iVar1;
  return __n;
}

