Function at 0x14004d540
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa0
xor ebx, ebx
mov r15, r9
mov edi, ebx
mov qword [rsp + 0x48], rbx
mov ebp, ebx
mov qword [rsp + 0x40], rbx
mov r13d, ebx
mov r14, r8
mov r12, rdx
mov esi, ecx
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rsp + 0x50]
lea edx, [rbx + 8]
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x14004d5ae
call fcn.140050120
mov rdx, rax
lea rcx, str.OpenProcessToken_failed:__s
call fcn.14004f910
jmp 0x14004d70e
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0xe0]
xor r9d, r9d
mov qword [rsp + 0x20], rax
xor r8d, r8d
lea edx, [r9 + 1]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
jne 0x14004d70e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x14004d5fc
call fcn.140050120
mov rdx, rax
lea rcx, str.GetTokenInformation__pre__failed:__s
call fcn.14004f910
jmp 0x14004d70e
mov edx, dword [rsp + 0xe0]
mov ecx, 1
call fcn.1400c537c
mov rdi, rax
test rax, rax
je 0x14004d70b
mov r9d, dword [rsp + 0xe0]
lea rax, [rsp + 0xe0]
mov rcx, qword [rsp + 0x50]
mov r8, rdi
mov edx, 1
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x14004d69f
mov rcx, qword [rdi]
lea rdx, [rsp + 0x40]
call qword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidA]
test eax, eax
jne 0x14004d665
call fcn.140050120
lea rcx, str.Unable_to_convert_SID_to_string:__s
jmp 0x14004d6ab
mov rcx, qword [rsp + 0x40]
lea rdx, [rsp + 0x48]
call qword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidA]
test eax, eax
jne 0x14004d692
call fcn.140050120
mov rdx, rax
lea rcx, str.Unable_to_convert_string_back_to_SID:__s
call fcn.14004f910
mov qword [rsp + 0x48], rbx
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x14004d6b3
call fcn.140050120
lea rcx, str.GetTokenInformation__real__failed:__s
mov rdx, rax
call fcn.14004f910
mov rcx, rdi
call fcn.1400e9080
mov rdi, qword [rsp + 0x48]
test rdi, rdi
je 0x14004d70b
mov edx, 1
lea rcx, [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x14004d70b
xor r8d, r8d
lea rcx, [rsp + 0x70]
mov rdx, rdi
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorOwner]
test eax, eax
je 0x14004d70b
lea rax, [rsp + 0x70]
mov dword [rsp + 0x58], 0x18
mov qword [rsp + 0x60], rax
lea rdi, [rsp + 0x58]
mov dword [rsp + 0x68], ebx
jmp 0x14004d722
mov rdi, rbx
call fcn.140050120
mov rdx, rax
lea rcx, str.Could_not_set_security_descriptor:__s
call fcn.14004f910
mov ecx, esi
test esi, esi
je 0x14004d764
sub ecx, 1
je 0x14004d757
cmp ecx, 1
je 0x14004d74d
mov r8d, 0x2b5
lea rdx, str.D:_a_rufus_rufus_src_stdfn.c
lea rcx, str.FALSE
call fcn.1400fc264
jmp 0x14004d772
mov ebp, 4
mov r13d, ebp
jmp 0x14004d772
mov ebp, 0x40000000
mov r13d, 2
jmp 0x14004d772
mov qword [r14], rbx
mov ebp, 0x80000000
mov r13d, 3
mov rcx, r12
call fcn.14004acd0
mov qword [rsp + 0x30], rbx
mov r9, rdi
mov dword [rsp + 0x28], 0x80
mov r8d, 1
mov edx, ebp
mov dword [rsp + 0x20], r13d
mov rcx, rax
mov r12, rax
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
test r12, r12
je 0x14004d7bb
mov rcx, r12
call fcn.1400e9080
mov ecx, ebp
call qword [sym.imp.KERNEL32.dll_SetLastError]
cmp rdi, 0xffffffffffffffff
jne 0x14004d7ea
call fcn.140050120
mov rdx, qword [rsp + 0xe8]
lea rcx, str.Could_not_open__s:__s
mov r8, rax
call fcn.14004f910
jmp 0x14004d889
mov ecx, esi
test esi, esi
je 0x14004d826
sub ecx, 1
je 0x14004d80d
cmp ecx, 1
jne 0x14004d875
lea r9d, [rcx + 1]
xor r8d, r8d
mov rcx, rdi
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov r8d, dword [r15]
mov r9, r15
mov rdx, qword [r14]
mov rcx, rdi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x14004d871
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, eax
mov dword [r15], ecx
call fcn.1400e9094
mov qword [r14], rax
test rax, rax
jne 0x14004d85a
lea rcx, str.Could_not_allocate_buffer_for_reading_file
call fcn.14004f910
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14004d896
mov r8d, dword [r15]
mov r9, r15
mov rdx, rax
mov qword [rsp + 0x20], rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x14004d8a8
call fcn.140050120
mov rdx, rax
lea rcx, str.I_O_Error:__s
call fcn.14004f910
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x14004d8a4
mov rcx, qword [r14]
call fcn.1400e9080
mov qword [r14], rbx
mov dword [r15], ebx
mov eax, ebx
jmp 0x14004d8de
mov rax, qword [rsp + 0xe8]
mov edx, 1
test esi, esi
mov qword [rsp + 0x20], rax
mov ecx, edx
setne bl
xor r8d, r8d
lea r9d, [rbx + 0xc8f]
call fcn.140020c90
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
mov rbx, qword [rsp + 0xf0]
add rsp, 0xa0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret