Function at 0x405d50
Capabilities:
Check if file exists

Disassembly:
push 0xffffffffffffffff
push 0x45c390
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x472940]
xor eax, esp
mov dword [esp + 0x2c], eax
push ebx
push esi
push edi
mov eax, dword [0x472940]
xor eax, esp
push eax
lea eax, [esp + 0x40]
mov dword fs:[0], eax
mov esi, ecx
push str.Sgsc.exe
lea edi, [esi + 0xc]
lea eax, [esp + 0x18]
push edi
push eax
call fcn.00404dc0
push str.SGSUninstall.exe
lea ecx, [esp + 0x28]
push edi
push ecx
mov dword [esp + 0x60], 0
call fcn.00404dc0
add esp, 0x18
lea ecx, [esp + 0x14]
lea ebx, [esp + 0x1c]
mov byte [esp + 0x48], 1
call fcn.00405c50
mov byte [esp + 0x48], 2
call fcn.00405480
mov eax, dword [edi]
mov ecx, dword [esp + 0x14]
push str.menu
push eax
mov ebx, 0x468048
call fcn.00405500
mov eax, dword [edi]
mov ecx, dword [esp + 0x18]
push 0x467c1c
push eax
mov ebx, 0x468148
call fcn.00405500
mov edx, dword [esp + 0x1c]
mov eax, dword [edi]
mov ecx, dword [esp + 0x18]
push edx
push eax
mov eax, dword [esp + 0x1c]
push eax
push ecx
call fcn.00405610
mov esi, dword [esi + 8]
xor ebx, ebx
cmp esi, ebx
je 0x405e28
push ebx
push 0x64
push 0x14d8
push esi
call dword [sym.imp.USER32.dll_PostMessageA]
push str.update_
lea edx, [esp + 0x14]
push edi
push edx
call fcn.00404dc0
mov byte [esp + 0x54], 3
mov eax, dword [esp + 0x1c]
add esp, 8
add eax, 0xfffffff0
mov dword [esp + 0x24], esp
mov esi, esp
push eax
call fcn.00401850
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.004020d0
add esp, 4
cmp al, bl
jne 0x405e74
mov eax, dword [esp + 0x10]
push eax
call fcn.00401bd0
add esp, 4
push 0xb
push str.upgrade.ini
lea ecx, [esp + 0x18]
call fcn.00402520
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
or esi, 0xffffffff
test eax, eax
jne 0x405f56
mov edx, dword [esp + 0x10]
push ebx
push 0x80
push 4
push ebx
push ebx
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, esi
jne 0x405f4f
mov byte [esp + 0x48], 2
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405ee0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x48], 1
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405f04
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x48], bl
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405f27
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x48], esi
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], esi
dec esi
test esi, esi
jg 0x405f48
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x40605f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call fcn.00443dd7
push eax
call fcn.004446ca
call fcn.004446dc
cdq
mov ecx, 0xa
idiv ecx
mov eax, dword [str.abcdefghijk]
mov ecx, dword [0x46816c]
mov dword [esp + 0x38], eax
mov eax, dword [0x468170]
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], ecx
xor eax, eax
mov byte [esp + 0x2c], bl
mov dword [esp + 0x2d], eax
mov dword [esp + 0x31], eax
mov byte [esp + 0x35], al
movsx ecx, byte [esp + edx + 0x38]
push ecx
push 0x467fd0
lea edx, [esp + 0x34]
call fcn.004074d0
mov edx, dword [esp + 0x20]
add esp, 0x10
push edx
lea eax, [esp + 0x28]
push eax
push str.myupgradetype
push str.UPGRADE
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
mov byte [esp + 0x48], 2
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405ff2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x48], 1
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406016
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x48], bl
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406039
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x48], esi
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], esi
dec esi
test esi, esi
jg 0x40605a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00443100
add esp, 0x3c
ret