Function at 0x405830
Capabilities:
Check if file exists
Query environment variable
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5979c0
mov eax, dword fs:[0]
push eax
sub esp, 0x90
mov eax, dword [0x6031c0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x24], 0
lea ecx, [ebp - 0x14]
call fcn.00402220
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x10]
call fcn.00402220
mov byte [ebp - 4], 1
mov eax, dword [ebp + 0xc]
cmp dword [eax + 0x28], 0
jne 0x4058a8
mov ecx, dword [ebp + 0xc]
add ecx, 0x34
push ecx
lea ecx, [ebp - 0x10]
call fcn.004025b0
lea edx, [ebp - 0x10]
push edx
mov ecx, 0x607c40
call fcn.004150c0
jmp 0x405c76
push ecx
mov ecx, esp
mov dword [ebp - 0x90], esp
mov eax, dword [ebp + 0xc]
add eax, 0x24
push eax
call fcn.00401fd0
call fcn.004079b0
add esp, 4
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x405a2e
mov ecx, dword [ebp + 0xc]
add ecx, 0x24
push ecx
lea ecx, [ebp - 0x14]
call fcn.004025b0
lea ecx, [ebp - 0x18]
call fcn.00402220
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx]
cmp dword [eax + 0x18], 0
jne 0x40592b
lea ecx, [ebp - 0x34]
push ecx
call fcn.004154d0
add esp, 4
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x30], edx
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x30]
push eax
lea ecx, [ebp - 0x18]
call fcn.004025b0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x34]
call fcn.004023e0
jmp 0x4059a7
mov ecx, dword [ebp - 0x1c]
add ecx, 4
push ecx
lea ecx, [ebp - 0x18]
call fcn.004025b0
push 0
lea ecx, [ebp - 0x18]
call fcn.00402790
push eax
call fcn.0056bd68
test eax, eax
je 0x4059a7
push 0x5aa62c
lea ecx, [ebp - 0x48]
call fcn.00402040
mov dword [ebp - 0x38], eax
mov edx, dword [ebp - 0x38]
mov dword [ebp - 0x3c], edx
mov byte [ebp - 4], 4
mov ecx, dword [ebp - 0x3c]
call fcn.00402790
mov dword [ebp - 0x40], eax
push 0
lea ecx, [ebp - 0x18]
call fcn.00402790
push eax
call fcn.0056bd68
mov dword [ebp - 0x44], eax
push 0x2d7
mov eax, dword [ebp - 0x40]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.00433d50
add esp, 0xc
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x48]
call fcn.004023e0
mov edx, dword [ebp - 0x14]
push edx
push str.downloading__s
call fcn.00435d80
add esp, 8
lea eax, [ebp - 0x18]
push eax
push ecx
mov ecx, esp
mov dword [ebp - 0x94], esp
lea edx, [ebp - 0x14]
push edx
call fcn.00401fd0
call fcn.00404ea0
add esp, 8
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x4059fc
push 0
lea ecx, [ebp - 0x14]
call fcn.00402790
push eax
mov ecx, dword [ebp - 0x20]
push ecx
call fcn.00433d50
add esp, 0xc
mov edx, dword [ebp - 0x1c]
add edx, 0x14
mov dword [ebp - 0x50], edx
lea eax, [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x50]
call fcn.00403940
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x10]
call fcn.004025b0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x18]
call fcn.004023e0
jmp 0x405c76
push ecx
mov ecx, esp
mov dword [ebp - 0x98], esp
mov edx, dword [ebp + 0xc]
add edx, 0x24
push edx
call fcn.00401fd0
call fcn.00407a80
add esp, 4
mov dword [ebp - 0x54], eax
cmp dword [ebp - 0x54], 0
je 0x405c59
mov eax, dword [ebp + 0xc]
add eax, 0x24
push eax
lea ecx, [ebp - 0x14]
call fcn.004025b0
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00405e30
mov dword [ebp - 0x58], eax
lea ecx, [ebp - 0x14]
call fcn.00402790
mov dword [ebp - 0x5c], eax
push 0x104
mov ecx, dword [ebp - 0x58]
push ecx
mov edx, dword [ebp - 0x5c]
push edx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x10]
call fcn.004094e0
mov ecx, 0x607bb4
call fcn.00402790
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x405b03
push 0x5aa67c
lea ecx, [ebp - 0x70]
call fcn.00402040
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x60]
mov dword [ebp - 0x64], eax
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x64]
call fcn.00402790
mov dword [ebp - 0x68], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x6c], eax
push 0x2ec
mov ecx, dword [ebp - 0x68]
push ecx
mov edx, dword [ebp - 0x6c]
push edx
call fcn.00433d50
add esp, 0xc
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x70]
call fcn.004023e0
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.004025b0
lea ecx, [ebp - 0x10]
call fcn.004052d0
lea ecx, [ebp - 0x14]
call fcn.00402790
mov dword [ebp - 0x74], eax
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00405e30
mov dword [ebp - 0x78], eax
push 0x104
mov ecx, dword [ebp - 0x74]
push ecx
mov edx, dword [ebp - 0x78]
push edx
call fcn.0057ca16
add esp, 0xc
test eax, eax
jne 0x405b63
push 0
mov ecx, dword [ebp + 0xc]
add ecx, 0x24
call fcn.00402790
push eax
push 2
call fcn.00433d50
add esp, 0xc
push 0xffffffffffffffff
lea ecx, [ebp - 0x10]
call fcn.004094e0
lea ecx, [ebp - 0x10]
call fcn.00402790
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x405bce
mov eax, dword [ebp + 0xc]
add eax, 0x24
push eax
lea ecx, [ebp - 0x10]
call fcn.004025b0
push 0
push 0
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00405e30
push eax
call dword [sym.imp.SHELL32.dll_PathResolve]
mov dword [ebp - 0x9c], eax
push 0xffffffffffffffff
lea ecx, [ebp - 0x10]
call fcn.004094e0
mov ecx, dword [ebp - 0x1c]
add ecx, 4
call fcn.00402790
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
jmp 0x405c57
mov ecx, dword [ebp + 0xc]
add ecx, 0x40
call fcn.00407980
movzx ecx, al
test ecx, ecx
jne 0x405c57
mov ecx, dword [ebp - 0x1c]
add ecx, 4
call fcn.00402790
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
jne 0x405c57
push 0x5aa6ac
lea ecx, [ebp - 0x8c]
call fcn.00402040
mov dword [ebp - 0x7c], eax
mov edx, dword [ebp - 0x7c]
mov dword [ebp - 0x80], edx
mov byte [ebp - 4], 6
mov ecx, dword [ebp - 0x80]
call fcn.00402790
mov dword [ebp - 0x84], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x88], eax
push 0x303
mov eax, dword [ebp - 0x84]
push eax
mov ecx, dword [ebp - 0x88]
push ecx
call fcn.00433d50
add esp, 0xc
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x8c]
call fcn.004023e0
jmp 0x405c76
mov edx, dword [ebp + 0xc]
add edx, 0x24
push edx
lea ecx, [ebp - 0x10]
call fcn.004025b0
lea eax, [ebp - 0x10]
push eax
mov ecx, 0x607c40
call fcn.004153f0
lea ecx, [ebp - 0x10]
call fcn.00402790
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x405c9e
push 0
lea ecx, [ebp - 0x10]
call fcn.00402790
push eax
push 2
call fcn.00433d50
add esp, 0xc
lea ecx, [ebp - 0x10]
push ecx
mov ecx, dword [ebp + 8]
call fcn.00401fd0
mov edx, dword [ebp - 0x24]
or edx, 1
mov dword [ebp - 0x24], edx
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x10]
call fcn.004023e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.004023e0
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov esp, ebp
pop ebp
ret 8