Function at 0x140058650
Capabilities:
Get disk information
Get file attributes

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
lea rbp, [rax - 0x238]
sub rsp, 0x320
mov qword [rbp - 0x80], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x1415dbbb0]
xor rax, rsp
mov qword [rbp + 0x210], rax
mov rdi, rcx
mov eax, dword [rcx + 0x6c]
test al, 8
jne 0x140058a75
and eax, 0xfffffffb
or eax, 8
mov dword [rcx + 0x6c], eax
mov rcx, qword [rcx + 0x20]
cmp dword [rcx + 8], 0
je 0x140058a78
lea rax, [0x1415d9378]
mov qword [rsp + 0x28], rax
lock inc dword [0x1415d9378]
lea rax, [0x14158e080]
mov qword [rsp + 0x70], rax
mov r12d, 1
mov r8d, r12d
lea rdx, [rsp + 0x70]
lea rcx, [rdi + 0x20]
call fcn.140011d30
lea rdx, [rdi + 0x20]
test al, al
je 0x140058746
lea rcx, [rsp + 0x50]
call fcn.140055840
nop
mov rdx, rax
lea rcx, [rsp + 0x28]
call fcn.140012be0
nop
mov rax, qword [rsp + 0x50]
lock dec dword [rax]
jne 0x14005871b
mov rcx, qword [rsp + 0x50]
call fcn.140012a00
mov rcx, qword [rsp + 0x28]
cmp dword [rcx + 8], 0
jne 0x140058750
mov ebx, dword [rdi + 0x6c]
shr ebx, 2
and bl, 1
lock dec dword [rcx]
jne 0x14005873e
mov rcx, qword [rsp + 0x28]
call fcn.140012a00
movzx eax, bl
jmp 0x140058a7e
lea rcx, [rsp + 0x28]
call fcn.140012be0
lea rdx, [rsp + 0x28]
lea rcx, [rsp + 0x60]
call fcn.140058030
nop
mov rdx, rax
lea rcx, [rsp + 0x28]
call fcn.140012be0
nop
mov rax, qword [rsp + 0x60]
lock dec dword [rax]
jne 0x140058782
mov rcx, qword [rsp + 0x60]
call fcn.140012a00
mov ecx, 0x8001
call qword [sym.imp.KERNEL32.dll_SetErrorMode]
mov r13d, eax
mov ecx, dword [rdi + 0x60]
cmp ecx, 0xffffffff
je 0x1400587cb
call fcn.1400b2568
cmp rax, 0xffffffffffffffff
je 0x140058a57
lea rdx, [rbp - 0x78]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
je 0x140058a57
or dword [rdi + 0x6c], 4
mov eax, dword [rbp - 0x78]
mov dword [rdi + 0x5c], eax
jmp 0x140058a57
lea rdx, [rsp + 0x28]
lea rcx, [rsp + 0x58]
call fcn.140056170
nop
mov rcx, rax
call fcn.140012e50
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rdi + 0x5c], eax
mov rax, qword [rsp + 0x58]
lock dec dword [rax]
jne 0x140058803
mov rcx, qword [rsp + 0x58]
call fcn.140012a00
cmp dword [rdi + 0x5c], 0xffffffff
jne 0x140058900
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x140058821
cmp eax, 0x20
jne 0x140058900
lea rdx, [rsp + 0x28]
lea rcx, [rsp + 0x40]
call fcn.14001c550
nop
mov ebx, 0x5c
mov word [rsp + 0x20], bx
mov r8d, r12d
lea rdx, [rsp + 0x20]
lea rcx, [rsp + 0x40]
call fcn.140010990
test al, al
je 0x140058879
mov edx, r12d
lea rcx, [rsp + 0x40]
call fcn.140014b50
mov word [rsp + 0x20], bx
mov r8d, r12d
lea rdx, [rsp + 0x20]
lea rcx, [rsp + 0x40]
call fcn.140010990
test al, al
jne 0x140058851
mov eax, 0x3a
mov word [rsp + 0x3c], ax
mov r8d, r12d
lea rdx, [rsp + 0x3c]
lea rcx, [rsp + 0x40]
call fcn.140010990
test al, al
jne 0x1400588ec
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x68]
call fcn.140056170
nop
mov rcx, rax
call fcn.140012e50
mov rcx, rax
lea rdx, [rbp - 0x40]
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov rbx, rax
mov rcx, qword [rsp + 0x68]
lock dec dword [rcx]
jne 0x1400588d5
mov rcx, qword [rsp + 0x68]
call fcn.140012a00
cmp rbx, 0xffffffffffffffff
je 0x1400588ec
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FindClose]
mov r11d, dword [rbp - 0x40]
mov dword [rdi + 0x5c], r11d
mov rax, qword [rsp + 0x40]
lock dec dword [rax]
jne 0x140058900
mov rcx, qword [rsp + 0x40]
call fcn.140012a00
and dword [rdi + 0x6c], 0xfffffffb
xor eax, eax
cmp dword [rdi + 0x5c], 0xffffffff
setne al
and eax, 1
shl eax, 2
or dword [rdi + 0x6c], eax
test byte [rdi + 0x6c], 4
jne 0x140058a57
mov rax, qword [rsp + 0x28]
cmp dword [rax + 8], 3
jne 0x1400589a6
mov rcx, qword [rax + 0x10]
movzx eax, word [rcx]
mov word [rsp + 0x3a], ax
lea rcx, [rsp + 0x3a]
call fcn.14000eef0
test al, al
je 0x1400589a6
mov rax, qword [rsp + 0x28]
mov rcx, qword [rax + 0x10]
cmp word [rcx + 2], 0x3a
jne 0x1400589a6
cmp word [rcx + 4], 0x2f
jne 0x1400589a6
call qword [sym.imp.KERNEL32.dll_GetLogicalDrives]
mov ebx, eax
mov rcx, qword [rsp + 0x28]
mov rdx, qword [rcx + 0x10]
movzx ecx, word [rdx]
mov word [rsp + 0x38], cx
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x38]
call fcn.14000f260
movzx ecx, word [rax]
sub ecx, 0x41
shl r12d, cl
test ebx, r12d
je 0x140058a57
mov dword [rdi + 0x5c], 0x14
or dword [rdi + 0x6c], 4
jmp 0x140058a57
lea rdx, [rsp + 0x28]
lea rcx, [rsp + 0x30]
call fcn.14001c550
nop
lea rax, [0x141558278]
mov qword [rsp + 0x78], rax
mov r8d, r12d
lea rdx, [rsp + 0x78]
lea rcx, [rsp + 0x30]
call fcn.140011bb0
test al, al
je 0x140058a43
mov rax, qword [rsp + 0x30]
mov rcx, qword [rax + 0x10]
mov r9d, r12d
mov r8d, 2
movzx edx, word [rcx]
lea rcx, [rsp + 0x30]
call fcn.140011a10
test eax, eax
jle 0x140058a2a
mov rcx, qword [rsp + 0x30]
mov rdx, qword [rcx + 0x10]
lea r8d, [rax + 1]
mov r9d, r12d
movzx edx, word [rdx]
lea rcx, [rsp + 0x30]
call fcn.140011a10
test eax, eax
jle 0x140058a2a
mov rcx, qword [rsp + 0x30]
mov edx, dword [rcx + 8]
dec edx
cmp eax, edx
jne 0x140058a43
lea rcx, [rsp + 0x30]
call fcn.1400583e0
test al, al
je 0x140058a43
mov dword [rdi + 0x5c], 0x10
or dword [rdi + 0x6c], 4
mov rax, qword [rsp + 0x30]
lock dec dword [rax]
jne 0x140058a57
mov rcx, qword [rsp + 0x30]
call fcn.140012a00
mov ecx, r13d
call qword [sym.imp.KERNEL32.dll_SetErrorMode]
nop
mov rax, qword [rsp + 0x28]
lock dec dword [rax]
jne 0x140058a75
mov rcx, qword [rsp + 0x28]
call fcn.140012a00
mov eax, dword [rdi + 0x6c]
shr eax, 2
and eax, 1
mov rcx, qword [rbp + 0x210]
xor rcx, rsp
call fcn.1400af490
lea r11, [rsp + 0x320]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r13
pop r12
pop rbp
ret