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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x42c
call fcn.00403bf0
mov dword [esp + 8], 0x104
mov dword [esp + 4], 0x4091a0
mov dword [esp], 0
call sub.KERNEL32.dll_GetModuleFileNameA
sub esp, 0xc
test eax, eax
je 0x404620
mov dword [esp], 0x409080
call fcn.00403780
mov dword [esp + 4], 0x4091a0
mov dword [esp], str.OCRA_EXECUTABLE
call sub.KERNEL32.dll_SetEnvironmentVariableA
sub esp, 8
mov dword [esp + 4], 1
mov dword [esp], 0x403400
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], 0x4091a0
call sub.KERNEL32.dll_CreateFileA
sub esp, 0x1c
cmp eax, 0xffffffff
mov ebx, eax
je 0x404680
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 0x404692
call sub.KERNEL32.dll_GetLastError
lea esi, [ebp - 0x418]
mov dword [esp], esi
mov dword [esp + 8], str.Failed_to_create_file_mapping__error__lu_
mov dword [esp + 4], 0x400
mov dword [esp + 0xc], eax
call sub.msvcrt.dll__snprintf
mov dword [esp + 4], esi
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
sub esp, 0x10
mov dword [esp], ebx
call sub.KERNEL32.dll_CloseHandle
mov eax, 0xffffffff
sub esp, 4
lea esp, [ebp - 0xc]
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, [ebp - 0x418]
mov dword [esp], ebx
mov dword [esp + 4], 0x400
call sub.msvcrt.dll__snprintf
mov dword [esp + 4], ebx
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], str.OCRA
mov dword [esp], 0
call sub.USER32.dll_MessageBoxA
mov eax, 0xffffffff
sub esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov dword [esp + 0xc], 0x4091a0
mov dword [esp + 8], str.Failed_to_open_executable___s_
jmp 0x404631
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
je 0x40486c
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [ebp - 0x41c], eax
call fcn.00403dc0
mov edx, dword [ebp - 0x41c]
test eax, eax
jne 0x4046eb
mov dword [0x40902c], 0xffffffff
mov dword [esp], edx
call sub.KERNEL32.dll_UnmapViewOfFile
test eax, eax
push edi
je 0x4047f0
mov dword [esp], esi
call sub.KERNEL32.dll_CloseHandle
test eax, eax
push ecx
jne 0x40474a
lea esi, [ebp - 0x418]
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 edx
jne 0x404798
lea ebx, [ebp - 0x418]
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 [0x406044], 0
je 0x4047bb
mov dword [esp], 0x409080
call sub.KERNEL32.dll_SetCurrentDirectoryA
push eax
mov dword [esp], str.._src
call sub.KERNEL32.dll_SetCurrentDirectoryA
push eax
mov eax, dword [0x409034]
test eax, eax
je 0x4047da
mov edx, dword [0x409030]
test edx, edx
je 0x4047da
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00404320
cmp dword [0x409020], 0
jne 0x404836
mov eax, dword [0x40902c]
mov dword [esp], eax
call sub.KERNEL32.dll_ExitProcess
lea edi, [ebp - 0x418]
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 0x4046fc
lea ebx, [ebp - 0x418]
mov dword [esp + 4], 0x104
mov dword [esp], ebx
call sub.KERNEL32.dll_GetSystemDirectoryA
test eax, eax
push edi
push edi
je 0x404898
mov dword [esp], ebx
call sub.KERNEL32.dll_SetCurrentDirectoryA
push esi
mov dword [esp], 0x409080
call fcn.00403bc0
jmp 0x4047e3
call sub.KERNEL32.dll_GetLastError
lea edi, [ebp - 0x418]
mov dword [esp + 8], str.Failed_to_map_view_of_executable_into_memory__error__lu_.
mov dword [esp + 4], 0x400
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll__snprintf
jmp 0x40480e
mov dword [esp], 0x407384
call sub.KERNEL32.dll_SetCurrentDirectoryA
push ebx
jmp 0x40485b