Function at 0x140046ec0
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x138
mov rbx, rcx
mov edi, edx
mov rcx, qword [rsp + 0x1b0]
mov r12, r8
mov rdx, qword [rsp + 0x1b8]
mov ebp, r9d
call fcn.140042df0
test eax, eax
jne 0x140047150
mov rdx, qword [rsp + 0x1a8]
mov ecx, dword [rsp + 0x1a0]
xor r13d, r13d
xor r14d, r14d
call fcn.140043160
lea edx, [rdi + 0x8501]
mov rcx, rbx
mov r8d, eax
call fcn.1400e47f0
mov esi, eax
cmp eax, 0xffffffff
je 0x140046f90
call fcn.140043020
xor edx, edx
mov rcx, rax
call fcn.1400ad9f0
mov rdi, rax
mov rax, qword [rax + 0x28]
mov dword [rax + 0x24], esi
mov rdx, qword [rdi + 0x28]
movzx eax, byte [rdx + 0x20]
and eax, 0xfffffffe
or eax, r13d
mov byte [rdx + 0x20], al
mov rax, qword [rdi + 0x28]
mov qword [rax], r14
test ebp, ebp
jne 0x140047120
mov rsi, qword [rdi + 0x28]
mov rcx, rbx
call fcn.1400e4a90
mov qword [rsi + 8], rax
mov rax, rdi
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r13, qword [sym.imp.msvcrt.dll__errno]
call r13
cmp dword [rax], 0x11
jne 0x140047140
mov eax, dword [rsp + 0x1a0]
mov rdx, qword [rsp + 0x1a8]
mov r15d, edi
mov ecx, dword [rsp + 0x1a0]
or r15d, ebp
and eax, 2
mov dword [rsp + 0x30], eax
call fcn.140043160
cmp r15d, 1
mov edx, 2
mov rcx, rbx
mov r15d, 0x8101
mov dword [rsp + 0x3c], eax
sbb r15d, 0xffffffff
call fcn.1400c7420
mov r14d, eax
test eax, eax
je 0x1400471f0
mov r10d, dword [rsp + 0x30]
test r10d, r10d
je 0x1400471f0
mov r8, qword [0x14048f6b0]
lea rax, [rsp + 0x50]
mov rcx, rbx
mov rdx, rax
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r8
call qword [r8 + 0x60]
mov r15d, eax
call r13
mov r8, qword [rsp + 0x40]
mov r9d, dword [rax]
test r15d, r15d
jne 0x1400477fb
movzx eax, word [rsp + 0x7c]
and ax, 0xf000
cmp ax, 0x8000
je 0x1400471d0
cmp ax, 0x4000
je 0x1400479b5
test r14d, r14d
je 0x1400478a0
test r12, r12
je 0x140047590
lea r15, [rsp + 0xc0]
mov rcx, rbx
mov rdx, r15
call qword [r8 + 0x58]
mov dword [rsp + 0x40], eax
call r13
mov edx, dword [rsp + 0x40]
mov r8d, dword [rax]
test edx, edx
jne 0x140047940
mov r8d, dword [r15 + 0x68]
mov edx, dword [r15 + 0x60]
lea rcx, str._lu:_lu:_lu
mov r9d, dword [r15 + 0x68]
imul r8, r8, 0x10624dd3
shr r8, 0x26
call fcn.1400e4e50
mov rcx, r12
mov rdx, rax
mov r15, rax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x14004776d
mov rcx, r15
call fcn.14034efb0
mov edx, dword [rsp + 0x30]
test edx, edx
jne 0x140047169
cmp dword [rsp + 0x84], 1
jbe 0x140047160
test ebp, ebp
jne 0x140047330
xor edx, edx
mov ecx, esi
call qword [sym.imp.msvcrt.dll__chsize]
cmp eax, 0xffffffff
je 0x140047c7a
cmp esi, 0xffffffff
je 0x140047150
mov r13d, 1
xor r14d, r14d
jmp 0x140046f2d
mov rsi, qword [rdi + 0x28]
xor r8d, r8d
lea rdx, [0x1403707f1]
mov rcx, rbx
call fcn.1400e4ea0
mov qword [rsi + 0x10], rax
jmp 0x140046f66
mov rdx, qword [rsp + 0x1b8]
mov rcx, rbx
call fcn.140044e40
xor edi, edi
jmp 0x140046f76
test r14d, r14d
jne 0x1400470e8
mov rcx, rbx
call fcn.1400c79c0
xor r8d, r8d
lea rdx, str..goutputstream_XXXXXX
mov r12, rax
mov rcx, rax
call fcn.1400cb160
mov rcx, r12
mov r14, rax
call fcn.14034efb0
mov r8d, dword [rsp + 0x3c]
lea edx, [rdi + 0x8001]
mov rcx, r14
or dh, 5
call fcn.1402ac170
mov r12d, eax
cmp eax, 0xffffffff
je 0x140047318
test esi, esi
jns 0x140047250
mov esi, r12d
mov r13d, 1
jmp 0x140046f2d
test r12, r12
je 0x1400470d2
mov r15, qword [rsp + 0x48]
test r14d, r14d
je 0x140047091
jmp 0x140047069
mov r8d, dword [rsp + 0x3c]
mov edx, r15d
mov rcx, rbx
call fcn.1400e47f0
mov esi, eax
call r13
mov r15d, dword [rax]
cmp esi, 0xffffffff
je 0x140047280
test r14d, r14d
jne 0x140047003
mov r8, qword [0x14048f6b0]
lea rax, [rsp + 0x50]
mov ecx, esi
mov rdx, rax
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r8
call qword [r8 + 0x70]
mov r15d, eax
call r13
mov r8, qword [rsp + 0x40]
mov r9d, dword [rax]
jmp 0x140047031
mov ecx, esi
call sub.msvcrt.dll__close_1
cmp eax, 0xffffffff
jne 0x1400471bb
call r13
mov esi, dword [rax]
cmp esi, 4
je 0x1400471bb
call r13
mov dword [rax], esi
jmp 0x1400471bb
mov rcx, rbx
call fcn.1400c69f0
mov rcx, qword [0x14048def0]
mov rbx, rax
mov rax, qword [rcx]
test rax, rax
je 0x140047b7b
lea rdx, str.Error_opening_file__s:__s
lea rcx, [0x14036fd08]
call fcn.1400c7f40
mov ecx, r15d
mov rdi, rax
call fcn.140026320
mov r14, qword [0x14048eee0]
mov esi, eax
cmp dword [r14], 0
jne 0x1400472da
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
mov ecx, r15d
mov ebp, dword [r14]
call fcn.1400e79b0
mov qword [rsp + 0x20], rbx
mov r9, rdi
mov r8d, esi
mov qword [rsp + 0x28], rax
mov rcx, qword [rsp + 0x1b8]
mov edx, ebp
xor edi, edi
call fcn.1400cab90
mov rcx, rbx
call fcn.14034efb0
jmp 0x140046f76
mov rcx, r14
call fcn.14034efb0
test ebp, ebp
je 0x1400475f9
nop dword [rax + rax]
xor r8d, r8d
mov rcx, rbx
lea rdx, [0x1403707f1]
call fcn.1400e4ea0
mov rcx, rax
mov qword [rsp + 0x40], rax
call fcn.1400e4a30
cmp eax, 0xffffffff
je 0x1400476d0
movzx r8d, word [rsp + 0x7c]
mov rcx, qword [rsp + 0x40]
mov edx, 0x8501
and r8d, 0x1ff
call fcn.1400e47f0
mov r12d, eax
cmp eax, 0xffffffff
je 0x140047af2
mov ecx, 0x2000
call sub.msvcrt.dll_malloc
mov r15, rax
test rax, rax
je 0x140047cca
mov qword [rsp + 0x180], rbx
mov dword [rsp + 0x188], edi
mov r8d, 0x2000
mov rdx, r15
mov ecx, esi
mov rdi, r15
call sub.msvcrt.dll__read
movsxd rbx, eax
mov r14, rbx
cmp rbx, 0xffffffffffffffff
jne 0x1400473df
jmp 0x140047550
sub r14, rdx
add rdi, rdx
test r14, r14
jle 0x1400475a8
mov rdx, rdi
mov r8d, r14d
mov ecx, r12d
call sub.msvcrt.dll__write
movsxd rdx, eax
cmp eax, 0xffffffff
jne 0x1400473d0
call r13
mov eax, dword [rax]
cmp eax, 4
je 0x1400473d6
mov ecx, eax
mov r14d, eax
call fcn.1400e79b0
mov rbx, qword [0x14048def0]
mov rbp, rax
mov rax, qword [rbx]
test rax, rax
je 0x1400476b0
lea rdx, str.Error_writing_to_file:__s
lea rdi, [0x14036fd08]
mov rcx, rdi
call fcn.1400c7f40
mov ecx, r14d
mov qword [rsp + 0x30], rax
call fcn.140026320
mov r14, qword [0x14048eee0]
mov r8d, eax
mov edx, dword [r14]
test edx, edx
jne 0x14004746d
lea rcx, [0x14036fd0f]
mov dword [rsp + 0x3c], eax
call fcn.1400daa90
mov r8d, dword [rsp + 0x3c]
mov dword [r14], eax
mov edx, eax
mov qword [rsp + 0x20], rbp
mov r9, qword [rsp + 0x30]
xor ecx, ecx
call fcn.1400cab90
mov rcx, r15
call fcn.14034efb0
mov rax, qword [rbx]
test rax, rax
je 0x140047c60
lea rdx, str.Backup_file_creation_failed
mov rcx, rdi
call fcn.1400c7f40
cmp dword [r14], 0
mov rbx, rax
jne 0x1400474b9
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
cmp qword [rsp + 0x1b8], 0
je 0x1400474f4
mov rax, qword [rsp + 0x1b8]
mov ecx, dword [r14]
cmp qword [rax], 0
je 0x140047cad
mov r9, rbx
lea r8, [0x14036fd20]
mov edx, 0x10
lea rcx, [0x14036fde6]
call fcn.1400d2190
mov rcx, qword [rsp + 0x40]
call fcn.1400e4a30
mov ecx, r12d
call sub.msvcrt.dll__close_1
add eax, 1
je 0x140047c95
mov rcx, qword [rsp + 0x40]
call fcn.14034efb0
test esi, esi
js 0x140047150
mov ecx, esi
call sub.msvcrt.dll__close_1
cmp eax, 0xffffffff
jne 0x140047150
call r13
mov ebx, dword [rax]
cmp ebx, 4
je 0x140047150
call r13
xor edi, edi
mov dword [rax], ebx
jmp 0x140046f76
call r13
mov r14d, dword [rax]
cmp r14d, 4
je 0x1400473a5
mov ecx, r14d
call fcn.1400e79b0
mov rbx, qword [0x14048def0]
mov rbp, rax
mov rax, qword [rbx]
test rax, rax
je 0x140047738
lea rdx, str.Error_reading_from_file:__s
jmp 0x140047426
mov r9d, dword [rsp + 0x30]
test r9d, r9d
je 0x1400470e8
jmp 0x140047169
test rbx, rbx
jne 0x1400473a5
mov rcx, r15
mov rbx, qword [rsp + 0x180]
mov edi, dword [rsp + 0x188]
call fcn.14034efb0
mov ecx, r12d
call sub.msvcrt.dll__close_1
cmp eax, 0xffffffff
je 0x140047752
mov rcx, qword [rsp + 0x40]
call fcn.14034efb0
xor r8d, r8d
xor edx, edx
mov ecx, esi
call fcn.140342e90
cmp rax, 0xffffffffffffffff
je 0x140047ba9
mov eax, dword [rsp + 0x30]
test eax, eax
je 0x1400470f0
mov ecx, esi
call sub.msvcrt.dll__close_1
cmp eax, 0xffffffff
je 0x140047720
mov rcx, rbx
call fcn.1400e4a30
test eax, eax
jne 0x140047a5c
mov r8d, dword [rsp + 0x3c]
lea edx, [rdi + 0x8101]
mov rcx, rbx
call fcn.1400e47f0
mov esi, eax
cmp eax, 0xffffffff
jne 0x140047108
call r13
mov rcx, rbx
mov esi, dword [rax]
call fcn.1400c69f0
mov ecx, esi
mov rbx, rax
call fcn.1400e79b0
lea rcx, str.Error_opening_file__s:__s
mov rbp, rax
call fcn.1400cb540
mov ecx, esi
mov rdi, rax
call fcn.140026320
mov esi, eax
call fcn.140025c60
mov qword [rsp + 0x28], rbp
mov r9, rdi
mov r8d, esi
mov qword [rsp + 0x20], rbx
mov rcx, qword [rsp + 0x1b8]
mov edx, eax
xor edi, edi
call fcn.1400cab90
mov rcx, rbx
call fcn.14034efb0
jmp 0x140046f76
mov rcx, rbx
call fcn.1400e7370
test eax, eax
je 0x14004741f
call fcn.1400cb3d0
jmp 0x14004741f
call r13
cmp dword [rax], 2
je 0x140047358
lea rcx, str.Backup_file_creation_failed
call fcn.1400cb540
mov rbx, rax
call fcn.140025c60
mov rcx, qword [rsp + 0x1b8]
mov r9, rbx
mov r8d, 0x16
mov edx, eax
call fcn.1400cacb0
mov rcx, qword [rsp + 0x40]
call fcn.14034efb0
jmp 0x140047519
call r13
mov esi, dword [rax]
cmp esi, 4
je 0x140047615
call r13
mov dword [rax], esi
jmp 0x140047615
mov rcx, rbx
call fcn.1400e7370
test eax, eax
je 0x14004757e
call fcn.1400cb3d0
jmp 0x14004757e
call r13
mov r12d, dword [rax]
cmp r12d, 4
je 0x1400475d9
call r13
mov dword [rax], r12d
jmp 0x1400475d9
mov rcx, qword [0x14048def0]
mov rax, qword [rcx]
test rax, rax
je 0x140047929
lea rcx, [0x14036fd08]
lea rdx, str.The_file_was_externally_modified
call fcn.1400c7f40
mov r14, qword [0x14048eee0]
mov rbx, rax
mov ecx, dword [r14]
test ecx, ecx
jne 0x1400477b3
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
cmp qword [rsp + 0x1b8], 0
je 0x1400477ee
mov rax, qword [rsp + 0x1b8]
mov ecx, dword [r14]
cmp qword [rax], 0
je 0x140047998
mov r9, rbx
lea r8, [0x14036fd20]
mov edx, 0x10
lea rcx, [0x14036fde6]
call fcn.1400d2190
mov rcx, r15
call fcn.14034efb0
jmp 0x140047519
mov rcx, rbx
mov dword [rsp + 0x30], r9d
call fcn.1400c69f0
mov ecx, dword [rsp + 0x30]
mov rbx, rax
call fcn.1400e79b0
mov rcx, qword [0x14048def0]
mov r12, rax
mov rax, qword [rcx]
test rax, rax
mov r9d, dword [rsp + 0x30]
je 0x140047a3b
lea rcx, [0x14036fd08]
lea rdx, str.Error_when_getting_information_for_file__s:__s
mov dword [rsp + 0x30], r9d
call fcn.1400c7f40
mov ecx, dword [rsp + 0x30]
mov rbp, rax
call fcn.140026320
mov r14, qword [0x14048eee0]
mov edi, eax
mov r8d, dword [r14]
test r8d, r8d
jne 0x140047873
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
mov qword [rsp + 0x28], r12
mov rcx, qword [rsp + 0x1b8]
mov r9, rbp
mov r8d, edi
mov qword [rsp + 0x20], rbx
mov edx, dword [r14]
call fcn.1400cab90
mov rcx, rbx
call fcn.14034efb0
jmp 0x140047519
mov rcx, qword [0x14048def0]
mov rax, qword [rcx]
test rax, rax
je 0x140047adb
lea rdx, str.Target_file_is_not_a_regular_file
lea rcx, [0x14036fd08]
call fcn.1400c7f40
mov r14, qword [0x14048eee0]
mov rbx, rax
cmp dword [r14], 0
jne 0x1400478e5
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
cmp qword [rsp + 0x1b8], 0
mov ecx, dword [r14]
je 0x140047519
mov rax, qword [rsp + 0x1b8]
cmp qword [rax], 0
je 0x140047c43
mov r9, rbx
lea r8, [0x14036fd20]
mov edx, 0x10
lea rcx, [0x14036fde6]
call fcn.1400d2190
jmp 0x140047519
call fcn.1400e7370
test eax, eax
je 0x140047780
call fcn.1400cb3d0
jmp 0x140047780
mov rcx, rbx
mov dword [rsp + 0x30], r8d
call fcn.1400c69f0
mov ecx, dword [rsp + 0x30]
mov rbx, rax
call fcn.1400e79b0
mov rcx, qword [0x14048def0]
mov r12, rax
mov rax, qword [rcx]
test rax, rax
mov r8d, dword [rsp + 0x30]
je 0x140047c0b
lea rcx, [0x14036fd08]
lea rdx, str.Error_when_getting_information_for_file__s:__s
mov dword [rsp + 0x30], r8d
call fcn.1400c7f40
mov ecx, dword [rsp + 0x30]
mov rbp, rax
jmp 0x14004784e
mov r8, rbx
mov edx, 0x17
call fcn.1400cac00
mov rbx, qword [rsp + 0x1b8]
mov qword [rbx], rax
jmp 0x1400477ee
mov rcx, qword [0x14048def0]
mov rax, qword [rcx]
test rax, rax
je 0x140047bf4
lea rdx, str.Target_file_is_a_directory
lea rcx, [0x14036fd08]
call fcn.1400c7f40
mov r14, qword [0x14048eee0]
mov rbx, rax
cmp dword [r14], 0
jne 0x1400479fa
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
cmp qword [rsp + 0x1b8], 0
mov ecx, dword [r14]
je 0x140047519
mov rax, qword [rsp + 0x1b8]
cmp qword [rax], 0
jne 0x140047909
mov r8, rbx
mov edx, 3
call fcn.1400cac00
mov rbx, qword [rsp + 0x1b8]
mov qword [rbx], rax
jmp 0x140047519
call fcn.1400e7370
mov r9d, dword [rsp + 0x30]
test eax, eax
je 0x14004782f
call fcn.1400cb3d0
mov r9d, dword [rsp + 0x30]
jmp 0x14004782f
call r13
mov ebx, dword [rax]
mov ecx, ebx
call fcn.1400e79b0
mov rcx, qword [0x14048def0]
mov rdi, rax
mov rax, qword [rcx]
test rax, rax
je 0x140047c2c
lea rdx, str.Error_removing_old_file:__s
lea rcx, [0x14036fd08]
call fcn.1400c7f40
mov ecx, ebx
mov rsi, rax
call fcn.140026320
mov r14, qword [0x14048eee0]
mov ebx, eax
cmp dword [r14], 0
jne 0x140047ab9
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
mov qword [rsp + 0x20], rdi
mov rcx, qword [rsp + 0x1b8]
mov r9, rsi
xor edi, edi
mov edx, dword [r14]
mov r8d, ebx
call fcn.1400cab90
jmp 0x140046f76
call fcn.1400e7370
test eax, eax
je 0x1400478b3
call fcn.1400cb3d0
jmp 0x1400478b3
mov rcx, qword [0x14048def0]
mov rax, qword [rcx]
test rax, rax
je 0x140047b92
lea rdx, str.Backup_file_creation_failed
lea rcx, [0x14036fd08]
call fcn.1400c7f40
mov r14, qword [0x14048eee0]
mov rbx, rax
cmp dword [r14], 0
jne 0x140047b37
lea rcx, [0x14036fd0f]
call fcn.1400daa90
mov dword [r14], eax
cmp qword [rsp + 0x1b8], 0
je 0x14004750f
mov rax, qword [rsp + 0x1b8]
mov ecx, dword [r14]
cmp qword [rax], 0
je 0x140047cf4
mov r9, rbx
lea r8, [0x14036fd20]
mov edx, 0x10
lea rcx, [0x14036fde6]
call fcn.1400d2190
jmp 0x14004750f
call fcn.1400e7370
test eax, eax
je 0x14004729e
call fcn.1400cb3d0
jmp 0x14004729e
call fcn.1400e7370
test eax, eax
je 0x140047b05
call fcn.1400cb3d0
jmp 0x140047b05
call r13
mov ebx, dword [rax]
mov ecx, ebx
call fcn.1400e79b0
lea rcx, str.Error_seeking_in_file:__s
mov rbp, rax
call fcn.1400cb540
mov ecx, ebx
mov rdi, rax
call fcn.140026320
mov ebx, eax
call fcn.140025c60
mov qword [rsp + 0x20], rbp
mov r9, rdi
mov r8d, ebx
mov rcx, qword [rsp + 0x1b8]
mov edx, eax
call fcn.1400cab90
jmp 0x140047519
call fcn.1400e7370
test eax, eax
je 0x1400479c8
call fcn.1400cb3d0
jmp 0x1400479c8
call fcn.1400e7370
mov r8d, dword [rsp + 0x30]
test eax, eax
je 0x140047974
call fcn.1400cb3d0
mov r8d, dword [rsp + 0x30]
jmp 0x140047974
call fcn.1400e7370
test eax, eax
je 0x140047a7e
call fcn.1400cb3d0
jmp 0x140047a7e
mov r8, rbx
mov edx, 6
call fcn.1400cac00
mov rbx, qword [rsp + 0x1b8]
mov qword [rbx], rax
jmp 0x140047519
mov rcx, rbx
call fcn.1400e7370
test eax, eax
je 0x140047492
call fcn.1400cb3d0
jmp 0x140047492
call r13
mov ebx, dword [rax]
mov ecx, ebx
call fcn.1400e79b0
lea rcx, str.Error_truncating_file:__s
mov rbp, rax
jmp 0x140047bbf
call r13
mov ebx, dword [rax]
cmp ebx, 4
je 0x14004750f
call r13
mov dword [rax], ebx
jmp 0x14004750f
mov r8, rbx
mov edx, 0x16
call fcn.1400cac00
mov rbx, qword [rsp + 0x1b8]
mov qword [rbx], rax
jmp 0x1400474f4
mov qword [rsp + 0x20], 0x2000
lea r9, [0x14036fe4a]
lea r8, [0x14036fe60]
mov edx, 4
lea rcx, [0x14036fde6]
call fcn.1400d2190
jmp 0x140047cf2
mov r8, rbx
mov edx, 0x16
call fcn.1400cac00
mov rbx, qword [rsp + 0x1b8]
mov qword [rbx], rax
jmp 0x14004750f