Function at 0x10040850
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1005152b
mov eax, dword fs:[0]
push eax
sub esp, 0x71c
mov eax, dword [0x1006f184]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ecx, 0x1007086c
call fcn.10012640
xor ebx, ebx
push 0x206
lea ecx, [ebp - 0x31e]
xor eax, eax
push ebx
push ecx
mov dword [ebp - 4], ebx
mov word [ebp - 0x320], ax
call sub.MSVCR100.dll_memset
add esp, 0xc
call fcn.1003e640
push 0x104
cmp eax, ebx
je 0x10040907
lea edx, [ebp - 0x320]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x100408e3
push str.driversetchosts
lea eax, [ebp - 0x320]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
test eax, eax
jne 0x1004092e
xor eax, eax
lea esp, [ebp - 0x738]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.1004c4fe
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x320]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x100408e3
push str.HOSTS
lea edx, [ebp - 0x320]
push edx
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
test eax, eax
je 0x100408e3
lea eax, [ebp - 0x320]
push 0x10064178
push eax
call dword [sym.imp.MSVCR100.dll__wfopen]
mov edi, eax
add esp, 8
mov dword [ebp - 0x728], edi
cmp edi, ebx
je 0x10040aa6
push edi
call dword [sym.imp.MSVCR100.dll_feof]
add esp, 4
test eax, eax
jne 0x10040a9c
push 0x103
lea ecx, [ebp - 0x117]
push ebx
push ecx
mov byte [ebp - 0x118], bl
call sub.MSVCR100.dll_memset
push edi
lea edx, [ebp - 0x118]
push 0x104
push edx
call dword [sym.imp.MSVCR100.dll_fgets]
push 0x3fe
lea ecx, [ebp - 0x71e]
xor eax, eax
push ebx
push ecx
mov word [ebp - 0x720], ax
call sub.MSVCR100.dll_memset
add esp, 0x24
lea edx, [ebp - 0x118]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [eax + 1]
cmp esi, 0x3fffffff
jg 0x10040a04
lea eax, [esi + esi]
call fcn.1004cab0
mov edi, esp
mov dword [ebp - 0x10], esp
cmp edi, ebx
je 0x100409fe
push esi
push edi
push 0xffffffffffffffff
lea ecx, [ebp - 0x118]
push ecx
push ebx
xor eax, eax
push 3
mov word [edi], ax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
neg eax
sbb eax, eax
and eax, edi
mov edi, dword [ebp - 0x728]
jmp 0x10040a06
mov edi, dword [ebp - 0x728]
xor eax, eax
push 0x200
lea edx, [ebp - 0x720]
push edx
push eax
call fcn.100400e0
add esp, 0xc
test eax, eax
je 0x10040953
lea eax, [ebp - 0x720]
push eax
lea ecx, [ebp - 0x724]
mov dword [ebp - 0x724], ebx
call fcn.10010350
mov eax, dword [0x1007086c]
mov edx, dword [eax + 4]
lea esi, [eax + 4]
lea ecx, [ebp - 0x724]
push ecx
push edx
push eax
mov ecx, 0x1007086c
mov byte [ebp - 4], 1
call fcn.10012680
mov ecx, 0x3ffffffe
sub ecx, dword [0x10070870]
cmp ecx, 1
jae 0x10040a78
push str.list_T__too_long
call dword [sym.imp.MSVCP100.dll_void___cdecl_std::_Xlength_error_char_const__]
inc dword [0x10070870]
mov edx, dword [ebp - 0x724]
mov dword [esi], eax
mov ecx, dword [eax + 4]
push edx
mov dword [ecx], eax
mov byte [ebp - 4], bl
call sub.MSVCR100.dll_void___cdecl_operator_delete___void__
add esp, 4
jmp 0x10040953
push edi
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov eax, 1
jmp 0x100408e5