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

char * psftp_getcwd(void)

{
  char *pcVar1;
  int *piVar2;
  char *pcVar3;
  size_t __size;
  
  __size = 0x100;
  pcVar1 = (char *)safemalloc(0x100,1);
  while( true ) {
    pcVar3 = getcwd(pcVar1,__size);
    if (pcVar3 != (char *)0x0) {
      return pcVar3;
    }
    piVar2 = __errno_location();
    if (*piVar2 != 0x22) break;
    __size = (int)(__size * 3) >> 1;
    pcVar1 = (char *)saferealloc(pcVar1,__size,1);
  }
  safefree(pcVar1);
  pcVar1 = strerror(*piVar2);
  pcVar1 = dupprintf("[cwd unavailable: %s]",pcVar1);
  return pcVar1;
}



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

void FUN_0006a370(void)

{
  char *pcVar1;
  int *piVar2;
  char *pcVar3;
  size_t __size;
  
  __size = 0x100;
  pcVar1 = (char *)FUN_0001a9b0(0x100,1);
  while( true ) {
    pcVar3 = getcwd(pcVar1,__size);
    if (pcVar3 != (char *)0x0) {
      return;
    }
    piVar2 = __errno_location();
    if (*piVar2 != 0x22) break;
    __size = (int)(__size * 3) >> 1;
    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);
  }
  FUN_0001b240(pcVar1);
  pcVar1 = strerror(*piVar2);
  FUN_0001b020("[cwd unavailable: %s]",pcVar1);
  return;
}


