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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x840
mov eax, dword [0x4a2300]
xor eax, esp
mov dword [esp + 0x83c], eax
push esi
push edi
push 0x63
lea eax, [esp + 0xd5]
mov dword [esp + 0x20], ecx
push 0
push eax
mov byte [esp + 0xdc], 0
call fcn.00451650
add esp, 0xc
mov byte [esp + 0x68], 0
lea eax, [esp + 0x69]
push 0x63
push 0
push eax
call fcn.00451650
add esp, 0xc
mov byte [esp + 0x138], 0
lea eax, [esp + 0x139]
push 0x257
push 0
push eax
call fcn.00451650
add esp, 0xc
mov byte [esp + 0x390], 0
lea eax, [esp + 0x391]
push 0x257
push 0
push eax
call fcn.00451650
add esp, 0xc
lea ecx, [esp + 0xd0]
call fcn.00403a30
test eax, eax
je 0x404989
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [esp + 0x138]
push 0x4a6890
push 0x258
push eax
push 0
push str.GameX
push str.PATH
call esi
test eax, eax
je 0x40469b
lea eax, [esp + 0x138]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
cmp eax, 1
jne 0x40469b
lea edx, [esp + 0x68]
lea ecx, [esp + 0x138]
call fcn.00402460
cmp eax, 1
jne 0x40469b
lea eax, [esp + 0x68]
push eax
lea eax, [esp + 0xd4]
push eax
call fcn.00456643
add esp, 8
test eax, eax
jne 0x40469b
lea ecx, [esp + 0x138]
lea edx, [ecx + 1]
lea ecx, [ecx]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404660
sub ecx, edx
lea eax, [esp + 0x138]
push ecx
push eax
lea eax, [esp + 0x398]
push eax
call fcn.00451000
add esp, 0xc
lea eax, [esp + 0x390]
push 0x5c
push eax
call fcn.00456990
add esp, 8
test eax, eax
je 0x40469b
mov byte [eax], 0
lea ecx, [esp + 0x390]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4046a5
sub ecx, edx
jne 0x404832
call fcn.00403b50
call fcn.004038c0
push 0x4a6890
push 0x258
cmp eax, 1
lea eax, [esp + 0x398]
push eax
push 0
jne 0x4046de
push str.Start
jmp 0x4046e3
push str.Game
push str.PATH
call esi
test eax, eax
je 0x404989
push 0x258
lea eax, [esp + 0x13c]
push 0
push eax
call fcn.00451650
lea edx, [esp + 0x39c]
add esp, 0xc
mov esi, edx
mov al, byte [edx]
inc edx
test al, al
jne 0x404712
lea edi, [esp + 0x138]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404723
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, [esp + 0x138]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x404741
mov ax, word [0x480958]
mov edx, 0x6ae530
mov word [edi], ax
mov esi, edx
jmp 0x404760
mov al, byte [edx]
inc edx
test al, al
jne 0x404760
lea edi, [esp + 0x138]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x404771
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, 0x6ae594
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404790
sub ecx, edx
je 0x4047e7
lea edi, [esp + 0x138]
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4047a3
mov ax, word [0x4809d8]
mov edx, 0x6ae594
mov word [edi], ax
mov esi, edx
lea ecx, [ecx]
mov al, byte [edx]
inc edx
test al, al
jne 0x4047c0
lea edi, [esp + 0x138]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4047d1
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, [esp + 0x138]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x404989
lea edx, [esp + 0x68]
lea ecx, [esp + 0x138]
call fcn.00402460
test eax, eax
je 0x404989
lea eax, [esp + 0x68]
push eax
lea eax, [esp + 0xd4]
push eax
call fcn.00456643
add esp, 8
test eax, eax
jne 0x404989
push 0x40
lea eax, [esp + 0x28]
push 0
push eax
call fcn.00451650
add esp, 0xc
mov dword [esp + 0x20], 0x44
mov eax, 1
mov dword [esp + 0x4c], 0
mov word [esp + 0x50], ax
lea eax, [esp + 0x5e9]
mov byte [esp + 0x5e8], 0
push 0x257
push 0
push eax
call fcn.00451650
lea edi, [esp + 0x5f4]
add esp, 0xc
dec edi
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x404884
mov ax, word [0x4808f4]
lea edx, [esp + 0x138]
mov word [edi], ax
mov esi, edx
mov cl, byte [edx]
inc edx
test cl, cl
jne 0x4048a0
lea edi, [esp + 0x5e8]
sub edx, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4048b1
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, [esp + 0x5e8]
dec edi
nop
mov cl, byte [edi + 1]
lea edi, [edi + 1]
test cl, cl
jne 0x4048d0
mov word [edi], ax
xorps xmm0, xmm0
lea eax, [esp + 0xc]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x398]
push eax
push 0
push 0x10
push 0
push 0
push 0
lea eax, [esp + 0x608]
push eax
push 0
movdqu xmmword [esp + 0x34], xmm0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x404989
mov eax, dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40492f
push eax
call esi
mov dword [esp + 0x10], 0
cmp dword [esp + 0x1c], 1
jne 0x40497e
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push eax
push 0
push 0
push 0x4040f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
je 0x40495d
push eax
call esi
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0xc]
call fcn.004044c0
pop edi
pop esi
mov ecx, dword [esp + 0x83c]
xor ecx, esp
call fcn.0045094b
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0xc]
test eax, eax
je 0x404989
push eax
call esi
mov ecx, dword [esp + 0x844]
pop edi
pop esi
xor ecx, esp
call fcn.0045094b
mov esp, ebp
pop ebp
ret