Function at 0x404720
Capabilities:
Get common file path
Get file size
Read file via mapping
Set current directory
Set environment variable
Terminate process

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x42c
call fcn.00403ed0
mov dword [esp + 8], 0x104
mov dword [esp + 4], 0x40a540
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
sub esp, 0xc
test eax, eax
je 0x4048a0
mov dword [esp], 0x40a420
call fcn.00403a40
mov dword [esp + 4], 0x40a540
mov dword [esp], str.OCRA_EXECUTABLE
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
sub esp, 8
mov dword [esp + 4], 1
mov dword [esp], 0x403630
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
sub esp, 8
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov dword [esp], 0x40a540
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
cmp eax, 0xffffffff
mov ebx, eax
je 0x4048f0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
sub esp, 8
mov edi, eax
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
sub esp, 0x18
cmp eax, 0xffffffff
mov esi, eax
jne 0x404902
lea esi, [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 8], str.Failed_to_create_file_mapping__error__lu_
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x400
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], esi
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
add esp, 0x42c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 8], str.Failed_to_get_executable_name__error__lu_.
mov dword [esp + 0xc], eax
lea ebx, [esp + 0x20]
mov dword [esp + 4], 0x400
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
jmp 0x404886
mov dword [esp + 0xc], 0x40a540
mov dword [esp + 8], str.Failed_to_open_executable___s_
jmp 0x4048b2
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
sub esp, 0x14
test eax, eax
mov ebp, eax
je 0x404ad6
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.00404090
test eax, eax
jne 0x404952
mov dword [0x40a040], 0xffffffff
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
test eax, eax
push ecx
je 0x404a90
mov dword [esp], esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
test eax, eax
push edx
jne 0x4049b5
lea edi, [esp + 0x20]
mov dword [esp + 8], str.Failed_to_close_file_mapping.
mov dword [esp + 4], 0x400
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
mov dword [esp], ebx
call esi
test eax, eax
push ebp
jne 0x404a00
lea ebx, [esp + 0x20]
mov dword [esp + 8], str.Failed_to_close_executable.
mov dword [esp + 4], 0x400
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
cmp dword [0x406064], 0
je 0x404a23
mov ebx, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov dword [esp], 0x40a420
call ebx
push esi
mov dword [esp], str.._src
call ebx
push edi
mov eax, dword [0x40a048]
test eax, eax
je 0x404a42
mov edx, dword [0x40a044]
test edx, edx
je 0x404a42
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00404580
cmp dword [0x40a034], 0
jne 0x404a59
mov eax, dword [0x40a040]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ExitProcess]
lea ebx, [esp + 0x20]
mov dword [esp + 4], 0x104
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
push ecx
push ecx
je 0x404aff
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push edx
mov dword [esp], 0x40a420
call fcn.00403ea0
jmp 0x404a4b
lea edi, [esp + 0x20]
mov dword [esp + 8], str.Failed_to_unmap_view_of_executable.
mov dword [esp + 4], 0x400
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], edi
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
jmp 0x404964
lea edi, [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 8], str.Failed_to_map_view_of_executable_into_memory__error__lu_.
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x400
mov dword [esp], edi
call dword [sym.imp.msvcrt.dll__snprintf]
jmp 0x404aad
mov dword [esp], 0x407368
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push eax
jmp 0x404a82