Function at 0x408740
Capabilities:
Get disk information
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x580
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x153]
push edi
push 0x103
mov ebx, edx
mov dword [ebp - 0x580], esi
push 0
push eax
mov dword [ebp - 0x57c], ebx
mov dword [ebp - 0x564], 0
mov dword [ebp - 0x560], 0x5c3a3f
mov byte [ebp - 0x154], 0
call fcn.004198c0
add esp, 0xc
xor eax, eax
mov byte [esi], al
mov dword [ebp - 0x578], eax
push dword [ebx + 0x14]
push dword [ebx + 0x10]
call fcn.0040dd80
push eax
lea eax, [ebx + 0xa0]
push eax
lea eax, [ebx + 0x20]
push eax
push dword [ebx + 4]
push str.ClearVentoyFromPhyDrive_PhyDrive_d____s__s__dGB__
call fcn.0040c4e0
add esp, 0x1c
push 0
push 8
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c3d8]
lea eax, [ebp - 0x4c]
sub esp, 8
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.004136cf
add esp, 0x14
lea eax, [ebp - 0x4c]
push eax
push dword [0x43297c]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push str.Lock_disk_for_clean_.............................
call fcn.0040c4e0
mov ecx, dword [ebx + 4]
mov dl, 1
push 0
call fcn.00406e50
mov esi, eax
add esp, 8
mov dword [ebp - 0x570], esi
cmp esi, 0xffffffff
jne 0x40885a
push str.Failed_to_open_physical_disk
call fcn.0040c4e0
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004136c0
mov esp, ebp
pop ebp
ret
push ecx
mov ecx, dword [ebx + 4]
lea edx, [ebp - 0x154]
call fcn.00406c70
add esp, 4
cmp byte [ebp - 0x154], 0
jne 0x4088c1
push str.No_drive_letter_was_assigned...
call fcn.0040c4e0
add esp, 4
mov byte [ebp - 0x555], 0x44
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
mov cl, byte [ebp - 0x555]
shr eax, 3
test al, 1
je 0x4088a8
lea esp, [esp]
shr eax, 1
inc cl
test al, 1
jne 0x4088a0
movsx eax, cl
push eax
push str.GetFirstUnusedDriveLetter__C:_...
mov byte [ebp - 0x560], cl
call fcn.0040c4e0
add esp, 8
jmp 0x408936
lea edi, [ebp - 0x154]
lea ecx, [edi + 1]
lea ebx, [ebx]
mov al, byte [edi]
inc edi
test al, al
jne 0x4088d0
sub edi, ecx
test edi, edi
jle 0x408936
lea ebx, [ebp - 0x154]
jmp 0x4088f0
mov al, byte [ebx + edi - 1]
mov byte [ebp - 0x560], al
lea eax, [ebp - 0x560]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteVolumeMountPointA]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
lea eax, [ebp - 0x560]
push eax
push str.Delete_mountpoint__s_ret:_u_code:_u
call fcn.0040c4e0
dec edi
add esp, 0x10
test edi, edi
jg 0x4088f0
mov ebx, dword [ebp - 0x57c]
mov esi, dword [ebp - 0x570]
mov al, byte [ebp - 0x560]
mov byte [ebp - 0x555], al
movsx eax, al
push eax
push str.Will_use__C:_as_volume_mountpoint
call fcn.0040c4e0
add esp, 8
lea eax, [ebp - 0x55c]
push 0
push eax
push 0
push 0
push 0
push 0
push 0x9001c
push esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 9
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c3e0]
lea eax, [ebp - 0x4c]
sub esp, 8
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.004136cf
add esp, 0x14
lea eax, [ebp - 0x4c]
push eax
push dword [0x43297c]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov edi, dword [ebx + 4]
mov ecx, 1
push 0
push 0
push 0x4018d0
mov edx, edi
call fcn.00401310
add esp, 0xc
mov esi, eax
push esi
push edi
push str.VDS_DeleteAllPartitions__d_ret:_d
call fcn.0040c4e0
add esp, 0xc
test esi, esi
jne 0x408a03
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Notice:_Could_not_delete_partitions:__u
call fcn.0040c4e0
add esp, 8
push str.Deleting_all_partitions_........................._OK
call fcn.0040c4e0
add esp, 4
push 0
push 0xa
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c3e8]
lea eax, [ebp - 0x4c]
sub esp, 8
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.004136cf
add esp, 0x14
lea eax, [ebp - 0x4c]
push eax
push dword [0x43297c]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push str.Lock_disk_for_write_.............................
call fcn.0040c4e0
mov ecx, dword [ebx + 4]
mov dl, 1
push 1
call fcn.00406e50
mov edi, eax
add esp, 8
cmp edi, 0xffffffff
jne 0x408a95
push str.Failed_to_GetPhysicalHandle_for_write.
call fcn.0040c4e0
add esp, 4
mov esi, 1
mov dword [ebp - 0x564], esi
jmp 0x408eae
push 0x200000
call fcn.00413be0
mov esi, eax
add esp, 4
mov dword [ebp - 0x578], esi
test esi, esi
jne 0x408ab5
push str.Failed_to_alloc_memory.
jmp 0x408a7d
push 0x200000
push 0
push esi
call fcn.004198c0
add esp, 0xc
mov dword [ebp - 0x56c], 0x200
lea eax, [ebp - 0x56c]
mov dword [ebp - 0x568], 0
push 0
push eax
push 0
push 0x200
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x55c]
push eax
push 0x1ffe00
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x55c]
push esi
push str.Write_fisrt_1MB_ret:_d_size:_u_err:_d
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x408a85
mov ecx, dword [ebx + 0x10]
lea edx, [ebp - 0x56c]
mov eax, dword [ebx + 0x14]
sub ecx, 0x200000
push 0
push edx
sbb eax, 0
mov dword [ebp - 0x56c], ecx
push eax
push ecx
push edi
mov dword [ebp - 0x568], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x55c]
push eax
mov eax, dword [ebp - 0x578]
push 0x200000
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x55c]
push esi
push str.Write_2nd_1MB_ret:_d_size:_u_err:_d
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x408a85
push 0
lea eax, [ebp - 0x56c]
xorps xmm0, xmm0
push eax
movlpd qword [ebp - 0x56c], xmm0
push dword [ebp - 0x568]
push dword [ebp - 0x56c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov ecx, dword [ebx + 0x14]
mov eax, dword [ebx + 0x10]
cmp ecx, 0x200
jb 0x408d75
ja 0x408bdc
test eax, eax
je 0x408d75
mov esi, dword [ebp - 0x578]
push ecx
push eax
mov ecx, esi
call fcn.0040d6a0
mov ecx, dword [ebx + 0x10]
lea edx, [ebp - 0x574]
mov eax, dword [ebx + 0x14]
add esp, 8
sub ecx, 0x200
mov dword [ebp - 0x574], ecx
sbb eax, 0
push 0
push edx
push eax
push ecx
push edi
mov dword [ebp - 0x570], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
lea edx, [ebp - 0x554]
mov ecx, esi
call fcn.0040db80
push 0
lea eax, [ebp - 0x55c]
push eax
push 0x200
lea eax, [ebp - 0x554]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408c77
mov esi, 1
mov dword [ebp - 0x564], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4400
push dword [ebp - 0x55c]
push str.Write_GPT_Backup_Head_Failed__dwSize:_u___u__ErrCode:_u
call fcn.0040c4e0
add esp, 0x10
jmp 0x408eae
mov ecx, dword [ebx + 0x10]
lea edx, [ebp - 0x574]
mov eax, dword [ebx + 0x14]
sub ecx, 0x4200
push 0
push edx
sbb eax, 0
mov dword [ebp - 0x574], ecx
push eax
push ecx
push edi
mov dword [ebp - 0x570], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x55c]
push eax
push 0x4000
lea eax, [esi + 0x400]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408cf3
mov esi, 1
mov dword [ebp - 0x564], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4400
push dword [ebp - 0x55c]
push str.Write_GPT_Backup_Part_Table_Failed__dwSize:_u___u__ErrCode:_u
call fcn.0040c4e0
add esp, 0x10
jmp 0x408eae
push 0
lea eax, [ebp - 0x574]
xorps xmm0, xmm0
push eax
movlpd qword [ebp - 0x574], xmm0
push dword [ebp - 0x570]
push dword [ebp - 0x574]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x55c]
push eax
push 0x4400
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x408d63
mov esi, 1
mov dword [ebp - 0x564], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4400
push dword [ebp - 0x55c]
push str.Write_GPT_Info_Failed__dwSize:_u___u__ErrCode:_u
call fcn.0040c4e0
add esp, 0x10
jmp 0x408eae
push str.Write_GPT_Info_OK_...
call fcn.0040c4e0
add esp, 4
jmp 0x408e82
push 0
lea eax, [ebp - 0x55c]
push eax
push 0x200
lea eax, [ebp - 0x354]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x55c]
push esi
push str.Read_MBR_ret:_d_size:_u_err:_d
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x408a85
push 0x1b8
lea eax, [ebp - 0x354]
push 0
push eax
call fcn.004198c0
add esp, 0xc
lea eax, [ebp - 0x196]
push 0x40
push 0
push eax
call fcn.004198c0
mov ecx, dword [ebx + 0x14]
lea eax, [ebp - 0x196]
mov esi, dword [ebx + 0x10]
add esp, 0xc
mov edx, esi
push eax
mov eax, ecx
shrd edx, eax, 9
push ecx
shr eax, 9
sub edx, 0x800
push esi
mov ecx, 0x800
call fcn.0040d3c0
add esp, 0xc
mov byte [ebp - 0x196], 0
lea eax, [ebp - 0x56c]
mov byte [ebp - 0x192], 7
xorps xmm0, xmm0
movlpd qword [ebp - 0x56c], xmm0
push 0
push eax
push dword [ebp - 0x568]
push dword [ebp - 0x56c]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x55c]
push eax
push 0x200
lea eax, [ebp - 0x354]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push dword [ebp - 0x55c]
push esi
push str.Write_MBR_ret:_d_size:_u_err:_d
call fcn.0040c4e0
add esp, 0x10
test esi, esi
je 0x408a85
push str.Clear_Ventoy_successfully_finished
call fcn.0040c4e0
add esp, 4
lea eax, [ebp - 0x55c]
push 0
push eax
push 0
push 0
push 0
push 0
push 0x70140
push edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
xor esi, esi
push 0
push 0x30
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c428]
lea eax, [ebp - 0x4c]
sub esp, 8
movsd qword [esp], xmm0
push str.Status____.0lf__
push 0x40
push eax
call fcn.004136cf
add esp, 0x14
lea eax, [ebp - 0x4c]
push eax
push dword [0x43297c]
call dword [sym.imp.USER32.dll_SetWindowTextA]
mov eax, dword [ebp - 0x578]
test eax, eax
je 0x408f09
push eax
call fcn.00413ba8
add esp, 4
test esi, esi
jne 0x409043
push str.Mounting_Ventoy_Partition_.......................
call fcn.0040c4e0
add esp, 4
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x104
lea eax, [ebp - 0x154]
push esi
push eax
call fcn.004198c0
mov ecx, dword [ebx + 4]
lea edx, [ebp - 0x154]
add esp, 8
call fcn.00406c70
add esp, 4
lea eax, [ebp - 0x154]
push eax
push str.Logical_drive_letter_after_write_ventoy:___s_
call fcn.0040c4e0
add esp, 8
xor ecx, ecx
mov al, byte [ebp + esi - 0x154]
test al, al
je 0x408f9d
mov byte [ebp - 0x560], al
lea eax, [ebp - 0x560]
push eax
push str._s_is_ventoy_part1__already_mounted
call fcn.0040c4e0
inc esi
add esp, 8
mov ecx, 1
cmp esi, 0x104
jb 0x408f65
jmp 0x40902e
cmp ecx, 1
je 0x40902e
push str.need_to_mount_ventoy_part1...
call fcn.0040c4e0
add esp, 4
lea edx, [ebp - 0x154]
push 0
push ecx
mov ecx, dword [ebx + 4]
push 0
push 0x800
call fcn.00406a10
add esp, 0x10
test eax, eax
jne 0x409021
mov bl, byte [ebp - 0x555]
lea eax, [ebp - 0x154]
push eax
lea eax, [ebp - 0x560]
mov byte [ebp - 0x560], bl
push eax
call dword [sym.imp.KERNEL32.dll_SetVolumeMountPointA]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
lea eax, [ebp - 0x154]
push eax
lea eax, [ebp - 0x560]
push eax
push str.SetVolumeMountPoint___s____s__bRet:_u_code:_u
call fcn.0040c4e0
mov eax, dword [ebp - 0x580]
add esp, 0x14
mov byte [eax], bl
jmp 0x40902e
push str.Failed_to_find_ventoy_volume
call fcn.0040c4e0
add esp, 4
push 0x429f34
call fcn.0040c4e0
mov esi, dword [ebp - 0x564]
add esp, 4
jmp 0x40904a
mov edx, ebx
call fcn.0040bd20
cmp edi, 0xffffffff
je 0x409056
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004136c0
mov esp, ebp
pop ebp
ret