Function at 0x1000bca0
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get common file path
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x100370b4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
push str.IsWow64Process
push 0x1002c888
call dword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_GetModuleHandleA]
push eax
call dword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_GetProcAddress]
mov esi, eax
mov dword [0x10037ce4], 0
call dword [sym.imp.api_ms_win_core_sysinfo_l1_1_0.dll_GetVersion]
cmp eax, 0x80000000
jb 0x1000bd0b
pop edi
pop esi
mov dword [0x10037ce0], 0
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100142a9
mov esp, ebp
pop ebp
ret 8
mov dword [0x10037ce0], 1
test esi, esi
je 0x1000bd34
push 0x10037ce4
call dword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_GetCurrentProcess]
push eax
call esi
cmp dword [0x10037ce0], 0
je 0x1000c024
movzx eax, word [ebp + 8]
push edi
push eax
push 0
call dword [sym.imp.api_ms_win_core_kernel32_legacy_l1_1_0.dll_FindResourceA]
mov esi, eax
push esi
push 0
call dword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_LoadResource]
mov edi, eax
push edi
call dword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_LockResource]
push esi
mov ebx, eax
push 0
mov dword [ebp - 0x218], ebx
call dword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_SizeofResource]
mov dword [ebp - 0x214], eax
test esi, esi
je 0x1000bfea
test edi, edi
je 0x1000bfea
test ebx, ebx
je 0x1000bfea
test eax, eax
je 0x1000bfea
push 0x104
lea eax, [ebp - 0x210]
push eax
call dword [sym.imp.api_ms_win_core_sysinfo_l1_1_0.dll_GetWindowsDirectoryA]
lea edi, [ebp - 0x210]
dec edi
cmp dword [0x10037ce4], 0
je 0x1000bdc0
nop
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1000bdb0
mov esi, str.SysWOW64drivers_rtport.sys
jmp 0x1000bdcd
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1000bdc0
mov esi, str._system32drivers_rtport.sys
mov ebx, dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileA]
lea eax, [ebp - 0x210]
mov ecx, 7
rep movsd dword es:[edi], dword [esi]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push eax
movsb byte es:[edi], byte [esi]
call ebx
mov edi, eax
cmp edi, 0xffffffff
je 0x1000be17
push 0
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileSize]
push edi
mov esi, eax
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
cmp esi, dword [ebp - 0x214]
je 0x1000be6e
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x210]
push eax
call ebx
mov edi, eax
cmp edi, 0xffffffff
je 0x1000be60
push 0
lea eax, [ebp - 0x21c]
push eax
push dword [ebp - 0x214]
push dword [ebp - 0x218]
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
push edi
mov esi, eax
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
jmp 0x1000be66
mov esi, dword [ebp - 0x21c]
test esi, esi
je 0x1000bfea
mov ax, word [0x1002d3a8]
movq xmm0, qword [str.._rtport]
push 0
push 0x80
push 3
push 0
mov word [ebp - 0x100], ax
mov al, byte [0x1002d3aa]
push 0
mov byte [ebp - 0xfe], al
lea eax, [ebp - 0x108]
push 0xc0000000
push eax
movq qword [ebp - 0x108], xmm0
call ebx
mov dword [0x10037cdc], eax
cmp eax, 0xffffffff
jne 0x1000c024
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 2
jne 0x1000bfea
push 0x10037ce8
push 0x104
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetCurrentDirectoryA]
test eax, eax
je 0x1000bfea
mov edi, 0x10037ce8
lea ecx, [edi - 1]
nop
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x1000bef0
mov eax, dword [str._rtport.sys]
push 0
push 0x80
push 3
push 0
mov dword [ecx], eax
mov eax, dword [0x1002d3b8]
push 0
mov dword [ecx + 4], eax
mov eax, dword [0x1002d3bc]
push 0x80000000
push 0x10037ce8
mov dword [ecx + 8], eax
call ebx
cmp eax, 0xffffffff
jne 0x1000bf93
push 0x104
push 0x10037ce8
call dword [sym.imp.api_ms_win_core_sysinfo_l1_1_0.dll_GetWindowsDirectoryA]
test eax, eax
je 0x1000bfea
dec edi
cmp dword [0x10037ce4], 0
je 0x1000bf60
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1000bf51
mov esi, str.SysWOW64drivers_rtport.sys
jmp 0x1000bf6d
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1000bf60
mov esi, str._system32drivers_rtport.sys
mov ecx, 7
rep movsd dword es:[edi], dword [esi]
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push 0x10037ce8
movsb byte es:[edi], byte [esi]
call ebx
cmp eax, 0xffffffff
je 0x1000bfea
test eax, eax
je 0x1000bf9e
push eax
call dword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
push 1
push 0x10037ce8
push str.rtport
call fcn.1000c040
test eax, eax
jne 0x1000bfff
push 2
push 0x10037ce8
push str.rtport
call fcn.1000c040
push 1
push 0x10037ce8
push str.rtport
call fcn.1000c040
test eax, eax
jne 0x1000bfff
push 2
push 0x10037ce8
push str.rtport
call fcn.1000c040
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100142a9
mov esp, ebp
pop ebp
ret 8
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x108]
push eax
call ebx
mov dword [0x10037cdc], eax
cmp eax, 0xffffffff
je 0x1000bfea
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100142a9
mov esp, ebp
pop ebp
ret 8