Function at 0x140021620
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rdx
mov dword [rsp + 8], ecx
push rbx
push rdi
push r14
sub rsp, 0x70
movsxd rax, ecx
mov rdi, 0xfffffffffffffffe
mov ebx, r8d
cmp eax, edi
mov dword [rsp + 0x34], ebx
jne 0x140021668
call fcn.140013d00
xor r14d, r14d
mov dword [rax], r14d
call fcn.140013cd0
mov dword [rax], 9
or eax, 0xffffffff
add rsp, 0x70
pop r14
pop rdi
pop rbx
ret
test ecx, ecx
js 0x140021eeb
cmp eax, dword [0x140030954]
jae 0x140021eeb
mov qword [rsp + 0x68], rbp
mov qword [rsp + 0x58], r12
mov r12, rax
and eax, 0x1f
sar r12, 5
lea r8, [0x140000000]
mov rcx, qword [r8 + r12*8 + 0x30960]
lea rbp, [rax + rax*4]
add rbp, rbp
movzx eax, byte [rcx + rbp*8 + 8]
test al, 1
jne 0x1400216c7
call fcn.140013d00
xor r14d, r14d
mov dword [rax], r14d
call fcn.140013cd0
mov dword [rax], 9
jmp 0x1400216e5
cmp ebx, 0x7fffffff
jbe 0x140021701
call fcn.140013d00
xor r14d, r14d
mov dword [rax], r14d
call fcn.140013cd0
mov dword [rax], 0x16
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x20], r14
call fcn.140010bf0
or eax, 0xffffffff
jmp 0x1400217c5
xor r14d, r14d
test ebx, ebx
mov qword [rsp + 0x60], rsi
mov esi, r14d
je 0x140021ee4
test al, 2
jne 0x140021ee4
test rdx, rdx
jne 0x14002174d
call fcn.140013d00
mov dword [rax], r14d
call fcn.140013cd0
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov dword [rax], 0x16
mov qword [rsp + 0x20], r14
call fcn.140010bf0
or eax, 0xffffffff
jmp 0x1400217c0
mov qword [rsp + 0x50], r13
mov qword [rsp + 0x48], r15
movzx r15d, byte [rcx + rbp*8 + 0x38]
add r15b, r15b
sar r15b, 1
movsx ecx, r15b
sub ecx, 1
je 0x140021784
sub ecx, 1
jne 0x14002177c
mov eax, ebx
not eax
test al, 1
je 0x14002178c
and ebx, 0xfffffffe
mov r13, rdx
jmp 0x140021837
mov eax, ebx
not eax
test al, 1
jne 0x1400217d8
call fcn.140013d00
mov dword [rax], r14d
call fcn.140013cd0
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov dword [rax], 0x16
mov qword [rsp + 0x20], r14
call fcn.140010bf0
or eax, 0xffffffff
mov r13, qword [rsp + 0x50]
mov r15, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x68]
mov r12, qword [rsp + 0x58]
add rsp, 0x70
pop r14
pop rdi
pop rbx
ret
mov eax, 4
shr ebx, 1
cmp ebx, eax
cmovb ebx, eax
mov ecx, ebx
call fcn.140013f10
test rax, rax
mov r13, rax
jne 0x14002180e
call fcn.140013cd0
mov dword [rax], 0xc
call fcn.140013d00
mov dword [rax], 8
or eax, 0xffffffff
jmp 0x1400217b6
mov ecx, dword [rsp + 0x90]
xor edx, edx
lea r8d, [rdx + 1]
call fcn.14001ce40
lea r8, [0x140000000]
mov r11, rax
mov rax, qword [r8 + r12*8 + 0x30960]
mov qword [rax + rbp*8 + 0x40], r11
mov rax, qword [r8 + r12*8 + 0x30960]
mov rdx, r13
test byte [rax + rbp*8 + 8], 0x48
je 0x1400218ec
movzx ecx, byte [rax + rbp*8 + 9]
cmp cl, 0xa
je 0x1400218ec
test ebx, ebx
je 0x1400218ec
mov byte [r13], cl
mov rax, qword [r8 + r12*8 + 0x30960]
add ebx, 0xffffffff
test r15b, r15b
lea rdx, [r13 + 1]
mov esi, 1
mov byte [rax + rbp*8 + 9], 0xa
je 0x1400218ec
mov rax, qword [r8 + r12*8 + 0x30960]
movzx ecx, byte [rax + rbp*8 + 0x39]
cmp cl, 0xa
je 0x1400218ec
test ebx, ebx
je 0x1400218ec
mov byte [rdx], cl
mov rax, qword [r8 + r12*8 + 0x30960]
add rdx, rsi
add ebx, 0xffffffff
cmp r15b, 1
mov esi, 2
mov byte [rax + rbp*8 + 0x39], 0xa
jne 0x1400218ec
mov rax, qword [r8 + r12*8 + 0x30960]
movzx ecx, byte [rax + rbp*8 + 0x3a]
cmp cl, 0xa
je 0x1400218ec
test ebx, ebx
je 0x1400218ec
mov byte [rdx], cl
mov rax, qword [r8 + r12*8 + 0x30960]
add rdx, 1
mov esi, 3
add ebx, 0xffffffff
mov byte [rax + rbp*8 + 0x3a], 0xa
mov rcx, qword [r8 + r12*8 + 0x30960]
lea r9, [rsp + 0x30]
mov r8d, ebx
mov rcx, qword [rcx + rbp*8]
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140021e4c
movsxd rdx, dword [rsp + 0x30]
test edx, edx
js 0x140021e4c
mov eax, ebx
cmp rdx, rax
ja 0x140021e4c
lea r8, [0x140000000]
add esi, edx
mov rax, qword [r8 + r12*8 + 0x30960]
test byte [rax + rbp*8 + 8], 0x80
je 0x140021ec2
cmp r15b, 2
je 0x140021c57
test edx, edx
je 0x140021963
cmp byte [r13], 0xa
jne 0x140021963
or byte [rax + rbp*8 + 8], 4
jmp 0x140021968
and byte [rax + rbp*8 + 8], 0xfb
movsxd rax, esi
mov rbx, r13
mov rdi, r13
lea rsi, [rax + r13]
cmp r13, rsi
jae 0x140021aeb
nop
movzx eax, byte [rdi]
cmp al, 0x1a
je 0x140021acb
cmp al, 0xd
je 0x14002199e
mov byte [rbx], al
add rbx, 1
add rdi, 1
jmp 0x140021ac0
lea rax, [rsi - 1]
cmp rdi, rax
jae 0x1400219d0
cmp byte [rdi + 1], 0xa
lea rax, [rdi + 1]
jne 0x1400219c1
add rdi, 2
mov byte [rbx], 0xa
add rbx, 1
jmp 0x140021ac0
mov byte [rbx], 0xd
add rbx, 1
mov rdi, rax
jmp 0x140021ac0
mov rcx, qword [r8 + r12*8 + 0x30960]
lea r9, [rsp + 0x30]
lea rdx, [rsp + 0xa0]
mov rcx, qword [rcx + rbp*8]
mov r8d, 1
add rdi, 1
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140021a10
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140021aa9
cmp dword [rsp + 0x30], r14d
je 0x140021aa9
lea r8, [0x140000000]
mov rax, qword [r8 + r12*8 + 0x30960]
test byte [rax + rbp*8 + 8], 0x48
je 0x140021a61
cmp byte [rsp + 0xa0], 0xa
jne 0x140021a44
mov byte [rbx], 0xa
add rbx, 1
jmp 0x140021ac0
mov byte [rbx], 0xd
mov rcx, qword [r8 + r12*8 + 0x30960]
movzx eax, byte [rsp + 0xa0]
mov byte [rcx + rbp*8 + 9], al
add rbx, 1
jmp 0x140021ac0
cmp rbx, r13
jne 0x140021a79
cmp byte [rsp + 0xa0], 0xa
jne 0x140021a79
mov byte [rbx], 0xa
add rbx, 1
jmp 0x140021ac0
mov ecx, dword [rsp + 0x90]
mov r8d, 1
or rdx, 0xffffffffffffffff
call fcn.14001ce40
cmp byte [rsp + 0xa0], 0xa
je 0x140021ab9
mov byte [rbx], 0xd
add rbx, 1
lea r8, [0x140000000]
jmp 0x140021ac0
mov byte [rbx], 0xd
add rbx, 1
lea r8, [0x140000000]
jmp 0x140021ac0
lea r8, [0x140000000]
cmp rdi, rsi
jb 0x140021980
jmp 0x140021aeb
mov rax, qword [r8 + r12*8 + 0x30960]
test byte [rax + rbp*8 + 8], 0x40
jne 0x140021ae1
or byte [rax + rbp*8 + 8], 2
jmp 0x140021aeb
movzx eax, byte [rdi]
add rbx, 1
mov byte [rbx - 1], al
mov esi, ebx
sub esi, r13d
cmp r15b, 1
jne 0x140021eb1
test esi, esi
je 0x140021ea0
mov al, byte [rbx - 1]
sub rbx, 1
test al, al
js 0x140021b16
add rbx, 1
jmp 0x140021be7
movzx eax, al
mov edx, 1
cmp byte [rax + r8 + 0x2f520], r14b
jne 0x140021b47
cmp edx, 4
jg 0x140021b47
cmp rbx, r13
jb 0x140021b47
movzx eax, byte [rbx - 1]
sub rbx, 1
add edx, 1
cmp byte [rax + r8 + 0x2f520], r14b
je 0x140021b28
movzx ecx, byte [rbx]
movsx eax, byte [rcx + r8 + 0x2f520]
test eax, eax
jne 0x140021b72
call fcn.140013cd0
mov r15, qword [rsp + 0x98]
or edi, 0xffffffff
mov dword [rax], 0x2a
jmp 0x140021eca
add eax, 1
cmp eax, edx
jne 0x140021b81
movsxd rax, edx
add rbx, rax
jmp 0x140021be7
mov rax, qword [r8 + r12*8 + 0x30960]
test byte [rax + rbp*8 + 8], 0x48
je 0x140021bd0
add rbx, 1
cmp edx, 2
mov byte [rax + rbp*8 + 9], cl
jl 0x140021bb0
movzx eax, byte [rbx]
mov rcx, qword [r8 + r12*8 + 0x30960]
add rbx, 1
mov byte [rcx + rbp*8 + 0x39], al
cmp edx, 3
jne 0x140021bc8
movzx eax, byte [rbx]
mov rcx, qword [r8 + r12*8 + 0x30960]
add rbx, 1
mov byte [rcx + rbp*8 + 0x3a], al
movsxd rax, edx
sub rbx, rax
jmp 0x140021be7
mov ecx, dword [rsp + 0x90]
neg edx
mov r8d, 1
movsxd rdx, edx
call fcn.14001ce40
mov eax, dword [rsp + 0x34]
mov r15, qword [rsp + 0x98]
sub ebx, r13d
shr eax, 1
mov r9d, ebx
mov r8, r13
mov dword [rsp + 0x28], eax
xor edx, edx
mov ecx, 0xfde9
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
mov esi, eax
jne 0x140021c2f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140013d30
or edi, 0xffffffff
jmp 0x140021eca
cmp eax, ebx
lea rax, [0x140000000]
mov rdi, 0xfffffffffffffffe
mov rax, qword [rax + r12*8 + 0x30960]
setne r14b
add esi, esi
mov dword [rax + rbp*8 + 0x48], r14d
jmp 0x140021eca
test edx, edx
je 0x140021c6a
cmp word [r13], 0xa
jne 0x140021c6a
or byte [rax + rbp*8 + 8], 4
jmp 0x140021c6f
and byte [rax + rbp*8 + 8], 0xfb
movsxd rax, esi
mov rbx, r13
mov rdi, r13
lea rsi, [rax + r13]
cmp r13, rsi
jae 0x140021e36
mov r15, 0xfffffffffffffffe
nop
movzx eax, word [rdi]
cmp ax, 0x1a
je 0x140021e15
cmp ax, 0xd
je 0x140021cb3
mov word [rbx], ax
add rbx, 2
add rdi, 2
jmp 0x140021e0a
lea rax, [rsi - 2]
cmp rdi, rax
jae 0x140021cea
cmp word [rdi + 2], 0xa
lea rax, [rdi + 2]
jne 0x140021cd9
add rdi, 4
mov word [rbx], 0xa
add rbx, 2
jmp 0x140021e0a
mov word [rbx], 0xd
add rbx, 2
mov rdi, rax
jmp 0x140021e0a
mov rcx, qword [r8 + r12*8 + 0x30960]
lea r9, [rsp + 0x30]
lea rdx, [rsp + 0xa8]
mov rcx, qword [rcx + rbp*8]
mov r8d, 2
add rdi, 2
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140021d2a
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x140021df1
cmp dword [rsp + 0x30], r14d
je 0x140021df1
lea r8, [0x140000000]
mov rax, qword [r8 + r12*8 + 0x30960]
test byte [rax + rbp*8 + 8], 0x48
je 0x140021da4
cmp word [rsp + 0xa8], 0xa
jne 0x140021d64
mov word [rbx], 0xa
add rbx, 2
jmp 0x140021e0a
mov word [rbx], 0xd
movzx eax, byte [rsp + 0xa8]
mov rcx, qword [r8 + r12*8 + 0x30960]
mov byte [rcx + rbp*8 + 9], al
movzx eax, byte [rsp + 0xa9]
mov rcx, qword [r8 + r12*8 + 0x30960]
mov byte [rcx + rbp*8 + 0x39], al
mov rax, qword [r8 + r12*8 + 0x30960]
add rbx, 2
mov byte [rax + rbp*8 + 0x3a], 0xa
jmp 0x140021e0a
cmp rbx, r13
jne 0x140021dbf
cmp word [rsp + 0xa8], 0xa
jne 0x140021dbf
mov word [rbx], 0xa
add rbx, 2
jmp 0x140021e0a
mov ecx, dword [rsp + 0x90]
mov r8d, 1
mov rdx, r15
call fcn.14001ce40
cmp word [rsp + 0xa8], 0xa
je 0x140021e03
mov word [rbx], 0xd
add rbx, 2
lea r8, [0x140000000]
jmp 0x140021e0a
mov word [rbx], 0xd
add rbx, 2
lea r8, [0x140000000]
jmp 0x140021e0a
lea r8, [0x140000000]
cmp rdi, rsi
jb 0x140021c90
jmp 0x140021e36
mov rax, qword [r8 + r12*8 + 0x30960]
test byte [rax + rbp*8 + 8], 0x40
jne 0x140021e2b
or byte [rax + rbp*8 + 8], 2
jmp 0x140021e36
movzx eax, word [rdi]
add rbx, 2
mov word [rbx - 2], ax
mov r15, qword [rsp + 0x98]
mov esi, ebx
mov rdi, 0xfffffffffffffffe
sub esi, r13d
jmp 0x140021eca
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x140021e7a
call fcn.140013cd0
mov dword [rax], 9
call fcn.140013d00
mov r15, qword [rsp + 0x98]
mov dword [rax], 5
or edi, 0xffffffff
jmp 0x140021eca
cmp eax, 0x6d
jne 0x140021e8c
mov r15, qword [rsp + 0x98]
mov edi, r14d
jmp 0x140021eca
mov ecx, eax
call fcn.140013d30
mov r15, qword [rsp + 0x98]
or edi, 0xffffffff
jmp 0x140021eca
mov r15, qword [rsp + 0x98]
mov rdi, 0xfffffffffffffffe
jmp 0x140021eca
mov r15, qword [rsp + 0x98]
mov rdi, 0xfffffffffffffffe
jmp 0x140021eca
mov r15, qword [rsp + 0x98]
cmp r13, r15
je 0x140021ed7
mov rcx, r13
call fcn.140010740
cmp edi, 0xfffffffe
cmove edi, esi
mov eax, edi
jmp 0x1400217b6
xor eax, eax
jmp 0x1400217c0
call fcn.140013d00
xor r14d, r14d
mov dword [rax], r14d
call fcn.140013cd0
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov dword [rax], 9
mov qword [rsp + 0x20], r14
call fcn.140010bf0
or eax, 0xffffffff
add rsp, 0x70
pop r14
pop rdi
pop rbx
ret