Function at 0x405a32
Capabilities:
Get disk information via ioctl

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1034
call fcn.00476660
mov eax, dword [0x4d8300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x102c], 0x5c3a53
push 0x1000
lea eax, [ebp - 0x1018]
mov esi, ecx
push ebx
push eax
mov dword [ebp - 0x1034], esi
mov edi, ebx
call fcn.00478bc0
add esp, 0xc
cmp dword [0x4da388], 0xa0
jge 0x405a95
push str.ESP_toggling_is_only_available_for_Windows_10_or_later
call fcn.0042ed57
pop ecx
xor eax, eax
jmp 0x405d78
push 1
push 1
xor edx, edx
mov ecx, esi
call fcn.00403d18
mov dword [ebp - 0x1020], eax
pop ecx
pop ecx
cmp eax, 0xffffffff
je 0x405a8e
push ebx
lea ecx, [ebp - 0x1028]
push ecx
push 0x1000
lea ecx, [ebp - 0x1018]
push ecx
push ebx
push ebx
push 0x70050
push eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x405d51
cmp dword [ebp - 0x1028], ebx
jbe 0x405d51
cmp dword [ebp - 0x1018], 1
je 0x405afe
push str.ESP_toggling_is_only_available_for_GPT_drives
call fcn.0042ed57
pop ecx
jmp 0x405d65
mov esi, ebx
mov dword [ebp - 0x1024], ebx
mov dword [ebp - 0x101c], ebx
cmp dword [ebp - 0x1014], ebx
jbe 0x405bbe
imul eax, esi, 0x90
lea ecx, [ebp - 0xfc8]
mov edx, 0x4b5e40
add ecx, eax
call fcn.0042e248
mov ecx, eax
lea eax, [ebx + 1]
test ecx, ecx
cmove eax, ebx
mov ebx, eax
mov eax, esi
cmove eax, edi
inc esi
mov edi, eax
cmp esi, dword [ebp - 0x1014]
jb 0x405b18
push 0
mov dword [ebp - 0x101c], ebx
cmp ebx, 1
mov dword [ebp - 0x1024], esi
pop ebx
jbe 0x405b67
push str.ESP_toggling_is_not_available_for_drives_with_more_than_one_ESP
jmp 0x405af3
cmp dword [ebp - 0x101c], 1
jne 0x405bbe
imul esi, edi, 0x90
lea eax, [ebp - 0xfa0]
mov dword [ebp - 0x1024], edi
add eax, esi
push eax
push str.ESP_name:__S
call fcn.0042ed57
pop ecx
pop ecx
lea ecx, [ebp - 0xfb8]
add ecx, esi
call fcn.004058db
test eax, eax
jne 0x405bac
push str.ESP_toggling_data_could_not_be_stored
jmp 0x405af3
lea edi, [ebp - 0xfc8]
add edi, esi
mov esi, 0x4b6320
jmp 0x405c4d
xor eax, eax
inc eax
mov dword [ebp - 0x101c], eax
mov cl, al
call fcn.0040599c
mov dword [ebp - 0x1030], eax
test eax, eax
je 0x405c17
cmp dword [ebp - 0x1014], 0
mov esi, ebx
mov dword [ebp - 0x1024], esi
jbe 0x405c17
lea edi, [ebp - 0xfb8]
mov edx, edi
mov ecx, eax
call fcn.0042e248
test eax, eax
jne 0x405c2b
mov eax, dword [ebp - 0x1030]
inc esi
add edi, 0x90
mov dword [ebp - 0x1024], esi
cmp esi, dword [ebp - 0x1014]
jb 0x405bef
mov eax, dword [ebp - 0x101c]
inc eax
mov dword [ebp - 0x101c], eax
cmp eax, 8
jbe 0x405bc7
jmp 0x405c31
mov eax, dword [ebp - 0x101c]
cmp eax, 8
ja 0x405d65
imul eax, esi, 0x90
lea edi, [ebp - 0xfc8]
mov esi, 0x4b5e40
add edi, eax
mov eax, dword [ebp - 0x1024]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
cmp eax, dword [ebp - 0x1014]
jb 0x405c69
push str.No_partition_to_toggle
jmp 0x405af3
mov edi, dword [ebp - 0x1020]
push ebx
imul esi, eax, 0x90
lea eax, [ebp - 0x1028]
push eax
push ebx
push ebx
push dword [ebp - 0x1028]
lea eax, [ebp - 0x1018]
push eax
push 0x7c054
push edi
mov byte [ebp + esi - 0xfcc], 1
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x405cbb
call fcn.0042fc51
push eax
push str.Could_not_set_drive_layout:__s
call fcn.0042ed57
pop ecx
pop ecx
jmp 0x405d6b
mov ecx, edi
call fcn.004077dc
lea ecx, [ebp - 0xfc8]
mov edx, 0x4b5e40
add ecx, esi
call fcn.0042e248
test eax, eax
je 0x405d07
mov eax, dword [ebp - 0x101c]
movzx eax, al
push eax
push str.ToggleEsp_02u
lea eax, [ebp - 0x14]
push 0x10
push eax
call fcn.00403163
add esp, 0x10
mov byte [ebp - 5], bl
mov edx, 0x4b4dda
lea ecx, [ebp - 0x14]
call fcn.00403724
jmp 0x405d4c
mov cl, byte [ebp - 0x102c]
call fcn.0040549c
test eax, eax
jne 0x405d4c
mov ecx, dword [ebp - 0x1034]
xor edx, edx
push ebx
push dword [ebp + esi - 0xfdc]
inc edx
push dword [ebp + esi - 0xfe0]
call fcn.00403d46
add esp, 0xc
lea ecx, [ebp - 0x102c]
mov esi, eax
mov edx, esi
call fcn.00406653
push esi
call fcn.004812c6
pop ecx
xor ebx, ebx
inc ebx
jmp 0x405d6b
call fcn.0042fc51
push eax
push esi
push str.Could_not_get_layout_for_drive_0x_02x:__s
call fcn.0042ed57
add esp, 0xc
mov edi, dword [ebp - 0x1020]
test edi, edi
je 0x405d76
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00475c80
leave
ret