Function at 0x40fb50
Capabilities:
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc00
cmp word [0x42ef30], 0
jne 0x40fd92
push esi
push edi
call fcn.00407cd0
test al, al
mov esi, dword [ebp + 8]
mov edi, dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
jne 0x40fbb1
lea eax, [ebp - 0x800]
push eax
push 0
push 0
push 0x23
push 0
call edi
test eax, eax
jl 0x40fd9b
push esi
lea ecx, [ebp - 0x800]
push 0x400
push ecx
call fcn.0040f9e0
add esp, 0xc
test al, al
jne 0x40fd1c
lea ecx, [ebp - 0x800]
push ecx
push 0
push 0
push 0x1c
push 0
call edi
test eax, eax
jl 0x40fdb3
push esi
lea edx, [ebp - 0x800]
push 0x400
push edx
call fcn.0040f9e0
add esp, 0xc
test al, al
jne 0x40fd1c
lea ecx, [ebp - 0x800]
push ecx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x40fdcb
push esi
lea edx, [ebp - 0x800]
push 0x400
push edx
call fcn.0040f9e0
add esp, 0xc
test al, al
jne 0x40fc37
xor eax, eax
lea esp, [esp]
movzx ecx, word [eax + 0x4240b4]
mov word [ebp + eax - 0x800], cx
add eax, 2
test cx, cx
jne 0x40fc20
push 0x3fe
lea ecx, [ebp - 0xbfe]
push 0
push ecx
mov word [ebp - 0xc00], 0
call sub.MSVCR80.dll_memset
lea edx, [ebp - 0xc00]
push 0x200
push edx
call sym.Bentley.lictransmit.exe_public:_static_wchar_t____cdecl_Bentley::SelectServer::Client::HostInfo::GetShortUserName_wchar_t___unsigned_int_
add esp, 0x14
cmp word [ebp - 0xc00], 0
lea esi, [ebp - 0xc00]
je 0x40fca0
mov edi, dword [sym.imp.MSVCR80.dll_wcschr]
lea ecx, [ecx]
movzx eax, word [esi]
push eax
push str._:_____t_n_.
call edi
add esp, 8
test eax, eax
je 0x40fc97
mov word [esi], 0x5f
add esi, 2
cmp word [esi], 0
jne 0x40fc80
lea eax, [ebp - 0x800]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40fcb0
sub eax, edx
sar eax, 1
mov ecx, 0x400
sub ecx, eax
push ecx
lea edx, [ebp - 0xc00]
push edx
lea eax, [ebp - 0x800]
push eax
call dword [sym.imp.MSVCR80.dll_wcsncat]
lea ecx, [ebp - 0x800]
push ecx
mov word [ebp - 2], 0
call dword [sym.imp.MSVCR80.dll__wmkdir]
add esp, 0x10
test eax, eax
je 0x40fd1c
call dword [sym.imp.MSVCR80.dll__errno]
cmp dword [eax], 0x11
je 0x40fd1c
call fcn.004044f0
mov edx, dword [eax]
mov edx, dword [edx + 0x28]
lea ecx, [ebp - 0x800]
push ecx
push str.Unable_to_create_dir__s
push eax
call edx
add esp, 0xc
call fcn.004044f0
mov ecx, dword [eax]
lea edx, [ebp - 0x800]
push edx
push str.found_log_dir__s
push eax
mov eax, dword [ecx + 0x38]
call eax
add esp, 0xc
lea eax, [ebp - 0x800]
pop edi
lea edx, [eax + 2]
pop esi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40fd43
sub eax, edx
sar eax, 1
add eax, 1
cmp eax, 0x105
jbe 0x40fd78
call fcn.004044f0
mov ecx, dword [eax]
lea edx, [ebp - 0x800]
push edx
push str.Log_path_name_is_too_long__s
push eax
mov eax, dword [ecx + 0x28]
call eax
add esp, 0xc
push 0x105
lea ecx, [ebp - 0x800]
push ecx
push 0x42ef30
call dword [sym.imp.MSVCR80.dll_wcsncpy]
add esp, 0xc
mov eax, 0x42ef30
mov esp, ebp
pop ebp
ret
call fcn.004044f0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
push str.Could_not_open_common_appdata
call eax
jmp 0x40fbb1
call fcn.004044f0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x34]
push str.Could_not_open_user_appdata
call eax
jmp 0x40fbe7
call fcn.004044f0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0x24]
push str.No_temp_directory_found
call eax
jmp 0x40fc1a