Function at 0x401340
Capabilities:
Get disk size

Disassembly:
sub esp, 0x234
push ebx
mov ebx, dword [esp + 0x240]
push esi
push edi
xor edi, edi
or edx, 0xffffffff
cmp ebx, edi
mov dword [esp + 0x10], edx
mov esi, edx
je 0x401365
mov dword [ebx], 1
mov eax, dword [esp + 0x244]
cmp eax, edi
je 0x401581
cmp word [eax], di
je 0x401581
push eax
lea eax, [esp + 0x34]
push eax
call fcn.00411cea
add esp, 8
cmp word [esp + 0x32], 0x3a
jne 0x4013a0
cmp word [esp + 0x34], 0x5c
jne 0x4013a0
mov word [esp + 0x36], di
push ebp
push str.KERNEL32.DLL
call dword [0x42110c]
mov ebp, eax
cmp ebp, edi
je 0x401497
cmp dword [0x4211dc], edi
je 0x4013c5
push str.GetDiskFreeSpaceExW
jmp 0x4013ca
push str.GetDiskFreeSpaceExA
push ebp
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x40147b
mov eax, 0x5c
cmp word [esp + 0x34], ax
jne 0x4013fa
cmp word [esp + 0x36], ax
jne 0x4013fa
lea ecx, [esp + 0x34]
push ecx
call fcn.00401090
jmp 0x401404
lea edx, [esp + 0x34]
push edx
call fcn.004010c0
mov eax, dword [0x4211dc]
add esp, 4
test eax, eax
je 0x40142a
lea eax, [esp + 0x24]
lea ecx, [esp + 0x2c]
push eax
lea edx, [esp + 0x20]
push ecx
lea eax, [esp + 0x3c]
push edx
push eax
call edi
mov edi, eax
jmp 0x401464
mov ecx, dword [0x419520]
lea edx, [esp + 0x34]
push ecx
push edx
call fcn.0040d8d0
add esp, 8
mov ebx, eax
lea eax, [esp + 0x24]
lea ecx, [esp + 0x2c]
push eax
lea edx, [esp + 0x20]
push ecx
push edx
push ebx
call edi
push ebx
mov edi, eax
call fcn.00411d95
mov ebx, dword [esp + 0x250]
add esp, 4
test edi, edi
je 0x40147b
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
shrd eax, esi, 0xa
mov dword [esp + 0x14], eax
shr esi, 0xa
push ebp
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x14]
and eax, esi
cmp eax, 0xffffffff
je 0x401495
test ebx, ebx
je 0x401570
xor edi, edi
mov ax, word [esp + 0x36]
mov ecx, 0x5c
cmp word [esp + 0x34], cx
mov dword [esp + 0x10], edi
jne 0x4014b1
cmp ax, cx
je 0x4014c1
cmp ax, 0x3a
jne 0x4014c1
mov word [esp + 0x38], cx
mov word [esp + 0x3a], di
cmp dword [0x4211dc], edi
je 0x4014ec
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x10]
push ecx
lea eax, [esp + 0x30]
push edx
lea ecx, [esp + 0x2c]
push eax
lea edx, [esp + 0x40]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceW]
mov ebx, eax
jmp 0x401527
mov eax, dword [0x419520]
lea ecx, [esp + 0x34]
push eax
push ecx
call fcn.0040d8d0
add esp, 8
mov edi, eax
lea edx, [esp + 0x1c]
lea eax, [esp + 0x10]
push edx
lea ecx, [esp + 0x30]
push eax
lea edx, [esp + 0x2c]
push ecx
push edx
push edi
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
push edi
mov ebx, eax
call fcn.00411d95
add esp, 4
test ebx, ebx
je 0x401570
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x24]
and eax, esi
cmp eax, 0xffffffff
jne 0x401557
mov eax, ecx
imul eax, edi
shr eax, 8
mul dword [esp + 0x10]
mov esi, edx
shrd eax, esi, 2
mov dword [esp + 0x14], eax
shr esi, 2
mov eax, dword [esp + 0x24c]
test eax, eax
je 0x401570
imul ecx, edi
add ecx, 0x3ff
shr ecx, 0xa
mov dword [eax], ecx
mov eax, dword [esp + 0x14]
pop ebp
mov edx, esi
pop edi
pop esi
pop ebx
add esp, 0x234
ret
pop edi
pop esi
mov eax, edx
pop ebx
add esp, 0x234
ret