Function at 0x404004
Capabilities:
Delete file
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
mov dword [esp + 8], 0x104
mov dword [esp + 4], 0x4081a0
mov dword [esp], 0
call sub.KERNEL32.dll_GetModuleFileNameA
sub esp, 0xc
test eax, eax
je 0x40416c
mov dword [esp], 0x408080
call fcn.00403740
mov dword [esp + 4], 0x4081a0
mov dword [esp], str.OCRA_EXECUTABLE
call sub.KERNEL32.dll_SetEnvironmentVariableA
sub esp, 8
mov dword [esp + 4], 1
mov dword [esp], 0x4033f8
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], 0x4081a0
call sub.KERNEL32.dll_CreateFileA
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x4041b8
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
mov esi, eax
cmp eax, 0xffffffff
jne 0x4041ca
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Failed_to_create_file_mapping__error__lu_
mov dword [esp + 4], 0x400
lea esi, [esp + 0x20]
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
push ecx
mov eax, 0xffffffff
add esp, 0x42c
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Failed_to_get_executable_name__error__lu_.
mov dword [esp + 4], 0x400
lea ebx, [esp + 0x20]
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 0x404159
mov dword [esp + 0xc], 0x4081a0
mov dword [esp + 8], str.Failed_to_open_executable___s_
jmp 0x40417d
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
mov ebp, eax
test eax, eax
je 0x4043a6
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.00403aa0
test eax, eax
jne 0x404219
mov dword [0x40802c], 0xffffffff
mov dword [esp], ebp
call sub.KERNEL32.dll_UnmapViewOfFile
push edx
test eax, eax
je 0x404362
mov dword [esp], esi
call sub.KERNEL32.dll_CloseHandle
push ebp
test eax, eax
jne 0x404276
mov dword [esp + 8], str.Failed_to_close_file_mapping.
mov dword [esp + 4], 0x400
lea esi, [esp + 0x20]
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
push edi
test eax, eax
jne 0x4042c2
mov dword [esp + 8], str.Failed_to_close_executable.
mov dword [esp + 4], 0x400
lea ebx, [esp + 0x20]
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 [0x405044], 0
je 0x4042e5
mov dword [esp], 0x408080
call sub.KERNEL32.dll_SetCurrentDirectoryA
push ebx
mov dword [esp], str.._src
call sub.KERNEL32.dll_SetCurrentDirectoryA
push esi
mov eax, dword [0x408034]
test eax, eax
je 0x404304
mov edx, dword [0x408030]
test edx, edx
je 0x404304
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00403e30
cmp dword [0x408020], 0
je 0x404355
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 3
mov dword [esp], 0x408080
call sub.KERNEL32.dll_lstrlenA
push edx
mov byte [eax + 0x408081], 0
mov dword [esp + 0x28], 0x408080
mov dword [esp + 0x2c], 0
mov word [esp + 0x30], 0x414
lea eax, [esp + 0x20]
mov dword [esp], eax
call sub.SHELL32.DLL_SHFileOperationA
push ecx
mov eax, dword [0x40802c]
mov dword [esp], eax
call sub.KERNEL32.dll_ExitProcess
mov dword [esp + 8], str.Failed_to_unmap_view_of_executable.
mov dword [esp + 4], 0x400
lea edi, [esp + 0x20]
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 0x40422a
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Failed_to_map_view_of_executable_into_memory__error__lu_.
mov dword [esp + 4], 0x400
lea edi, [esp + 0x20]
mov dword [esp], edi
call sub.msvcrt.dll__snprintf
jmp 0x40437e