PUSH EDI
PUSH ESI
MOV ESI,0x100
PUSH EBX
CALL 0x00014970
ADD EBX,0x3fa13
SUB ESP,0x18
PUSH 0x1
PUSH 0x100
CALL 0x0001a9b0
ADD ESP,0x10
MOV EDI,EAX
JMP 0x0006a3c0
CALL 0x00014550
CMP dword ptr [EAX],0x22
JNZ 0x0006a3e0
LEA ESI,[ESI + ESI*0x2]
SUB ESP,0x4
SAR ESI,0x1
PUSH 0x1
PUSH ESI
PUSH EDI
CALL 0x0001adb0
ADD ESP,0x10
MOV EDI,EAX
SUB ESP,0x8
PUSH ESI
PUSH EDI
CALL 0x00014460
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0006a3a0
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
MOV dword ptr [ESP + 0xc],EAX
SUB ESP,0xc
PUSH EDI
CALL 0x0001b240
POP EAX
MOV EAX,dword ptr [ESP + 0x18]
PUSH dword ptr [EAX]
CALL 0x00014390
POP EDX
POP ECX
PUSH EAX
LEA EAX,[EBX + 0xfffd7e23]
PUSH EAX
CALL 0x0001b020
ADD ESP,0x10
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0006a370(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}\n\n" comment (function_definition "void FUN_0006a370(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}" primitive_type (function_declarator "FUN_0006a370(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t __size;" primitive_type identifier ;) (expression_statement "__size = 0x100;" (assignment_expression "__size = 0x100" identifier = number_literal) ;) (expression_statement "pcVar1 = (char *)FUN_0001a9b0(0x100,1);" (assignment_expression "pcVar1 = (char *)FUN_0001a9b0(0x100,1)" identifier = (cast_expression "(char *)FUN_0001a9b0(0x100,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001a9b0(0x100,1)" identifier (argument_list "(0x100,1)" ( number_literal , number_literal ))))) ;) (while_statement "while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }" { (expression_statement "pcVar3 = getcwd(pcVar1,__size);" (assignment_expression "pcVar3 = getcwd(pcVar1,__size)" identifier = (call_expression "getcwd(pcVar1,__size)" identifier (argument_list "(pcVar1,__size)" ( identifier , identifier )))) ;) (if_statement "if (pcVar3 != (char *)0x0) {\n      return;\n    }" if (parenthesized_expression "(pcVar3 != (char *)0x0)" ( (binary_expression "pcVar3 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 0x22) break;" if (parenthesized_expression "(*piVar2 != 0x22)" ( (binary_expression "*piVar2 != 0x22" (pointer_expression "*piVar2" * identifier) != number_literal) )) (break_statement "break;" break ;)) (expression_statement "__size = (int)(__size * 3) >> 1;" (assignment_expression "__size = (int)(__size * 3) >> 1" identifier = (binary_expression "(int)(__size * 3) >> 1" (cast_expression "(int)(__size * 3)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(__size * 3)" ( (binary_expression "__size * 3" identifier * number_literal) ))) >> number_literal)) ;) (expression_statement "pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);" (assignment_expression "pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1)" identifier = (cast_expression "(char *)FUN_0001adb0(pcVar1,__size,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001adb0(pcVar1,__size,1)" identifier (argument_list "(pcVar1,__size,1)" ( identifier , identifier , number_literal ))))) ;) })) (expression_statement "FUN_0001b240(pcVar1);" (call_expression "FUN_0001b240(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pcVar1 = strerror(*piVar2);" (assignment_expression "pcVar1 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "FUN_0001b020("[cwd unavailable: %s]",pcVar1);" (call_expression "FUN_0001b020("[cwd unavailable: %s]",pcVar1)" identifier (argument_list "("[cwd unavailable: %s]",pcVar1)" ( (string_literal ""[cwd unavailable: %s]"" " string_content ") , identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * psftp_getcwd(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)safemalloc(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return pcVar3;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)saferealloc(pcVar1,__size,1);\n  }\n  safefree(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  pcVar1 = dupprintf("[cwd unavailable: %s]",pcVar1);\n  return pcVar1;\n}\n\n" comment comment (function_definition "char * psftp_getcwd(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)safemalloc(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return pcVar3;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)saferealloc(pcVar1,__size,1);\n  }\n  safefree(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  pcVar1 = dupprintf("[cwd unavailable: %s]",pcVar1);\n  return pcVar1;\n}" primitive_type (pointer_declarator "* psftp_getcwd(void)" * (function_declarator "psftp_getcwd(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) )))) (compound_statement "{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)safemalloc(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return pcVar3;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)saferealloc(pcVar1,__size,1);\n  }\n  safefree(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  pcVar1 = dupprintf("[cwd unavailable: %s]",pcVar1);\n  return pcVar1;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t __size;" primitive_type identifier ;) (expression_statement "__size = 0x100;" (assignment_expression "__size = 0x100" identifier = number_literal) ;) (expression_statement "pcVar1 = (char *)safemalloc(0x100,1);" (assignment_expression "pcVar1 = (char *)safemalloc(0x100,1)" identifier = (cast_expression "(char *)safemalloc(0x100,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(0x100,1)" identifier (argument_list "(0x100,1)" ( number_literal , number_literal ))))) ;) (while_statement "while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return pcVar3;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)saferealloc(pcVar1,__size,1);\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return pcVar3;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)saferealloc(pcVar1,__size,1);\n  }" { (expression_statement "pcVar3 = getcwd(pcVar1,__size);" (assignment_expression "pcVar3 = getcwd(pcVar1,__size)" identifier = (call_expression "getcwd(pcVar1,__size)" identifier (argument_list "(pcVar1,__size)" ( identifier , identifier )))) ;) (if_statement "if (pcVar3 != (char *)0x0) {\n      return pcVar3;\n    }" if (parenthesized_expression "(pcVar3 != (char *)0x0)" ( (binary_expression "pcVar3 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return pcVar3;\n    }" { (return_statement "return pcVar3;" return identifier ;) })) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 0x22) break;" if (parenthesized_expression "(*piVar2 != 0x22)" ( (binary_expression "*piVar2 != 0x22" (pointer_expression "*piVar2" * identifier) != number_literal) )) (break_statement "break;" break ;)) (expression_statement "__size = (int)(__size * 3) >> 1;" (assignment_expression "__size = (int)(__size * 3) >> 1" identifier = (binary_expression "(int)(__size * 3) >> 1" (cast_expression "(int)(__size * 3)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(__size * 3)" ( (binary_expression "__size * 3" identifier * number_literal) ))) >> number_literal)) ;) (expression_statement "pcVar1 = (char *)saferealloc(pcVar1,__size,1);" (assignment_expression "pcVar1 = (char *)saferealloc(pcVar1,__size,1)" identifier = (cast_expression "(char *)saferealloc(pcVar1,__size,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "saferealloc(pcVar1,__size,1)" identifier (argument_list "(pcVar1,__size,1)" ( identifier , identifier , number_literal ))))) ;) })) (expression_statement "safefree(pcVar1);" (call_expression "safefree(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pcVar1 = strerror(*piVar2);" (assignment_expression "pcVar1 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "pcVar1 = dupprintf("[cwd unavailable: %s]",pcVar1);" (assignment_expression "pcVar1 = dupprintf("[cwd unavailable: %s]",pcVar1)" identifier = (call_expression "dupprintf("[cwd unavailable: %s]",pcVar1)" identifier (argument_list "("[cwd unavailable: %s]",pcVar1)" ( (string_literal ""[cwd unavailable: %s]"" " string_content ") , identifier )))) ;) (return_statement "return pcVar1;" return identifier ;) })))
(translation_unit "void FUN_0006a370(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}\n\n" (function_definition "void FUN_0006a370(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}" primitive_type (function_declarator "FUN_0006a370(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "size_t __size;" primitive_type identifier ;) (expression_statement "__size = 0x100;" (assignment_expression "__size = 0x100" identifier = number_literal) ;) (expression_statement "pcVar1 = (char *)FUN_0001a9b0(0x100,1);" (assignment_expression "pcVar1 = (char *)FUN_0001a9b0(0x100,1)" identifier = (cast_expression "(char *)FUN_0001a9b0(0x100,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001a9b0(0x100,1)" identifier (argument_list "(0x100,1)" ( number_literal , number_literal ))))) ;) (while_statement "while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }" { (expression_statement "pcVar3 = getcwd(pcVar1,__size);" (assignment_expression "pcVar3 = getcwd(pcVar1,__size)" identifier = (call_expression "getcwd(pcVar1,__size)" identifier (argument_list "(pcVar1,__size)" ( identifier , identifier )))) ;) (if_statement "if (pcVar3 != (char *)0x0) {\n      return;\n    }" if (parenthesized_expression "(pcVar3 != (char *)0x0)" ( (binary_expression "pcVar3 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return;\n    }" { (return_statement "return;" return ;) })) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 != 0x22) break;" if (parenthesized_expression "(*piVar2 != 0x22)" ( (binary_expression "*piVar2 != 0x22" (pointer_expression "*piVar2" * identifier) != number_literal) )) (break_statement "break;" break ;)) (expression_statement "__size = (int)(__size * 3) >> 1;" (assignment_expression "__size = (int)(__size * 3) >> 1" identifier = (binary_expression "(int)(__size * 3) >> 1" (cast_expression "(int)(__size * 3)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(__size * 3)" ( (binary_expression "__size * 3" identifier * number_literal) ))) >> number_literal)) ;) (expression_statement "pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);" (assignment_expression "pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1)" identifier = (cast_expression "(char *)FUN_0001adb0(pcVar1,__size,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001adb0(pcVar1,__size,1)" identifier (argument_list "(pcVar1,__size,1)" ( identifier , identifier , number_literal ))))) ;) })) (expression_statement "FUN_0001b240(pcVar1);" (call_expression "FUN_0001b240(pcVar1)" identifier (argument_list "(pcVar1)" ( identifier ))) ;) (expression_statement "pcVar1 = strerror(*piVar2);" (assignment_expression "pcVar1 = strerror(*piVar2)" identifier = (call_expression "strerror(*piVar2)" identifier (argument_list "(*piVar2)" ( (pointer_expression "*piVar2" * identifier) )))) ;) (expression_statement "FUN_0001b020("[cwd unavailable: %s]",pcVar1);" (call_expression "FUN_0001b020("[cwd unavailable: %s]",pcVar1)" identifier (argument_list "("[cwd unavailable: %s]",pcVar1)" ( (string_literal ""[cwd unavailable: %s]"" " string_content ") , identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT * LIT) ))) >> LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT ))) ;) (return_statement return ;) })))
(function_definition "void FUN_0006a370(void)\n\n{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0006a370(void)" (identifier "FUN_0006a370") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  char *pcVar1;\n  int *piVar2;\n  char *pcVar3;\n  size_t __size;\n  \n  __size = 0x100;\n  pcVar1 = (char *)FUN_0001a9b0(0x100,1);\n  while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }\n  FUN_0001b240(pcVar1);\n  pcVar1 = strerror(*piVar2);\n  FUN_0001b020("[cwd unavailable: %s]",pcVar1);\n  return;\n}" ({ "{") (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "size_t __size;" (primitive_type "size_t") (identifier "__size") (; ";")) (expression_statement "__size = 0x100;" (assignment_expression "__size = 0x100" (identifier "__size") (= "=") (number_literal "0x100")) (; ";")) (expression_statement "pcVar1 = (char *)FUN_0001a9b0(0x100,1);" (assignment_expression "pcVar1 = (char *)FUN_0001a9b0(0x100,1)" (identifier "pcVar1") (= "=") (cast_expression "(char *)FUN_0001a9b0(0x100,1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001a9b0(0x100,1)" (identifier "FUN_0001a9b0") (argument_list "(0x100,1)" (( "(") (number_literal "0x100") (, ",") (number_literal "1") () ")"))))) (; ";")) (while_statement "while( true ) {\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    pcVar3 = getcwd(pcVar1,__size);\n    if (pcVar3 != (char *)0x0) {\n      return;\n    }\n    piVar2 = __errno_location();\n    if (*piVar2 != 0x22) break;\n    __size = (int)(__size * 3) >> 1;\n    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);\n  }" ({ "{") (expression_statement "pcVar3 = getcwd(pcVar1,__size);" (assignment_expression "pcVar3 = getcwd(pcVar1,__size)" (identifier "pcVar3") (= "=") (call_expression "getcwd(pcVar1,__size)" (identifier "getcwd") (argument_list "(pcVar1,__size)" (( "(") (identifier "pcVar1") (, ",") (identifier "__size") () ")")))) (; ";")) (if_statement "if (pcVar3 != (char *)0x0) {\n      return;\n    }" (if "if") (parenthesized_expression "(pcVar3 != (char *)0x0)" (( "(") (binary_expression "pcVar3 != (char *)0x0" (identifier "pcVar3") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return;\n    }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar2 != 0x22) break;" (if "if") (parenthesized_expression "(*piVar2 != 0x22)" (( "(") (binary_expression "*piVar2 != 0x22" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (!= "!=") (number_literal "0x22")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "__size = (int)(__size * 3) >> 1;" (assignment_expression "__size = (int)(__size * 3) >> 1" (identifier "__size") (= "=") (binary_expression "(int)(__size * 3) >> 1" (cast_expression "(int)(__size * 3)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(__size * 3)" (( "(") (binary_expression "__size * 3" (identifier "__size") (* "*") (number_literal "3")) () ")"))) (>> ">>") (number_literal "1"))) (; ";")) (expression_statement "pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);" (assignment_expression "pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1)" (identifier "pcVar1") (= "=") (cast_expression "(char *)FUN_0001adb0(pcVar1,__size,1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001adb0(pcVar1,__size,1)" (identifier "FUN_0001adb0") (argument_list "(pcVar1,__size,1)" (( "(") (identifier "pcVar1") (, ",") (identifier "__size") (, ",") (number_literal "1") () ")"))))) (; ";")) (} "}"))) (expression_statement "FUN_0001b240(pcVar1);" (call_expression "FUN_0001b240(pcVar1)" (identifier "FUN_0001b240") (argument_list "(pcVar1)" (( "(") (identifier "pcVar1") () ")"))) (; ";")) (expression_statement "pcVar1 = strerror(*piVar2);" (assignment_expression "pcVar1 = strerror(*piVar2)" (identifier "pcVar1") (= "=") (call_expression "strerror(*piVar2)" (identifier "strerror") (argument_list "(*piVar2)" (( "(") (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) () ")")))) (; ";")) (expression_statement "FUN_0001b020("[cwd unavailable: %s]",pcVar1);" (call_expression "FUN_0001b020("[cwd unavailable: %s]",pcVar1)" (identifier "FUN_0001b020") (argument_list "("[cwd unavailable: %s]",pcVar1)" (( "(") (string_literal ""[cwd unavailable: %s]"" (" """) (string_content "[cwd unavailable: %s]") (" """)) (, ",") (identifier "pcVar1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

char * function_1(void)

{
  char *pcVar1;
  int *piVar2;
  char *var_3;
  size_t var_5;
  
  var_5 = 0x100;
  pcVar1 = (char *)var_1(0x100,1);
  while( true ) {
    var_3 = var_2(pcVar1,var_5);
    if (var_3 != (char *)0x0) {
      return var_3;
    }
    piVar2 = var_4();
    if (*piVar2 != 0x22) break;
    var_5 = (int)(var_5 * 3) >> 1;
    pcVar1 = (char *)var_6(pcVar1,var_5,1);
  }
  var_7(pcVar1);
  pcVar1 = var_8(*piVar2);
  pcVar1 = var_9("[cwd unavailable: %s]",pcVar1);
  return pcVar1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_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)))))) (while_statement condition: (parenthesized_expression (true)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) 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 (identifier) (identifier) (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (identifier)))) (return_statement))))

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

void MASKED(void)

{
  char *pcVar1;
  int *piVar2;
  char *pcVar3;
  size_t __size;
  
  __size = 0x100;
  pcVar1 = (char *)FUN_0001a9b0(0x100,1);
  while( true ) {
    pcVar3 = getcwd(pcVar1,__size);
    if (pcVar3 != (char *)0x0) {
      return;
    }
    piVar2 = __errno_location();
    if (*piVar2 != 0x22) break;
    __size = (int)(__size * 3) >> 1;
    pcVar1 = (char *)FUN_0001adb0(pcVar1,__size,1);
  }
  FUN_0001b240(pcVar1);
  pcVar1 = strerror(*piVar2);
  FUN_0001b020("[cwd unavailable: %s]",pcVar1);
  return;
}

