Function at 0x404840
Capabilities:
Check if file exists
Create process on windows
Create thread
Read .ini file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x840
mov eax, dword [0x4a4300]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push 0x63
lea eax, [ebp - 0xd7]
mov dword [ebp - 0x7e4], ecx
push 0
push eax
mov byte [ebp - 0xd8], 0
call fcn.00452270
add esp, 0xc
mov byte [ebp - 0x70], 0
lea eax, [ebp - 0x6f]
push 0x63
push 0
push eax
call fcn.00452270
add esp, 0xc
mov byte [ebp - 0x330], 0
lea eax, [ebp - 0x32f]
push 0x257
push 0
push eax
call fcn.00452270
add esp, 0xc
mov byte [ebp - 0x588], 0
lea eax, [ebp - 0x587]
push 0x257
push 0
push eax
call fcn.00452270
add esp, 0xc
lea ecx, [ebp - 0xd8]
call fcn.00403c00
test eax, eax
je 0x404cb9
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [ebp - 0x330]
push 0x4a8890
push 0x258
push eax
push 0
push str.GameX
push str.PATH
call esi
test eax, eax
je 0x40497c
lea eax, [ebp - 0x330]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
cmp eax, 1
jne 0x40497c
lea edx, [ebp - 0x70]
lea ecx, [ebp - 0x330]
call fcn.004024e0
cmp eax, 1
jne 0x40497c
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0xd8]
push eax
call fcn.004572e3
add esp, 8
test eax, eax
jne 0x40497c
lea ecx, [ebp - 0x330]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404944
sub ecx, edx
lea eax, [ebp - 0x330]
push ecx
push eax
lea eax, [ebp - 0x588]
push eax
call fcn.00451c20
add esp, 0xc
lea eax, [ebp - 0x588]
push 0x5c
push eax
call fcn.00457750
add esp, 8
test eax, eax
je 0x40497c
mov byte [eax], 0
lea ecx, [ebp - 0x588]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404985
sub ecx, edx
jne 0x404b42
call fcn.00403e80
call fcn.00403a90
push 0x4a8890
push 0x258
cmp eax, 1
lea eax, [ebp - 0x588]
push eax
push 0
jne 0x4049bd
push str.Start
jmp 0x4049c2
push str.Game
push str.PATH
call esi
test eax, eax
je 0x404cb9
push 0x258
lea eax, [ebp - 0x330]
push 0
push eax
call fcn.00452270
lea edx, [ebp - 0x588]
add esp, 0xc
mov esi, edx
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x4049f0
lea edi, [ebp - 0x330]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404a00
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x330]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x404a20
mov ax, word [0x482998]
mov edx, 0x6b05b0
mov word [edi], ax
mov esi, edx
lea ebx, [ebx]
mov al, byte [edx]
inc edx
test al, al
jne 0x404a40
lea edi, [ebp - 0x330]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404a50
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x6b0614
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404a70
sub ecx, edx
je 0x404ac6
lea edi, [ebp - 0x330]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x404a82
mov ax, word [0x482a18]
mov edx, 0x6b0614
mov word [edi], ax
mov esi, edx
lea esp, [esp]
mov al, byte [edx]
inc edx
test al, al
jne 0x404aa0
lea edi, [ebp - 0x330]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404ab0
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebp - 0x330]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x404cb9
push 0x64
lea eax, [ebp - 0x70]
push 0
push eax
call fcn.00452270
add esp, 0xc
lea edx, [ebp - 0x70]
lea ecx, [ebp - 0x330]
call fcn.004024e0
test eax, eax
je 0x404cb9
push 0x64
lea eax, [ebp - 0xd8]
push 0
push eax
call fcn.00452270
add esp, 0xc
lea ecx, [ebp - 0xd8]
call fcn.00403c00
test eax, eax
je 0x404cb9
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0xd8]
push eax
call fcn.004572e3
add esp, 8
test eax, eax
jne 0x404cb9
push 0x40
lea eax, [ebp - 0x82c]
push 0
push eax
call fcn.00452270
add esp, 0xc
mov dword [ebp - 0x830], 0x44
mov eax, 1
mov dword [ebp - 0x804], 0
mov word [ebp - 0x800], ax
lea eax, [ebp - 0x7df]
mov byte [ebp - 0x7e0], 0
push 0x257
push 0
push eax
call fcn.00452270
lea edi, [ebp - 0x7e0]
add esp, 0xc
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x404ba0
mov ax, word [0x482934]
lea edx, [ebp - 0x330]
mov word [edi], ax
mov esi, edx
jmp 0x404bc0
mov cl, byte [edx]
inc edx
test cl, cl
jne 0x404bc0
lea edi, [ebp - 0x7e0]
sub edx, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x404bd0
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x7e0]
dec edi
lea ecx, [ecx]
mov cl, byte [edi + 1]
lea edi, [edi + 1]
test cl, cl
jne 0x404bf0
mov word [edi], ax
xorps xmm0, xmm0
lea eax, [ebp - 0x840]
push eax
lea eax, [ebp - 0x830]
push eax
lea eax, [ebp - 0x588]
push eax
push 0
push 0x10
push 0
push 0
push 0
lea eax, [ebp - 0x7e0]
push eax
push 0
movdqu xmmword [ebp - 0x840], xmm0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x404cb9
mov eax, dword [ebp - 0x83c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x404c57
push eax
call esi
mov dword [ebp - 0x83c], 0
cmp dword [ebp - 0x7e4], 1
jne 0x404cac
lea eax, [ebp - 0x7e4]
mov dword [ebp - 0x7e4], 0
push eax
push 0
push 0
push 0x4043f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
je 0x404c8b
push eax
call esi
mov edx, dword [ebp - 0x838]
mov ecx, dword [ebp - 0x840]
call fcn.004047c0
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00451570
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x840]
test eax, eax
je 0x404cb9
push eax
call esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.00451570
mov esp, ebp
pop ebp
ret