Function at 0x40ba97
Capabilities:
Get disk information via ioctl
Read file on windows

Disassembly:
push ebp
mov eax, 0x129c
mov ebp, esp
push edi
push esi
push ebx
call fcn.00487b00
mov ecx, 0x400
mov esi, str._vFAT
sub esp, eax
mov eax, dword [ebp + 0xc]
lea edi, [ebp - 0x1018]
mov dword [ebp - 0x1260], 0x5c3a53
mov dword [ebp - 0x1274], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x1278], eax
xor eax, eax
cmp dword [ebp - 0x1278], 0
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x123c]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
jne 0x40bb12
cmp dword [ebp - 0x1274], 0
jne 0x40bb12
cmp dword [0x5275c0], 0x9f
ja 0x40bb12
mov dword [esp], str.ESP_toggling_is_only_available_for_Windows_10_or_later
call fcn.0043efa9
jmp 0x40bb3c
xor edi, edi
mov dword [esp + 0xc], 1
mov dword [esp + 8], 1
mov dword [esp + 4], edi
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00408902
mov dword [ebp - 0x126c], eax
inc eax
jne 0x40bb43
xor ebx, ebx
jmp 0x40c26b
lea eax, [ebp - 0x1268]
xor esi, esi
xor ebx, ebx
mov dword [esp + 0x14], 0x1000
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], esi
mov dword [esp + 8], esi
mov dword [esp + 4], 0x70050
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
sub esp, 0x20
test eax, eax
je 0x40bb96
cmp dword [ebp - 0x1268], 0
jne 0x40bbb7
call fcn.0043f53d
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp], str.Could_not_get_layout_for_drive_0x_02x:__s
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x40bcd9
cmp dword [ebp - 0x1278], 0
mov ecx, dword [ebp - 0x1014]
jne 0x40bbcf
cmp dword [ebp - 0x1274], 0
je 0x40bbd6
xor edi, edi
jmp 0x40be54
lea ebx, [ebp - 0xfc8]
xor edi, edi
cmp dword [ebp - 0x1014], edi
jle 0x40bc17
mov eax, dword [ebp - 0x1018]
test eax, eax
jne 0x40bbfe
cmp byte [ebx], 0xef
je 0x40bc2d
inc edi
add ebx, 0x90
jmp 0x40bbde
dec eax
jne 0x40bbf5
mov dword [esp + 4], 0x4caa3c
mov dword [esp], ebx
call fcn.0043e378
test eax, eax
je 0x40bbf5
jmp 0x40bc2d
mov dword [ebp - 0x127c], 1
xor ecx, ecx
xor esi, esi
or edi, 0xffffffff
jmp 0x40bd50
cmp dword [ebp - 0x1018], 1
jne 0x40c067
imul ebx, edi, 0x90
mov dword [esp], str.ESP_name:__S
lea eax, [ebp + ebx - 0xfa0]
mov dword [esp + 4], eax
call fcn.0043efa9
lea eax, [ebp + ebx - 0xfb8]
mov dword [ebp - 0x127c], eax
mov ebx, 1
lea esi, [ebp - 0x1218]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.ToggleEsp_02u
mov dword [esp + 4], 0x10
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__snprintf]
mov eax, esi
mov byte [ebp - 0x1209], 0
call fcn.004086c0
test eax, eax
jne 0x40c0a6
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x127c]
mov dword [esp], eax
call fcn.0043f8b4
mov edx, eax
lea eax, [ebp - 0x1218]
call fcn.0040834c
test eax, eax
jne 0x40bebb
mov dword [esp], str.ESP_toggling_data_could_not_be_stored
call fcn.0043efa9
xor ebx, ebx
jmp 0x40c042
test edi, edi
jns 0x40bd35
mov eax, dword [ebp - 0x1018]
cmp eax, 1
jne 0x40bdb8
mov ecx, ebx
mov dword [esp + 4], ecx
mov eax, dword [ebp - 0x1280]
mov dword [ebp - 0x1284], ecx
mov dword [esp], eax
call fcn.0043e378
mov ecx, dword [ebp - 0x1284]
test eax, eax
jne 0x40bdf1
inc dword [ebp - 0x1270]
add ebx, 0x90
mov eax, dword [ebp - 0x1270]
cmp dword [ebp - 0x1014], eax
jg 0x40bce0
inc dword [ebp - 0x127c]
cmp dword [ebp - 0x127c], 8
jg 0x40beab
test edi, edi
jns 0x40befe
mov eax, dword [ebp - 0x127c]
lea ebx, [ebp - 0x1218]
mov dword [ebp - 0x1284], ecx
mov dword [esp + 8], str.ToggleEsp_02u
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x10
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__snprintf]
mov eax, ebx
mov byte [ebp - 0x1209], 0
call fcn.004086c0
mov dword [esp], eax
call fcn.0043f976
mov ecx, dword [ebp - 0x1284]
test eax, eax
mov dword [ebp - 0x1280], eax
je 0x40bd35
xor eax, eax
lea ebx, [ebp - 0xfb8]
mov dword [ebp - 0x1270], eax
jmp 0x40bd27
test eax, eax
jne 0x40bcf5
mov eax, dword [ebp - 0x1010]
mov edx, dword [ebx - 0x24]
lea ecx, [ebp - 0x125c]
mov dword [ebp - 0x125c], eax
xor eax, eax
mov dword [ebp - 0x1258], eax
mov eax, dword [ebx - 0x28]
mov dword [ebp - 0x1250], edx
mov dword [ebp - 0x1254], eax
jmp 0x40bcf5
mov eax, dword [ebp - 0x1018]
cmp eax, 1
jne 0x40be1f
mov dword [ebx - 0x10], 0xc12a7328
mov word [ebx - 0xc], 0xf81f
mov word [ebx - 0xa], 0x11d2
mov dword [ebx - 8], 0xa0004bba
mov dword [ebx - 4], 0x3bc93ec9
jmp 0x40be23
test eax, eax
je 0x40be33
mov edi, dword [ebp - 0x1270]
mov esi, 1
jmp 0x40bd1b
mov byte [ebx - 0x10], 0xef
jmp 0x40be23
imul eax, edi, 0x90
lea esi, [ebp - 0xfe0]
lea edx, [eax + esi]
mov esi, dword [ebp - 0x1278]
cmp dword [edx + 4], esi
je 0x40be5a
inc edi
cmp edi, ecx
jl 0x40be39
jmp 0x40beaf
mov esi, dword [ebp - 0x1274]
cmp dword [edx], esi
jne 0x40be53
mov edx, dword [ebp - 0x1018]
cmp edx, 1
jne 0x40be9d
mov dword [ebp + eax - 0xfc8], 0xc12a7328
mov dword [ebp + eax - 0xfc4], 0x11d2f81f
mov dword [ebp + eax - 0xfc0], 0xa0004bba
mov dword [ebp + eax - 0xfbc], 0x3bc93ec9
jmp 0x40befc
test edx, edx
jne 0x40befc
mov byte [ebp + eax - 0xfc8], 0xef
jmp 0x40befc
test edi, edi
jns 0x40befe
mov dword [esp], str.No_partition_to_toggle
jmp 0x40bcd4
mov eax, dword [ebp - 0x1018]
cmp eax, 1
jne 0x40c157
imul eax, edi, 0x90
mov dword [ebp + eax - 0xfc8], 0xebd0a0a2
mov dword [ebp + eax - 0xfc4], 0x4433b9e5
mov dword [ebp + eax - 0xfc0], 0xb668c087
mov dword [ebp + eax - 0xfbc], 0xc79926b7
xor esi, esi
imul edi, edi, 0x90
xor ecx, ecx
lea eax, [ebp - 0x1268]
xor ebx, ebx
mov byte [ebp + edi - 0xfcc], 1
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], ebx
mov eax, dword [ebp - 0x1268]
mov dword [esp + 4], 0x7c054
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
sub esp, 0x20
test eax, eax
jne 0x40bf72
call fcn.0043f53d
mov dword [esp], str.Could_not_set_drive_layout:__s
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x40bcd9
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
call fcn.0040ba38
cmp dword [ebp - 0x1278], 0
jne 0x40bf92
cmp dword [ebp - 0x1274], 0
je 0x40bf9c
mov ebx, 1
jmp 0x40c042
test esi, esi
je 0x40bfdf
movzx eax, byte [ebp - 0x1270]
lea ebx, [ebp - 0x124c]
mov dword [esp + 8], str.ToggleEsp_02u
mov dword [esp + 4], 0x10
mov dword [esp + 0xc], eax
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__snprintf]
mov edx, 0x498840
mov eax, ebx
mov byte [ebp - 0x123d], 0
call fcn.0040834c
jmp 0x40bf92
movsx eax, byte [ebp - 0x1260]
mov dword [esp], eax
call fcn.0040a80f
test eax, eax
jne 0x40bf92
xor edx, edx
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], edx
mov eax, dword [ebp + edi - 0xfe0]
mov edx, dword [ebp + edi - 0xfdc]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00408b0c
mov dword [esp + 4], eax
mov ebx, eax
lea eax, [ebp - 0x1260]
mov dword [esp], eax
call fcn.0040b53e
mov dword [esp], ebx
call sub.msvcrt.dll_free
jmp 0x40bf92
mov eax, dword [ebp - 0x126c]
dec eax
cmp eax, 0xfffffffd
ja 0x40c26b
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push eax
jmp 0x40c26b
mov eax, dword [ebp - 0x1010]
xor ecx, ecx
mov dword [ebp - 0x1258], ecx
mov dword [ebp - 0x125c], eax
imul eax, edi, 0x90
mov edx, dword [ebp + eax - 0xfdc]
mov eax, dword [ebp + eax - 0xfe0]
mov dword [ebp - 0x1250], edx
mov dword [ebp - 0x1254], eax
lea eax, [ebp - 0x125c]
jmp 0x40bc5e
cmp byte [eax], 0
je 0x40bca2
inc ebx
cmp ebx, 9
jne 0x40bc69
mov ebx, 1
lea ecx, [ebp - 0x1218]
mov dword [esp + 0xc], ebx
inc ebx
mov edx, dword [sym.imp.msvcrt.dll__snprintf]
lea esi, [ebp - 0x1208]
mov dword [esp], ecx
mov dword [esp + 8], str.ToggleEsp_02u
mov dword [esp + 4], 0x10
mov dword [ebp - 0x1280], edx
call edx
mov byte [ebp - 0x1209], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str.ToggleEsp_02u
mov dword [esp + 4], 0x10
mov dword [esp], esi
mov edx, dword [ebp - 0x1280]
call edx
mov eax, esi
mov byte [ebp - 0x11f9], 0
call fcn.004086c0
lea ecx, [ebp - 0x1218]
mov edx, eax
mov eax, ecx
call fcn.0040834c
cmp ebx, 8
jne 0x40c0be
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x127c]
mov dword [esp], eax
call fcn.0043f8b4
mov edx, eax
mov eax, esi
jmp 0x40bcc0
test eax, eax
jne 0x40befc
imul eax, edi, 0x90
xor edx, edx
mov byte [ebp + eax - 0xfc8], 0xb
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edx
mov edx, dword [ebp + eax - 0xfdc]
mov eax, dword [ebp + eax - 0xfe0]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
sub esp, 0x14
test eax, eax
je 0x40befc
xor eax, eax
mov dword [esp + 8], 0x200
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x1264]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1218]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x126c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40befc
cmp dword [ebp - 0x1264], 0x200
jne 0x40befc
mov esi, 0x36
lea eax, [ebp - 0x1218]
lea edx, [ebp - 0x123b]
xor ebx, ebx
lea ecx, [eax + esi]
mov dword [esp + 4], edx
mov dword [esp + 8], 8
mov dword [ebp - 0x1280], edx
mov dword [esp], ecx
mov dword [ebp - 0x127c], ecx
call sub.msvcrt.dll_memcmp
mov ecx, dword [ebp - 0x127c]
mov edx, dword [ebp - 0x1280]
test eax, eax
jne 0x40c252
imul eax, edi, 0x90
lea ebx, [ebx + ebx*8]
mov dl, byte [ebp + ebx - 0x123c]
mov byte [ebp + eax - 0xfc8], dl
jmp 0x40c25b
inc ebx
add edx, 9
cmp ebx, 4
jne 0x40c209
cmp esi, 0x52
je 0x40befc
mov esi, 0x52
jmp 0x40c1f8
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret