Function at 0x66410370
Capabilities:
Get disk information

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x9c
mov esi, dword [eax + 0xa4]
mov eax, esi
test al, al
je 0x66410170
mov edx, dword [sym.imp.kernel32.dll_GetDriveTypeW]
movzx eax, al
mov dword [ebp - 0x2e], 0x3a
add eax, 0x40
mov word [ebp - 0x30], ax
lea eax, [ebp - 0x30]
mov dword [esp], eax
mov dword [ebp - 0x5c], edx
call edx
mov edx, dword [ebp - 0x5c]
sub esp, 4
cmp eax, 1
jbe 0x664101e0
sub esi, 1
mov eax, esi
movzx eax, al
add eax, 0x41
jmp 0x66410183
call fcn.6640e720
mov edx, dword [sym.imp.kernel32.dll_GetDriveTypeW]
mov esi, eax
movzx eax, al
add eax, 0x41
lea edi, [ebp - 0x4a]
xor ecx, ecx
mov dword [ebp - 0x48], 0x5c003a
mov word [ebp - 0x44], cx
mov word [ebp - 0x4a], ax
mov dword [esp], edi
call edx
and dword [ebx + 0xc0], 0xfffffffe
sub esp, 4
mov edx, eax
cmp eax, 1
jbe 0x664101f0
mov ecx, dword [ebx + 0xb0]
movzx eax, cl
sub eax, 4
cmp eax, 0xb
ja case.0x664101be.4
jmp dword [eax*4 + 0x664485c4]
test byte [0x664447b0], 2
jne 0x66410268
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x5b
mov esi, 0x1a
jmp 0x66410183
test byte [0x664447b0], 8
jne 0x66410228
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 0xf
mov eax, 0xf
or dword [ebx + 0xc0], 1
mov word [ebx + 0xb0], ax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, esi
movzx esi, al
add esi, 0x41
mov dword [esp + 0x14], esi
movzx eax, byte [ebx + 0xb0]
mov dword [esp + 0xc], str.IOCTL___SUBFUNCTION__d___INVALID_DRIVE__c:_n
mov dword [esp + 8], str.INT21_Ioctl_Block
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], eax
mov dword [esp], 3
call fcn.6640d110
jmp 0x664101f9
movzx eax, word [ebx + 0x94]
movzx ecx, cx
mov dword [esp + 0x34], eax
movzx eax, word [ebx + 0x98]
mov dword [esp + 0x30], eax
movzx eax, word [ebx + 0x9c]
mov dword [esp + 0x2c], eax
movzx eax, word [ebx + 0xa0]
mov dword [esp + 0x28], eax
movzx eax, word [ebx + 0xa8]
mov dword [esp + 0x24], eax
movzx eax, word [ebx + 0xac]
mov dword [esp + 0x20], eax
movzx eax, word [ebx + 0xa4]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], 0x21
mov dword [esp + 0x10], 0x21
mov dword [esp + 0xc], 0x66447e88
mov dword [esp + 8], str.INT21_Ioctl_Block
mov dword [esp + 4], 0x664447b0
mov dword [esp], 1
call fcn.6640d110
jmp 0x664101d5
test byte [0x664447b0], 8
jne 0x66410860
xor cx, cx
mov eax, ecx
or eax, 1
cmp edx, 2
cmovne ecx, eax
mov dword [ebx + 0xb0], ecx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x664447b0], 8
jne 0x66410820
mov eax, dword [ebx + 0xa8]
xor ax, ax
cmp edx, 4
je 0x66410810
cmp edx, 5
je 0x664104a0
mov ecx, eax
or ch, 8
cmp edx, 3
cmove eax, ecx
mov dword [ebx + 0xa8], eax
jmp 0x664101d5
mov eax, dword [ebx + 0xa8]
mov dword [esp + 4], eax
movzx eax, word [ebx + 0x98]
mov dword [esp], eax
call fcn.6642fb90
movzx ecx, word [ebx + 0xac]
mov edx, eax
lea eax, [ecx - 0x841]
cmp eax, 0x31
ja case.0x664103a1.2114
jmp dword [eax*4 + 0x664485f4]
test byte [0x664447b0], 8
jne 0x664108a8
xor cl, cl
mov dword [ebx + 0xb0], ecx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x664447b0], 8
je 0x664103bd
movzx edx, byte [ebx + 0xa4]
mov eax, str.default
test edx, edx
je 0x66410405
cmp edx, 0x1a
ja 0x664108c8
add edx, 0x40
mov dword [esp], 0x66448581
mov dword [esp + 4], edx
call fcn.6640e6c0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.IOCTL___SET_LOGICAL_DRIVE_MAP_for_drive__s_n
mov dword [esp + 8], str.INT21_Ioctl_Block
mov dword [esp + 4], 0x664447b0
mov dword [esp], 3
call fcn.6640d110
mov ecx, dword [ebx + 0xb0]
jmp 0x664103bd
test byte [0x664447b0], 2
je 0x664101d5
movzx eax, word [ebx + 0x94]
mov dword [esp + 0x34], eax
movzx eax, word [ebx + 0x98]
mov dword [esp + 0x30], eax
movzx eax, word [ebx + 0x9c]
mov dword [esp + 0x2c], eax
movzx eax, word [ebx + 0xa0]
mov dword [esp + 0x28], eax
movzx eax, word [ebx + 0xa8]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
movzx eax, word [ebx + 0xa4]
mov dword [esp + 0x1c], eax
movzx eax, word [ebx + 0xb0]
mov dword [esp + 0x18], eax
jmp 0x664102bc
or ah, 0x10
mov dword [ebx + 0xa8], eax
jmp 0x664101d5
test byte [0x664447b0], 8
jne 0x66410968
movzx eax, word [edx + 1]
movzx edi, word [edx + 7]
mov word [ebp - 0x5c], ax
movzx eax, word [edx + 3]
mov word [ebp - 0x5e], ax
movzx eax, word [edx + 5]
mov word [ebp - 0x60], ax
movzx eax, word [edx + 9]
mov dword [esp + 4], eax
movzx eax, word [edx + 0xb]
mov dword [esp], eax
call fcn.6642fb90
mov ecx, esi
cmp cl, 1
jbe 0x664109d9
or dword [ebx + 0xc0], 1
mov edi, 0x1d
mov word [ebx + 0xb0], di
jmp 0x664101d5
or dword [ebx + 0xc0], 1
mov eax, 1
mov word [ebx + 0xb0], ax
jmp 0x664101d5
xor eax, eax
mov ecx, 8
mov edi, edx
rep stosd dword es:[edi], eax
mov eax, esi
mov byte [edx], 4
cmp al, 1
jbe 0x664108f6
mov ecx, 0x202
mov esi, 0xfffff002
mov eax, 0x105
mov byte [edx + 5], 3
mov word [edx + 8], cx
mov edi, 0x38
mov ecx, 0x28
mov word [edx + 0xc], si
mov esi, 0xfffffffa
mov word [edx + 1], ax
mov eax, esi
mov byte [edx + 0x11], 0xf8
mov byte [edx + 0x10], al
mov eax, edi
mov byte [edx + 0x12], cl
mov byte [edx + 0x14], al
mov byte [edx + 0x16], 2
and dword [ebx + 0xc0], 0xfffffffe
jmp 0x664101d5
test byte [0x664447b0], 8
je 0x664101d5
mov eax, esi
movzx eax, al
add eax, 0x41
mov dword [esp + 0x18], eax
movzx eax, word [ebx + 0xa8]
mov dword [esp + 0x14], eax
movzx eax, byte [ebx + 0xa5]
mov dword [esp + 0xc], str.GENERIC_IOCTL___Lock_logical_volume__level__d_mode__d____c:_n
mov dword [esp + 8], str.INT21_Ioctl_Block
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], eax
mov dword [esp], 3
call fcn.6640d110
jmp 0x664101d5
movzx eax, byte [edx]
lea esi, [edx + 1]
lea ecx, [eax - 1]
mov ebx, eax
cmp ecx, 4
jae 0x664108dd
test ecx, ecx
je 0x6641060a
mov byte [edx + 1], 0
test cl, 2
jne 0x66410a1d
mov ecx, 0xffffff07
mov byte [edx + 1], bl
mov word [edx + 2], cx
jmp 0x664101d5
test byte [0x664447b0], 8
jne 0x6641092d
mov dword [ebp - 0x5c], edx
lea ebx, [ebp - 0x30]
mov dword [esp], edi
xor edi, edi
lea esi, [ebp - 0x42]
mov dword [esp + 4], ebx
lea eax, [ebp - 0x50]
mov dword [esp + 0x1c], 9
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xc
call dword [sym.imp.kernel32.dll_GetVolumeInformationW]
mov edx, dword [ebp - 0x5c]
sub esp, 0x20
mov word [edx], di
mov eax, dword [ebp - 0x50]
mov dword [edx + 2], eax
lea eax, [edx + 6]
mov dword [esp + 8], ebx
mov ebx, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0xb
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xb
mov dword [esp + 4], 0
mov dword [esp], 1
call ebx
mov edx, dword [ebp - 0x5c]
sub esp, 0x20
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
add edx, 0x11
mov dword [esp + 0x14], 8
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 8
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 1
call ebx
sub esp, 0x20
jmp 0x664101d5
mov eax, esi
movzx edi, al
test byte [0x664447b0], 8
jne 0x664109a3
movzx eax, word [edx + 1]
movzx ecx, word [edx + 3]
mov word [ebp - 0x5c], ax
movzx eax, word [edx + 5]
mov word [ebp - 0x5e], cx
movzx ecx, word [edx + 7]
mov word [ebp - 0x60], ax
movzx eax, word [edx + 9]
mov word [ebp - 0x62], cx
mov dword [esp + 4], eax
movzx eax, word [edx + 0xb]
mov dword [esp], eax
call fcn.6642fb90
mov ecx, esi
mov dword [esp + 0x10], 0
mov edx, eax
mov eax, esi
mov dword [esp], edi
mov dword [esp + 0xc], edx
movzx edx, word [ebp - 0x62]
cmp al, 2
sbb eax, eax
and eax, 0xfffff034
add eax, 0xff0
cmp cl, 2
mov dword [esp + 8], edx
movzx edx, word [ebp - 0x5e]
sbb ecx, ecx
and cl, 0x13
add ecx, 0xff
imul edx, eax
movzx eax, word [ebp - 0x60]
add eax, edx
movzx edx, word [ebp - 0x5c]
imul edx, ecx
add eax, edx
mov dword [esp + 4], eax
call fcn.66418150
test eax, eax
jne 0x664101d5
or dword [ebx + 0xc0], 1
mov eax, 0x1e
mov word [ebx + 0xb0], ax
jmp 0x664101d5
test byte [0x664447b0], 8
je 0x664101d5
mov eax, esi
mov dword [esp + 0xc], str.GENERIC_IOCTL___Logical_volume_unlocked____c:_n
movzx eax, al
mov dword [esp + 8], str.INT21_Ioctl_Block
add eax, 0x41
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], eax
mov dword [esp], 3
call fcn.6640d110
jmp 0x664101d5
or ah, 0x12
mov dword [ebx + 0xa8], eax
jmp 0x664101d5
mov eax, esi
mov dword [esp + 0xc], str.IOCTL___CHECK_IF_BLOCK_DEVICE_REMOTE____c:_n
movzx esi, al
mov dword [esp + 8], str.INT21_Ioctl_Block
add esi, 0x41
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], esi
mov dword [esp], 3
mov dword [ebp - 0x5c], edx
call fcn.6640d110
mov edx, dword [ebp - 0x5c]
jmp 0x66410335
mov eax, esi
mov dword [esp + 0xc], str.IOCTL___CHECK_IF_BLOCK_DEVICE_REMOVABLE____c:_n
movzx esi, al
mov dword [esp + 8], str.INT21_Ioctl_Block
add esi, 0x41
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], esi
mov dword [esp], 3
mov dword [ebp - 0x5c], edx
call fcn.6640d110
mov ecx, dword [ebx + 0xb0]
mov edx, dword [ebp - 0x5c]
jmp 0x66410305
mov eax, esi
mov dword [esp + 0xc], str.IOCTL___GET_LOGICAL_DRIVE_MAP____c:_n
movzx esi, al
add esi, 0x41
mov dword [esp + 0x10], esi
jmp 0x66410411
mov dword [esp + 4], edx
mov dword [esp], str._Bad_drive:__d_
call fcn.6640e6c0
jmp 0x66410405
mov dword [esi + ecx - 4], 0
lea ecx, [eax - 2]
mov edi, esi
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
jmp 0x6641060a
mov eax, 0x207
mov byte [edx + 4], 0x50
mov esi, 0xb
mov ecx, 6
mov word [edx + 1], ax
mov eax, 0x202
mov edi, 0x12
mov word [edx + 8], ax
mov eax, 0xfffff002
mov word [edx + 0xc], ax
mov byte [edx + 0xf], 0x40
jmp 0x6641056c
mov eax, esi
mov dword [esp + 0xc], str.GENERIC_IOCTL___Get_media_id____c:_n
movzx eax, al
mov dword [esp + 8], str.INT21_Ioctl_Block
add eax, 0x41
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], eax
mov dword [esp], 3
mov dword [ebp - 0x5c], edx
call fcn.6640d110
mov edx, dword [ebp - 0x5c]
jmp 0x66410628
mov eax, esi
mov dword [esp + 0xc], str.GENERIC_IOCTL___Write_logical_device_track____c:_n
movzx eax, al
mov dword [esp + 8], str.INT21_Ioctl_Block
add eax, 0x41
mov dword [esp + 4], 0x664447b0
mov dword [esp + 0x10], eax
mov dword [esp], 3
mov dword [ebp - 0x5c], edx
call fcn.6640d110
mov edx, dword [ebp - 0x5c]
jmp 0x664104bb
lea eax, [edi + 0x41]
mov dword [esp + 0xc], str.GENERIC_IOCTL___Read_logical_device_track____c:_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.INT21_Ioctl_Block
mov dword [esp + 4], 0x664447b0
mov dword [esp], 3
mov dword [ebp - 0x5c], edx
call fcn.6640d110
mov edx, dword [ebp - 0x5c]
jmp 0x66410718
mov dword [esp + 0xc], eax
movzx eax, word [ebp - 0x5e]
movzx esi, cl
mov dword [esp + 0x10], 0
mov dword [esp + 8], edi
mov dword [esp], esi
lea edx, [eax + eax*8]
movzx eax, word [ebp - 0x60]
lea edx, [eax + edx*4]
movzx eax, word [ebp - 0x5c]
lea eax, [eax + eax*8]
lea eax, [edx + eax*2]
mov dword [esp + 4], eax
call fcn.664184c0
test eax, eax
jne 0x664101d5
jmp 0x664104f6
mov word [esi + ecx - 2], 0
jmp 0x6641060a