Function at 0x407900
Capabilities:
Identify system language via api
Read .ini file
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a4793
mov eax, dword fs:[0]
push eax
sub esp, 0x1a4
mov eax, dword [0x4c9614]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea esi, [ebp - 0x198]
call fcn.00402de0
xor ebx, ebx
mov edi, 0x4d0c68
mov dword [ebp - 4], ebx
call fcn.00409700
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x198]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407971
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor ecx, ecx
mov dword [ebp - 0x30], 7
mov dword [ebp - 0x34], ebx
mov word [ebp - 0x44], cx
mov edx, str.default
lea ecx, [ebp - 0x2c]
mov dword [ebp - 4], 1
call fcn.00402fd0
push 0xffffffffffffffff
push ebx
push eax
lea eax, [ebp - 0x48]
mov byte [ebp - 4], 3
call fcn.00401c50
mov edi, 8
mov byte [ebp - 4], 1
cmp dword [ebp - 0x14], edi
jb 0x4079bf
mov edx, dword [ebp - 0x28]
push edx
call fcn.0047e6e0
add esp, 4
mov eax, dword [ebp - 0x44]
cmp dword [ebp - 0x30], edi
jae 0x4079ca
lea eax, [ebp - 0x44]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
call fcn.00408110
test eax, eax
jne 0x4079f2
cmp dword [ebp - 0x30], edi
jb 0x4079eb
mov eax, dword [ebp - 0x44]
push eax
call fcn.0047e6e0
add esp, 4
xor eax, eax
jmp 0x4080e7
lea ecx, [ebp - 0x1a0]
push 0x4d0c68
push ecx
mov esi, str.config.ini
call fcn.00403790
add esp, 8
mov byte [ebp - 4], 4
mov edx, dword [0x4d0c78]
mov eax, dword [edx - 8]
mov esi, dword [ebp - 0x1a0]
mov ecx, 1
sub ecx, dword [edx - 4]
sub eax, 0x40
or eax, ecx
jge 0x407a42
mov ecx, 0x40
mov eax, 0x4d0c78
call fcn.00403a80
mov edx, dword [0x4d0c78]
push esi
push 0x40
push edx
push 0x4aaa44
push str.language
push 0x4aa97c
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov eax, dword [0x4d0c78]
mov ecx, dword [eax - 8]
push ecx
push eax
call fcn.0047f161
mov edx, dword [0x4d0c78]
mov dword [edx - 0xc], eax
mov edx, dword [0x4d0c78]
xor ecx, ecx
mov word [edx + eax*2], cx
add esp, 8
mov dword [ebp - 0x184], ebx
mov byte [ebp - 4], 5
push str.sites.dll
mov dword [ebp - 0x190], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
cmp eax, ebx
je 0x407ab3
push 0x4aaa58
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x190], eax
lea eax, [ebp - 0x184]
mov dword [ebp - 0x18c], eax
mov eax, dword [ebp - 0x184]
cmp eax, ebx
je 0x407ad1
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
push ebx
lea eax, [ebp - 0x184]
push eax
push 0x4aa81c
lea ecx, [ebp - 0x190]
push ecx
mov edx, 0x4aa9fc
mov dword [ebp - 0x184], ebx
call fcn.004088a0
cmp dword [ebp - 0x184], ebx
je 0x407ff8
push str.CommonXMLCommonResource.xml
lea ecx, [ebp - 0x48]
lea esi, [ebp - 0x2c]
call fcn.004034e0
add esp, 4
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x28]
cmp dword [ebp - 0x14], edi
jae 0x407b23
lea ecx, [ebp - 0x28]
lea edx, [ebp - 0x188]
push edx
call fcn.00403ba0
lea eax, [ebp - 0x188]
push 0x4d0c88
push eax
mov byte [ebp - 4], 7
call fcn.00431de0
add esp, 8
test al, al
mov byte [ebp - 4], 6
mov eax, dword [ebp - 0x188]
sete bl
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407b72
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test bl, bl
je 0x407bc9
mov esi, 0x4d0c88
call fcn.00408640
lea ecx, [ebp - 0x188]
push ecx
mov ecx, 0x4aaa44
call fcn.00403ba0
lea edx, [ebp - 0x188]
push edx
mov edi, esi
mov byte [ebp - 4], 8
call fcn.00409610
mov byte [ebp - 4], 6
mov eax, dword [ebp - 0x188]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407bc9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [ebp - 0x28]
mov esi, 8
cmp dword [ebp - 0x14], esi
jae 0x407bd9
lea edi, [ebp - 0x28]
push ecx
mov ecx, esp
mov dword [ebp - 0x18c], esp
push ecx
call fcn.00406c60
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x184]
test ecx, ecx
jne 0x407c00
push 0x80004003
call fcn.0047e430
mov byte [ebp - 4], 6
call fcn.00408f20
mov eax, dword [0x4d0c70]
test eax, eax
jne 0x407c1c
push 0x80004003
call fcn.0047e430
mov ecx, dword [ebp - 0x184]
mov edx, dword [eax]
mov edx, dword [edx + 0x34]
push ecx
push 0
push eax
call edx
mov edi, dword [0x4d0c78]
push ecx
mov eax, esp
mov dword [ebp - 0x18c], esp
push eax
call fcn.00406c60
mov byte [ebp - 4], 0xc
cmp dword [0x4d0c70], 0
jne 0x407c59
push 0x80004003
call fcn.0047e430
mov byte [ebp - 4], 6
mov ecx, dword [0x4d0c70]
call fcn.00408bf0
push ecx
mov ecx, esp
mov dword [ebp - 0x18c], esp
push ecx
mov edi, str.support
call fcn.00406c60
mov byte [ebp - 4], 0xd
mov ecx, dword [ebp - 0x184]
test ecx, ecx
jne 0x407c94
push 0x80004003
call fcn.0047e430
lea edx, [ebp - 0x1ac]
mov byte [ebp - 4], 6
call fcn.004068c0
mov byte [ebp - 4], 0xe
mov eax, dword [eax]
test eax, eax
je 0x407cb1
mov eax, dword [eax]
jmp 0x407cb3
xor eax, eax
mov edx, eax
lea eax, [ebp - 0x64]
call fcn.004032f0
lea edi, [ebp - 0x1ac]
mov byte [ebp - 4], 0x10
call fcn.00406d00
mov eax, dword [ebp - 0x60]
cmp dword [ebp - 0x4c], esi
jae 0x407cd7
lea eax, [ebp - 0x60]
push 0x4aa9d0
push eax
call fcn.0047f291
add esp, 8
test eax, eax
je 0x407d39
push ecx
mov edx, esp
mov dword [ebp - 0x18c], esp
push edx
mov edi, 0x4aaa44
call fcn.00406c60
mov byte [ebp - 4], 0x11
cmp dword [0x4d0c70], 0
jne 0x407d14
push 0x80004003
call fcn.0047e430
mov byte [ebp - 4], 0x10
mov ecx, dword [0x4d0c70]
call fcn.00408bf0
mov edx, 0x4aaa44
mov edi, 0x4d0c78
mov byte [0x4d0c85], 1
call fcn.00403b60
call dword [sym.imp.KERNEL32.dll_GetUserDefaultUILanguage]
movzx eax, ax
mov ecx, 0x419
cmp cx, ax
jne 0x407d69
mov eax, 0x4d0c78
call fcn.004085c0
test al, al
je 0x407d69
call fcn.004083f0
mov byte [0x4d0c84], al
jmp 0x407fbe
push ecx
mov edx, esp
mov dword [ebp - 0x18c], esp
push edx
mov edi, str.autolinebreak
call fcn.00406c60
mov byte [ebp - 4], 0x12
mov ecx, dword [ebp - 0x184]
test ecx, ecx
jne 0x407d95
push 0x80004003
call fcn.0047e430
lea edx, [ebp - 0x1a8]
mov byte [ebp - 4], 0x10
call fcn.004068c0
mov byte [ebp - 4], 0x13
mov eax, dword [eax]
test eax, eax
je 0x407db2
mov eax, dword [eax]
jmp 0x407db4
xor eax, eax
lea ecx, [ebp - 0x194]
push ecx
mov ecx, eax
call fcn.00403ba0
mov bl, 0x15
lea edi, [ebp - 0x1a8]
mov byte [ebp - 4], bl
call fcn.00406d00
mov ecx, dword [ebp - 0x194]
cmp dword [ecx - 0xc], 0
jl 0x407dff
push 0x4aaa54
push ecx
call fcn.0047f5f4
mov ecx, dword [ebp - 0x194]
add esp, 8
test eax, eax
je 0x407dff
sub eax, ecx
sar eax, 1
cmp eax, 0xffffffff
jne 0x407e24
push 0x4aa9d0
push ecx
call fcn.0047f291
add esp, 8
test eax, eax
jne 0x407f98
call fcn.004083f0
mov byte [0x4d0c84], al
jmp 0x407f98
lea ecx, [eax + 1]
lea esi, [ebp - 0x1a4]
lea edx, [ebp - 0x194]
call fcn.00408bd0
mov byte [ebp - 4], 0x16
mov edi, dword [ebp - 0x1a4]
cmp dword [edi - 0xc], 0
jl 0x407f74
push 0x4aaa50
push edi
call fcn.0047f5f4
add esp, 8
test eax, eax
je 0x407f74
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x407f74
lea ecx, [eax + 1]
lea esi, [ebp - 0x188]
lea edx, [ebp - 0x1a4]
call fcn.00408bd0
push 0x4aa9f4
lea edx, [ebp - 0x18c]
push edx
mov eax, esi
push eax
mov byte [ebp - 4], 0x17
lea eax, [ebp - 0x198]
mov dword [ebp - 0x198], 0
call fcn.00408e00
mov eax, dword [eax]
push eax
call fcn.0047f5e9
add esp, 4
lea ecx, [ebp - 0x18c]
mov esi, eax
call fcn.0046c940
push 0x4aa9f4
lea ecx, [ebp - 0x19c]
push ecx
lea edx, [ebp - 0x188]
push edx
lea eax, [ebp - 0x198]
call fcn.00408e00
push pe_nt_image_headers32
lea eax, [ebp - 0x17c]
push 0
push eax
mov byte [ebp - 4], 0x18
call fcn.004845b0
add esp, 0xc
lea ecx, [ebp - 0x180]
push ecx
mov dword [ebp - 0x180], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp esi, dword [ebp - 0x17c]
jne 0x407f5e
lea esi, [ebp - 0x19c]
call fcn.00408520
test al, al
je 0x407f30
call fcn.004083f0
jmp 0x407f59
mov edx, dword [ebp - 0x19c]
push edx
call fcn.0047f5e9
add esp, 4
cmp eax, dword [ebp - 0x178]
jne 0x407f57
call fcn.004083f0
test al, al
je 0x407f57
mov eax, 1
jmp 0x407f59
xor eax, eax
mov byte [0x4d0c84], al
lea ecx, [ebp - 0x19c]
call fcn.0046c940
lea ecx, [ebp - 0x188]
call fcn.0046c940
lea eax, [edi - 0x10]
mov byte [ebp - 4], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407f93
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, 8
mov byte [ebp - 4], 0x10
mov eax, dword [ebp - 0x194]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407fbe
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [ebp - 0x4c], esi
jb 0x407fcf
mov ecx, dword [ebp - 0x60]
push ecx
call fcn.0047e6e0
add esp, 4
xor edx, edx
mov byte [ebp - 4], 5
mov dword [ebp - 0x4c], 7
mov dword [ebp - 0x50], 0
mov word [ebp - 0x60], dx
cmp dword [ebp - 0x14], esi
jb 0x407ff8
mov eax, dword [ebp - 0x28]
push eax
call fcn.0047e6e0
add esp, 4
lea edi, [ebp - 0x2c]
call fcn.004031a0
mov bl, 0x19
mov esi, 8
mov byte [ebp - 4], bl
cmp dword [eax + 0x18], esi
jb 0x408014
mov eax, dword [eax + 4]
jmp 0x408017
add eax, 4
mov ecx, dword [0x4d0c78]
push ecx
push eax
lea edx, [ebp - 0x18c]
push edx
call fcn.0046dd80
add esp, 0xc
mov edi, 0x4d0c7c
mov byte [ebp - 4], 0x1a
call fcn.00409700
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x18c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408061
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 5
cmp dword [ebp - 0x14], esi
jb 0x408076
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.0047e6e0
add esp, 4
call fcn.0042aab0
push ecx
mov ecx, esp
mov dword [ecx], 0
push ecx
mov ecx, esp
mov esi, eax
mov dword [ecx], 0
call fcn.0042b860
mov byte [ebp - 4], 4
mov eax, dword [ebp - 0x184]
test eax, eax
je 0x4080aa
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x1a0]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4080d0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [ebp - 0x30], 8
jb 0x4080e2
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.0047e6e0
add esp, 4
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0047e6eb
mov esp, ebp
pop ebp
ret