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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x446f60
mov eax, dword fs:[0]
push eax
sub esp, 0xb4
mov eax, dword [0x45f070]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0xbc], 0
call fcn.0040d3e0
mov word [ebp - 0x18], ax
lea ecx, [ebp - 0x50]
xor eax, eax
mov dword [ebp - 0x16], 0x5c003a
push 4
push str.._
mov word [ebp - 0x12], ax
mov dword [ebp - 0x3c], 7
mov dword [ebp - 0x40], eax
mov word [ebp - 0x50], ax
call fcn.00407a70
push 2
lea eax, [ebp - 0x18]
mov dword [ebp - 4], 0
push eax
lea ecx, [ebp - 0x50]
call fcn.0040c5a0
cmp dword [ebp - 0x3c], 8
lea eax, [ebp - 0x50]
push 0
cmovae eax, dword [ebp - 0x50]
push 0
push 3
push 0
push 3
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x64], eax
cmp eax, 0xffffffff
jne 0x40d91a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x38]
push str.CreateFile___failed_with__d
push eax
call fcn.0040c880
add esp, 0xc
lea eax, [ebp - 0x38]
mov dword [ebp - 0x90], vtable.Sonarworks::CException.0
xorps xmm0, xmm0
lea ecx, [ebp - 0x84]
push eax
movq qword [ebp - 0x8c], xmm0
call fcn.00404bf0
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x6c], 3
call fcn.00404ad0
push 0x45d9a4
lea eax, [ebp - 0x90]
push eax
call fcn.0042a8e7
xorps xmm0, xmm0
movq qword [ebp - 0x58], xmm0
mov dword [ebp - 0x58], eax
xor bl, bl
mov dword [ebp - 0x20], 0
xor esi, esi
mov dword [ebp - 0x1c], esi
mov byte [ebp - 4], 2
mov edi, 0x150
nop dword [eax]
push edi
call fcn.00412874
mov ecx, eax
add esp, 4
mov eax, esi
mov dword [ebp - 0x5c], ecx
mov esi, ecx
mov dword [ebp - 0x1c], esi
test eax, eax
je 0x40d964
push eax
call fcn.00412385
add esp, 4
mov ecx, esi
push 0
lea eax, [ebp - 0x20]
push eax
push edi
push ecx
push 0
push 0
push 0x70050
push dword [ebp - 0x64]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40d9af
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40d995
add edi, 0x90
jmp 0x40d940
push eax
push dword [ebp - 0x64]
lea eax, [ebp - 0x38]
push str.DeviceIoControl_0x_p__IOCTL_DISK_GET_DRIVE_LAYOUT_EX__...__failed_with__d
push eax
call fcn.0040c880
add esp, 0x10
jmp 0x40d8d6
mov eax, dword [ebp - 0x5c]
mov ecx, dword [eax + 4]
mov dword [ebp - 0x1c], ecx
test ecx, ecx
je 0x40da07
lea edi, [eax + 0x30]
nop
mov eax, dword [edi]
test eax, eax
jne 0x40d9d0
cmp byte [edi + 0x20], 0x42
jne 0x40d9d0
mov bl, 1
jmp 0x40d9f6
cmp eax, 1
jne 0x40d9f6
lea ecx, [edi + 0x20]
mov edx, 0x457318
lea esi, [eax + 0xb]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40d9f3
add ecx, 4
add edx, 4
sub esi, 4
jae 0x40d9e0
mov bl, 1
mov ecx, dword [ebp - 0x1c]
add edi, 0x90
sub ecx, 1
mov dword [ebp - 0x1c], ecx
jne 0x40d9c0
mov eax, dword [ebp - 0x5c]
push eax
mov byte [ebp - 4], 1
call fcn.00412385
add esp, 4
test bl, bl
jne 0x40db74
mov ebx, dword [ebp - 0x64]
lea eax, [ebp - 0x1c]
mov edi, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
xorps xmm0, xmm0
push 0
push eax
push 8
lea eax, [ebp - 0x60]
movq qword [ebp - 0x2c], xmm0
push eax
push 0xc
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x24], 0
push eax
push 0x2d1400
push ebx
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x1c], 0
call edi
test eax, eax
jne 0x40dad3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x80]
push str.DeviceIoControl___failed_with__d
push eax
call fcn.0040c880
add esp, 0xc
mov dword [ebp - 0xb8], vtable.Sonarworks::CException.0
lea eax, [ebp - 0x80]
xorps xmm0, xmm0
lea ecx, [ebp - 0xac]
movq qword [ebp - 0xb4], xmm0
push eax
call fcn.00404bf0
lea ecx, [ebp - 0x80]
mov dword [ebp - 0x94], 3
call fcn.00404ad0
push 0x45d9a4
lea eax, [ebp - 0xb8]
jmp 0x40d914
push dword [ebp - 0x5c]
call fcn.00412874
mov esi, eax
add esp, 4
mov dword [ebp - 0x20], esi
mov byte [ebp - 4], 3
push dword [ebp - 0x5c]
push 0
push esi
call fcn.0042b2b0
add esp, 0xc
lea eax, [ebp - 0x1c]
push 0
push eax
push dword [ebp - 0x5c]
lea eax, [ebp - 0x2c]
push esi
push 0xc
push eax
push 0x2d1400
push ebx
call edi
test eax, eax
je 0x40da75
mov eax, dword [esi + 0x18]
test eax, eax
je 0x40db44
mov ecx, dword [ebp - 0x68]
add eax, esi
push eax
call fcn.00404c70
push esi
call fcn.00412385
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x50]
call fcn.004026c0
mov eax, dword [ebp - 0x68]
jmp 0x40db9e
push 3
sub esp, 0x18
mov eax, esp
push str.Could_not_locate_the_OS_HDD_serial_in_the_STORAGE_DEVICE_DESCRIPTOR_structure
push eax
call fcn.0040c880
add esp, 8
lea ecx, [ebp - 0xb8]
call fcn.0040cb10
push 0x45d9a4
lea eax, [ebp - 0xb8]
jmp 0x40d914
mov edi, dword [ebp - 0x68]
mov ecx, edi
call fcn.0040d750
push dword [ebp - 0x64]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x3c]
cmp eax, 8
jb 0x40db9c
inc eax
lea ecx, [ebp - 0x50]
push eax
push dword [ebp - 0x50]
call fcn.00408700
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00412374
mov esp, ebp
pop ebp
ret