Function at 0x406720
Capabilities:
Get disk information
Get disk size

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x40c
mov eax, dword [0x45cefc]
xor eax, esp
mov dword [esp + 0x408], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0x18]
push esi
mov esi, edx
push edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], ebx
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
mov ecx, dword [ebp + 0xc]
mov edx, 1
shl edx, cl
test edx, eax
je 0x406780
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x408]
xor ecx, esp
call fcn.004231f4
mov esp, ebp
pop ebp
ret
test esi, esi
jne 0x4067a4
mov ecx, dword [0x463de0]
push esi
lea eax, [esp + 0x34]
push eax
push esi
push esi
push esi
push esi
push 0x7202c
push ecx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x406769
push 0x2cc
lea edx, [esp + 0x3c]
push 0
push edx
call fcn.00422ac0
xor eax, eax
add esp, 0xc
cmp dword [ebp + 0x14], eax
sete al
mov dword [esp + 0x2a8], eax
test esi, esi
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov dword [esp + 0x290], ecx
mov dword [esp + 0x28c], edx
je 0x4067ef
mov ecx, 0x12
lea edi, [esp + 0x244]
rep movsd dword es:[edi], dword [esi]
jmp 0x4067fa
mov dword [esp + 0x244], 0
mov eax, dword [ebx]
test eax, eax
jne 0x406823
cmp dword [ebx + 8], eax
je 0x406823
lea esi, [ebx + 0x18]
mov ecx, 0x12
lea edi, [esp + 0x2bc]
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x2b8], 1
jmp 0x40682e
mov dword [esp + 0x2b8], 0
cmp dword [0x471ac4], 5
mov ecx, dword [ebx + 0x10]
mov edx, dword [ebx + 0x14]
mov dword [esp + 0x2a0], eax
mov eax, dword [ebx + 4]
mov dword [esp + 0x2a4], eax
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x298], ecx
mov dword [esp + 0x29c], edx
mov dword [esp + 0x2b4], eax
mov dword [esp + 0x2ac], 1
jne 0x406885
cmp dword [0x471ac8], 0
jne 0x406885
mov dword [esp + 0x2ac], 0
mov ebx, dword [esp + 0x28]
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x40]
push edx
call fcn.004058f0
add esp, 8
cmp dword [esp + 0x20], 0
jne 0x40697d
cmp byte [ebx], 0x5c
jne 0x4068d7
cmp byte [ebx + 1], 0x5c
lea eax, [ebx + 1]
jne 0x4068d7
push eax
push str.UNC_s
lea eax, [esp + 0x44]
push 0x104
push eax
call fcn.0044475d
add esp, 0x10
mov dword [esp + 0x2b0], 1
push 0x103
lea ecx, [esp + 0x30c]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetVolumePathNameA]
test eax, eax
je 0x40697d
lea edx, [esp + 0x10]
push edx
mov eax, edx
push eax
lea ecx, [esp + 0x2c]
push ecx
push edx
lea eax, [esp + 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
test eax, eax
je 0x40691e
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x294], ecx
cmp dword [esp + 0x2a0], 0
jne 0x40695f
push 0
push 0
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x1c]
push eax
push 0
push 0
push 0
lea ecx, [esp + 0x324]
push ecx
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationA]
test eax, eax
je 0x40695f
mov edx, dword [esp + 0x2c]
shr edx, 0x13
and edx, 1
mov dword [esp + 0x2a0], edx
lea eax, [esp + 0x308]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 4
jne 0x40697d
mov dword [esp + 0x2b0], 1
lea esi, [esp + 0x3c]
call fcn.00405b40
push 0
lea ecx, [esp + 0x38]
push ecx
mov ecx, dword [0x463de0]
push 0x2cc
lea edx, [esp + 0x44]
push edx
push 0x2cc
mov eax, edx
push eax
push 0x72000
push ecx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
lea esi, [esp + 0x244]
mov edx, 0x48
mov edi, edx
mov ecx, esi
mov byte [ecx], 0
add ecx, 1
sub edi, 1
jne 0x4069c1
lea esp, [esp]
sub edx, 1
mov byte [esi], 0
add esi, 1
test edx, edx
jne 0x4069d0
lea esi, [esp + 0x2bc]
mov edx, 0x48
mov edi, edx
mov ecx, esi
lea ecx, [ecx]
mov byte [ecx], 0
add ecx, 1
sub edi, 1
jne 0x4069f0
jmp 0x406a00
sub edx, 1
mov byte [esi], 0
add esi, 1
test edx, edx
jne 0x406a00
test eax, eax
jne 0x406ae6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x20
jne 0x406a7b
cmp dword [esp + 0x2a8], 0
je 0x406a9d
push str.FILE_IN_USE
push str.____hs___
push 0x474260
call dword [sym.imp.USER32.dll_wsprintfW]
mov edx, dword [0x471ab4]
mov eax, dword [esp + 0x28]
add esp, 0xc
push 0x134
push edx
push 0x474260
push eax
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp eax, 6
jne 0x406ace
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov dword [esp + 0x2a8], 0
jmp 0x4067c7
cmp dword [esp + 0x2b0], 0
jne 0x406ace
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov dword [esp + 0x2b0], 1
jmp 0x4067c7
push str.FILE_IN_USE_FAILED
push str.____hs___
push 0x474260
call dword [sym.imp.USER32.dll_wsprintfW]
mov ecx, dword [0x471ab4]
mov edx, dword [esp + 0x28]
add esp, 0xc
push 0x10
push ecx
push 0x474260
push edx
call dword [sym.imp.USER32.dll_MessageBoxW]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x408]
xor ecx, esp
call fcn.004231f4
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x38]
test eax, eax
je 0x406b10
xor ecx, ecx
cmp eax, 3
setne cl
sub ecx, 1
mov eax, ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x408]
xor ecx, esp
call fcn.004231f4
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0xc]
mov edi, 0x8000
call fcn.00406590
mov eax, dword [esp + 0x2a8]
mov ecx, dword [esp + 0x414]
pop edi
neg eax
pop esi
sbb eax, eax
pop ebx
xor ecx, esp
add eax, 2
call fcn.004231f4
mov esp, ebp
pop ebp
ret