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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x42c
call fcn.00403d70
mov dword [esp + 8], 0x104
mov dword [esp + 4], 0x40c1c0
mov dword [esp], 0
call sub.KERNEL32.dll_GetModuleFileNameA
sub esp, 0xc
test eax, eax
je 0x404730
mov dword [esp], 0x40c0a0
call fcn.004038c0
mov dword [esp + 4], 0x40c1c0
mov dword [esp], str.OCRA_EXECUTABLE
call sub.KERNEL32.dll_SetEnvironmentVariableA
sub esp, 8
mov dword [esp + 4], 1
mov dword [esp], 0x4034f0
call sub.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], 0x40c1c0
call sub.KERNEL32.dll_CreateFileA
sub esp, 0x1c
cmp eax, 0xffffffff
mov ebx, eax
je 0x404780
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.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 sub.KERNEL32.dll_CreateFileMappingA
sub esp, 0x18
cmp eax, 0xffffffff
mov esi, eax
jne 0x404792
lea esi, [esp + 0x20]
call sub.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 sub.msvcrt.dll__snprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], esi
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
mov dword [esp], ebx
call sub.KERNEL32.dll_CloseHandle
sub esp, 4
add esp, 0x42c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
call sub.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 sub.msvcrt.dll__snprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], ebx
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
jmp 0x40471c
mov dword [esp + 0xc], 0x40c1c0
mov dword [esp + 8], str.Failed_to_open_executable___s_
jmp 0x404741
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 sub.KERNEL32.dll_MapViewOfFile
sub esp, 0x14
test eax, eax
mov ebp, eax
je 0x40495a
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.00403f20
test eax, eax
jne 0x4047e1
mov dword [0x40c02c], 0xffffffff
mov dword [esp], ebp
call sub.KERNEL32.dll_UnmapViewOfFile
test eax, eax
push edx
je 0x4048e2
mov dword [esp], esi
call sub.KERNEL32.dll_CloseHandle
test eax, eax
push ebp
jne 0x40483e
lea esi, [esp + 0x20]
mov dword [esp + 8], str.Failed_to_close_file_mapping.
mov dword [esp + 4], 0x400
mov dword [esp], esi
call sub.msvcrt.dll__snprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], esi
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
mov dword [esp], ebx
call sub.KERNEL32.dll_CloseHandle
test eax, eax
push edi
jne 0x40488a
lea ebx, [esp + 0x20]
mov dword [esp + 8], str.Failed_to_close_executable.
mov dword [esp + 4], 0x400
mov dword [esp], ebx
call sub.msvcrt.dll__snprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], ebx
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
cmp dword [0x408064], 0
je 0x4048ad
mov dword [esp], 0x40c0a0
call sub.KERNEL32.dll_SetCurrentDirectoryA
push ebx
mov dword [esp], str.._src
call sub.KERNEL32.dll_SetCurrentDirectoryA
push esi
mov eax, dword [0x40c034]
test eax, eax
je 0x4048cc
mov edx, dword [0x40c030]
test edx, edx
je 0x4048cc
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00404430
cmp dword [0x40c020], 0
jne 0x404926
mov eax, dword [0x40c02c]
mov dword [esp], eax
call sub.KERNEL32.dll_ExitProcess
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 sub.msvcrt.dll__snprintf
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp + 4], edi
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
jmp 0x4047f2
lea ebx, [esp + 0x20]
mov dword [esp + 4], 0x104
mov dword [esp], ebx
call sub.KERNEL32.dll_GetSystemDirectoryA
test eax, eax
push ecx
push ecx
je 0x404984
mov dword [esp], ebx
call sub.KERNEL32.dll_SetCurrentDirectoryA
push edx
mov dword [esp], 0x40c0a0
call fcn.00403d40
jmp 0x4048d5
lea edi, [esp + 0x20]
call sub.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 sub.msvcrt.dll__snprintf
jmp 0x4048fe
mov dword [esp], 0x409388
call sub.KERNEL32.dll_SetCurrentDirectoryA
push eax
jmp 0x404949