Function at 0x140006010
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x108
mov esi, edx
xor edx, edx
mov qword [rsp + 0x58], rcx
mov ebx, r8d
mov rdi, r9
call dbg.output_create
mov qword [rsp + 0x60], rax
mov qword [rax + 0x228], 0
cmp esi, ebx
jge 0x1400061a4
movsxd rax, esi
sub ebx, esi
lea r13, [rdi + rax*8]
add rax, rbx
lea r14, [rdi + rax*8]
mov r12, r14
jmp 0x1400060c9
mov r9, rsi
mov r8d, 0x63
mov edx, 1
mov rcx, rbx
call sym.fread
cmp rax, 0x62
jbe 0x140006320
movabs rax, 0x2f6e61637373616d
cmp qword [rbx], rax
je 0x1400061c1
xor ecx, ecx
mov r8, r14
lea rdx, str._____s:_unknown_file_format__expeced__masscan_1.1___n
call dbg.LOG
mov rcx, rbx
call sym.free
mov rcx, rsi
call sym.fclose
add r13, 8
cmp r13, r12
je 0x1400061a4
mov r14, qword [r13]
mov ecx, 0x100000
call dbg.MALLOC
lea rdx, [0x1400579f4]
mov rcx, r14
mov rbx, rax
call sym.fopen
mov rsi, rax
test rax, rax
je 0x140006132
xor ecx, ecx
mov r8, r14
lea rdx, str._____readscan__s_n
call dbg.LOG
mov rcx, rsi
call sym.feof
test eax, eax
je 0x140006068
xor ecx, ecx
mov r8, r14
lea rdx, str._____s:_file_is_empty_n
call dbg.LOG
test rbx, rbx
je 0x1400060b4
mov rcx, rbx
call sym.free
jmp 0x1400060b4
mov rdi, qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov ecx, 2
call rdi
mov r8d, 0x15
mov edx, 1
lea rcx, str.____FAIL:___readscan_n
mov r9, rax
call sym.fwrite
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call sym.strerror
mov ecx, 2
mov rsi, rax
call rdi
mov r9, rsi
mov r8, r14
lea rdx, [0x140057a0d]
mov rcx, rax
call sym.fprintf_1
test rbx, rbx
je 0x1400060bc
mov rcx, rbx
add r13, 8
call sym.free
cmp r13, r12
jne 0x1400060c9
mov rcx, qword [rsp + 0x60]
add rsp, 0x108
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp dbg.output_destroy
cmp dword [rbx + 7], 0x312e312f
jne 0x14000609b
cmp byte [rbx + 0xb], 0x2e
je 0x140006958
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x68], r14
lea r15, [0x140057ae4]
lea rdi, [rax + 0xcb8]
add rax, 0xba8
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rdi
xor edi, edi
nop word cs:[rax + rax]
nop dword [rax]
mov r9, rsi
mov r8d, 1
mov edx, 1
mov rcx, rbx
call sym.fread
cmp rax, 1
jne 0x140006128
movzx eax, byte [rbx]
mov ebp, eax
and ebp, 0x7f
test al, al
js 0x140006251
jmp 0x14000626d
movzx eax, byte [rbx]
shl ebp, 7
mov edx, eax
and edx, 0x7f
or ebp, edx
test al, al
jns 0x14000626d
mov r9, rsi
mov r8d, 1
mov edx, 1
mov rcx, rbx
call sym.fread
cmp rax, 1
je 0x140006240
mov r9, rsi
mov r8d, 1
mov edx, 1
mov rcx, rbx
call sym.fread
cmp rax, 1
jne 0x140006128
movzx eax, byte [rbx]
mov r14d, eax
and r14d, 0x7f
test al, al
js 0x1400062b3
jmp 0x1400062dc
movzx eax, byte [rbx]
shl r14d, 7
mov edx, eax
and edx, 0x7f
or r14d, edx
test al, al
jns 0x1400062cf
mov r9, rsi
mov r8d, 1
mov edx, 1
mov rcx, rbx
call sym.fread
cmp rax, 1
je 0x1400062a0
cmp r14d, 0x100000
ja 0x1400069e6
mov r9, rsi
mov r8, r14
mov edx, 1
mov rcx, rbx
call sym.fread
mov r10, rax
cmp rax, r14
jb 0x140006128
cmp ebp, 0xd
ja 0x140006900
test ebp, ebp
je case.0x14000631e.0
cmp ebp, 0xd
ja case.0x14000631e.0
mov eax, ebp
movsxd rax, dword [r15 + rax*4]
add rax, r15
jmp rax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call sym.strerror
xor ecx, ecx
mov r8, r14
lea rdx, [0x140057a0d]
mov r9, rax
call dbg.LOG
test rbx, rbx
jne 0x140006128
jmp 0x1400060b4
cmp r10, 3
jbe 0x14000692e
mov eax, dword [rbx]
bswap eax
mov dword [rsp + 0x98], eax
mov r14d, eax
cmp r10, 4
je 0x14000692e
movzx eax, byte [rbx + 4]
mov byte [rsp + 0x80], al
cmp r10, 6
jbe 0x14000692e
movzx r11d, word [rbx + 5]
rol r11w, 8
cmp r10, 8
jbe 0x14000692e
movzx eax, word [rbx + 7]
rol ax, 8
movzx eax, ax
mov dword [rsp + 0x88], eax
cmp r10, 9
je 0x14000692e
movzx eax, byte [rbx + 9]
mov byte [rsp + 0x8c], al
cmp r10, 0xa
je 0x14000692e
mov qword [rsp + 0xc8], 0xb
cmp byte [rbx + 0xa], 6
jne 0x14000692e
lea rbp, [rsp + 0xc8]
mov rdx, r10
mov rcx, rbx
mov qword [rsp + 0x90], r10
mov r8, rbp
call dbg._get_long
mov rdx, qword [rsp + 0x90]
mov r8, rbp
mov qword [rsp + 0xd8], rax
call dbg._get_long
mov r10, qword [rsp + 0x90]
mov qword [rsp + 0xe0], rax
mov rax, qword [rsp + 0x60]
cmp qword [rax + 0x228], 0
jne 0x140006440
mov ecx, r14d
mov qword [rax + 0x228], rcx
mov byte [rsp + 0xe8], 6
movzx r11d, r11w
mov rax, qword [rsp + 0xe8]
lea rbp, [rsp + 0xa0]
mov r14d, dword [rsp + 0x88]
mov r9, qword [rsp + 0x70]
mov edx, r11d
mov rcx, rbp
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0x78]
movdqu xmm2, xmmword [rsp + 0xd8]
mov r8d, r14d
mov qword [rsp + 0x90], r10
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x88], r11d
movaps xmmword [rsp + 0xa0], xmm2
call dbg.readscan_filter_pass
test eax, eax
je 0x140006540
mov rax, qword [rsp + 0xc8]
mov r10, qword [rsp + 0x90]
cmp r10, rax
jb 0x140006540
sub r10d, eax
add rax, rbx
mov dword [rsp + 0x28], r14d
mov rcx, qword [rsp + 0x60]
mov qword [rsp + 0x38], rax
mov r11d, dword [rsp + 0x88]
mov r8, rbp
movzx eax, byte [rsp + 0x8c]
mov dword [rsp + 0x40], r10d
mov rdx, qword [rsp + 0xe8]
mov dword [rsp + 0x20], r11d
movdqu xmm4, xmmword [rsp + 0xd8]
mov dword [rsp + 0x30], eax
mov qword [rsp + 0xb0], rdx
mov edx, dword [rsp + 0x98]
movzx r9d, byte [rsp + 0x80]
movaps xmmword [rsp + 0xa0], xmm4
call dbg.output_report_banner
nop word cs:[rax + rax]
nop
add rdi, 1
test di, di
jne 0x140006210
mov r8, qword [rsp + 0x68]
mov r9, rdi
lea rdx, str.____s:__8llu_r
xor ecx, ecx
call dbg.LOG
jmp 0x140006210
mov rax, qword [rsp + 0x58]
mov eax, dword [rax + 0xcc0]
test eax, eax
jne 0x140006540
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x60]
mov r9, r10
mov r8, rbx
mov edx, 2
mov qword [rsp + 0x20], rax
call dbg.parse_status6
jmp 0x140006540
mov rax, qword [rsp + 0x58]
mov edx, dword [rax + 0xcc0]
test edx, edx
jne 0x140006540
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x60]
mov r9, r10
mov r8, rbx
mov edx, 1
mov qword [rsp + 0x20], rax
call dbg.parse_status6
jmp 0x140006540
cmp r10, 0xd
jbe 0x140006540
mov eax, dword [rbx]
movzx edx, word [rbx + 9]
mov byte [rsp + 0xe8], 4
movzx r8d, word [rbx + 0xb]
bswap eax
mov ecx, eax
mov eax, dword [rbx + 4]
rol dx, 8
rol r8w, 8
mov dword [rsp + 0x8c], ecx
bswap eax
mov dword [rsp + 0xd8], eax
movzx eax, byte [rbx + 8]
movzx r8d, r8w
mov byte [rsp + 0x80], al
movzx eax, byte [rbx + 0xd]
mov byte [rsp + 0x88], al
mov rax, qword [rsp + 0x60]
cmp qword [rax + 0x228], 0
jne 0x140006638
mov qword [rax + 0x228], rcx
mov rax, qword [rsp + 0xe8]
movzx ebp, dx
movdqu xmm1, xmmword [rsp + 0xd8]
lea r14, [rsp + 0xa0]
mov r9, qword [rsp + 0x70]
mov edx, ebp
mov rcx, r14
mov qword [rsp + 0x98], r10
mov qword [rsp + 0xb0], rax
mov rax, qword [rsp + 0x78]
mov dword [rsp + 0x90], r8d
mov qword [rsp + 0x20], rax
movaps xmmword [rsp + 0xa0], xmm1
call dbg.readscan_filter_pass
test eax, eax
je 0x140006540
mov rax, qword [rsp + 0xe8]
mov r10, qword [rsp + 0x98]
mov dword [rsp + 0x20], ebp
mov r8d, dword [rsp + 0x90]
mov edx, dword [rsp + 0x8c]
mov qword [rsp + 0xb0], rax
lea rax, [rbx + 0xe]
sub r10, 0xe
movdqu xmm3, xmmword [rsp + 0xd8]
mov qword [rsp + 0x38], rax
mov rcx, qword [rsp + 0x60]
movzx eax, byte [rsp + 0x88]
mov dword [rsp + 0x28], r8d
mov r8, r14
movzx r9d, byte [rsp + 0x80]
mov dword [rsp + 0x40], r10d
mov dword [rsp + 0x30], eax
movaps xmmword [rsp + 0xa0], xmm3
call dbg.output_report_banner
jmp 0x140006540
mov rax, qword [rsp + 0x58]
mov ecx, dword [rax + 0xcc0]
test ecx, ecx
jne 0x140006540
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x60]
mov r9, r10
mov r8, rbx
mov edx, 2
mov qword [rsp + 0x20], rax
call dbg.parse_status2
jmp 0x140006540
mov rax, qword [rsp + 0x58]
mov r8d, dword [rax + 0xcc0]
test r8d, r8d
jne 0x140006540
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x60]
mov r9, r10
mov r8, rbx
mov edx, 1
mov qword [rsp + 0x20], rax
call dbg.parse_status2
jmp 0x140006540
cmp r10, 0xc
jbe 0x140006540
mov r8, r10
mov rcx, qword [rsp + 0x60]
mov rdx, rbx
call sym.parse_banner4.part.0
jmp 0x140006540
lea rcx, [rbx + r10]
mov r9, rsi
mov r8d, 1
mov edx, 1
mov qword [rsp + 0x80], r10
call sym.fread
mov r10, qword [rsp + 0x80]
cmp rax, 1
jne 0x140006a13
lea r8, [r10 + 1]
cmp r8, 0xc
ja 0x14000678c
jmp 0x140006540
mov eax, dword [rbx + 4]
movzx ecx, word [rbx + 8]
mov byte [rsp + 0xe8], 4
mov r11, qword [rsp + 0x60]
mov edx, dword [rbx]
bswap eax
mov dword [rsp + 0xd8], eax
movzx eax, word [rbx + 0xa]
rol cx, 8
bswap edx
mov edx, edx
rol ax, 8
cmp qword [r11 + 0x228], 0
movzx eax, ax
jne 0x140006821
mov qword [r11 + 0x228], rdx
mov r8, qword [rsp + 0xe8]
mov dword [rsp + 0x28], eax
sub r10d, 0xc
movzx eax, cx
mov dword [rsp + 0x40], r10d
mov rcx, qword [rsp + 0x60]
mov r9d, 6
movdqu xmm0, xmmword [rsp + 0xd8]
mov dword [rsp + 0x20], eax
mov qword [rsp + 0xb0], r8
lea r8, [rbx + 0xc]
mov qword [rsp + 0x38], r8
lea r8, [rsp + 0xa0]
mov dword [rsp + 0x30], 0
movaps xmmword [rsp + 0xa0], xmm0
call dbg.output_report_banner
jmp 0x140006540
mov rax, qword [rsp + 0x58]
mov r9d, dword [rax + 0xcc0]
test r9d, r9d
jne 0x140006540
cmp r10, 0xb
jbe 0x140006540
mov rcx, qword [rsp + 0x60]
mov r9, r10
mov r8, rbx
mov edx, 2
call sym.parse_status.part.0
jmp 0x140006540
mov rax, qword [rsp + 0x58]
mov r11d, dword [rax + 0xcc0]
test r11d, r11d
jne 0x140006540
cmp r10, 0xb
jbe 0x140006540
mov rcx, qword [rsp + 0x60]
mov r9, r10
mov r8, rbx
mov edx, 1
call sym.parse_status.part.0
jmp 0x140006540
cmp ebp, 0x6d
je 0x140006540
nop dword [rax]
xor ecx, ecx
mov r8d, ebp
lea rdx, str.____file_corrupt:_unknown_type__u_n
call dbg.LOG
mov rcx, rbx
call sym.free
jmp 0x1400060b4
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8d, 0x13
mov edx, 1
lea rcx, str.____corrupt_record_n
mov r9, rax
call sym.fwrite
jmp 0x140006540
xor r8d, r8d
xor edx, edx
lea rcx, [rbx + 0xc]
call sym.strtoul
cmp eax, 1
jbe 0x1400061d8
mov rcx, rbx
xor eax, eax
jmp 0x14000698e
cmp dl, 0xa
je 0x14000699b
add rcx, 1
cmp eax, 0x61
je 0x140006a01
movzx edx, byte [rcx]
mov r8d, eax
add eax, 1
test dl, dl
jne 0x140006980
mov edx, eax
movzx edx, byte [rbx + rdx]
cmp dl, 0x73
jne 0x1400069b1
lea edx, [r8 + 2]
mov rax, rdx
movzx edx, byte [rbx + rdx]
cmp dl, 0x3a
sete dl
movzx edx, dl
add eax, edx
cmp eax, 0x60
ja 0x1400061d8
lea rcx, [rbx + rax]
xor r8d, r8d
xor edx, edx
call sym.strtoul
mov rdi, qword [rsp + 0x60]
mov eax, eax
mov qword [rdi + 0x228], rax
jmp 0x1400061d8
xor ecx, ecx
lea rdx, str.____file_corrupt_n
call dbg.LOG
mov rcx, rbx
call sym.free
jmp 0x1400060b4
mov r8d, 0x61
mov edx, 0x62
mov eax, 0x62
jmp 0x14000699d
xor ecx, ecx
lea rdx, str.____read___error_n
call dbg.LOG
mov ecx, 1
call sym.exit
nop
nop
nop
nop
nop