Function at 0x402350
Capabilities:
Get disk size
Get storage device properties

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
mov eax, dword [0x452004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x48]
push edi
mov edi, dword [ebp + 0xc]
mov ebx, edx
push ecx
push str..PhysicalDrive_d
push 0x40
push eax
mov dword [ebp - 0x78], 1
call fcn.00401100
add esp, 0x10
lea eax, [ebp - 0x48]
push 0
push 0
push 3
push 0
push 1
push closesocket
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x74], eax
cmp eax, 0xffffffff
jne 0x4023d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x48]
push eax
push str.CreateFileA__s_failed__u_n
push 1
call fcn.00401a20
mov eax, dword [ebp - 0x78]
add esp, 0x10
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00422702
mov esp, ebp
pop ebp
ret
push 0
lea ecx, [ebp - 0x4c]
push ecx
push 8
lea ecx, [ebp - 0x58]
push ecx
push 0
push 0
push 0x7405c
push eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x402421
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_GET_LENGTH_INFO_failed__u_n
push 1
call fcn.00401a20
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00422702
mov esp, ebp
pop ebp
ret
test ebx, ebx
je 0x402430
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x54]
mov dword [ebx], eax
mov dword [ebx + 4], ecx
mov ebx, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
lea eax, [ebp - 0x4c]
push 0
push eax
push 8
lea eax, [ebp - 0x6c]
mov dword [ebp - 0x64], 0
push eax
push 0xc
lea eax, [ebp - 0x64]
mov dword [ebp - 0x60], 0
push eax
push 0x2d1400
push dword [ebp - 0x74]
call ebx
test eax, eax
jne 0x40247f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_STORAGE_QUERY_PROPERTY_failed__u_n
push 1
call fcn.00401a20
add esp, 0xc
jmp 0x4025f7
mov eax, dword [ebp - 0x68]
push eax
cmp eax, 0x28
jae 0x40249c
push str.DevDescHeader.size_invalid__u_n
push 1
call fcn.00401a20
add esp, 0xc
jmp 0x4025f7
call fcn.0042475b
add esp, 4
mov dword [ebp - 0x70], eax
test eax, eax
jne 0x4024bf
push str.malloc_failed_n
push 1
call fcn.00401a20
add esp, 8
jmp 0x4025f7
push 0
lea ecx, [ebp - 0x4c]
push ecx
push dword [ebp - 0x68]
push eax
push 0xc
lea eax, [ebp - 0x64]
push eax
push 0x2d1400
push dword [ebp - 0x74]
call ebx
test eax, eax
jne 0x4024f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_STORAGE_QUERY_PROPERTY_failed__u_n
push 1
call fcn.00401a20
add esp, 0xc
jmp 0x4025ec
mov ecx, dword [ebp - 0x70]
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x402573
test esi, esi
je 0x402573
add eax, ecx
push eax
push 0x80
push esi
call fcn.00427bdd
mov ecx, esi
add esp, 0xc
mov edx, esi
lea ebx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402520
sub ecx, ebx
je 0x402550
dec ecx
mov ebx, 1
add ecx, esi
sub ebx, esi
mov al, byte [ecx]
cmp al, 0x20
je 0x40253f
cmp al, 9
jne 0x402550
mov byte [ecx], 0
dec ecx
lea eax, [ebx + ecx]
test eax, eax
jne 0x402535
nop word [eax + eax]
mov al, byte [edx]
cmp al, 0x20
je 0x40255a
cmp al, 9
jne 0x40255d
inc edx
jmp 0x402550
test al, al
je 0x40256d
sub edx, esi
mov byte [esi], al
inc esi
mov al, byte [edx + esi]
test al, al
jne 0x402563
mov ecx, dword [ebp - 0x70]
mov byte [esi], 0
mov eax, dword [ecx + 0x10]
test eax, eax
je 0x4025e5
test edi, edi
je 0x4025e5
add eax, ecx
push eax
push 0x80
push edi
call fcn.00427bdd
mov ecx, edi
add esp, 0xc
mov edx, edi
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402596
sub ecx, esi
je 0x4025c5
dec ecx
mov esi, 1
add ecx, edi
sub esi, edi
nop dword [eax + eax]
mov al, byte [ecx]
cmp al, 0x20
je 0x4025ba
cmp al, 9
jne 0x4025c5
mov byte [ecx], 0
dec ecx
lea eax, [esi + ecx]
test eax, eax
jne 0x4025b0
mov al, byte [edx]
cmp al, 0x20
je 0x4025cf
cmp al, 9
jne 0x4025d2
inc edx
jmp 0x4025c5
test al, al
je 0x4025e2
sub edx, edi
mov byte [edi], al
inc edi
mov al, byte [edx + edi]
test al, al
jne 0x4025d8
mov byte [edi], 0
mov dword [ebp - 0x78], 0
push dword [ebp - 0x70]
call fcn.00424740
add esp, 4
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x78]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.00422702
mov esp, ebp
pop ebp
ret