Function at 0x180008680
Capabilities:
Read file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0x2e0
mov rax, qword [section..data]
xor rax, rsp
mov qword [rsp + 0x2c0], rax
xor r12d, r12d
mov rax, rdx
mov qword [rsp + 0x70], r9
mov qword [rsp + 0x60], rdx
mov esi, r8d
mov rbp, rcx
lea r9, [rsp + 0x30]
lea rdx, [rsp + 0xa0]
mov rcx, rax
mov r8d, 0x200
mov dword [rsp + 0x30], r12d
mov edi, r12d
mov r13d, r12d
mov qword [rsp + 0x80], r12
mov qword [rsp + 0x58], r12
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180008d32
cmp dword [rsp + 0x30], 0x200
jne 0x180008d32
lea r8d, [r12 + 9]
lea rdx, [rsp + 0xd6]
lea rcx, [rsp + 0x2a0]
mov qword [rsp + 0x2d0], r15
call qword [sym.imp.KERNEL32.dll_lstrcpynA]
lea r8d, [r12 + 9]
lea rdx, [rsp + 0xf2]
lea rcx, [rsp + 0x2b0]
call qword [sym.imp.KERNEL32.dll_lstrcpynA]
lea rdx, [0x18003eda0]
lea rcx, [rsp + 0x2a0]
call qword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x180008778
lea rdx, str.FAT_WipeFreeSpace:_Found_bootsector_signature_for_FAT12._n
mov rcx, rbp
call fcn.180016b80
lea r15d, [r12 + 4]
jmp 0x1800087da
lea rdx, [0x18003edf0]
lea rcx, [rsp + 0x2a0]
call qword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x1800087a8
lea rdx, str.FAT_WipeFreeSpace:_Found_bootsector_signature_for_FAT16._n
mov rcx, rbp
call fcn.180016b80
mov r15d, 5
jmp 0x1800087da
lea rdx, [0x18003ee40]
lea rcx, [rsp + 0x2b0]
call qword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x180008d1c
lea rdx, str.FAT_WipeFreeSpace:_Found_bootsector_signature_for_FAT32._n
mov rcx, rbp
call fcn.180016b80
mov r15d, 6
movsx r8d, word [rsp + 0xab]
movzx eax, byte [rsp + 0xad]
mov qword [rsp + 0x320], rbx
imul eax, r8d
mov ebx, r8d
mov dword [rsp + 0x48], eax
test eax, eax
je 0x180008d15
cmp eax, 0x20000
ja 0x180008d15
cmp r15d, 4
jb 0x180008850
cmp r15d, 5
jbe 0x18000883b
cmp r15d, 6
jne 0x180008850
cmp r12w, word [rsp + 0xb6]
jne 0x180008d15
mov edi, dword [rsp + 0xc4]
jmp 0x180008850
movzx eax, word [rsp + 0xb6]
cmp r12w, ax
je 0x180008d15
movzx edi, ax
movzx edx, byte [rsp + 0xb0]
imul ebx, edi
cmp dl, 1
jae 0x18000886a
mov rcx, r12
mov qword [rsp + 0x58], rcx
jmp 0x18000887f
movzx ecx, word [rsp + 0xae]
movsx rax, r8w
imul rcx, rax
mov qword [rsp + 0x58], rcx
cmp dl, 2
jae 0x18000888b
mov qword [rsp + 0x50], r12
jmp 0x180008895
mov eax, ebx
add rax, rcx
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x2d8], r14
test rcx, rcx
je 0x180008cf3
mov r9d, 4
mov r8d, 0x1000
mov edx, ebx
xor ecx, ecx
mov edi, ebx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r14, rax
test rax, rax
je 0x180008d0e
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [rsp + 0x58]
mov rcx, qword [rsp + 0x60]
lea r8, [rsp + 0x5c]
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x1800088fc
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x180008cfd
mov rcx, qword [rsp + 0x60]
lea r9, [rsp + 0x30]
mov r8d, ebx
mov rdx, r14
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180008cfd
cmp ebx, dword [rsp + 0x30]
jne 0x180008cfd
cmp qword [rsp + 0x50], r12
jbe 0x180008a06
mov r9d, 4
mov r8d, 0x1000
mov rdx, rdi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r12, rax
test rax, rax
je 0x180008cfd
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rdi, qword [rsp + 0x60]
mov edx, dword [rsp + 0x50]
lea r8, [rsp + 0x54]
mov rcx, rdi
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x180008988
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1800089ab
lea r9, [rsp + 0x30]
mov r8d, ebx
mov rdx, r12
mov rcx, rdi
mov qword [rsp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1800089ab
cmp ebx, dword [rsp + 0x30]
je 0x180008a06
xor edx, edx
mov r8d, 0x8000
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
mov r14, qword [rsp + 0x2d8]
mov rbx, qword [rsp + 0x320]
mov r15, qword [rsp + 0x2d0]
mov rcx, qword [rsp + 0x2c0]
xor rcx, rsp
call fcn.18002d590
add rsp, 0x2e0
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
xor ecx, ecx
mov edx, 0x200000
mov r8d, 0x1000
lea r9d, [rcx + 4]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rdi, rax
mov qword [rsp + 0x88], rax
test rax, rax
jne 0x180008a5b
xor edx, edx
mov r8d, 0x8000
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_VirtualFree]
test r12, r12
je 0x180008a54
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x1800089cf
movzx ecx, byte [rsp + 0xb0]
movzx edx, word [rsp + 0xae]
movsx rax, word [rsp + 0xab]
imul rdx, rax
imul ecx, ebx
add rdx, rcx
mov qword [rsp + 0x78], rdx
cmp r15d, 6
je 0x180008a95
add rdx, 0x4000
mov qword [rsp + 0x78], rdx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea eax, [rsi + 2]
mov dword [rsp + 0x3c], 2
mov dword [rsp + 0x68], eax
cmp eax, 2
jbe 0x180008cbb
mov rcx, r14
xor ebx, ebx
mov r10d, 0xfffffff8
mov r11d, 0x18
sub rcx, r12
lea rsi, [r12 + 4]
mov dword [rsp + 0x44], r10d
lea rdi, [r12 + 8]
mov qword [rsp + 0x90], rcx
mov dword [rsp + 0x40], r11d
nop word [rax + rax]
xor edx, edx
xor r8d, r8d
mov eax, r15d
xor r9d, r9d
sub eax, 4
mov dword [rsp + 0x34], edx
mov dword [rsp + 0x38], r8d
je 0x180008b27
sub eax, 1
je 0x180008b18
cmp eax, 1
jne 0x180008b4a
mov edx, dword [rcx + rdi]
jmp 0x180008b4a
movzx eax, word [rcx + rsi]
mov word [rsp + 0x34], ax
mov edx, dword [rsp + 0x34]
jmp 0x180008b4a
mov eax, r11d
mov ecx, r10d
shr rax, 3
and ecx, 7
movzx eax, word [rax + r14]
mov word [rsp + 0x34], ax
mov edx, dword [rsp + 0x34]
shr edx, cl
and edx, 0xfff
test r12, r12
je 0x180008b9b
mov eax, r15d
sub eax, 4
je 0x180008b75
sub eax, 1
je 0x180008b66
cmp eax, 1
jne 0x180008b9b
mov r8d, dword [rdi]
jmp 0x180008b9b
movzx eax, word [rsi]
mov word [rsp + 0x38], ax
mov r8d, dword [rsp + 0x38]
jmp 0x180008b9b
mov eax, r11d
mov ecx, r10d
shr rax, 3
and ecx, 7
movzx eax, word [rax + r12]
mov word [rsp + 0x38], ax
mov r8d, dword [rsp + 0x38]
shr r8d, cl
and r8d, 0xfff
test edx, edx
jne 0x180008bbf
test r8d, r8d
jne 0x180008bbf
test r13d, r13d
jne 0x180008bb8
mov eax, ebx
add rax, qword [rsp + 0x78]
mov qword [rsp + 0x80], rax
add r13d, dword [rsp + 0x48]
jmp 0x180008bc5
mov r9d, 1
test r13d, r13d
je 0x180008c11
test r9d, r9d
jne 0x180008bd8
cmp r13d, 0x200000
jb 0x180008c11
mov rax, qword [rsp + 0x80]
mov ecx, dword [rbp + 0x294]
mov r8, qword [rsp + 0x88]
mov edx, dword [rbp + 0x298]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x60]
shr ecx, 2
mov r9d, r13d
mov qword [rsp + 0x20], rax
call fcn.180016390
xor r13d, r13d
mov eax, dword [rbp + 0x294]
and eax, 1
test al, al
je 0x180008c42
xor edx, edx
mov eax, ebx
add rax, qword [rsp + 0x70]
imul rax, rax, 0x1388
div qword [rbp + 0x28c]
add eax, 0x1388
mov dword [rbp + 0x29c], eax
jmp 0x180008c5f
mov eax, ebx
xor edx, edx
add rax, qword [rsp + 0x70]
imul rax, rax, 0x2710
div qword [rbp + 0x28c]
mov dword [rbp + 0x29c], eax
mov rcx, qword [rbp + 0x24]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x180008cb3
mov ecx, dword [rsp + 0x3c]
mov r11d, dword [rsp + 0x40]
mov r10d, dword [rsp + 0x44]
add ebx, dword [rsp + 0x48]
inc ecx
add r11d, 0xc
add r10d, 0xfffffffc
add rdi, 4
add rsi, 2
cmp ecx, dword [rsp + 0x68]
mov dword [rsp + 0x3c], ecx
mov rcx, qword [rsp + 0x90]
mov dword [rsp + 0x40], r11d
mov dword [rsp + 0x44], r10d
jb 0x180008af0
mov rdi, qword [rsp + 0x88]
xor edx, edx
mov r8d, 0x8000
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_VirtualFree]
test r12, r12
je 0x180008ce2
xor edx, edx
mov r8d, 0x8000
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor edx, edx
mov r8d, 0x8000
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, 1
jmp 0x1800089cf
xor edx, edx
mov r8d, 0x8000
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
jmp 0x1800089cf
xor eax, eax
jmp 0x1800089d7
lea rdx, str.FAT_WipeFreeSpace:_Not_found_FAT_signature_in_the_bootsector._n
mov rcx, rbp
call fcn.180016b80
xor eax, eax
jmp 0x1800089df
xor eax, eax
jmp 0x1800089e7