Function at 0x491330
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
push 0x490ce0
call fcn.0051befa
add esp, 4
push 2
push str.japanese
lea ecx, [ebp - 0xc]
call fcn.00491870
push eax
lea eax, [ebp - 4]
push eax
call fcn.0051b9d2
mov edi, dword [ebp - 4]
add esp, 8
test edi, edi
je 0x4913a2
push 0
lea ecx, [ebp - 8]
call fcn.0051b249
mov eax, dword [edi + 4]
test eax, eax
je 0x491383
cmp eax, 0xffffffff
jae 0x491383
dec eax
mov dword [edi + 4], eax
mov esi, dword [edi + 4]
neg esi
sbb esi, esi
lea ecx, [ebp - 8]
not esi
call fcn.0051b271
and esi, edi
je 0x4913a2
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
mov edi, dword [ebp - 0xc]
test edi, edi
je 0x4913e2
push 0
lea ecx, [ebp - 8]
call fcn.0051b249
mov eax, dword [edi + 4]
test eax, eax
je 0x4913c3
cmp eax, 0xffffffff
jae 0x4913c3
dec eax
mov dword [edi + 4], eax
mov esi, dword [edi + 4]
neg esi
sbb esi, esi
lea ecx, [ebp - 8]
not esi
call fcn.0051b271
and esi, edi
je 0x4913e2
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
test byte [0x7938c4], 1
jne 0x491409
or dword [0x7938c4], 1
mov ecx, 0x7938c8
call fcn.0059cd80
push 0x5e83c0
call fcn.0052e444
add esp, 4
test byte [0x6898e0], 1
jne 0x491430
or dword [0x6898e0], 1
mov ecx, 0x6898b4
call fcn.00480540
push 0x5f2090
call fcn.0052e444
add esp, 4
lea ecx, [ebp - 0x28]
push 0
push ecx
call fcn.00491990
mov esi, 0x10
add esp, 8
cmp dword [eax + 0x14], esi
jb 0x49144a
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
cmp dword [ebp - 0x14], esi
jb 0x491462
mov edx, dword [ebp - 0x28]
push edx
call fcn.0052d217
add esp, 4
push 0xa
push str.System.dat
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
call fcn.00405440
lea eax, [ebp - 0x28]
push eax
call fcn.00483ff0
add esp, 4
test al, al
sete bl
cmp dword [ebp - 0x14], esi
jb 0x4914a5
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.0052d217
add esp, 4
test bl, bl
je 0x4914c5
push 0
push 0
push 0x610d18
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [ebp + 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpA]
push 0x610d40
push esi
call edi
test eax, eax
je 0x4915ea
push 0x610d44
push esi
call edi
test eax, eax
je 0x4915ea
push 0x610d48
push esi
call edi
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
mov ebx, 0x10
test eax, eax
jne 0x491533
mov eax, dword [0x68a4c4]
cmp dword [0x68a4d8], ebx
jae 0x491517
mov eax, 0x68a4c4
push 4
push eax
push 0x610d50
push 0
call edi
cmp eax, 7
je 0x49168e
mov byte [0x68a015], 1
call fcn.00491080
dec eax
je 0x4915c1
dec eax
je 0x491598
call fcn.00490f70
test al, al
je 0x49168e
push esi
lea ecx, [ebp - 0x28]
call fcn.00405540
lea edx, [ebp - 0x28]
push 0
push edx
call fcn.0043b590
mov ecx, eax
call fcn.0046b060
lea ecx, [ebp - 0x28]
mov bl, al
call fcn.004868c0
test bl, bl
je 0x49168e
push 0x490d30
call fcn.004209d0
mov ecx, eax
call fcn.0059cc20
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [0x68a4c4]
cmp dword [0x68a4d8], ebx
jae 0x4915aa
mov eax, 0x68a4c4
push 0
push eax
push 0x610dbc
push 0
call edi
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [0x68a4c4]
cmp dword [0x68a4d8], ebx
jae 0x4915d3
mov eax, 0x68a4c4
push 0
push eax
push 0x610d9c
push 0
call edi
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, esi
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], 0
mov byte [ebp - 0x28], 0
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x491601
sub eax, edx
push eax
push esi
lea ecx, [ebp - 0x28]
call fcn.00405440
test byte [0x689708], 1
jne 0x49163b
or dword [0x689708], 1
mov ecx, 0x6896c0
call fcn.00466b50
push 0x5f1950
call fcn.0052e444
add esp, 4
push 1
lea eax, [ebp - 0x28]
push eax
mov ecx, 0x6896c0
call fcn.0046b060
cmp dword [ebp - 0x14], 0x10
jb 0x49165d
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.0052d217
add esp, 4
test byte [0x689708], 1
jne 0x491684
or dword [0x689708], 1
mov ecx, 0x6896c0
call fcn.00466b50
push 0x5f1950
call fcn.0052e444
add esp, 4
mov ecx, 0x6896c0
call fcn.0046a290
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10