Function at 0x407620
Capabilities:
Get disk size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2e8
mov dword [ebp - 4], edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 8], esi
xor esi, esi
cmp edi, 0x31c
mov dword [ebp - 0xc], ebx
je 0x407857
jg 0x407690
cmp edi, 0x30d
je 0x4078c0
jle 0x407753
cmp edi, 0x30f
je 0x4079b2
lea esi, [esi]
lea edi, [edi]
call sub.cygwin1.dll___errno
mov dword [eax], 0x58
mov esi, 0xffffffff
mov eax, esi
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
cmp edi, 0x330
je 0x407760
jle 0x4077c0
cmp edi, 0x1260
je 0x4076b2
cmp edi, 0x41268
jne 0x407670
xor eax, eax
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x25c]
mov dword [esp + 0x18], eax
mov eax, 8
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x268]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, 0x7405c
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_DeviceIoControl
sub esp, 0x20
test eax, eax
je 0x407a84
mov ecx, dword [0x40e5e0]
test ecx, ecx
jne 0x407afe
mov eax, dword [ebp - 0x268]
mov edx, dword [ebp - 0x264]
mov dword [ebp - 0x290], eax
test edx, edx
mov dword [ebp - 0x28c], edx
js 0x407b19
cmp edi, 0x1260
je 0x407acf
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x290]
mov edx, dword [ebp - 0x28c]
mov dword [ecx], eax
mov dword [ecx + 4], edx
jmp 0x407680
cmp edi, 0x301
jne 0x407670
nop
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x58]
call fcn.00407270
test eax, eax
mov esi, eax
jne 0x407680
cmp edi, 0x301
je 0x407a39
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp + 0x10]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x4c]
cmp eax, 0xff
ja 0x407964
mov edx, dword [ebp + 0x10]
mov byte [edx], al
mov eax, dword [ebp - 0x48]
cmp eax, 0xff
jbe 0x4077ac
mov eax, 0xff
mov ecx, dword [ebp + 0x10]
mov byte [ecx + 1], al
mov dword [ecx + 8], 0
jmp 0x407680
cmp edi, 0x31f
jne 0x407670
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x407680
xor edx, edx
xor eax, eax
lea ebx, [ebp - 0x288]
mov dword [ebp - 0x288], edx
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x284], eax
movzx eax, byte [edx]
mov byte [ebp - 0x282], al
movzx eax, byte [edx + 2]
mov byte [ebp - 0x288], al
movzx edx, byte [edx + 3]
test dl, dl
je 0x407abd
mov byte [ebp - 0x287], dl
movzx eax, dl
shl eax, 9
lea edx, [ebp - 0x288]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
add eax, 4
mov dword [esp], eax
mov eax, dword [ebp + 8]
call fcn.00406b80
mov esi, eax
movzx eax, byte [ebx + 6]
mov edx, dword [ebp + 0x10]
mov byte [edx], al
movzx eax, byte [ebp - 0x288]
mov byte [edx + 1], al
movzx eax, byte [ebx + 1]
mov byte [edx + 2], al
jmp 0x407680
xor eax, eax
mov edi, 0x2d5004
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x27c]
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov ecx, dword [ebp + 8]
mov dword [esp], ecx
call sub.KERNEL32.dll_DeviceIoControl
sub esp, 0x20
test eax, eax
je 0x40796e
mov ebx, dword [0x40e5e0]
test ebx, ebx
jne 0x407951
xor eax, eax
mov esi, eax
mov eax, esi
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x407680
xor eax, eax
lea edx, [ebp - 0x270]
mov dword [ebp - 0x270], eax
xor eax, eax
mov dword [ebp - 0x26c], eax
cmp byte [0x40e5b0], 1
mov byte [ebp - 0x26f], 1
sbb eax, eax
and al, 0x4b
sub al, 0x5f
mov byte [ebp - 0x26a], al
mov eax, 0x200
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [ebp + 8]
call fcn.00406b80
test eax, eax
mov esi, eax
jne 0x407680
mov eax, dword [ebp + 0x10]
mov edx, 0x28
add eax, 0x36
call fcn.004075d0
mov eax, dword [ebp + 0x10]
mov edx, 8
add eax, 0x2e
call fcn.004075d0
mov eax, dword [ebp + 0x10]
mov edx, 0x14
add eax, 0x14
call fcn.004075d0
jmp 0x407680
mov dword [esp], str.__IOCTL_STORAGE_RESET_DEVICE_succeeded
call sub.cygwin1.dll_puts
xor eax, eax
jmp 0x4078ae
mov eax, 0xff
jmp 0x407798
call sub.KERNEL32.dll_GetLastError
mov esi, dword [0x40e5e0]
mov ebx, eax
test esi, esi
jne 0x407ae9
call sub.cygwin1.dll___errno
cmp ebx, 1
sete cl
cmp ebx, 0x32
sete dl
or edx, ecx
and edx, 1
cmp edx, 1
sbb edx, edx
and edx, 0xffffffad
add edx, 0x58
mov dword [eax], edx
mov eax, 0xffffffff
mov esi, eax
jmp 0x4078b0
mov edi, dword [ebp + 0x10]
test edi, edi
je 0x407680
xor ebx, ebx
xor edx, edx
xor esi, esi
mov dword [ebp - 0x274], ebx
mov ecx, 0x200
lea ebx, [ebp - 0x258]
mov dword [ebp - 0x278], esi
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], ebx
call sub.cygwin1.dll_memset
cmp byte [0x40e5b0], 1
mov byte [ebp - 0x277], 1
lea edx, [ebp - 0x278]
sbb eax, eax
and al, 0x4b
sub al, 0x5f
mov byte [ebp - 0x272], al
mov eax, 0x200
mov dword [esp + 4], eax
mov dword [esp], ebx
mov eax, dword [ebp + 8]
call fcn.00406b80
test eax, eax
mov esi, eax
jne 0x407680
movzx eax, byte [ebp - 0x19c]
mov edx, dword [ebp + 0x10]
mov dword [edx], eax
jmp 0x407680
mov eax, dword [ebp - 0x58]
cmp eax, 0xffff
jbe 0x407a48
mov eax, pe_overlay
mov edx, dword [ebp + 0x10]
mov word [edx + 2], ax
mov eax, dword [ebp - 0x4c]
cmp eax, 0xff
jbe 0x407a5e
mov eax, 0xff
mov ecx, dword [ebp + 0x10]
mov byte [ecx], al
mov eax, dword [ebp - 0x48]
cmp eax, 0xff
jbe 0x407a72
mov eax, 0xff
mov edx, dword [ebp + 0x10]
mov byte [edx + 1], al
mov dword [edx + 4], 0
jmp 0x407680
call sub.KERNEL32.dll_GetLastError
mov ebx, eax
mov eax, dword [0x40e5e0]
test eax, eax
jne 0x407c23
call sub.cygwin1.dll___errno
xor edx, edx
cmp ebx, 1
sete dl
dec edx
and edx, 0xffffffad
add edx, 0x58
mov dword [eax], edx
mov eax, 0xffffffff
mov edx, 0xffffffff
jmp 0x40771a
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ecx + 1]
mov byte [ebp - 0x287], al
jmp 0x407815
mov edx, dword [ebp - 0x28c]
mov eax, dword [ebp - 0x290]
shrd eax, edx, 9
mov edx, dword [ebp + 0x10]
mov dword [edx], eax
jmp 0x407680
mov dword [esp + 4], eax
mov dword [esp], str.__IOCTL_STORAGE_RESET_DEVICE_failed__Error_ld_n
call sub.cygwin1.dll_printf
jmp 0x407983
mov eax, dword [ebp - 0x25c]
mov dword [esp], str.__IOCTL_DISK_GET_LENGTH_INFO_succeeded__bytes_returned:__lu_n
mov dword [esp + 4], eax
call sub.cygwin1.dll_printf
jmp 0x40770e
call sub.cygwin1.dll___errno
cmp dword [eax], 0x58
jne 0x40772e
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x38]
call fcn.00407270
test eax, eax
mov esi, eax
jne 0x407680
mov ecx, dword [ebp - 0x2c]
xor ebx, ebx
mov eax, dword [ebp - 0x38]
mul ecx
mov dword [ebp - 0x294], edx
mov edx, dword [ebp - 0x38]
mov dword [ebp - 0x298], eax
mov eax, dword [ebp - 0x294]
imul edx, ebx
add eax, edx
mov dword [ebp - 0x2a0], eax
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x2a0]
imul eax, ecx
xor ecx, ecx
add eax, edx
mov dword [ebp - 0x294], eax
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x298]
mov ebx, dword [ebp - 0x294]
mov dword [ebp - 0x2c0], edx
mul dword [ebp - 0x2c0]
mov dword [ebp - 0x2a4], edx
mov edx, dword [ebp - 0x298]
mov dword [ebp - 0x2a8], eax
mov eax, dword [ebp - 0x2c0]
imul edx, ecx
mov ecx, dword [ebp - 0x2a4]
imul eax, ebx
add ecx, edx
xor edx, edx
lea eax, [ecx + eax]
mov dword [ebp - 0x2a4], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x2bc], edx
mov ecx, dword [ebp - 0x2bc]
mov dword [ebp - 0x2c0], eax
mov eax, dword [ebp - 0x2a8]
mul dword [ebp - 0x2c0]
mov dword [ebp - 0x28c], edx
mov edx, dword [ebp - 0x2a8]
mov dword [ebp - 0x290], eax
mov eax, dword [ebp - 0x2c0]
imul edx, ecx
mov ecx, dword [ebp - 0x28c]
add ecx, edx
mov edx, dword [ebp - 0x2a4]
imul eax, edx
lea eax, [ecx + eax]
mov dword [ebp - 0x28c], eax
jmp 0x40772e
mov dword [esp + 4], ebx
mov dword [esp], str.__IOCTL_DISK_GET_LENGTH_INFO_failed__Error_ld_n
call sub.cygwin1.dll_printf
jmp 0x407a98