Function at 0x505678
Capabilities:
Get disk size

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffb84
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x37c], ebx
mov dword [ebp - 0x374], ebx
mov dword [ebp - 0x378], ebx
mov dword [ebp - 0x2cc], ebx
mov dword [ebp - 0x2a4], ecx
mov dword [ebp - 0x2a0], edx
mov dword [ebp - 0x29c], eax
xor eax, eax
push ebp
push 0x505f2a
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0x2a0]
mov dword [eax], 0
mov dword [eax + 4], 0
mov eax, dword [ebp - 0x2a4]
xor edx, edx
mov dword [eax], edx
xor eax, eax
mov dword [ebp - 0x2c8], eax
mov dword [ebp - 0x2b0], 0
mov dword [ebp - 0x2ac], 0
cmp dword [ebp - 0x29c], 0
jl 0x505f01
cmp dword [ebp - 0x29c], 0xc7
jge 0x505f01
mov eax, dword [0x7d6870]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x29c]
jle 0x505799
mov eax, dword [ebp - 0x29c]
lea eax, [eax + eax*4]
mov edx, dword [0x7d748c]
cmp byte [edx + eax*2], 0
je 0x505799
mov eax, dword [ebp - 0x29c]
mov eax, dword [eax*4 + 0xc0b72c]
cdq
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
cmp dword [ebp - 0x2ac], 0
jne 0x50576a
cmp dword [ebp - 0x2b0], 0
jb 0x505f01
jmp 0x505770
jl 0x505f01
push 0
push 0x100000
mov eax, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x2ac]
call fcn.004063ec
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
jmp 0x505f01
xor eax, eax
push ebp
push 0x50580a
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [ebp - 0x29c], 0
jl 0x505800
mov eax, dword [0x7d6870]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x29c]
jle 0x505800
imul eax, dword [ebp - 0x29c], 0x83
mov edx, dword [0x7d6d40]
add edx, eax
mov eax, 0x505f48
call fcn.00402c58
test eax, eax
jle 0x505800
mov dword [ebp - 0x2b0], 0
mov dword [ebp - 0x2ac], 0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x505f01
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x505814
mov eax, dword [0x7d7484]
cmp dword [eax], 2
je 0x505877
mov al, byte [ebp - 0x29c]
lea edx, [ebp - 0x370]
call fcn.00577430
test al, al
je 0x505850
fld qword [ebp - 0x348]
fmul dword [0x505f50]
call fcn.00402d64
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
fld qword [ebp - 0x348]
call fcn.00402d64
mov ecx, dword [ebp - 0x2a0]
mov dword [ecx], eax
mov dword [ecx + 4], edx
mov eax, dword [ebp - 0x2a4]
mov dword [eax], 0x200
jmp 0x505f01
mov eax, dword [0x7d6594]
mov edx, dword [ebp - 0x29c]
cmp byte [eax + edx], 0
jne 0x505a23
mov eax, dword [0x7d69cc]
mov edx, dword [ebp - 0x29c]
mov eax, dword [eax + edx*4]
call fcn.00405548
cmp eax, 0x80
jle 0x505a23
mov eax, dword [ebp - 0x29c]
mov edx, eax
shl eax, 4
add eax, edx
mov edx, dword [0x7d6aec]
cmp byte [edx + eax], 0
je 0x505a23
cmp byte [ebp + 8], 0
je 0x505a23
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
fld qword [edx + eax*8 + 0x28]
call fcn.00402d64
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
push 0
push 0x200
mov eax, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x2ac]
call fcn.004063ec
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
fld qword [edx + eax*8 + 0x28]
call fcn.00402d64
mov ecx, dword [ebp - 0x2a0]
mov dword [ecx], eax
mov dword [ecx + 4], edx
mov eax, dword [ebp - 0x2a4]
mov dword [eax], 0x200
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
cmp word [edx + eax*8 + 0x10], 0x400
jb 0x505a06
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
cmp word [edx + eax*8 + 0x10], 0x4000
ja 0x505a06
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
fld qword [edx + eax*8 + 0x28]
call fcn.00402d64
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
movzx eax, word [edx + eax*8 + 0x10]
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x2ac]
call fcn.004063ec
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
mov eax, dword [ebp - 0x29c]
shl eax, 2
lea eax, [eax + eax*2]
mov edx, dword [0x7d6f38]
movzx eax, word [edx + eax*8 + 0x10]
mov edx, dword [ebp - 0x2a4]
mov dword [edx], eax
cmp dword [ebp - 0x2ac], 0
jne 0x505a1d
cmp dword [ebp - 0x2b0], 0
jbe 0x505a23
jmp 0x505f01
jg 0x505f01
cmp byte [ebp + 8], 0
je 0x505a3a
mov eax, dword [ebp - 0x29c]
call fcn.005a8144
mov dword [ebp - 0x29c], eax
mov dword [ebp - 0x2c4], 0x80000000
cmp dword [ebp + 0x10], 2
jne 0x505a54
add dword [ebp - 0x2c4], 0x40000000
lea eax, [ebp - 0x310]
xor ecx, ecx
mov edx, 0x18
call fcn.00403450
push 0
push 0
push 3
push 0
push 3
mov eax, dword [ebp - 0x2c4]
push eax
lea edx, [ebp - 0x378]
mov eax, dword [ebp - 0x29c]
call fcn.0040a83c
mov ecx, dword [ebp - 0x378]
lea eax, [ebp - 0x374]
mov edx, 0x505f5c
call fcn.00405594
mov eax, dword [ebp - 0x374]
call fcn.00405748
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [ebp - 0x2d4], eax
cmp dword [ebp - 0x2d4], 0xffffffff
jne 0x505b29
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x20
jne 0x505ae2
inc dword [ebp - 0x2c8]
push 0xa
call sub.kernel32.dll_Sleep_1
cmp dword [ebp - 0x2c8], 0x14
jl 0x505a54
mov eax, dword [0x7d6388]
mov edx, dword [ebp - 0x29c]
cmp dword [eax + edx*8 + 4], 0
jne 0x505b00
cmp dword [eax + edx*8], 0
jbe 0x505f01
jmp 0x505b06
jle 0x505f01
mov eax, dword [0x7d6388]
mov edx, dword [ebp - 0x29c]
mov ecx, dword [eax + edx*8]
mov dword [ebp - 0x2b0], ecx
mov ecx, dword [eax + edx*8 + 4]
mov dword [ebp - 0x2ac], ecx
jmp 0x505f01
cmp dword [ebp + 0x10], 1
jne 0x505bd4
lea eax, [ebp - 0x37c]
call fcn.004a1a18
mov eax, dword [ebp - 0x37c]
mov edx, 0x505f78
call fcn.00405694
jb 0x505bcd
push 0
lea eax, [ebp - 0x2b8]
push eax
push 8
lea eax, [ebp - 0x2e0]
push eax
push 0
push 0
push 0x7405c
mov eax, dword [ebp - 0x2d4]
push eax
call sub.kernel32.dll_DeviceIoControl
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x2cd], al
cmp byte [ebp - 0x2cd], 0
je 0x505bcd
mov eax, dword [ebp - 0x2d4]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, dword [ebp - 0x2e0]
mov dword [ebp - 0x2b0], eax
mov eax, dword [ebp - 0x2dc]
mov dword [ebp - 0x2ac], eax
cmp dword [ebp - 0x2ac], 0
jne 0x505bc7
cmp dword [ebp - 0x2b0], 0
jbe 0x505bcd
jmp 0x505f01
jg 0x505f01
mov dword [ebp + 0x10], 2
cmp dword [ebp + 0x10], 2
jne 0x505d5c
lea eax, [ebp - 0x298]
xor ecx, ecx
mov edx, 0x298
call fcn.00403450
mov word [ebp - 0x298], 0x2c
mov byte [ebp - 0x294], 1
mov byte [ebp - 0x292], 0xa
mov byte [ebp - 0x291], 0x18
mov byte [ebp - 0x290], 1
mov dword [ebp - 0x28c], 0xc0
mov dword [ebp - 0x288], 2
lea eax, [ebp - 0x24c]
lea edx, [ebp - 0x298]
sub eax, edx
mov dword [ebp - 0x284], eax
lea eax, [ebp - 0x26c]
lea edx, [ebp - 0x298]
sub eax, edx
mov dword [ebp - 0x280], eax
mov byte [ebp - 0x27c], 0x25
mov eax, dword [ebp - 0x284]
add eax, dword [ebp - 0x28c]
mov dword [ebp - 0x2b4], eax
push 0
lea eax, [ebp - 0x2b8]
push eax
mov eax, dword [ebp - 0x2b4]
push eax
lea eax, [ebp - 0x298]
push eax
push 0x2c
lea eax, [ebp - 0x298]
push eax
push 0x4d004
mov eax, dword [ebp - 0x2d4]
push eax
call sub.kernel32.dll_DeviceIoControl
test eax, eax
je 0x505d5c
lea eax, [ebp - 0x24c]
xor ecx, ecx
mov edx, 0x1ff
call fcn.004a0228
xor edx, edx
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
cmp dword [ebp - 0x2ac], 0
jne 0x505ceb
cmp dword [ebp - 0x2b0], 0xffffffff
jne 0x505ceb
mov dword [ebp - 0x2b0], 0
mov dword [ebp - 0x2ac], 0
jmp 0x505d5c
mov eax, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x2ac]
add eax, 1
adc edx, 0
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
lea eax, [ebp - 0x24c]
mov ecx, 4
mov edx, 0x1ff
call fcn.004a0228
mov dword [ebp - 0x2b8], eax
mov eax, dword [ebp - 0x2b8]
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x2b0]
mov edx, dword [ebp - 0x2ac]
call fcn.004063ec
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], edx
mov eax, dword [ebp - 0x2d4]
push eax
call sub.kernel32.dll_CloseHandle_1
jmp 0x505f01
push 0
lea eax, [ebp - 0x2b8]
push eax
push 0x18
lea eax, [ebp - 0x310]
push eax
push 0
push 0
push 0x70000
mov eax, dword [ebp - 0x2d4]
push eax
call sub.kernel32.dll_DeviceIoControl
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x2cd], al
mov eax, dword [ebp - 0x2d4]
push eax
call sub.kernel32.dll_CloseHandle_1
cmp byte [ebp - 0x2cd], 0
je 0x505f01
push dword [ebp - 0x30c]
push dword [ebp - 0x310]
lea eax, [ebp - 0x47c]
call fcn.00406608
lea edx, [ebp - 0x47c]
lea eax, [ebp - 0x2cc]
call fcn.004054ec
mov eax, dword [ebp - 0x310]
mov dword [ebp - 0x2c0], eax
mov eax, dword [ebp - 0x30c]
mov dword [ebp - 0x2bc], eax
mov eax, dword [ebp - 0x300]
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x304]
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x2c0]
mov edx, dword [ebp - 0x2bc]
call fcn.004063ec
call fcn.004063ec
mov dword [ebp - 0x2c0], eax
mov dword [ebp - 0x2bc], edx
mov eax, dword [ebp - 0x2a0]
mov edx, dword [ebp - 0x2c0]
mov dword [eax], edx
mov edx, dword [ebp - 0x2bc]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x2a4]
mov edx, dword [ebp - 0x2fc]
mov dword [eax], edx
mov eax, dword [ebp - 0x2fc]
xor edx, edx
push edx
push eax
mov eax, dword [ebp - 0x2c0]
mov edx, dword [ebp - 0x2bc]
call fcn.004063ec
mov dword [ebp - 0x2c0], eax
mov dword [ebp - 0x2bc], edx
mov eax, dword [ebp - 0x2c0]
mov dword [ebp - 0x2b0], eax
mov eax, dword [ebp - 0x2bc]
mov dword [ebp - 0x2ac], eax
call fcn.00504884
test al, al
je 0x505f01
lea ecx, [ebp - 0x2f8]
lea edx, [ebp - 0x2f0]
mov eax, dword [ebp - 0x29c]
call fcn.00504a3c
mov dword [ebp - 0x2e8], eax
mov dword [ebp - 0x2e4], edx
cmp dword [ebp - 0x2e4], 0
jne 0x505ec2
cmp dword [ebp - 0x2e8], 0
jbe 0x505f01
jmp 0x505ec4
jle 0x505f01
mov eax, dword [ebp - 0x2e8]
mov dword [ebp - 0x2b0], eax
mov eax, dword [ebp - 0x2e4]
mov dword [ebp - 0x2ac], eax
mov eax, dword [ebp - 0x2a0]
mov edx, dword [ebp - 0x2f0]
mov dword [eax], edx
mov edx, dword [ebp - 0x2ec]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x2a4]
mov edx, dword [ebp - 0x2f8]
mov dword [eax], edx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x505f31
lea eax, [ebp - 0x37c]
mov edx, 3
call fcn.0040529c
lea eax, [ebp - 0x2cc]
call fcn.00405278
ret