Function at 0x401490
Capabilities:
Get common file path
Get startup folder
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x498
mov eax, dword [0x4244e0]
xor eax, esp
mov dword [esp + 0x494], eax
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x10]
push str.japanese
push 0
call fcn.00405e9b
xor eax, eax
mov dword [0x426b88], esi
add esp, 8
mov dword [esp + 0x54], 7
mov dword [esp + 0x50], 0
mov word [esp + 0x40], ax
cmp word [edi], ax
jne 0x4014e7
xor ecx, ecx
jmp 0x4014ff
mov ecx, edi
lea edx, [ecx + 2]
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4014f0
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [esp + 0x48]
call fcn.004023b0
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x48]
mov ecx, 0x426b90
push eax
call fcn.00402290
cmp dword [esp + 0x54], 8
jb 0x401530
push dword [esp + 0x40]
call fcn.00405896
add esp, 4
push 0x104
lea eax, [esp + 0x8c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor eax, eax
mov dword [esp + 0x3c], 7
mov dword [esp + 0x38], 0
mov word [esp + 0x28], ax
cmp word [esp + 0x88], ax
jne 0x40156a
xor ecx, ecx
jmp 0x401583
lea ecx, [esp + 0x88]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401574
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [esp + 0x8c]
push eax
lea ecx, [esp + 0x30]
call fcn.004023b0
lea edx, [esp + 0x28]
lea ecx, [esp + 0x10]
call fcn.00402d50
mov esi, 0x426ba8
cmp eax, esi
je 0x4015b7
push 0xffffffffffffffff
push 0
push eax
mov ecx, esi
call fcn.00402290
cmp dword [esp + 0x24], 8
jb 0x4015ca
push dword [esp + 0x10]
call fcn.00405896
add esp, 4
lea edx, [esp + 0x28]
lea ecx, [esp + 0x70]
call fcn.00402ce0
mov edx, eax
lea ecx, [esp + 0x10]
call fcn.00402dc0
cmp eax, 0x426bc0
je 0x4015f8
push 0xffffffffffffffff
push 0
push eax
mov ecx, 0x426bc0
call fcn.00402290
cmp dword [esp + 0x24], 8
jb 0x40160b
push dword [esp + 0x10]
call fcn.00405896
add esp, 4
xor eax, eax
mov dword [esp + 0x24], 7
cmp dword [esp + 0x84], 8
mov dword [esp + 0x20], 0
mov word [esp + 0x10], ax
jb 0x401638
push dword [esp + 0x70]
call fcn.00405896
add esp, 4
cmp dword [0x426bbc], 8
cmovae esi, dword [0x426ba8]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push 0
push 5
lea eax, [esp + 0x298]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
xor eax, eax
mov dword [esp + 0x6c], 7
mov dword [esp + 0x68], 0
mov word [esp + 0x58], ax
cmp word [esp + 0x290], ax
jne 0x401686
xor ecx, ecx
jmp 0x40169f
lea ecx, [esp + 0x290]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x401690
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [esp + 0x294]
push eax
lea ecx, [esp + 0x60]
call fcn.004023b0
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x60]
mov ecx, 0x426bf0
push eax
call fcn.00402290
cmp dword [esp + 0x6c], 8
jb 0x4016d7
push dword [esp + 0x58]
call fcn.00405896
add esp, 4
push 0
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [esp + 8]
mov dword [esp + 8], 8
push eax
mov dword [esp + 0x10], 0x809
call dword [sym.imp.COMCTL32.dll_InitCommonControlsEx]
push 0x41f98c
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
test esi, esi
jne 0x401763
push 0x29
push str.riched32.dll
lea ecx, [esp + 0x18]
mov dword [esp + 0x2c], 7
mov dword [esp + 0x28], eax
mov word [esp + 0x18], ax
call fcn.004023b0
cmp dword [esp + 0x24], 8
lea eax, [esp + 0x10]
push 0x30
cmovae eax, dword [esp + 0x14]
push 0x422298
push eax
push dword [0x426b8c]
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp dword [esp + 0x24], 8
jb 0x401775
push dword [esp + 0x10]
call fcn.00405896
add esp, 4
jmp 0x401775
call fcn.004017a0
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
call dword [sym.imp.ole32.dll_CoUninitialize]
cmp dword [esp + 0x3c], 8
jb 0x401788
push dword [esp + 0x28]
call fcn.00405896
add esp, 4
mov ecx, dword [esp + 0x49c]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.004050e0
mov esp, ebp
pop ebp
ret 0x10