Function at 0x404388
Capabilities:
Delete file
Get file size
Read file via mapping
Set current directory
Set environment variable
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
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 0x4044f4
mov dword [esp], 0x409080
call fcn.00403888
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], 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], 0x4091a0
call sub.KERNEL32.dll_CreateFileA
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x404558
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 0x404593
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esi, 0x40
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_to_create_file_mapping__error__lu_
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov dword [esp + 4], esi
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
mov dword [esp], ebx
call sub.KERNEL32.dll_CloseHandle
push ecx
mov eax, 0xffffffff
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x40
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_to_get_executable_name__error__lu_.
mov dword [esp], ebx
call sub.msvcrt.dll_fprintf
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
mov eax, 0xffffffff
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x40
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
mov dword [esp + 8], 0x4091a0
mov dword [esp + 4], str.Failed_to_open_executable___s_
jmp 0x40452e
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 0x4047e4
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.00403d1c
test eax, eax
jne 0x4045e2
mov dword [0x40902c], 0xffffffff
mov dword [esp], ebp
call sub.KERNEL32.dll_UnmapViewOfFile
push edx
test eax, eax
jne 0x404648
mov edi, dword [sym.imp.msvcrt.dll__iob]
add edi, 0x40
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0x23
mov dword [esp + 4], 1
mov dword [esp], str.Failed_to_unmap_view_of_executable.
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], edi
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
mov dword [esp], esi
call sub.KERNEL32.dll_CloseHandle
push ebp
test eax, eax
jne 0x4046ae
mov esi, dword [sym.imp.msvcrt.dll__iob]
add esi, 0x40
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x1d
mov dword [esp + 4], 1
mov dword [esp], str.Failed_to_close_file_mapping.
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], esi
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
mov dword [esp], ebx
call sub.KERNEL32.dll_CloseHandle
push edi
test eax, eax
jne 0x404714
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x40
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 1
mov dword [esp], str.Failed_to_close_executable.
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
cmp dword [0x406044], 0
je 0x404744
cmp dword [0x409024], 0
jne 0x40483b
mov dword [esp], 0x409080
call sub.KERNEL32.dll_SetCurrentDirectoryA
push ebx
mov dword [esp], str.._src
call sub.KERNEL32.dll_SetCurrentDirectoryA
push esi
cmp dword [0x409034], 0
je 0x404779
cmp dword [0x409030], 0
je 0x404779
cmp dword [0x409024], 0
jne 0x404871
mov eax, dword [0x409030]
mov dword [esp + 4], eax
mov eax, dword [0x409034]
mov dword [esp], eax
call fcn.004041a0
cmp dword [0x409020], 0
je 0x4047d7
cmp dword [0x409024], 0
jne 0x404921
mov dword [esp + 0x22], 0
mov dword [esp + 0x26], 3
mov dword [esp], 0x409080
call sub.KERNEL32.dll_lstrlenA
push edx
mov byte [eax + 0x409081], 0
mov dword [esp + 0x2a], 0x409080
mov dword [esp + 0x2e], 0
mov word [esp + 0x32], 0x414
lea eax, [esp + 0x22]
mov dword [esp], eax
call sub.SHELL32.DLL_SHFileOperationA
push ecx
mov eax, dword [0x40902c]
mov dword [esp], eax
call sub.KERNEL32.dll_ExitProcess
mov edi, dword [sym.imp.msvcrt.dll__iob]
add edi, 0x40
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0xd
mov dword [esp + 4], 1
mov dword [esp], str.FATAL_ERROR:
call sub.msvcrt.dll_fwrite
call sub.KERNEL32.dll_GetLastError
mov dword [esp + 8], eax
mov dword [esp + 4], str.Failed_to_map_view_of_executable_into_memory__error__lu_.
mov dword [esp], edi
call sub.msvcrt.dll_fprintf
mov dword [esp + 4], edi
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
jmp 0x404648
mov dword [esp + 8], 0x409080
mov dword [esp + 4], str.Changing_CWD_to_unpacked_directory__s_src
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x40
mov dword [esp], ebx
call sub.msvcrt.dll_fprintf
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
jmp 0x40472a
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x40
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], 1
mov dword [esp], 0x40745c
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
cmp dword [0x409024], 0
je 0x404763
mov dword [esp + 8], 0x409080
mov dword [esp + 4], str.Starting_app_in:__s
mov dword [esp], ebx
call sub.msvcrt.dll_fprintf
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
cmp dword [0x409024], 0
je 0x404763
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xa
mov dword [esp + 4], 1
mov dword [esp], 0x40745c
call sub.msvcrt.dll_fwrite
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
jmp 0x404763
mov dword [esp + 8], 0x409080
mov dword [esp + 4], str.Deleting_temporary_installation_directory__s
mov ebx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 0x40
mov dword [esp], ebx
call sub.msvcrt.dll_fprintf
mov dword [esp + 4], ebx
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
jmp 0x40478f