Function at 0x1400018b0
Capabilities:
Get disk information via ioctl
Get storage device properties

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
lea rbp, [rsp - 0x3a8]
sub rsp, 0x4a8
mov rax, qword [0x140022008]
xor rax, rsp
mov qword [rbp + 0x390], rax
movups xmm0, xmmword [0x140015380]
mov r13, rdx
mov qword [rbp - 0x58], rcx
mov rsi, rcx
xor r14d, r14d
xor edx, edx
lea rcx, [rbp + 0x180]
mov r8d, 0x208
mov r12d, r14d
movups xmmword [rbp - 8], xmm0
call fcn.1400047f0
lea r9d, [r14 + 0x12]
xor r8d, r8d
xor edx, edx
lea rcx, [rbp - 8]
call qword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov qword [rbp - 0x60], rax
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140001930
xor eax, eax
jmp 0x1400023c2
xorps xmm0, xmm0
mov qword [rsp + 0x4f0], rbx
lea rax, [rbp + 8]
mov qword [rsp + 0x4a0], r15
movups xmmword [rbp + 8], xmm0
xor r9d, r9d
mov dword [rbp + 8], 0x20
lea r8, [rbp - 8]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rdi
movups xmmword [rbp + 0x18], xmm0
call qword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
je 0x1400023a6
lea r15, [rsi + 0x24]
nop dword [rax]
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], r14
xor r9d, r9d
mov qword [rsp + 0x20], rax
xor r8d, r8d
mov dword [r15 - 0x20], r12d
lea rdx, [rbp + 8]
mov rcx, rdi
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
mov ecx, dword [rbp - 0x50]
call fcn.140007ee8
mov r8d, dword [rbp - 0x50]
xor edx, edx
mov rcx, rax
mov rbx, rax
call fcn.1400047f0
mov dword [rbx], 8
lea rdx, [rbp + 8]
mov r9d, dword [rbp - 0x50]
mov r8, rbx
mov rcx, rdi
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], r14
call qword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
add rbx, 4
lea rdx, str._Disk_i__DevicePath_s_r_n
mov r9, rbx
mov r8d, r12d
mov rcx, r13
call fcn.140001120
movsxd rax, r12d
imul rcx, rax, 0x468
mov rax, 0xffffffffffffffff
add rsi, rcx
mov qword [rbp - 0x68], rsi
lea rdi, [rsi + 0x50]
mov qword [rbp - 0x70], rdi
nop dword [rax + rax]
inc rax
cmp word [rbx + rax*2], 0
jne 0x140001a20
movsxd r9, eax
mov r8, rbx
mov edx, 0x104
mov rcx, rdi
call fcn.140007ef0
mov r8d, r12d
lea rdx, str._Disk_i__Check_TG_Optane_r_n
mov rcx, r13
call fcn.140001120
lea rdx, str.intel_mem
mov rcx, rbx
call fcn.140004358
test rax, rax
je 0x140001a6a
mov dword [r15], 1
lea rdx, str.intel_hbr
mov rcx, rbx
call fcn.140004358
test rax, rax
je 0x140001a86
mov dword [r15 + 4], 1
lea rdx, str.optane
mov rcx, rbx
call fcn.140004358
test rax, rax
je 0x140001aa2
mov dword [r15 + 8], 1
mov r8d, r12d
lea rdx, str._Disk_i__Get_disk_info_by_DeviceIoControl_r_n
mov rcx, r13
call fcn.140001120
xor r9d, r9d
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], 0x80
mov edx, 0xc0000003
mov rcx, rbx
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 3]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rbp - 0x80], rax
mov r14, rax
cmp rax, 0xffffffffffffffff
je 0x1400021ef
mov r8d, r12d
lea rdx, str._Disk_i__Get_order__r_n
mov rcx, r13
call fcn.140001120
lea rax, [rbp - 0x50]
xor ebx, ebx
mov qword [rsp + 0x38], rbx
xor r9d, r9d
mov qword [rsp + 0x30], rax
xor r8d, r8d
lea rax, [rbp - 0x18]
mov dword [rsp + 0x28], 0xc
mov edx, 0x2d1080
mov qword [rsp + 0x20], rax
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140001b57
mov eax, dword [rbp - 0x14]
lea rdx, str._Disk_i__PartitionNumber_d_r_n
mov r9d, dword [rbp - 0x10]
mov r8d, r12d
mov rcx, r13
mov dword [r15 - 0x24], eax
call fcn.140001120
mov r8d, r12d
lea rdx, str._Disk_i__Get_BusType__removable__device_type.__r_n
mov rcx, r13
call fcn.140001120
mov qword [rsp + 0x38], rbx
lea rax, [rbp - 0x50]
mov qword [rsp + 0x30], rax
lea r8, [rbp - 0x40]
lea rax, [rbp + 0x38]
mov dword [rsp + 0x28], 0x28
mov r9d, 0xc
mov qword [rsp + 0x20], rax
mov edx, 0x2d1400
mov qword [rbp - 0x3c], rbx
mov rcx, r14
mov dword [rbp - 0x40], ebx
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140001bec
movzx eax, byte [rbp + 0x42]
lea rdx, str._Disk_i__BusType_d.__r_n
mov r9d, dword [rbp + 0x54]
mov r8d, r12d
mov dword [r15 - 4], eax
mov rcx, r13
movzx eax, byte [rbp + 0x40]
mov byte [r15 + 0xc], al
mov dword [r15 - 0xc], r9d
call fcn.140001120
movzx r9d, byte [r15 + 0xc]
lea rdx, str._Disk_i__DeviceType_d.__r_n
mov r8d, r12d
mov rcx, r13
call fcn.140001120
mov r8d, r12d
lea rdx, str._Disk_i__Get_SeekPenalty.__r_n
mov rcx, r13
call fcn.140001120
mov qword [rsp + 0x38], rbx
lea rax, [rbp - 0x50]
mov qword [rsp + 0x30], rax
lea r8, [rbp - 0x40]
lea rax, [rbp + 0x28]
mov dword [rsp + 0x28], 0xc
mov r9d, 0xc
mov qword [rsp + 0x20], rax
mov edx, 0x2d1400
mov dword [rbp - 0x40], 7
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140001c4a
movzx eax, byte [rbp + 0x30]
mov dword [r15 - 8], eax
jmp 0x140001c5c
mov r8d, r12d
lea rdx, str._Disk_i__Failed_to_get_seek_penalty__an_USB_external_storage__maybe_card_reader_or_USB_disk._r_n
mov rcx, r13
call fcn.140001120
mov r8d, r12d
lea rdx, str._Disk_i__Get_disk_size_in_GB.__r_n
mov rcx, r13
call fcn.140001120
xor eax, eax
mov qword [rsp + 0x38], rbx
mov qword [rbp - 0x20], rax
xorps xmm0, xmm0
lea rax, [rbp - 0x50]
xor r9d, r9d
mov qword [rsp + 0x30], rax
xor r8d, r8d
lea rax, [rbp - 0x30]
mov dword [rsp + 0x28], 0x18
mov edx, 0x70000
mov qword [rsp + 0x20], rax
mov rcx, r14
movups xmmword [rbp - 0x30], xmm0
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140001cdd
mov ecx, dword [rbp - 0x20]
mov eax, dword [rbp - 0x1c]
imul rax, rcx
mov ecx, dword [rbp - 0x24]
imul rax, rcx
imul rax, qword [rbp - 0x30]
cqo
and edx, 0x3fffffff
add rax, rdx
sar rax, 0x1e
mov qword [r15 + 0x1c], rax
jmp 0x140001cef
mov r8d, r12d
lea rdx, str._Disk_i__Failed_to_get_size_r_n
mov rcx, r13
call fcn.140001120
mov r8d, r12d
lea rdx, str._Disk_i__Get_port_number__bus_number_and_target_ID.__r_n
mov rcx, r13
call fcn.140001120
mov qword [rsp + 0x38], rbx
lea rax, [rbp - 0x50]
mov qword [rsp + 0x30], rax
xor r9d, r9d
lea rax, [rbp - 0x48]
mov dword [rsp + 0x28], 8
xor r8d, r8d
mov qword [rsp + 0x20], rax
mov edx, 0x41018
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140001d58
movzx eax, byte [rbp - 0x44]
mov dword [r15 - 0x1c], eax
movzx eax, byte [rbp - 0x43]
mov dword [r15 - 0x18], eax
movzx eax, byte [rbp - 0x42]
mov dword [r15 - 0x14], eax
movzx eax, byte [rbp - 0x41]
mov dword [r15 - 0x10], eax
mov r8d, r12d
lea rdx, str._Disk_i__Get_partitions.__r_n
mov rcx, r13
call fcn.140001120
mov dword [r15 + 0x10], ebx
cmp dword [r15 - 4], ebx
jne 0x1400021e6
mov r8d, r12d
lea rdx, str._Disk_i__Get_partition_amount.__r_n
mov rcx, r13
call fcn.140001120
mov ecx, 0xc0
mov dword [rbp - 0x4c], ebx
mov edi, ebx
call fcn.140007ee8
mov rsi, rax
mov qword [rsp + 0x38], rbx
mov qword [rbp - 0x78], rax
xor r9d, r9d
lea rax, [rbp - 0x4c]
xor r8d, r8d
mov qword [rsp + 0x30], rax
mov edx, 0x70050
mov dword [rsp + 0x28], 0xc0
mov rcx, r14
mov qword [rsp + 0x20], rsi
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x140001e43
inc edi
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140001de8
mov dword [r15 + 0x14], 0xffffffff
cmp edi, 0x3e7
jg 0x1400023e2
lea ebx, [rdi + rdi*8]
shl ebx, 4
add ebx, 0xc0
mov ecx, ebx
call fcn.140007ee8
mov rsi, rax
mov qword [rsp + 0x38], 0
mov qword [rbp - 0x78], rax
xor r9d, r9d
lea rax, [rbp - 0x4c]
xor r8d, r8d
mov qword [rsp + 0x30], rax
mov edx, 0x70050
mov dword [rsp + 0x28], ebx
mov rcx, r14
mov qword [rsp + 0x20], rsi
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x140001dd3
xor ebx, ebx
mov r9d, edi
lea rdx, str._Disk_i__IOCTL_DISK_GET_DRIVE_LAYOUT_EX_done__i__d_._r_n
mov r8d, r12d
mov rcx, r13
call fcn.140001120
mov r9d, dword [rbp - 0x4c]
lea rdx, str._Disk_i__Byte_returned:__u__bytes_of_structure_DRIVE_LAYOUT_INFORMATION:__u._r_n
mov r8d, r12d
mov qword [rsp + 0x20], 0x28
mov rcx, r13
call fcn.140001120
mov r9d, dword [rsi + 4]
lea rdx, str._Disk_i__PartitionCount_d._r_n
mov r8d, r12d
mov dword [r15 + 0x14], r9d
mov rcx, r13
call fcn.140001120
mov r8d, r12d
lea rdx, str._Disk_i__Go_through_each_partition.__r_n
mov rcx, r13
call fcn.140001120
cmp dword [rsi], 1
mov r8d, r12d
mov rcx, r13
jne 0x1400020f0
lea rdx, str._Disk_i__Disk_is_GPT._r_n
call fcn.140001120
cmp dword [r15 + 0x14], 0
mov dword [rsp + 0x70], ebx
jle 0x1400021bd
lea rax, [rsi + 0x30]
mov qword [rsp + 0x78], rax
nop word [rax + rax]
movups xmm2, xmmword [rax + 0x20]
movups xmm0, xmmword [rax]
movups xmm1, xmmword [rax + 0x10]
movaps xmmword [rbp + 0xf0], xmm0
movups xmm0, xmmword [rax + 0x30]
movaps xmmword [rbp + 0x100], xmm1
movups xmm1, xmmword [rax + 0x40]
movaps xmmword [rbp + 0x120], xmm0
movups xmm0, xmmword [rax + 0x50]
movaps xmmword [rbp + 0x130], xmm1
movups xmm1, xmmword [rax + 0x60]
movaps xmmword [rbp + 0x140], xmm0
movups xmm0, xmmword [rax + 0x70]
movaps xmmword [rbp + 0x150], xmm1
movups xmm1, xmmword [rax + 0x80]
movaps xmmword [rbp + 0x160], xmm0
movdqa xmm0, xmm2
psrldq xmm0, 0xf
movd eax, xmm0
movdqa xmm0, xmm2
psrldq xmm0, 0xe
movaps xmmword [rbp + 0x110], xmm2
movzx r14d, al
movd eax, xmm0
movdqa xmm0, xmm2
psrldq xmm0, 0xd
mov dword [rsp + 0x60], r14d
movzx esi, al
movd eax, xmm0
movdqa xmm0, xmm2
psrldq xmm0, 0xc
mov dword [rsp + 0x58], esi
movzx edi, al
movd eax, xmm0
movdqa xmm0, xmm2
psrldq xmm0, 0xb
mov dword [rsp + 0x50], edi
movzx ebx, al
movd eax, xmm0
movdqa xmm0, xmm2
psrldq xmm0, 0xa
mov dword [rsp + 0x48], ebx
movzx r11d, al
movd eax, xmm0
movdqa xmm0, xmm2
mov dword [rsp + 0x40], r11d
psrldq xmm0, 9
movzx r10d, al
movd eax, xmm0
movdqa xmm0, xmm2
mov dword [rsp + 0x38], r10d
psrldq xmm0, 8
movzx r8d, al
mov dword [rsp + 0x30], r8d
movd eax, xmm0
movd r8d, xmm2
movaps xmmword [rbp + 0x170], xmm1
movzx edx, al
pextrw eax, xmm2, 3
mov dword [rsp + 0x28], edx
lea rdx, str._08lX__04lX__04lX__02lX_02lX__02lX_02lX_02lX_02lX_02lX_02lX
movzx ecx, ax
pextrw eax, xmm2, 2
mov dword [rsp + 0x20], ecx
lea rcx, [rbp + 0x180]
movzx r9d, ax
call fcn.140003210
mov rax, qword [rbp + 0x100]
lea rdx, str._Disk_i__partition_u__s:___s__size_uBytes._r_n
mov ebx, dword [rsp + 0x70]
mov r8d, r12d
mov qword [rsp + 0x30], rax
mov r9d, ebx
lea rax, [rbp + 0x138]
mov rcx, r13
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x180]
mov qword [rsp + 0x20], rax
call fcn.140001120
lea rcx, [rbp + 0x180]
call qword [sym.imp.USER32.dll_CharUpperW]
mov r8, rax
lea r9, str.C12A7328_F81F_11D2_BA4B_00A0C93EC93B
mov rcx, 0xffffffffffffffff
nop word [rax + rax]
movzx edx, word [r8 + rcx*2 + 2]
cmp dx, word [r9 + rcx*2 + 2]
jne 0x1400020c3
add rcx, 2
cmp rcx, 0x25
je 0x1400020a6
movzx eax, word [r8 + rcx*2]
cmp ax, word [r9 + rcx*2]
je 0x140002080
jmp 0x1400020c3
mov r9d, ebx
lea rdx, str._Disk_i__Partition_u_is_EFI_partition._r_n
mov r8d, r12d
mov rcx, r13
call fcn.140001120
mov dword [r15 + 0x10], 1
mov rax, qword [rsp + 0x78]
inc ebx
add rax, 0x90
mov dword [rsp + 0x70], ebx
mov qword [rsp + 0x78], rax
cmp ebx, dword [r15 + 0x14]
jl 0x140001ee0
mov rsi, qword [rbp - 0x78]
mov r14, qword [rbp - 0x80]
jmp 0x1400021bd
lea rdx, str._Disk_i__Disk_is_MBR._r_n
call fcn.140001120
cmp dword [r15 + 0x14], 0
mov edi, ebx
jle 0x1400021bd
lea rbx, [rsi + 0x30]
nop dword [rax]
movups xmm0, xmmword [rbx]
mov r9d, edi
mov r8d, r12d
movups xmm1, xmmword [rbx + 0x10]
lea rdx, str._Disk_i__Partition_u:___s__size_uBytes._r_n
mov rcx, r13
movaps xmmword [rbp + 0x60], xmm0
movups xmm0, xmmword [rbx + 0x20]
movaps xmmword [rbp + 0x70], xmm1
movups xmm1, xmmword [rbx + 0x30]
mov rax, qword [rbp + 0x70]
movaps xmmword [rbp + 0x80], xmm0
movups xmm0, xmmword [rbx + 0x40]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xa8]
movaps xmmword [rbp + 0x90], xmm1
movups xmm1, xmmword [rbx + 0x50]
mov qword [rsp + 0x20], rax
movaps xmmword [rbp + 0xa0], xmm0
movups xmm0, xmmword [rbx + 0x60]
movaps xmmword [rbp + 0xb0], xmm1
movups xmm1, xmmword [rbx + 0x70]
movaps xmmword [rbp + 0xc0], xmm0
movups xmm0, xmmword [rbx + 0x80]
movaps xmmword [rbp + 0xd0], xmm1
movaps xmmword [rbp + 0xe0], xmm0
call fcn.140001120
cmp byte [rbp + 0x81], 0
je 0x1400021aa
mov dword [r15 + 0x10], 1
inc edi
add rbx, 0x90
cmp edi, dword [r15 + 0x14]
jl 0x140002110
cmp dword [r15 + 0x10], 0
je 0x1400021d6
mov r8d, r12d
lea rdx, str._Disk_i__This_is_a_OS_disk_r_n
mov rcx, r13
call fcn.140001120
mov rcx, rsi
call fcn.1400032b0
mov rdi, qword [rbp - 0x70]
mov rsi, qword [rbp - 0x68]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r9, rdi
lea rdx, str._Disk_i__Convert_device_path_to_device_id._SRC:__s__r_n
mov r8d, r12d
mov rcx, r13
call fcn.140001120
lea rdx, [rsi + 0x258]
mov rcx, rdi
call fcn.140001270
lea r9, [rsi + 0x258]
mov r8d, r12d
lea rdx, str._Disk_i__Convert_device_path_to_device_id._DST:______s__r_n
mov rcx, r13
call fcn.140001120
cmp dword [r15 - 0xc], 0x11
jne 0x14000225b
mov r8d, r12d
lea rdx, str._Disk_i__Try_to_get_NVMe_generation._r_n
mov rcx, r13
call fcn.140001120
mov rdx, r13
lea rcx, [rsi + 0x258]
call fcn.1400013e0
mov dword [r15 + 0x43c], eax
mov r8d, r12d
lea rdx, str._Disk_i__Try_to_get_information_under_Intel_RST_VMD._r_n
mov rcx, r13
call fcn.140001120
mov r9d, dword [r15 - 0x10]
lea rax, [rbp - 0x78]
mov r8d, dword [r15 - 0x14]
xor r14d, r14d
mov edx, dword [r15 - 0x18]
mov ecx, dword [r15 - 0x1c]
mov qword [rsp + 0x40], r13
mov qword [rsp + 0x38], rax
lea rax, [rbp - 0x80]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x78]
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x70], r14d
mov dword [rsp + 0x78], r14d
mov dword [rbp - 0x80], r14d
mov dword [rbp - 0x78], r14d
call fcn.140002420
test eax, eax
je 0x140002370
mov r8d, r12d
lea rdx, str._Disk_i__Success_getting_information_under_Intel_RST_VMD._r_n
mov rcx, r13
call fcn.140001120
mov ebx, dword [rsp + 0x70]
cmp ebx, 2
jl 0x140002310
mov r8d, r12d
lea rdx, str._Disk_i__Update_DeviceType._r_n
mov rcx, r13
call fcn.140001120
lea eax, [rbx - 3]
cmp eax, 1
ja 0x140002306
mov byte [r15 + 0xc], 0x11
jmp 0x140002310
cmp ebx, 2
jne 0x140002310
mov byte [r15 + 0xc], 0xb
mov ebx, dword [rbp - 0x80]
cmp ebx, 2
jl 0x140002370
mov r8d, r12d
lea rdx, str._Disk_i__Update_NVMe_generation._r_n
mov rcx, r13
call fcn.140001120
cmp ebx, 5
jne 0x14000233c
mov dword [r15 + 0x43c], 4
jmp 0x140002370
cmp ebx, 4
jne 0x14000234e
mov dword [r15 + 0x43c], 3
jmp 0x140002370
cmp ebx, 3
jne 0x140002360
mov dword [r15 + 0x43c], 2
jmp 0x140002370
cmp ebx, 2
jne 0x140002370
mov dword [r15 + 0x43c], 1
mov rdi, qword [rbp - 0x60]
lea rax, [rbp + 8]
inc r12d
mov qword [rsp + 0x20], rax
mov r9d, r12d
lea r8, [rbp - 8]
mov rcx, rdi
xor edx, edx
add r15, 0x468
call qword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
je 0x1400023a6
mov rsi, qword [rbp - 0x58]
jmp 0x140001980
mov rcx, rdi
call qword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
mov rbx, qword [rsp + 0x4f0]
mov eax, r12d
mov r15, qword [rsp + 0x4a0]
mov rcx, qword [rbp + 0x390]
xor rcx, rsp
call fcn.140003290
add rsp, 0x4a8
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, r12d
lea rdx, str._Disk_i__Failed_to_get_paritions_by_IOCTL_DISK_GET_DRIVE_LAYOUT_EX__error_code___0x_08X_._r_n
mov r9d, eax
mov rcx, r13
call fcn.140001120
lea rdx, [0x140020e58]
mov dword [rsp + 0x78], 0x80004005
lea rcx, [rsp + 0x78]
call fcn.140004a38
int3