Function at 0x407db0
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x545c89
mov eax, dword fs:[0]
push eax
sub esp, 0x24c
mov eax, dword [0x5ad6a8]
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
mov ebx, ecx
push 0
call fcn.0041bdf8
add esp, 4
cmp dword [0x5b4498], 6
jl 0x408423
mov eax, dword [0x5b44a0]
lea edi, [ebx + 0xcc]
mov edx, dword [eax + 4]
test edx, edx
jne 0x407e0d
xor ecx, ecx
jmp 0x407e21
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407e12
sub ecx, esi
sar ecx, 1
push ecx
push edx
mov ecx, edi
call fcn.00401580
mov eax, dword [0x5b44a0]
lea esi, [ebx + 0xd0]
mov edx, dword [eax + 8]
test edx, edx
jne 0x407e40
xor ecx, ecx
jmp 0x407e63
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x23c], eax
jmp 0x407e50
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407e50
sub ecx, dword [ebp - 0x23c]
sar ecx, 1
push ecx
push edx
mov ecx, esi
call fcn.00401580
mov eax, dword [0x5b44a0]
mov edx, dword [eax + 0xc]
lea eax, [ebx + 0xd4]
test edx, edx
jne 0x407e82
xor ecx, ecx
jmp 0x407ea9
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x23c], eax
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407e90
sub ecx, dword [ebp - 0x23c]
lea eax, [ebx + 0xd4]
sar ecx, 1
push ecx
push edx
mov ecx, eax
call fcn.00401580
mov eax, dword [0x5b44a0]
push dword [eax + 0x10]
call fcn.0052dedf
mov dword [ebx + 0xd8], eax
mov eax, dword [0x5b44a0]
add esp, 4
mov edx, dword [eax + 0x14]
lea eax, [ebx + 0xdc]
test edx, edx
jne 0x407ede
xor ecx, ecx
jmp 0x407f09
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x23c], eax
lea esp, [esp]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407ef0
sub ecx, dword [ebp - 0x23c]
lea eax, [ebx + 0xdc]
sar ecx, 1
push ecx
push edx
mov ecx, eax
call fcn.00401580
cmp dword [0x5b4498], 6
jle 0x407f37
mov eax, dword [0x5b44a0]
push dword [eax + 0x18]
call fcn.0052dedf
add esp, 4
neg eax
sbb eax, eax
neg eax
mov dword [ebx + 0xe4], eax
push ecx
mov eax, esp
push esi
push str._CTStartApp::InitInstance__Archive_START:
push eax
call fcn.00402410
add esp, 0xc
call fcn.00406930
add esp, 4
lea ecx, [ebp - 0x248]
call fcn.00405460
mov eax, dword [edi]
push 0
push ecx
sub eax, 0x10
mov esi, esp
push eax
mov dword [ebp - 4], 0
call fcn.00401220
add eax, 0x10
add esp, 4
lea ecx, [ebp - 0x248]
mov dword [esi], eax
call fcn.004072a0
test eax, eax
js 0x408411
cmp dword [ebx + 0xe4], 0
push ecx
mov ecx, esp
mov dword [ebp - 0x240], esp
je 0x407fb2
push str.bscuptool.exe
call fcn.00401ed0
mov byte [ebp - 4], 1
push 1
jmp 0x407fc2
push 0x556d00
call fcn.00401ed0
mov byte [ebp - 4], 2
push 0
mov eax, dword [edi]
push ecx
sub eax, 0x10
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
add esp, 4
lea ecx, [ebp - 0x248]
mov byte [ebp - 4], 0
call fcn.00407420
test eax, eax
js 0x408411
mov eax, dword [ebx + 0xd0]
push ecx
sub eax, 0x10
mov dword [ebp - 0x240], esp
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
mov eax, dword [edi]
sub eax, 0x10
mov esi, esp
push eax
mov byte [ebp - 4], 3
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
add esp, 4
lea ecx, [ebp - 0x248]
mov byte [ebp - 4], 0
call fcn.00407120
test eax, eax
js 0x408411
mov eax, dword [ebx + 0xd0]
xorps xmm0, xmm0
movq qword [ebp - 0x238], xmm0
movq qword [ebp - 0x230], xmm0
movq qword [ebp - 0x228], xmm0
movq qword [ebp - 0x220], xmm0
cmp dword [eax - 0xc], 0
jge 0x408075
push 0x80070057
call fcn.00401200
movzx eax, word [eax]
lea ecx, [ebp - 0x238]
push ecx
push eax
call fcn.00403ef0
add esp, 8
test eax, eax
js 0x408411
cmp dword [ebp - 0x238], 2
jne 0x4080a3
mov dword [ebx + 0xe0], 1
lea ecx, [ebp - 0x258]
call fcn.00405440
push 0x7530
push 1
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 4
call fcn.00406850
cmp eax, 1
jne 0x408119
mov eax, dword [edi]
push ecx
sub eax, 0x10
mov dword [ebp - 0x240], esp
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
mov eax, dword [ebx + 0xd0]
sub eax, 0x10
mov esi, esp
push eax
mov byte [ebp - 4], 5
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
add esp, 4
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 4
call fcn.00406dc0
lea ecx, [ebp - 0x258]
call fcn.004075e0
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 0
call fcn.00405470
cmp dword [ebx + 0xe4], 0
jne 0x408184
push ecx
mov eax, esp
push edi
push str._CTStartApp::InitInstance__TenmaruExec_START:
push eax
call fcn.00402410
add esp, 0xc
call fcn.00406930
mov eax, dword [edi]
sub eax, 0x10
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
add esp, 4
mov ecx, ebx
mov dword [esi], eax
call fcn.00408830
mov esi, eax
push esi
push ecx
mov ecx, esp
push str._CTStartApp::InitInstance__TenmaruExec_END__d_
call fcn.00401ed0
call fcn.00406ce0
add esp, 8
test esi, esi
js 0x408411
lea ecx, [ebp - 0x24c]
call fcn.004010e0
lea eax, [ebp - 0x24c]
push eax
mov eax, dword [edi]
push ecx
sub eax, 0x10
mov esi, esp
push eax
mov byte [ebp - 4], 6
call fcn.00401220
add eax, 0x10
add esp, 4
lea ecx, [ebp - 0x248]
mov dword [esi], eax
call fcn.00405e30
push ecx
mov ecx, dword [ebx + 0xcc]
sub ecx, 0x10
mov esi, esp
push ecx
mov edi, eax
call fcn.00401220
add eax, 0x10
add esp, 4
lea ecx, [ebp - 0x248]
mov dword [esi], eax
call fcn.00405d50
mov dword [ebp - 0x23c], eax
test edi, edi
je 0x40827f
push ecx
mov ecx, esp
lea eax, [ebp - 0x24c]
push eax
push str._CTStartApp::InitInstance__DoOnlineUpdate_START:
push ecx
call fcn.00402410
add esp, 0xc
call fcn.00406930
mov eax, dword [ebp - 0x24c]
add eax, 0xfffffff0
mov dword [ebp - 0x240], esp
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
mov eax, dword [ebx + 0xcc]
sub eax, 0x10
mov esi, esp
push eax
mov byte [ebp - 4], 7
call fcn.00401220
add eax, 0x10
mov dword [esi], eax
add esp, 4
mov ecx, ebx
mov byte [ebp - 4], 6
call fcn.004079f0
mov esi, eax
push esi
push ecx
mov ecx, esp
push str._CTStartApp::InitInstance__DoOnlineUpdate_END__d_
call fcn.00401ed0
call fcn.00406ce0
mov eax, dword [ebp - 0x23c]
add esp, 8
mov ecx, 1
test esi, esi
cmove eax, ecx
mov dword [ebp - 0x23c], eax
lea ecx, [ebp - 0x258]
call fcn.00405440
push 0x7530
push 1
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 8
call fcn.00406850
cmp dword [ebp - 0x23c], 0
mov esi, eax
je 0x40830a
push 0
lea ecx, [ebp - 0x138]
call fcn.00408970
push ecx
lea eax, [ebp - 0x138]
mov ecx, esp
push str._CTStartApp::InitInstance__DoModal_START
mov byte [ebp - 4], 9
mov dword [ebx + 0x20], eax
call fcn.00401ed0
call fcn.00406930
add esp, 4
lea ecx, [ebp - 0x138]
call fcn.00418d76
push eax
push ecx
mov ecx, esp
push str._CTStartApp::InitInstance__DoModal_END__d_
call fcn.00401ed0
call fcn.00406ce0
add esp, 8
lea ecx, [ebp - 0x138]
mov byte [ebp - 4], 8
call fcn.004078e0
cmp esi, 1
jne 0x40834d
push ecx
mov ecx, esp
mov dword [ebp - 0x244], esp
push 0x556d00
call fcn.00401ed0
push ecx
mov ecx, esp
push 0x556d00
mov byte [ebp - 4], 0xa
call fcn.00401ed0
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 8
call fcn.00406dc0
lea ecx, [ebp - 0x258]
call fcn.004075e0
lea ecx, [ebp - 0x258]
mov byte [ebp - 4], 6
call fcn.00405470
mov eax, dword [ebx + 0xd4]
push ecx
sub eax, 0x10
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.00403dd0
add esp, 4
cmp eax, 1
jne 0x4083f1
push 0x104
lea eax, [ebp - 0x218]
push eax
push dword [ebx + 0x44]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x4083cd
push ecx
lea eax, [ebp - 0x218]
mov ecx, esp
push eax
call fcn.00401ed0
lea eax, [ebp - 0x23c]
push eax
call fcn.004042a0
add esp, 8
push dword [eax]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea ecx, [ebp - 0x23c]
call fcn.00401110
mov eax, dword [ebx + 0xd4]
push 1
push ecx
sub eax, 0x10
mov esi, esp
push eax
call fcn.00401220
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.00403a20
add esp, 8
push ecx
mov ecx, esp
push str._CTStartApp::InitInstance__Archive_END
call fcn.00401ed0
call fcn.00406930
add esp, 4
lea ecx, [ebp - 0x24c]
call fcn.00401110
lea ecx, [ebp - 0x248]
mov dword [ebp - 4], 0xffffffff
call fcn.00405480
xor eax, eax
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.0052ba1e
mov esp, ebp
pop ebp
ret