Function at 0x402588
Capabilities:
Check if file exists
Check mutex on windows
Create directory
Create process on windows
Delete file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41969a
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x1d64
call fcn.004173e0
mov eax, dword [0x420108]
xor eax, esp
mov dword [esp + 0x1d60], eax
push ebx
push esi
push edi
mov eax, dword [0x420108]
xor eax, esp
push eax
lea eax, [esp + 0x1d78]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
push 0x3e8
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [esp + 0x15c]
push str.sf_dyupdatepatcher
xor ebx, ebx
push eax
mov dword [esp + 0x364], ebx
call fcn.0040a25e
pop ecx
pop ecx
lea eax, [esp + 0x15c]
push eax
push ebx
push ebx
mov dword [esp + 0x1d8c], ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [esp + 0x35c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40265c
push dword [esp + 0x35c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x1d78]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1d60]
xor ecx, esp
call fcn.00408643
mov esp, ebp
pop ebp
ret 0x10
lea eax, [esp + 0xf8]
push eax
call fcn.00407804
push 0x6d
lea edi, [esp + 0xfc]
mov byte [esp + 0x1d84], 1
call fcn.00407b97
test eax, eax
push 0x104
lea eax, [esp + 0xb68]
push eax
push ebx
setne byte [esp + 0x24]
mov byte [esp + 0x23], bl
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, ebx
jne 0x4026b3
lea edi, [esp + 0xf8]
call fcn.00407871
jmp 0x402627
mov esi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0xb64]
push eax
call esi
lea eax, [esp + 0xb64]
push eax
call esi
lea eax, [esp + 0xb64]
push eax
lea eax, [esp + 0x144]
call fcn.004013fe
push str.LOG_
lea eax, [esp + 0x144]
push eax
lea eax, [esp + 0xe4]
push eax
mov byte [esp + 0x1d8c], 2
call fcn.00401fc6
add esp, 0xc
mov byte [esp + 0x1d80], 3
cmp dword [esp + 0xf4], 8
mov esi, dword [esp + 0xe0]
jae 0x402726
lea esi, [esp + 0xe0]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40273a
push ebx
push esi
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
push 0x7fe
lea eax, [esp + 0x1572]
push ebx
push eax
mov word [esp + 0x1578], bx
call fcn.0040a690
add esp, 0xc
push ebx
call fcn.0040a369
mov dword [esp + 0x28], eax
pop ecx
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x2c], edx
call fcn.0040a1cb
pop ecx
push eax
push str._Y__m__d
lea eax, [esp + 0x1574]
push 0x20
push eax
call fcn.00409348
add esp, 0x10
lea eax, [esp + 0x156c]
push eax
lea eax, [esp + 0xe0]
push eax
call fcn.004020ad
push str.Err.log
lea eax, [esp + 0xe0]
push eax
lea eax, [esp + 0x74]
push eax
call fcn.00401fc6
add esp, 0xc
push 0xffffffffffffffff
lea ecx, [esp + 0xe0]
push ecx
xor ebx, ebx
mov byte [esp + 0x1d88], 4
call fcn.00401cf5
push ebx
push 1
lea esi, [esp + 0x74]
mov byte [esp + 0x1d88], 3
call fcn.0040166d
sub esp, 0x1c
lea eax, [esp + 0xf8]
mov esi, esp
mov dword [esp + 0x48], esp
call fcn.00401cd6
call fcn.0040116e
push dword [esp + 0x1c]
lea eax, [esp + 0x128]
call fcn.004013fe
mov byte [esp + 0x1d80], 5
cmp dword [esp + 0x11c], ebx
je 0x40296a
cmp dword [esp + 0x120], 8
mov ecx, dword [esp + 0x10c]
jae 0x40283d
lea ecx, [esp + 0x10c]
cmp dword [esp + 0x13c], 8
mov eax, dword [esp + 0x128]
jae 0x402855
lea eax, [esp + 0x128]
push ecx
push eax
push 0x41bd6c
push 2
push 0xbf
mov edi, str..PatchStub.cpp
mov esi, 0x42113c
call fcn.004011c9
add esp, 0x14
push 0x7fe
lea eax, [esp + 0x36a]
push ebx
push eax
mov word [esp + 0x370], bx
call fcn.0040a690
add esp, 0xc
push 0x207
lea eax, [esp + 0x368]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x364]
push eax
call esi
lea eax, [esp + 0x364]
push eax
call esi
lea eax, [esp + 0x364]
push eax
lea eax, [esp + 0x8c]
call fcn.004013fe
push str.WebNetDiskCmd.ini
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x74]
push eax
mov byte [esp + 0x1d8c], 6
call fcn.00401fc6
mov eax, dword [esp + 0x7c]
add esp, 0xc
cmp dword [esp + 0x84], 8
jae 0x402909
lea eax, [esp + 0x70]
push eax
push 0x41bde0
push 0x41bde4
push str.NeedUploadLog
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
xor edi, edi
push ebx
inc edi
push edi
lea esi, [esp + 0x74]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0x90]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0x12c]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0xe4]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0x148]
call fcn.0040166d
jmp 0x4026a2
push 7
pop edi
mov dword [esp + 0xd8], edi
mov dword [esp + 0xd4], ebx
mov word [esp + 0xc4], bx
lea eax, [esp + 0xc0]
push eax
push 0x70
lea eax, [esp + 0x100]
mov byte [esp + 0x1d88], 7
call fcn.00407c33
test al, al
jne 0x402aed
push 0x41be10
push 2
push 0xcf
mov edi, str..PatchStub.cpp
mov esi, 0x42113c
call fcn.004011c9
add esp, 0xc
push 0x7fe
lea eax, [esp + 0x36a]
push ebx
push eax
mov word [esp + 0x370], bx
call fcn.0040a690
add esp, 0xc
push 0x207
lea eax, [esp + 0x368]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x364]
push eax
call esi
lea eax, [esp + 0x364]
push eax
call esi
lea eax, [esp + 0x364]
push eax
lea eax, [esp + 0x8c]
call fcn.004013fe
push str.WebNetDiskCmd.ini
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x74]
push eax
mov byte [esp + 0x1d8c], 8
call fcn.00401fc6
mov eax, dword [esp + 0x7c]
add esp, 0xc
cmp dword [esp + 0x84], 8
jae 0x402a5b
lea eax, [esp + 0x70]
push eax
push 0x41bde0
push 0x41bde4
push str.NeedUploadLog
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push ebx
push 1
lea esi, [esp + 0x74]
call fcn.0040166d
push ebx
push 1
lea esi, [esp + 0x90]
call fcn.0040166d
mov dword [esp + 0x18], ebx
xor edi, edi
push ebx
inc edi
push edi
lea esi, [esp + 0xc8]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0x12c]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0xe4]
call fcn.0040166d
push ebx
push edi
lea esi, [esp + 0x148]
call fcn.0040166d
lea edi, [esp + 0xf8]
call fcn.00407871
push dword [esp + 0x35c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
jmp 0x402636
cmp dword [esp + 0xd8], 8
mov eax, dword [esp + 0xc4]
jae 0x402b05
lea eax, [esp + 0xc4]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x402b9f
cmp dword [esp + 0xd8], 8
mov eax, dword [esp + 0xc4]
jae 0x402b2c
lea eax, [esp + 0xc4]
push eax
lea eax, [esp + 0xd70]
push 0x41be20
push eax
call fcn.0040884f
add esp, 0xc
cmp byte [esp + 0x18], bl
jne 0x403071
lea eax, [esp + 0xd6c]
push eax
lea eax, [esp + 0x70]
call fcn.004013fe
cmp dword [esp + 0x84], 8
mov eax, dword [esp + 0x70]
jae 0x402b6f
lea eax, [esp + 0x70]
push eax
push 0x41bc24
push 2
push 0xe6
mov edi, str..PatchStub.cpp
mov esi, 0x42113c
call fcn.004011c9
add esp, 0x10
push ebx
push 1
lea esi, [esp + 0x74]
call fcn.0040166d
jmp 0x402fac
mov dword [esp + 0xa0], edi
mov dword [esp + 0x9c], ebx
mov word [esp + 0x8c], bx
push 0x7fe
lea eax, [esp + 0x36a]
push ebx
mov byte [esp + 0x1d88], 9
push eax
mov word [esp + 0x370], bx
call fcn.0040a690
add esp, 0xc
lea esi, [esp + 0x364]
call fcn.00406f0f
mov eax, esi
push str.sf_dyupdatepatcher.zip
push eax
call fcn.0040a234
mov eax, esi
push eax
call fcn.00403327
add esp, 0xc
cmp eax, ebx
je 0x402c6e
push eax
lea eax, [esp + 0xd70]
push 0x41be78
push eax
call fcn.0040884f
add esp, 0xc
cmp byte [esp + 0x18], bl
jne 0x402f8b
lea eax, [esp + 0xd6c]
push eax
lea eax, [esp + 0x70]
call fcn.004013fe
cmp dword [esp + 0x84], 8
mov eax, dword [esp + 0x70]
jae 0x402c46
lea eax, [esp + 0x70]
push eax
push 0x41bc24
push ebx
push 0xfc
mov edi, str..PatchStub.cpp
mov esi, 0x42113c
call fcn.004011c9
add esp, 0x10
mov byte [esp + 0x17], 1
jmp 0x402f7f
cmp dword [esp + 0xd8], 8
mov ecx, dword [esp + 0xc4]
jae 0x402c86
lea ecx, [esp + 0xc4]
push dword [esp + 0x18]
lea eax, [esp + 0x368]
push eax
call fcn.00406f6c
cmp eax, ebx
pop ecx
pop ecx
jge 0x402cf2
push eax
lea eax, [esp + 0xd70]
push 0x41bea4
push eax
call fcn.0040884f
add esp, 0xc
cmp byte [esp + 0x18], bl
jne 0x402f8b
lea eax, [esp + 0xd6c]
push eax
lea eax, [esp + 0x70]
call fcn.004013fe
cmp dword [esp + 0x84], 8
mov eax, dword [esp + 0x70]
jae 0x402ce0
lea eax, [esp + 0x70]
push eax
push 0x41bc24
push 2
push 0x109
jmp 0x402c52
lea eax, [esp + 0x364]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [esp + 0x88]
push eax
push 0x75
lea eax, [esp + 0x100]
call fcn.00407c33
test al, al
jne 0x402e6a
mov dword [esp + 0x84], edi
mov dword [esp + 0x80], ebx
mov word [esp + 0x70], bx
mov dword [esp + 0xbc], edi
mov dword [esp + 0xb8], ebx
mov word [esp + 0xa8], bx
lea eax, [esp + 0x6c]
push eax
push 0x73
lea eax, [esp + 0x100]
mov byte [esp + 0x1d88], 0xb
call fcn.00407c33
test al, al
je 0x402e56
lea eax, [esp + 0xa4]
push eax
push 0x63
lea eax, [esp + 0x100]
call fcn.00407c33
cmp dword [esp + 0xb8], ebx
je 0x402e1b
xor edi, edi
lea eax, [esp + 0xa4]
call fcn.004030df
cmp word [eax], 0x23
jne 0x402dc7
inc edi
lea eax, [esp + 0xa4]
call fcn.004030df
mov esi, eax
push esi
call fcn.00408d7b
pop ecx
mov ecx, esi
lea esi, [esp + 0xa4]
call fcn.004018a7
jmp 0x402e1b
lea edx, [esp + 0xa4]
lea ecx, [esp + 0x34]
call fcn.00402459
mov ecx, eax
lea edx, [esp + 0x50]
mov byte [esp + 0x1d80], 0xc
call fcn.0040235d
push 0xffffffffffffffff
lea ecx, [esp + 0xa8]
push ecx
xor ebx, ebx
mov byte [esp + 0x1d88], 0xd
call fcn.00401cf5
push ebx
push 1
lea esi, [esp + 0x58]
call fcn.0040166d
push ebx
push 1
lea ecx, [esp + 0x3c]
call fcn.0040159b
cmp dword [esp + 0xbc], 8
mov ecx, dword [esp + 0xa8]
jae 0x402e33
lea ecx, [esp + 0xa8]
cmp dword [esp + 0x84], 8
mov eax, dword [esp + 0x70]
jae 0x402e45
lea eax, [esp + 0x70]
push 5
push ebx
push ecx
push eax
push str.open
push ebx
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
push ebx
push 1
lea esi, [esp + 0xac]
call fcn.0040166d
jmp 0x402f7f
cmp dword [esp + 0x9c], ebx
je 0x402f8b
push 0x75
lea eax, [esp + 0xfc]
call fcn.00407bfc
mov edi, eax
cmp edi, ebx
je 0x402f8b
call fcn.00401477
test eax, eax
je 0x402f8b
lea esi, [esp + 0x2c]
call fcn.0040145d
push dword [eax + 4]
mov esi, edi
push dword [eax]
lea eax, [esp + 0x24]
push eax
call fcn.00403130
mov dword [esp + 0x84], 7
mov dword [esp + 0x80], ebx
mov word [esp + 0x70], bx
lea eax, [esp + 0x6c]
push eax
lea edi, [esp + 0xfc]
mov byte [esp + 0x1d84], 0xe
call fcn.00407c6e
test al, al
je 0x402f7f
push 0x40e
lea eax, [esp + 0xd72]
push ebx
push eax
mov word [esp + 0xd78], bx
call fcn.0040a690
add esp, 0xc
push 0x207
lea eax, [esp + 0xd70]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0xd6c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
cmp dword [esp + 0xa0], 8
mov eax, dword [esp + 0x8c]
jae 0x402f46
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0xd70]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
cmp dword [esp + 0x84], 8
mov eax, dword [esp + 0x70]
jae 0x402f67
lea eax, [esp + 0x70]
push 5
push ebx
push eax
lea eax, [esp + 0xd78]
push eax
push str.open
push ebx
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
push ebx
push 1
lea esi, [esp + 0x74]
call fcn.0040166d
push ebx
push 1
lea esi, [esp + 0x90]
mov byte [esp + 0x1d88], 7
call fcn.0040166d
cmp byte [esp + 0x17], bl
je 0x403071
push 0x7fe
lea eax, [esp + 0x36a]
push ebx
push eax
mov word [esp + 0x370], bx
call fcn.0040a690
add esp, 0xc
push 0x207
lea eax, [esp + 0x368]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [esp + 0x364]
push eax
call esi
lea eax, [esp + 0x364]
push eax
call esi
lea eax, [esp + 0x364]
push eax
lea eax, [esp + 0x8c]
call fcn.004013fe
push str.WebNetDiskCmd.ini
lea eax, [esp + 0x8c]
push eax
lea eax, [esp + 0x74]
push eax
mov byte [esp + 0x1d8c], 0xf
call fcn.00401fc6
mov eax, dword [esp + 0x7c]
add esp, 0xc
cmp dword [esp + 0x84], 8
jae 0x403040
lea eax, [esp + 0x70]
push eax
push 0x41bde0
push 0x41bde4
push str.NeedUploadLog
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
push ebx
push 1
lea esi, [esp + 0x74]
call fcn.0040166d
push ebx
push 1
lea esi, [esp + 0x90]
call fcn.0040166d
mov dword [esp + 0x18], 1
jmp 0x402a90