Function at 0x40f430
Capabilities:
Check if file exists
Check mutex on windows
Get file attributes
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x534656
mov eax, dword fs:[0]
push eax
sub esp, 0x1d4
mov eax, dword [0x56adc0]
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
push str.MUTEX_STARTBUTTON_INSTALLbbcacfea_ef92_401e_83d0_767074a346c3
xor edi, edi
push edi
push edi
mov byte [ebp - 0xf8], 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
mov dword [ebp - 0xfc], esi
mov dword [ebp - 4], edi
cmp esi, edi
je 0x40f5b4
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, edi
je 0x40f49e
cmp eax, 0x80
jne 0x40f5ad
mov bl, 1
lea ecx, [ebp - 0x80]
mov byte [ebp - 0xf8], bl
call fcn.0040e840
mov byte [ebp - 4], bl
call fcn.004267c0
test al, al
je 0x40f4df
push str.KometaStartButton
push edi
call dword [sym.imp.USER32.dll_FindWindowW]
push edi
push edi
push 0x1f58
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x6c], 8
mov eax, dword [ebp - 0x80]
jae 0x40f4eb
lea eax, [ebp - 0x80]
push eax
push 0x71
call fcn.00426980
add esp, 8
test al, al
jne 0x40f5bb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x9a
lea eax, [ebp - 0x1e0]
push eax
mov ebx, str.appstart.cpp
call fcn.0041a6b0
mov ebx, eax
mov byte [ebp - 4], 2
test ebx, ebx
je 0x40f571
lea edi, [ebx + 0x10]
test edi, edi
je 0x40f531
lea eax, [ebx + 0x20]
jmp 0x40f533
xor eax, eax
push str.ERROR:
push eax
call fcn.00407c44
add esp, 8
test edi, edi
je 0x40f54a
lea eax, [ebx + 0x20]
jmp 0x40f54c
xor eax, eax
push str.Failed_unzip_resources_to_kometa_folder
push eax
call fcn.00407c44
add esp, 8
test edi, edi
je 0x40f563
lea eax, [ebx + 0x20]
jmp 0x40f565
xor eax, eax
push eax
lea ecx, [ebp - 0x80]
call fcn.00407e0a
add esp, 4
lea ecx, [ebp - 0x1e0]
mov byte [ebp - 4], 1
call fcn.0041a760
cmp dword [ebp - 0x6c], 8
jb 0x40f592
mov ecx, dword [ebp - 0x80]
push ecx
call fcn.004f77ab
add esp, 4
xor edx, edx
push esi
mov dword [ebp - 0x6c], 7
mov dword [ebp - 0x70], 0
mov word [ebp - 0x80], dx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x40fd31
push 0x13
xor eax, eax
mov esi, 7
push str.kometastartvx86.exe
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x38], edi
mov word [ebp - 0x48], ax
call fcn.00404bd5
lea ebx, [ebp - 0x48]
lea ecx, [ebp - 0x80]
lea edi, [ebp - 0x64]
mov byte [ebp - 4], 3
call fcn.00424f20
mov byte [ebp - 4], 4
cmp dword [eax + 0x14], 8
jb 0x40f5fb
mov edx, dword [eax]
jmp 0x40f5fd
mov edx, eax
xor edi, edi
xor ecx, ecx
mov eax, edx
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], edi
mov word [ebp - 0x2c], cx
lea ebx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40f610
sub eax, ebx
sar eax, 1
push eax
push edx
lea ecx, [ebp - 0x2c]
call fcn.00404bd5
lea edx, [ebp - 0x2c]
lea ecx, [ebp - 0xb8]
mov byte [ebp - 4], 5
call fcn.00427260
cmp dword [ebp - 0x18], 8
jb 0x40f64d
mov edx, dword [ebp - 0x2c]
push edx
call fcn.004f77ab
add esp, 4
xor eax, eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], edi
mov word [ebp - 0x2c], ax
mov ebx, 8
cmp dword [ebp - 0x50], ebx
jb 0x40f66f
mov ecx, dword [ebp - 0x64]
push ecx
call fcn.004f77ab
add esp, 4
xor edx, edx
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x54], edi
mov word [ebp - 0x64], dx
mov byte [ebp - 4], 9
cmp dword [ebp - 0x34], ebx
jb 0x40f690
mov eax, dword [ebp - 0x48]
push eax
call fcn.004f77ab
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x38], edi
mov word [ebp - 0x48], cx
call fcn.0040ed40
lea edx, [ebp - 0xb8]
push edx
lea ecx, [ebp - 0x80]
call fcn.0040edd0
add esp, 4
push 0xc
xor eax, eax
push str.kometaup.zip
lea ecx, [ebp - 0xd4]
mov dword [ebp - 0xc0], esi
mov dword [ebp - 0xc4], edi
mov word [ebp - 0xd4], ax
call fcn.00404bd5
lea ecx, [ebp - 0xf0]
mov byte [ebp - 4], 0xa
call fcn.0040e840
lea ebx, [ebp - 0xd4]
mov ecx, eax
lea edi, [ebp - 0x9c]
mov byte [ebp - 4], 0xb
call fcn.00424f20
cmp dword [ebp - 0xdc], 8
jb 0x40f718
mov ecx, dword [ebp - 0xf0]
push ecx
call fcn.004f77ab
add esp, 4
xor edi, edi
xor edx, edx
mov dword [ebp - 0xdc], esi
mov dword [ebp - 0xe0], edi
mov word [ebp - 0xf0], dx
mov ebx, 8
mov byte [ebp - 4], 0xe
cmp dword [ebp - 0xc0], ebx
jb 0x40f74f
mov eax, dword [ebp - 0xd4]
push eax
call fcn.004f77ab
add esp, 4
xor ecx, ecx
mov dword [ebp - 0xc0], esi
mov dword [ebp - 0xc4], edi
mov word [ebp - 0xd4], cx
cmp dword [ebp - 0x88], ebx
jb 0x40f7f1
mov eax, dword [ebp - 0x9c]
cmp eax, edi
je 0x40f839
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f839
test al, 0x10
jne 0x40f839
mov ecx, dword [ebp - 0x9c]
cmp dword [ebp - 0x88], ebx
jae 0x40f7aa
lea ecx, [ebp - 0x9c]
call fcn.004273b0
test al, al
jne 0x40f839
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xab
lea edx, [ebp - 0x1e0]
push edx
mov ebx, str.appstart.cpp
call fcn.0041a6b0
mov esi, eax
mov byte [ebp - 4], 0xf
call fcn.00405fba
mov esi, eax
test esi, esi
je 0x40f823
lea edi, [esi + 0x10]
test edi, edi
je 0x40f7f9
lea eax, [esi + 0x20]
jmp 0x40f7fb
lea eax, [ebp - 0x9c]
jmp 0x40f77e
xor eax, eax
push str.failed_to_check
push eax
call fcn.00407c44
add esp, 8
test edi, edi
je 0x40f812
lea eax, [esi + 0x20]
jmp 0x40f814
xor eax, eax
push eax
lea ecx, [ebp - 0x9c]
call fcn.00407e0a
add esp, 4
lea ecx, [ebp - 0x1e0]
mov byte [ebp - 4], 0xe
call fcn.0041a760
xor edi, edi
mov esi, 7
xor eax, eax
mov byte [ebp - 0xf1], 1
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], edi
mov word [ebp - 0x2c], ax
lea ecx, [ebp - 0x128]
push ecx
mov byte [ebp - 4], 0x10
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
cmp word [ebp - 0x128], 9
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x38], edi
push 0x13
lea ecx, [ebp - 0x48]
jne 0x40f93f
xor edx, edx
push str.kometastartvx64.exe
mov word [ebp - 0x48], dx
call fcn.00404bd5
lea ebx, [ebp - 0x48]
lea ecx, [ebp - 0x80]
lea edi, [ebp - 0x64]
mov byte [ebp - 4], 0x11
call fcn.00424f20
mov edi, eax
lea eax, [ebp - 0x2c]
cmp eax, edi
je 0x40f8fd
cmp dword [ebp - 0x18], 8
jb 0x40f8b3
mov ecx, dword [ebp - 0x2c]
push ecx
call fcn.004f77ab
add esp, 4
xor ebx, ebx
xor edx, edx
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], ebx
mov word [ebp - 0x2c], dx
cmp dword [edi + 0x14], 8
jae 0x40f8dd
mov eax, dword [edi + 0x10]
inc eax
add eax, eax
push eax
lea ecx, [ebp - 0x2c]
push edi
push ecx
call fcn.004f6f30
add esp, 0xc
jmp 0x40f8e4
mov edx, dword [edi]
mov dword [ebp - 0x2c], edx
mov dword [edi], ebx
mov eax, dword [edi + 0x10]
mov dword [ebp - 0x1c], eax
mov ecx, dword [edi + 0x14]
mov dword [ebp - 0x18], ecx
xor edx, edx
mov dword [edi + 0x14], esi
mov dword [edi + 0x10], ebx
mov word [edi], dx
jmp 0x40f8ff
xor ebx, ebx
mov edi, 8
cmp dword [ebp - 0x50], edi
jb 0x40f915
mov eax, dword [ebp - 0x64]
push eax
call fcn.004f77ab
add esp, 4
xor ecx, ecx
mov byte [ebp - 4], 0x10
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x54], ebx
mov word [ebp - 0x64], cx
cmp dword [ebp - 0x34], edi
jb 0x40fa02
mov edx, dword [ebp - 0x48]
push edx
call fcn.004f77ab
add esp, 4
jmp 0x40fa02
xor eax, eax
push str.kometastartvx86.exe
mov word [ebp - 0x48], ax
call fcn.00404bd5
lea ebx, [ebp - 0x48]
lea ecx, [ebp - 0x80]
lea edi, [ebp - 0x64]
mov byte [ebp - 4], 0x13
call fcn.00424f20
mov edi, eax
lea ecx, [ebp - 0x2c]
cmp ecx, edi
je 0x40f9c7
cmp dword [ebp - 0x18], 8
jb 0x40f97c
mov edx, dword [ebp - 0x2c]
push edx
call fcn.004f77ab
add esp, 4
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], ebx
mov word [ebp - 0x2c], ax
cmp dword [edi + 0x14], 8
jae 0x40f9a7
mov eax, dword [edi + 0x10]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [ebp - 0x2c]
push edi
push edx
call fcn.004f6f30
add esp, 0xc
jmp 0x40f9ae
mov eax, dword [edi]
mov dword [ebp - 0x2c], eax
mov dword [edi], ebx
mov ecx, dword [edi + 0x10]
mov dword [ebp - 0x1c], ecx
mov edx, dword [edi + 0x14]
mov dword [ebp - 0x18], edx
xor eax, eax
mov dword [edi + 0x14], esi
mov dword [edi + 0x10], ebx
mov word [edi], ax
jmp 0x40f9c9
xor ebx, ebx
mov edi, 8
cmp dword [ebp - 0x50], edi
jb 0x40f9df
mov ecx, dword [ebp - 0x64]
push ecx
call fcn.004f77ab
add esp, 4
xor edx, edx
mov byte [ebp - 4], 0x10
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x54], ebx
mov word [ebp - 0x64], dx
cmp dword [ebp - 0x34], edi
jb 0x40fa00
mov eax, dword [ebp - 0x48]
push eax
call fcn.004f77ab
add esp, 4
xor ebx, ebx
cmp dword [ebp - 0x18], 8
jb 0x40fa63
mov eax, dword [ebp - 0x2c]
cmp eax, ebx
je 0x40fa23
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40fa23
test al, 0x10
je 0x40faa3
mov byte [ebp - 0xf1], bl
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xc9
lea ecx, [ebp - 0x1e0]
push ecx
mov ebx, str.appstart.cpp
call fcn.0041a6b0
mov esi, eax
mov byte [ebp - 4], 0x15
call fcn.00405fba
mov esi, eax
test esi, esi
je 0x40fa8f
lea edi, [esi + 0x10]
test edi, edi
je 0x40fa68
lea eax, [esi + 0x20]
jmp 0x40fa6a
lea eax, [ebp - 0x2c]
jmp 0x40fa0f
xor eax, eax
push str.failed_to_find_start_button_file:
push eax
call fcn.00407c44
add esp, 8
test edi, edi
je 0x40fa81
lea eax, [esi + 0x20]
jmp 0x40fa83
xor eax, eax
push eax
lea ecx, [ebp - 0x2c]
call fcn.00407e0a
add esp, 4
lea ecx, [ebp - 0x1e0]
mov byte [ebp - 4], 0x10
call fcn.0041a760
xor ebx, ebx
lea esi, [ebx + 7]
cmp dword [ebp - 0x18], 8
mov edi, dword [ebp - 0x2c]
jae 0x40faaf
lea edi, [ebp - 0x2c]
push 0x53ff0c
call fcn.0042b760
add esp, 4
test al, al
jne 0x40fb3d
mov byte [ebp - 0xf1], bl
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xd0
lea edx, [ebp - 0x1e0]
push edx
mov ebx, str.appstart.cpp
call fcn.0041a6b0
mov esi, eax
mov byte [ebp - 4], 0x16
call fcn.00405fba
mov esi, eax
test esi, esi
je 0x40fb27
lea edi, [esi + 0x10]
test edi, edi
je 0x40fb00
lea eax, [esi + 0x20]
jmp 0x40fb02
xor eax, eax
push str.failed_to_launch_start_button:
push eax
call fcn.00407c44
add esp, 8
test edi, edi
je 0x40fb19
lea eax, [esi + 0x20]
jmp 0x40fb1b
xor eax, eax
push eax
lea ecx, [ebp - 0x2c]
call fcn.00407e0a
add esp, 4
lea ecx, [ebp - 0x1e0]
mov byte [ebp - 4], 0x10
call fcn.0041a760
xor ebx, ebx
mov esi, 7
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x100], esp
push 0xffffffffffffffff
push ebx
lea edx, [ebp - 0x2c]
xor eax, eax
mov dword [ecx + 0x14], esi
mov dword [ecx + 0x10], ebx
push edx
mov word [ecx], ax
call fcn.004044ed
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x104], esp
push 0xffffffffffffffff
mov byte [ebp - 4], 0x17
push ebx
lea edx, [ebp - 0x80]
xor eax, eax
mov dword [ecx + 0x14], esi
mov dword [ecx + 0x10], ebx
push edx
mov word [ecx], ax
call fcn.004044ed
mov byte [ebp - 4], 0x10
call fcn.0040f0b0
add esp, 0x38
mov byte [ebp - 4], 0xe
cmp dword [ebp - 0x18], 8
jb 0x40fba7
mov eax, dword [ebp - 0x2c]
push eax
call fcn.004f77ab
add esp, 4
lea edi, [ebp - 0x48]
call fcn.0040eaf0
cmp byte [ebp - 0xf1], bl
jne 0x40fc29
lea ecx, [ebp - 0x64]
push 0x53ff0c
push ecx
mov ecx, eax
mov byte [ebp - 4], 0x18
call fcn.00405ce0
add esp, 8
mov byte [ebp - 4], 0x19
cmp dword [eax + 0x14], 8
jb 0x40fbda
mov eax, dword [eax]
mov ecx, dword [ebp - 0xb8]
mov edi, 8
cmp dword [ebp - 0xa4], edi
jae 0x40fbf3
lea ecx, [ebp - 0xb8]
push edi
push str.install_fail
call fcn.00410d00
add esp, 8
cmp dword [ebp - 0x50], edi
jb 0x40fc12
mov edx, dword [ebp - 0x64]
push edx
call fcn.004f77ab
add esp, 4
xor eax, eax
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x54], ebx
mov word [ebp - 0x64], ax
cmp dword [ebp - 0x34], edi
jb 0x40fca1
mov ecx, dword [ebp - 0x48]
push ecx
jmp 0x40fc99
lea edx, [ebp - 0x64]
push 0x53ff0c
push edx
mov ecx, eax
mov byte [ebp - 4], 0x1a
call fcn.00405ce0
add esp, 8
mov byte [ebp - 4], 0x1b
cmp dword [eax + 0x14], 8
jb 0x40fc4c
mov eax, dword [eax]
mov ecx, dword [ebp - 0xb8]
mov edi, 8
cmp dword [ebp - 0xa4], edi
jae 0x40fc65
lea ecx, [ebp - 0xb8]
push edi
push str.install_success
call fcn.00410d00
add esp, 8
cmp dword [ebp - 0x50], edi
jb 0x40fc84
mov eax, dword [ebp - 0x64]
push eax
call fcn.004f77ab
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x54], ebx
mov word [ebp - 0x64], cx
cmp dword [ebp - 0x34], edi
jb 0x40fca1
mov edx, dword [ebp - 0x48]
push edx
call fcn.004f77ab
add esp, 4
mov edi, 8
cmp dword [ebp - 0x88], edi
jb 0x40fcbd
mov eax, dword [ebp - 0x9c]
push eax
call fcn.004f77ab
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x88], esi
mov dword [ebp - 0x8c], ebx
mov word [ebp - 0x9c], cx
cmp dword [ebp - 0xa4], edi
jb 0x40fce9
mov edx, dword [ebp - 0xb8]
push edx
call fcn.004f77ab
add esp, 4
xor eax, eax
mov dword [ebp - 0xa4], esi
mov dword [ebp - 0xa8], ebx
mov word [ebp - 0xb8], ax
cmp dword [ebp - 0x6c], edi
jb 0x40fd0f
mov ecx, dword [ebp - 0x80]
push ecx
call fcn.004f77ab
add esp, 4
mov dword [ebp - 0x6c], esi
mov esi, dword [ebp - 0xfc]
xor edx, edx
push esi
mov dword [ebp - 0x70], ebx
mov word [ebp - 0x80], dx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
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.004f6bad
mov esp, ebp
pop ebp
ret