Function at 0x407987
Capabilities:
Get disk information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
xor edi, edi
xor ebx, ebx
inc ebx
cmp dword [0x421324], edi
jne 0x4079b1
call fcn.0040759c
or eax, eax
jne 0x4079b1
jmp 0x407c74
or esi, esi
je 0x407ae9
cmp byte [esi], 0
je 0x407ae9
push esi
call sub.KERNEL32.DLL_lstrlenA
mov edi, eax
cmp edi, 0x104
jbe 0x4079d9
xor eax, eax
jmp 0x407c74
mov dword [ebp - 0x10c], 0
jmp 0x407a17
mov eax, dword [ebp - 0x10c]
cmp byte [esi + eax], 0x2f
jne 0x407a01
mov eax, dword [ebp - 0x10c]
mov byte [ebp + eax - 0x105], 0x5c
jmp 0x407a11
mov eax, dword [ebp - 0x10c]
mov dl, byte [esi + eax]
mov byte [ebp + eax - 0x105], dl
inc dword [ebp - 0x10c]
cmp dword [ebp - 0x10c], edi
jbe 0x4079e5
cmp byte [ebp - 0x105], 0x5c
jne 0x407ac2
cmp byte [ebp - 0x104], 0x5c
jne 0x407ac2
mov dword [ebp - 0x110], 0
mov dword [ebp - 0x10c], 2
jmp 0x407a8c
mov eax, dword [ebp - 0x10c]
cmp byte [ebp + eax - 0x105], 0x5c
jne 0x407a86
inc dword [ebp - 0x110]
cmp dword [ebp - 0x110], 2
jne 0x407a86
inc dword [ebp - 0x10c]
mov eax, dword [ebp - 0x10c]
mov byte [ebp + eax - 0x105], 0
mov edi, eax
jmp 0x407a94
inc dword [ebp - 0x10c]
cmp dword [ebp - 0x10c], edi
jb 0x407a4f
cmp dword [ebp - 0x110], 1
jne 0x407ae9
cmp byte [ebp + edi - 0x105], 0x5c
je 0x407ae9
mov al, byte [ebp - 0x105]
mov byte [ebp + edi - 0x105], al
mov eax, edi
inc eax
mov byte [ebp + eax - 0x105], 0
inc edi
jmp 0x407ae9
cmp byte [ebp - 0x104], 0x3a
jne 0x407ae0
mov byte [ebp - 0x103], 0x5c
mov byte [ebp - 0x102], 0
mov edi, 3
jmp 0x407ae9
mov byte [ebp - 0x105], 0
xor edi, edi
push 0x41fecc
call sub.KERNEL32.DLL_EnterCriticalSection
cmp dword [0x41fd9c], 0
je 0x407b15
lea eax, [ebp - 0x105]
push eax
push 0x41fdb8
call sub.KERNEL32.DLL_lstrcmpiA
or eax, eax
je 0x407c2f
mov dword [ebp - 0x10c], 0
mov dword [ebp - 0x110], 0
push 0x41fecc
call sub.KERNEL32.DLL_LeaveCriticalSection
push 0
push 0
lea eax, [ebp - 0x114]
push eax
push 0
push 0
push 0
push 0
cmp byte [ebp - 0x105], 0
jne 0x407b5b
mov dword [ebp - 0x118], 0
jmp 0x407b67
lea eax, [ebp - 0x105]
mov dword [ebp - 0x118], eax
push dword [ebp - 0x118]
call sub.KERNEL32.DLL_GetVolumeInformationA
mov ebx, eax
or ebx, ebx
je 0x407bd7
test byte [ebp - 0x114], 8
je 0x407bd7
mov eax, dword [ebp + 0x10]
cmp dword [eax + 8], 0
je 0x407bd7
cmp byte [ebp - 0x105], 0
jne 0x407b9f
mov dword [ebp - 0x11c], 0
jmp 0x407bab
lea eax, [ebp - 0x105]
mov dword [ebp - 0x11c], eax
push dword [ebp - 0x11c]
call sub.KERNEL32.DLL_GetDriveTypeA
cmp eax, 4
jne 0x407bd7
mov dword [ebp - 0x110], 1
lea eax, [ebp - 0x10c]
push eax
push dword [ebp + 0xc]
call fcn.004078a0
add esp, 8
push 0x41fecc
call sub.KERNEL32.DLL_EnterCriticalSection
or ebx, ebx
je 0x407c2f
mov eax, edi
inc eax
push eax
lea eax, [ebp - 0x105]
push eax
push 0x41fdb8
call sub.KERNEL32.DLL_lstrcpynA
mov dword [0x41fda0], 0
mov eax, dword [ebp - 0x114]
mov dword [0x41fda8], eax
mov eax, dword [ebp - 0x110]
mov dword [0x41fdac], eax
mov eax, dword [ebp - 0x10c]
mov dword [0x41fdb0], eax
mov dword [0x41fd9c], 1
or ebx, ebx
je 0x407c5e
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 8]
mov dword [0x41fda4], ecx
mov eax, dword [eax + 0x18]
mov dword [0x41fdb4], eax
push 0x124
push 0x41fd9c
push dword [ebp + 0x10]
call sub.CRTDLL.DLL_memcpy
add esp, 0xc
jmp 0x407c68
mov dword [0x41fd9c], 0
push 0x41fecc
call sub.KERNEL32.DLL_LeaveCriticalSection
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret