Function at 0x402720
Capabilities:
Check if file exists
Create process on windows
Create process suspended
Create thread
Get file attributes
Inject dll
Inject thread
Resume thread
Use process replacement

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
mov eax, 0x10a8
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
call fcn.004025a0
sub esp, eax
mov eax, dword [ecx]
mov dword [ebp - 0x1080], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0x1084], eax
call fcn.004016c0
mov dword [esp], str.terranx.exe
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
call ebx
sub esp, 4
cmp eax, 0xffffffff
je 0x402a4b
mov dword [esp], str.thinker.dll
call ebx
sub esp, 4
cmp eax, 0xffffffff
je 0x402a19
xor eax, eax
lea edi, [ebp - 0x1058]
mov ecx, 0x10
cmp dword [ebp - 0x1080], 1
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x100c]
mov ecx, 0x3fd
mov dword [ebp - 0x106c], 0
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x1018]
mov dword [ebp - 0x1068], 0
mov dword [ebp - 0x1064], 0
mov dword [ebp - 0x1060], 0
mov dword [ebp - 0x105c], 0x44
mov dword [ebp - 0x1018], 0x72726574
mov dword [ebp - 0x1014], 0x2e786e61
mov dword [ebp - 0x1010], 0x657865
jle 0x402866
mov ebx, 1
lea edi, [ebp - 0x1018]
jmp 0x402838
mov eax, 0x20
add ebx, 1
mov word [edi + edx], ax
mov dword [esp + 8], 0xffc
mov dword [esp + 4], esi
mov dword [esp], edi
call sub.msvcrt.dll_strncat
cmp dword [ebp - 0x1080], ebx
je 0x402866
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov dword [ebp - 0x107c], eax
mov eax, dword [ebp - 0x1084]
mov esi, dword [eax + ebx*4]
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov edx, dword [ebp - 0x107c]
add eax, edx
cmp eax, 0xffb
jbe 0x402810
lea eax, [ebp - 0x106c]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x105c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], str.terranx.exe
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
sub esp, 0x28
test eax, eax
je 0x402a14
mov dword [esp], str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
sub esp, 4
mov dword [esp + 4], str.LoadLibraryA
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
sub esp, 8
mov esi, eax
test eax, eax
je 0x402a14
mov dword [esp + 0x10], 4
mov dword [esp + 0xc], 0x3000
mov dword [esp + 8], 0xc
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x106c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
sub esp, 0x14
mov ebx, eax
test eax, eax
je 0x402a14
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xc
mov dword [esp + 8], str.thinker.dll
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x106c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
sub esp, 0x14
test eax, eax
je 0x402a14
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x106c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
sub esp, 0x1c
test eax, eax
je 0x402a14
mov dword [esp], 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x1068]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
sub esp, 4
test eax, eax
je 0x402a14
mov dword [esp + 4], 0x64
mov eax, dword [ebp - 0x106c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x106c]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 8
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x1068]
sub esp, 4
mov dword [esp], eax
call ebx
xor eax, eax
sub esp, 4
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
call fcn.00401550
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], 0x404103
mov dword [esp + 4], str.Cannot_find_thinker.dll._Game_is_unable_to_start.
xor edx, edx
mov dword [esp], edx
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], 0x404103
mov dword [esp + 4], str.Cannot_find_terranx.exe._Game_is_unable_to_start.
jmp 0x402a31