Function at 0x40c820
Capabilities:
Get disk information

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x108
and eax, 7
push ebx
push ebp
push esi
cmp eax, 2
push edi
jne 0x40cafa
mov esi, dword [esp + 0x11c]
mov ecx, dword [0x41c330]
xor ebp, ebp
mov al, byte [esi]
lea edi, [esi + 1]
mov byte [ecx], al
mov eax, dword [0x41c330]
mov ecx, edi
cmp byte [eax], 0
je 0x40c872
inc eax
inc ecx
mov dword [0x41c330], eax
mov dl, byte [ecx - 1]
mov byte [eax], dl
mov eax, dword [0x41c330]
cmp byte [eax], 0
jne 0x40c85c
mov ecx, dword [0x41c32c]
lea eax, [esp + 0x14]
push 0x40
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_OpenFile]
cmp eax, 0xffffffff
jne 0x40c89d
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x7b
je 0x40c8d1
sub eax, 0x53
je 0x40c8d1
jmp 0x40c8a4
push eax
call dword [sym.imp.KERNEL32.dll__lclose]
mov eax, dword [0x41c318]
mov dl, byte [esi]
mov ecx, edi
mov byte [eax], dl
mov eax, dword [0x41c318]
cmp byte [eax], 0
je 0x40c8df
inc eax
inc ecx
mov dword [0x41c318], eax
mov dl, byte [ecx - 1]
mov byte [eax], dl
mov eax, dword [0x41c318]
cmp byte [eax], 0
jne 0x40c8b9
jmp 0x40c8df
push 0x41c318
push esi
call fcn.0040c6c0
add esp, 8
mov eax, dword [0x41c330]
mov edx, dword [0x41c32c]
sub eax, edx
cmp eax, 0x102
jle 0x40c8f8
mov ebp, 1
mov ecx, dword [0x41c324]
push 0x41cda0
push ecx
call fcn.0041318e
add esp, 8
test eax, eax
je 0x40ca44
mov eax, dword [0x424f70]
test eax, eax
jne 0x40c947
mov edx, dword [0x41c32c]
push edx
call fcn.0040df2e
mov eax, dword [0x41c324]
push eax
call fcn.0040df2e
add esp, 8
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
test ebp, ebp
je 0x40c995
mov ecx, dword [0x41c32c]
push ecx
push 0x419bb8
push 0x419ea0
call fcn.0040dba4
push 0x419ea0
call fcn.0040df5d
mov edx, dword [0x41c32c]
push edx
call fcn.0040df2e
mov eax, dword [0x41c324]
push eax
call fcn.0040df2e
add esp, 0x18
mov eax, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov ecx, dword [0x41c324]
push ecx
call fcn.004134f8
add esp, 4
cmp eax, 0xffffffff
jne 0x40c9f8
mov edx, dword [0x41c324]
push 0x41cde0
push edx
push 0x419bdc
push 0x419ea0
call fcn.0040dba4
push 0x419ea0
call fcn.0040df5d
mov eax, dword [0x41c32c]
push eax
call fcn.0040df2e
mov ecx, dword [0x41c324]
push ecx
call fcn.0040df2e
add esp, 0x1c
mov eax, 3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov dword [0x41c304], 1
mov eax, dword [0x41c330]
pop edi
pop esi
pop ebp
mov byte [eax], 0x2f
mov edx, dword [0x41c330]
mov ecx, dword [0x41c318]
inc edx
mov dword [0x41c330], edx
pop ebx
mov byte [ecx], 0x2f
mov eax, dword [0x41c318]
inc eax
mov dword [0x41c318], eax
mov byte [eax], 0
mov edx, dword [0x41c330]
xor eax, eax
mov byte [edx], 0
add esp, 0x108
ret
mov dx, word [0x41cda6]
and edx, 0xf000
cmp edx, 0x4000
je 0x40caa8
mov eax, dword [0x41c324]
push 0x41cde0
push eax
push 0x419c28
push 0x419ea0
call fcn.0040dba4
push 0x419ea0
call fcn.0040df5d
mov ecx, dword [0x41c32c]
push ecx
call fcn.0040df2e
mov edx, dword [0x41c324]
push edx
call fcn.0040df2e
add esp, 0x1c
mov eax, 3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
test ebp, ebp
je 0x40ca02
mov eax, dword [0x41c32c]
push eax
push 0x419c80
push 0x419ea0
call fcn.0040dba4
push 0x419ea0
call fcn.0040df5d
mov ecx, dword [0x41c32c]
push ecx
call fcn.0040df2e
mov edx, dword [0x41c324]
push edx
call fcn.0040df2e
add esp, 0x18
mov eax, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
cmp eax, 4
jne 0x40cb63
mov edi, dword [0x41c324]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x11c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x41c324]
push ecx
call fcn.0040df2e
mov edx, dword [0x41c32c]
push edx
call fcn.0040df2e
add esp, 8
xor eax, eax
mov dword [0x41c318], eax
mov dword [0x41c330], eax
pop edi
pop esi
pop ebp
mov dword [0x41c324], eax
mov dword [0x41c32c], eax
pop ebx
add esp, 0x108
ret
cmp eax, 3
jne 0x40cc80
mov ebx, dword [esp + 0x11c]
mov ecx, dword [0x41c330]
xor edi, edi
mov al, byte [ebx]
lea ebp, [ebx + 1]
mov byte [ecx], al
mov eax, dword [0x41c330]
mov esi, ebp
cmp byte [eax], 0
je 0x40cbef
mov ecx, dword [0x41c32c]
inc eax
mov edx, eax
mov dword [0x41c330], eax
sub edx, ecx
cmp edx, 0x105
jl 0x40cbe0
dec eax
mov dword [0x41c330], eax
mov byte [eax], 0
mov eax, dword [0x41c32c]
push eax
push 0x41cde0
push 0x419ca4
push 0x419ea0
call fcn.0040dba4
push 0x419ea0
call fcn.0040df5d
mov eax, dword [0x41c330]
add esp, 0x14
mov edi, 1
mov cl, byte [esi]
inc esi
mov byte [eax], cl
mov eax, dword [0x41c330]
cmp byte [eax], 0
jne 0x40cb8e
mov edx, dword [0x416044]
test byte [edx + 0x14], 0x20
jne 0x40cc24
mov ecx, dword [0x41c32c]
lea eax, [esp + 0x14]
push 0x40
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_OpenFile]
cmp eax, 0xffffffff
jne 0x40cc5c
call dword [sym.imp.KERNEL32.dll_GetLastError]
sub eax, 0x7b
je 0x40cc65
sub eax, 0x53
je 0x40cc65
mov eax, dword [0x41c318]
mov dl, byte [ebx]
mov ecx, ebp
mov byte [eax], dl
mov eax, dword [0x41c318]
cmp byte [eax], 0
je 0x40cc4f
inc eax
inc ecx
mov dword [0x41c318], eax
mov dl, byte [ecx - 1]
mov byte [eax], dl
mov eax, dword [0x41c318]
cmp byte [eax], 0
jne 0x40cc39
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
push eax
call dword [sym.imp.KERNEL32.dll__lclose]
jmp 0x40cc24
push 0x41c318
push ebx
call fcn.0040c6c0
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
cmp eax, 1
jne 0x40ced4
mov eax, dword [0x41c320]
mov ecx, dword [0x41c334]
lea edx, [ecx + eax + 1]
push edx
call fcn.0040db30
add esp, 4
mov dword [0x41c32c], eax
test eax, eax
jne 0x40ccba
pop edi
pop esi
pop ebp
mov eax, 0xa
pop ebx
add esp, 0x108
ret
mov eax, dword [0x41c320]
mov ecx, dword [0x41c334]
lea edx, [ecx + eax + 1]
push edx
call fcn.0040db30
add esp, 4
mov dword [0x41c324], eax
test eax, eax
jne 0x40ccf9
mov eax, dword [0x41c32c]
push eax
call fcn.0040df2e
add esp, 4
mov eax, 0xa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov ecx, dword [0x416044]
test byte [ecx + 0x14], 0x20
je 0x40ce14
mov eax, dword [0x41c328]
mov bl, 0x3a
test eax, eax
je 0x40cd1d
mov eax, dword [esp + 0x11c]
jmp 0x40cd26
mov eax, dword [0x41c308]
test eax, eax
je 0x40cd3a
cmp byte [eax + 1], bl
jne 0x40cd3a
xor edx, edx
mov dl, byte [eax]
push edx
call fcn.0040e36e
add esp, 4
jmp 0x40cd90
lea edx, [esp + 0x10]
lea eax, [esp + 0x14]
push edx
push eax
push 0x104
push 0x419d00
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
cmp eax, 0x104
jbe 0x40cd7d
push 0x419d04
push 0x419ea0
call fcn.0040dba4
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov eax, dword [esp + 0x14]
and eax, 0xff
sub eax, 0x60
mov dword [0x41c300], eax
add al, 0x60
mov ecx, dword [0x41c32c]
mov byte [ecx], al
mov ecx, dword [0x41c32c]
mov edx, dword [0x41a8d4]
xor eax, eax
mov al, byte [ecx]
sub eax, 0x60
test edx, edx
mov dword [0x41c300], eax
je 0x40cdf0
cmp byte [ecx], 0x61
jb 0x40cdf0
cmp edx, 1
jne 0x40ce7f
lea edx, [esp + 0x10]
add al, 0x40
push edx
mov byte [esp + 0x14], al
mov byte [esp + 0x15], bl
mov byte [esp + 0x16], 0x2f
mov byte [esp + 0x17], 0
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
mov ecx, dword [0x41c32c]
cmp eax, 2
je 0x40ce7f
push ecx
call fcn.0040df2e
mov eax, dword [0x41c324]
push eax
call fcn.0040df2e
add esp, 8
mov eax, 0x4e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov eax, dword [0x41c328]
test eax, eax
je 0x40ce47
mov edi, dword [esp + 0x11c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [0x41c32c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40ce82
mov eax, dword [0x41c334]
test eax, eax
jle 0x40ce79
mov edi, dword [0x41c308]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [0x41c32c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40ce82
mov ecx, dword [0x41c32c]
mov byte [ecx], 0
mov eax, dword [0x41c32c]
mov ecx, dword [0x41c324]
mov dword [0x41c330], eax
mov dword [0x41c318], ecx
mov dl, byte [eax]
mov byte [ecx], dl
mov eax, dword [0x41c318]
cmp byte [eax], 0
je 0x40cec7
mov ecx, dword [0x41c330]
inc eax
inc ecx
mov dword [0x41c318], eax
mov dword [0x41c330], ecx
mov cl, byte [ecx]
mov byte [eax], cl
mov eax, dword [0x41c318]
cmp byte [eax], 0
jne 0x40cea6
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x108
ret
test eax, eax
jne 0x40d0c9
mov esi, dword [esp + 0x11c]
test esi, esi
jne 0x40cef8
mov dword [0x41c334], esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
mov dword [0x41c334], ecx
jle 0x40d0bc
mov eax, dword [0x41a2ec]
xor edi, edi
xor ebp, ebp
cmp eax, 1
mov ebx, 2
jle 0x40cf3f
xor edx, edx
push 0x103
mov dl, byte [esi]
push edx
call fcn.0040e439
mov ecx, dword [0x41c334]
add esp, 8
jmp 0x40cf52
mov edx, dword [0x41a0e0]
xor eax, eax
mov al, byte [esi]
mov ax, word [edx + eax*2]
and eax, 0x103
test eax, eax
je 0x40cf61
cmp byte [esi + 1], 0x3a
jne 0x40cf61
mov ebp, 1
cmp byte [ecx + esi - 1], 0x2f
jne 0x40cf7e
dec ecx
mov edi, 1
mov dword [0x41c334], ecx
mov byte [ecx + esi], 0
mov ecx, dword [0x41c334]
test ebp, ebp
je 0x40cf99
cmp ecx, 2
jne 0x40cf99
test edi, edi
jne 0x40d02d
mov ebx, 3
jmp 0x40d02d
test ecx, ecx
jle 0x40d02d
push 0x41cda0
push esi
call fcn.0041318e
add esp, 8
test eax, eax
jne 0x40cfc5
mov ax, word [0x41cda6]
and eax, 0xf000
cmp eax, 0x4000
je 0x40d027
mov eax, dword [0x424f70]
xor edi, edi
cmp eax, edi
jne 0x40cfe6
mov dword [0x41c334], edi
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x108
ret
push esi
call fcn.004134f8
add esp, 4
cmp eax, 0xffffffff
jne 0x40d027
push esi
push 0x419d34
push 0x419ea0
call fcn.0040dba4
push 0x419ea0
call fcn.0040df5d
add esp, 0x10
mov dword [0x41c334], edi
mov eax, 3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x108
ret
mov ecx, dword [0x41c334]
add ecx, ebx
push ecx
call fcn.0040db30
mov edx, eax
add esp, 4
test edx, edx
mov dword [0x41c308], edx
jne 0x40d059
pop edi
pop esi
mov dword [0x41c334], eax
pop ebp
mov eax, 0xa
pop ebx
add esp, 0x108
ret
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
cmp ebx, 3
rep movsb byte es:[edi], byte [esi]
jne 0x40d098
mov ecx, dword [0x41c334]
mov edx, dword [0x41c308]
mov byte [edx + ecx], 0x2e
mov eax, dword [0x41c334]
inc eax
mov dword [0x41c334], eax
mov eax, dword [0x41c308]
mov ecx, dword [0x41c334]
mov byte [eax + ecx], 0x2f
mov eax, dword [0x41c334]
mov edx, dword [0x41c308]
inc eax
mov dword [0x41c334], eax
mov byte [edx + eax], 0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x108
ret
cmp eax, 5
jne 0x40d0f2
mov eax, dword [0x41c334]
test eax, eax
jle 0x40d0e5
mov eax, dword [0x41c308]
push eax
call fcn.0040df2e
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x108
ret
pop edi
pop esi
pop ebp
mov eax, 0x63
pop ebx
add esp, 0x108
ret