Function at 0x4018f0
Capabilities:
Get common file path
Identify system language via api
Read .ini file
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5487cd
mov eax, dword fs:[0]
push eax
sub esp, 0x1b0
mov eax, dword [0x579aa4]
xor eax, esp
mov dword [esp + 0x1a8], eax
push ebx
push esi
push edi
mov eax, dword [0x579aa4]
xor eax, esp
push eax
lea eax, [esp + 0x1c0]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov edi, ecx
xor ebx, ebx
xor ecx, ecx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x60], 7
mov dword [esp + 0x5c], ebx
mov word [esp + 0x4c], cx
cmp byte [ebp + 0x10], 1
mov dword [esp + 0x1c8], ebx
jne 0x401a34
mov edx, dword [0x57d4ac]
mov eax, dword [edx + 0xc]
mov ecx, 0x57d4ac
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x20], esi
mov byte [esp + 0x1c8], 1
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
jge 0x4019a8
push 0x104
lea ecx, [esp + 0x24]
call fcn.00405870
mov esi, dword [esp + 0x20]
push esi
xor ecx, ecx
mov dword [esi - 0xc], 0x104
push 0x104
mov word [esi + 0x208], cx
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.0050cd69
add esp, 8
xor edx, edx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], dx
mov eax, esi
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4019e0
sub eax, edx
sar eax, 1
push eax
push esi
lea ecx, [esp + 0x50]
call fcn.004033b0
push 1
push 0x55c9e4
lea ecx, [esp + 0x50]
call fcn.00402f00
lea eax, [esi - 0x10]
mov byte [esp + 0x1c8], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x401a2e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x5c], ebx
jne 0x401a92
lea ecx, [esp + 0x64]
push str.default
push ecx
call fcn.004261c0
add esp, 8
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x54]
mov byte [esp + 0x1d4], 2
call fcn.004032b0
mov esi, 8
mov byte [esp + 0x1c8], 0
cmp dword [esp + 0x7c], esi
jb 0x401a7b
mov edx, dword [esp + 0x68]
push edx
call fcn.0050c4ec
add esp, 4
mov eax, dword [esp + 0x4c]
cmp dword [esp + 0x60], esi
jae 0x401a89
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
jmp 0x401a97
mov esi, 8
mov ecx, dword [ebp + 8]
call fcn.00402260
test al, al
jne 0x401abd
cmp dword [esp + 0x60], esi
jb 0x401ab6
mov eax, dword [esp + 0x4c]
push eax
call fcn.0050c4ec
add esp, 4
xor al, al
jmp 0x40222c
lea ecx, [esp + 0x3c]
push ebx
push ecx
call fcn.00405ab0
push 0x55c8c4
lea edx, [esp + 0x48]
push edx
lea eax, [esp + 0x44]
push eax
mov byte [esp + 0x1dc], 3
call fcn.00404ee0
add esp, 0x14
mov byte [esp + 0x1c8], 4
mov eax, dword [edi + 0x10]
mov esi, dword [esp + 0x34]
add edi, 0x10
sub eax, 0x10
mov ecx, 1
sub ecx, dword [eax + 0xc]
mov eax, dword [eax + 8]
sub eax, 0x40
or eax, ecx
mov dword [esp + 0x30], edi
jge 0x401b1b
push 0x40
mov ecx, edi
call fcn.00405870
mov eax, dword [edi]
push esi
push 0x40
push eax
push 0x55c8dc
push str.language
push 0x55c8f8
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov eax, dword [edi]
mov ecx, dword [eax - 8]
cmp eax, ebx
jne 0x401b43
xor eax, eax
jmp 0x401b4d
push ecx
push eax
call fcn.0050cd69
add esp, 8
mov ecx, dword [edi]
mov dword [ecx - 0xc], eax
mov edx, dword [edi]
xor ecx, ecx
mov word [edx + eax*2], cx
mov dword [esp + 0x10], ebx
mov byte [esp + 0x1c8], 5
push str.sites.dll
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
cmp eax, ebx
je 0x401b89
push str.DllGetClassObject
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x10]
mov dword [esp + 0x28], edx
cmp eax, ebx
je 0x401ba1
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
push ebx
lea eax, [esp + 0x14]
push eax
push 0x55cae8
push 0x55c9c4
lea ecx, [esp + 0x34]
mov dword [esp + 0x20], ebx
call fcn.00403d70
cmp dword [esp + 0x10], ebx
je 0x402129
mov ebx, str.CommonXMLCommonResource.xml
lea ecx, [esp + 0x48]
lea esi, [esp + 0x64]
call fcn.004038b0
mov bl, 6
mov byte [esp + 0x1c8], bl
cmp dword [esp + 0x7c], 8
mov eax, dword [esp + 0x68]
jae 0x401bf2
lea eax, [esp + 0x68]
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push eax
call fcn.00404ad0
mov byte [esp + 0x1cc], 7
mov ecx, dword [esp + 0x14]
test ecx, ecx
jne 0x401c19
push 0x80004003
call fcn.0050a1f0
push 0
mov byte [esp + 0x1d0], bl
call fcn.00404d40
mov esi, dword [esp + 0x2c]
mov eax, dword [esi + 0xc]
test eax, eax
jne 0x401c3c
push 0x80004003
call fcn.0050a1f0
mov edx, dword [esp + 0x10]
mov ecx, dword [eax]
push edx
push 0
push eax
mov eax, dword [ecx + 0x34]
call eax
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401d2d
push eax
lea ecx, [esp + 0x18]
call fcn.00405520
mov byte [esp + 0x1c8], 8
mov eax, dword [edi]
test eax, eax
je 0x401c92
mov ecx, dword [esp + 0x14]
cmp dword [ecx - 0xc], 0
jl 0x401c92
push eax
push ecx
call fcn.0050c88b
add esp, 8
test eax, eax
je 0x401c92
sub eax, dword [esp + 0x14]
sar eax, 1
cmp eax, 0xffffffff
jne 0x401d06
lea ecx, [esp + 0x1c]
push ecx
push 0x55c950
lea edx, [esp + 0x20]
push edx
lea ecx, [esp + 0x20]
mov dword [esp + 0x28], 0
call fcn.00402710
mov byte [esp + 0x1c8], 9
mov eax, dword [esp + 0x18]
cmp dword [eax - 0xc], 0
je 0x401cd2
lea ecx, [esp + 0x18]
push ecx
mov ecx, edi
call fcn.004049c0
jmp 0x401cde
push 0x55c8dc
mov ecx, edi
call fcn.004057e0
mov byte [esp + 0x1c8], 8
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x401d06
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x1c8], bl
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x401d2d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [edi]
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push edi
call fcn.00404ad0
mov byte [esp + 0x1cc], 0xa
mov ecx, dword [esi + 0xc]
test ecx, ecx
jne 0x401d55
push 0x80004003
call fcn.0050a1f0
mov byte [esp + 0x1cc], bl
call fcn.00404920
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push 0x55c954
call fcn.00404ad0
mov byte [esp + 0x1cc], 0xb
mov ecx, dword [esp + 0x14]
test ecx, ecx
jne 0x401d8c
push 0x80004003
call fcn.0050a1f0
lea edi, [esp + 0x48]
mov byte [esp + 0x1cc], bl
call fcn.00404830
mov byte [esp + 0x1c8], 0xc
mov eax, dword [eax]
test eax, eax
je 0x401dae
mov eax, dword [eax]
jmp 0x401db0
xor eax, eax
push eax
lea ecx, [esp + 0x84]
call fcn.00402a80
lea ecx, [esp + 0x44]
mov byte [esp + 0x1c8], 0xe
call fcn.00404cc0
cmp dword [esp + 0x98], 8
mov eax, dword [esp + 0x84]
jae 0x401de6
lea eax, [esp + 0x84]
push 0x55c964
push eax
call fcn.0050ed1f
add esp, 8
test eax, eax
je 0x401e3d
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push 0x55c8dc
call fcn.00404ad0
mov byte [esp + 0x1cc], 0xf
mov ecx, dword [esi + 0xc]
test ecx, ecx
jne 0x401e22
push 0x80004003
call fcn.0050a1f0
mov byte [esp + 0x1cc], 0xe
call fcn.00404920
mov ecx, dword [esp + 0x30]
push 0x55c8dc
call fcn.004057e0
call dword [sym.imp.KERNEL32.dll_GetUserDefaultUILanguage]
movzx eax, ax
mov ecx, 0x419
cmp cx, ax
jne 0x401e75
mov edx, dword [esp + 0x30]
push 0x55c96c
push edx
call fcn.004029c0
add esp, 8
test al, al
je 0x401e75
mov eax, esi
call fcn.00402660
mov byte [esi + 0x1c], al
jmp 0x4020cc
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
push str.autolinebreak
call fcn.00404ad0
mov byte [esp + 0x1cc], 0x10
mov ecx, dword [esp + 0x14]
test ecx, ecx
jne 0x401ea0
push 0x80004003
call fcn.0050a1f0
lea edi, [esp + 0x44]
mov byte [esp + 0x1cc], 0xe
call fcn.00404830
mov byte [esp + 0x1c8], 0x11
mov eax, dword [eax]
test eax, eax
je 0x401ec3
mov eax, dword [eax]
jmp 0x401ec5
xor eax, eax
push eax
lea ecx, [esp + 0x18]
call fcn.00405520
mov bl, 0x13
lea ecx, [esp + 0x40]
mov byte [esp + 0x1c8], bl
call fcn.00404cc0
mov ecx, dword [esp + 0x14]
cmp dword [ecx - 0xc], 0
jl 0x401f0a
push str..x
push ecx
call fcn.0050c88b
mov ecx, dword [esp + 0x1c]
add esp, 8
test eax, eax
je 0x401f0a
sub eax, ecx
sar eax, 1
cmp eax, 0xffffffff
jne 0x401f2f
push 0x55c964
push ecx
call fcn.0050ed1f
add esp, 8
test eax, eax
jne 0x4020a4
mov eax, esi
call fcn.00402660
mov byte [esi + 0x1c], al
jmp 0x4020a4
inc eax
push eax
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x1c]
call fcn.004046f0
mov byte [esp + 0x1c8], 0x14
mov edi, dword [esp + 0x38]
cmp dword [edi - 0xc], 0
jl 0x402081
push 0x55c994
push edi
call fcn.0050c88b
add esp, 8
test eax, eax
je 0x402081
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x402081
inc eax
push eax
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x40]
call fcn.004046f0
lea edx, [esp + 0x1c]
push edx
push 0x55c998
lea eax, [esp + 0x2c]
mov byte [esp + 0x1d0], 0x15
push eax
lea ecx, [esp + 0x2c]
mov dword [esp + 0x28], 0
call fcn.00402710
mov eax, dword [eax]
push eax
call fcn.0050ee2b
add esp, 4
lea ecx, [esp + 0x24]
mov esi, eax
call fcn.00406190
lea ecx, [esp + 0x1c]
push ecx
push 0x55c998
lea edx, [esp + 0x20]
push edx
lea ecx, [esp + 0x2c]
call fcn.00402710
push pe_nt_image_headers32
lea eax, [esp + 0xa4]
push 0
push eax
mov byte [esp + 0x1d4], 0x16
call fcn.0050c770
add esp, 0xc
lea ecx, [esp + 0x9c]
push ecx
mov dword [esp + 0xa0], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp esi, dword [esp + 0xa0]
jne 0x40206f
lea esi, [esp + 0x18]
call fcn.00402920
test al, al
je 0x40203c
mov esi, dword [esp + 0x2c]
mov eax, esi
call fcn.00402660
mov byte [esi + 0x1c], al
jmp 0x40206f
mov edx, dword [esp + 0x18]
push edx
call fcn.0050ee2b
add esp, 4
cmp eax, dword [esp + 0xa4]
jne 0x402066
mov eax, dword [esp + 0x2c]
call fcn.00402660
test al, al
je 0x402066
mov eax, 1
jmp 0x402068
xor eax, eax
mov ecx, dword [esp + 0x2c]
mov byte [ecx + 0x1c], al
lea ecx, [esp + 0x18]
call fcn.00406190
lea ecx, [esp + 0x20]
call fcn.00406190
lea eax, [edi - 0x10]
mov byte [esp + 0x1c8], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4020a4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x1c8], 0xe
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4020cc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, 8
cmp dword [esp + 0x98], esi
jb 0x4020ea
mov ecx, dword [esp + 0x84]
push ecx
call fcn.0050c4ec
add esp, 4
xor edx, edx
mov byte [esp + 0x1c8], 5
mov dword [esp + 0x98], 7
mov dword [esp + 0x94], 0
mov word [esp + 0x84], dx
cmp dword [esp + 0x7c], esi
jb 0x402125
mov eax, dword [esp + 0x68]
push eax
call fcn.0050c4ec
add esp, 4
mov edi, dword [esp + 0x30]
lea esi, [esp + 0x64]
call fcn.00426390
mov bl, 0x17
mov byte [esp + 0x1c8], bl
cmp dword [eax + 0x18], 8
mov edi, dword [edi]
jb 0x402148
mov eax, dword [eax + 4]
jmp 0x40214b
add eax, 4
lea ecx, [esp + 0x24]
push edi
push ecx
mov ecx, eax
call fcn.0046e740
add esp, 8
mov ecx, dword [esp + 0x2c]
add ecx, 0x14
push eax
mov byte [esp + 0x1cc], 0x18
call fcn.004049c0
mov byte [esp + 0x1c8], bl
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402197
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, 8
cmp dword [esp + 0x7c], esi
jb 0x4021af
mov ecx, dword [esp + 0x68]
push ecx
call fcn.0050c4ec
add esp, 4
mov byte [esp + 0x1c8], 4
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4021c7
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov byte [esp + 0x1c8], 3
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4021ef
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x1c8], 0
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402217
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x60], esi
jb 0x40222a
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.0050c4ec
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x1c0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1a8]
xor ecx, esp
call fcn.0050c75f
mov esp, ebp
pop ebp
ret 0xc