Function at 0x140056dd0
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x20
mov rbx, qword [rcx + 8]
mov rdi, r8
mov rsi, rdx
cmp dword [rbx + 0x9c], 2
je 0x140056db2
mov rax, qword [rcx]
call qword [rax + 0x18]
mov dword [rbx + 0x9c], 2
mov r8, rdi
mov rdx, rsi
mov rcx, rbx
mov rbx, qword [rsp + 0x30]
mov rsi, qword [rsp + 0x38]
add rsp, 0x20
pop rdi
jmp 0x14005c600
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r14
sub rsp, 0x20
mov r14, qword [rcx + 0x18]
mov rdi, r8
mov rbp, rdx
mov rsi, rcx
test r8, r8
js 0x140056f07
xor ebx, ebx
test r8, r8
je 0x140056efb
cmp qword [rcx + 0x70], rbx
je 0x140056e4f
nop dword [rax]
mov r9, qword [rsi + 0x70]
lea rcx, [rbx + rbp]
mov r8, rdi
mov edx, 1
sub r8, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add rbx, rax
test rax, rax
jne 0x140056e41
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
xor ecx, ecx
cmp dword [rax], 4
sete cl
jmp 0x140056e49
xor ecx, ecx
cmp rbx, rdi
setl cl
test ecx, ecx
jne 0x140056e10
jmp 0x140056e91
cmp dword [rcx + 0x98], 0xffffffff
je 0x140056e96
nop dword [rax + rax]
mov ecx, dword [rsi + 0x98]
lea rdx, [rbx + rbp]
mov r8d, 0x7fffffff
mov rax, rdi
sub rax, rbx
cmp rax, r8
cmovb r8d, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__write]
test eax, eax
jle 0x140056e91
cdqe
add rbx, rax
cmp rbx, rdi
jl 0x140056e60
test rbx, rbx
jne 0x140056efb
mov rbx, 0xffffffffffffffff
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov edx, ebx
lea rcx, [rsp + 0x40]
mov rdi, rax
call fcn.14004d480
cmp dword [rdi], 0x1c
mov r8, rax
mov eax, 4
mov edx, 2
cmove edx, eax
mov rcx, r14
call fcn.140054dd0
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx]
test eax, eax
je 0x140056ee8
cmp eax, ebx
je 0x140056f02
sub eax, 1
mov dword [rcx], eax
jne 0x140056f02
mov rcx, qword [rsp + 0x40]
mov edx, 2
lea r8d, [rdx + 6]
call fcn.140014460
mov rax, rbx
jmp 0x140056f57
and dword [rsi + 0x40], 0xffdfffff
mov rax, rbx
jmp 0x140056f57
mov edx, 0x16
lea rcx, [rsp + 0x40]
call fcn.14004d480
mov r8, rax
mov edx, 2
mov rcx, r14
call fcn.140054dd0
mov rcx, qword [rsp + 0x40]
mov eax, dword [rcx]
test eax, eax
je 0x140056f42
cmp eax, 0xffffffff
je 0x140056f50
sub eax, 1
mov dword [rcx], eax
jne 0x140056f50
mov rcx, qword [rsp + 0x40]
mov edx, 2
lea r8d, [rdx + 6]
call fcn.140014460
mov rax, 0xffffffffffffffff
mov rbx, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x50]
add rsp, 0x20
pop r14
pop rdi
pop rsi
ret
push rbp
push rsi
push r14
push r15
sub rsp, 0x38
cmp qword [rcx + 0x70], 0
mov rbp, r8
mov r15, qword [rcx + 0x18]
mov r14, rdx
mov rsi, rcx
jne 0x14005c72c
cmp dword [rcx + 0x98], 0xffffffff
jne 0x14005c72c
mov rcx, qword [rcx + 0x78]
mov qword [rsp + 0x68], rbx
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x30], r12
cmp rcx, 0xffffffffffffffff
je 0x14005c723
mov rbx, r8
lea r9, [rsp + 0x60]
mov r8d, 0x2000000
xor r12d, r12d
cmp rbx, r8
mov qword [rsp + 0x20], r12
mov edi, r12d
cmovl r8d, ebp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x14005c6d5
mov eax, dword [rsp + 0x60]
test eax, eax
je 0x14005c6b8
add rdi, rax
sub rbx, rax
cmp rdi, rbp
jge 0x14005c6b8
mov rcx, qword [rsi + 0x78]
lea rdx, [rdi + r14]
mov r8d, 0x2000000
mov qword [rsp + 0x20], r12
cmp rbx, r8
lea r9, [rsp + 0x60]
cmovl r8d, ebx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x14005c677
test rdi, rdi
je 0x14005c6d5
mov rax, rdi
mov rdi, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x68]
mov r12, qword [rsp + 0x30]
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbp
ret
mov edx, 0xffffffff
lea rcx, [rsp + 0x78]
call fcn.14004d310
mov r8, rax
mov edx, 2
mov rcx, r15
call fcn.140054dd0
mov rcx, qword [rsp + 0x78]
mov r8d, dword [rcx]
test r8d, r8d
je 0x14005c715
cmp r8d, 0xffffffff
je 0x14005c723
sub r8d, 1
mov dword [rcx], r8d
jne 0x14005c723
mov rcx, qword [rsp + 0x78]
mov edx, 2
lea r8d, [rdx + 6]
call fcn.140014460
mov rax, 0xffffffffffffffff
jmp 0x14005c6bb
add rsp, 0x38
pop r15
pop r14
pop rsi
pop rbp
jmp 0x140056dd0