Function at 0x542160
Capabilities:
Get disk size

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x224
mov eax, dword [ebp + 0xc]
mov ecx, eax
mov dword [esp + 0xc], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
test eax, eax
jne 0x54219e
lea edx, [esp + 0x128]
call fcn.005424c0
test eax, eax
jne 0x5423c3
lea ecx, [esp + 0x128]
mov dword [esp + 0x18], ecx
call fcn.005426b0
mov edx, eax
mov dword [esp + 0x14], edx
test edx, edx
jne 0x5421b7
lea eax, [edx + 7]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 0x14]
mov ecx, 0xc0000000
mov eax, ebx
and eax, 2
mov dword [esp + 0x10], eax
mov eax, closesocket
cmove ecx, eax
mov dword [esp + 0x1c], ecx
test bl, 0x10
je 0x5421e0
mov esi, 1
jmp 0x5421f4
test bl, 4
mov eax, 0
setne al
add eax, 3
mov dword [esp + 0xc], eax
mov esi, eax
test bl, 8
mov dword [esp + 0xc], 0x80
mov eax, 0x4000102
cmove eax, dword [esp + 0xc]
mov dword [esp + 0xc], eax
mov eax, dword [0x586578]
test eax, eax
jne 0x542241
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0x94
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov ecx, dword [esp + 0x1c]
xor eax, eax
cmp dword [esp + 0x30], 2
mov edx, dword [esp + 0x14]
sete al
inc eax
mov dword [0x586578], eax
push 0
push dword [esp + 0x10]
push esi
push 0
push 3
push ecx
push edx
cmp eax, 2
jne 0x54225b
call dword [sym.imp.KERNEL32.dll_CreateFileW]
jmp 0x542261
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, eax
cmp edx, 0xffffffff
jne 0x5422a7
push dword [esp + 0x14]
call fcn.00441c86
add esp, 4
cmp dword [esp + 0x10], 0
je 0x54229b
push dword [ebp + 0x18]
and ebx, 0xfffffffd
or ebx, 1
push ebx
push edi
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00542160
add esp, 0x14
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0xe
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x18]
test ecx, ecx
je 0x5422ba
xor eax, eax
cmp dword [esp + 0x10], eax
setne al
inc eax
mov dword [ecx], eax
lea eax, [esp + 0x20]
mov dword [edi + 8], 0
push eax
push 0x104
push dword [esp + 0x20]
mov dword [edi + 0x10], 0
push dword [ebp + 8]
mov dword [edi], 0x56917c
mov dword [edi + 4], edx
mov dword [edi + 0xc], 0
mov dword [esp + 0x1c], 0x200
call fcn.00541ea0
add esp, 0x10
test eax, eax
jne 0x5423ae
lea ecx, [esp + 0x20]
call fcn.005426b0
mov esi, eax
test esi, esi
je 0x5423a7
call fcn.00543110
mov ecx, esi
test eax, eax
je 0x542364
movzx eax, word [esi]
test ax, ax
je 0x54234b
mov edx, eax
nop dword [eax]
cmp dx, 0x5c
je 0x542346
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x542330
jmp 0x54234b
xor eax, eax
mov word [ecx], ax
lea eax, [esp + 0x10]
push eax
push eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x1c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceW]
jmp 0x542398
mov al, byte [esi]
test al, al
je 0x542381
nop word [eax + eax]
cmp al, 0x5c
je 0x54237e
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x542370
jmp 0x542381
mov byte [ecx], 0
lea eax, [esp + 0x10]
push eax
push eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x1c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
push esi
mov ebx, eax
call fcn.00441c86
add esp, 4
test ebx, ebx
jne 0x5423ae
mov eax, 0x200
jmp 0x5423b2
mov eax, dword [esp + 0xc]
push dword [esp + 0x14]
mov dword [edi + 0x10], eax
call fcn.00441c86
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret