Function at 0x403729
Capabilities:
Get common file path

Disassembly:
mov eax, 0x40e2be
call fcn.0040db00
sub esp, 0x214
push ebx
push esi
mov esi, ecx
push edi
lea eax, [esi + 8]
push eax
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esi + 0x28]
test ecx, ecx
je 0x40375d
mov eax, dword [ecx]
push 1
call dword [eax + 4]
and dword [esi + 0x28], 0
mov edi, 0x414c70
lea ebx, [esi + 0x3c]
push edi
call sub.MSVCRT.dll_strlen
pop ecx
push eax
push edi
mov ecx, ebx
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov eax, dword [esi + 4]
sub eax, 0
je 0x4037a1
dec eax
je 0x40378a
dec eax
jne 0x4038dc
jmp 0x4037e7
mov edi, dword [sym.imp.MSVCP60.dll_bool___cdecl_std::operator_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___char_const__]
lea eax, [esi + 0x2c]
push str.debugstring
push eax
call edi
pop ecx
test al, al
pop ecx
je 0x4037bc
push 4
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
je 0x4038d7
mov dword [eax], 0x40f368
jmp 0x4038d9
lea eax, [esi + 0x2c]
push str.null
push eax
call edi
pop ecx
test al, al
pop ecx
je 0x4037d6
and dword [esi + 0x28], 0
jmp 0x4038dc
lea eax, [esi + 0x2c]
push str.stdout
push eax
call edi
pop ecx
test al, al
pop ecx
je 0x40380d
push 4
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
pop ecx
test edi, edi
je 0x403803
mov dword [edi], 0x40f360
call dword [sym.imp.KERNEL32.dll_AllocConsole]
jmp 0x403805
xor edi, edi
mov dword [esi + 0x28], edi
jmp 0x4038dc
lea eax, [esi + 0x2c]
push str.random
push eax
call edi
pop ecx
test al, al
pop ecx
je 0x40387d
lea eax, [ebp - 0x220]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp - 0x11c]
push eax
push 0
lea eax, [ebp - 0x220]
push 0x413678
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea eax, [ebp - 0x11c]
push str..log
push eax
call sub.MSVCRT.dll_strcat
lea eax, [ebp - 0x11c]
push eax
call sub.MSVCRT.dll_strlen
add esp, 0xc
mov ecx, ebx
push eax
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
jmp 0x403892
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ecx, ebx
push dword [eax]
lea eax, [esi + 0x2c]
push 0
push eax
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
push 8
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
pop ecx
mov dword [ebp - 0x10], eax
and dword [ebp - 4], 0
test eax, eax
je 0x4038d7
mov al, byte [ebx]
sub esp, 0x10
mov edi, esp
mov dword [ebp - 0x18], esp
push 0
mov ecx, edi
mov byte [edi], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ecx, edi
push dword [eax]
push 0
push ebx
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov ecx, dword [ebp - 0x10]
call fcn.00403958
jmp 0x4038d9
xor eax, eax
mov dword [esi + 0x28], eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret