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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x598
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
mov edi, dword [0x430260]
lea eax, [ebp - 0x153]
push 0x103
mov ebx, ecx
mov dword [ebp - 0x580], edi
push 0
push eax
mov dword [ebp - 0x578], ebx
mov dword [ebp - 0x568], 0
mov dword [ebp - 0x55c], 0x5c3a3f
mov byte [ebp - 0x154], 0
call fcn.004198c0
add esp, 0xc
xor esi, esi
mov dword [ebp - 0x560], esi
push dword [ebx + 0x14]
push dword [ebx + 0x10]
call fcn.0040dd80
push eax
lea eax, [ebx + 0xa0]
mov ecx, 0x429f3c
push eax
lea eax, [ebx + 0x20]
test edi, edi
push eax
push dword [ebx + 4]
mov eax, 0x429f38
cmove eax, ecx
push eax
push dword [ebp + 8]
push str.InstallVentoy2PhyDrive_try_d__s_PhyDrive_d____s__s__dGB__
call fcn.0040c4e0
add esp, 0x24
test edi, edi
je 0x409b76
push 0x4400
call fcn.00413be0
add esp, 4
mov dword [ebp - 0x560], eax
mov esi, eax
push 0x4400
push 0
push esi
call fcn.004198c0
add esp, 0xc
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 dword [ebx + 0x14]
push dword [ebx + 0x10]
test edi, edi
je 0x409c26
mov ecx, esi
call fcn.0040d860
mov eax, dword [esi + 0x420]
add esp, 8
mov edi, dword [esi + 0x428]
mov ecx, dword [esi + 0x424]
sub edi, eax
mov dword [ebp - 0x584], eax
mov eax, dword [esi + 0x42c]
sbb eax, ecx
mov dword [ebp - 0x57c], ecx
add edi, 1
mov dword [ebp - 0x588], edi
mov edi, dword [esi + 0x4a0]
adc eax, 0
mov dword [ebp - 0x594], edi
mov edi, dword [esi + 0x4a4]
mov dword [ebp - 0x590], eax
mov dword [ebp - 0x58c], edi
jmp 0x409c78
xor edx, edx
lea ecx, [ebp - 0x354]
call fcn.0040d490
mov eax, dword [ebp - 0x18e]
add esp, 8
mov dword [ebp - 0x584], eax
mov eax, dword [ebp - 0x18a]
mov dword [ebp - 0x588], eax
mov eax, dword [ebp - 0x17e]
mov dword [ebp - 0x57c], 0
mov dword [ebp - 0x590], 0
mov dword [ebp - 0x594], eax
mov dword [ebp - 0x58c], 0
push str.Lock_disk_for_clean_.............................
call fcn.0040c4e0
mov ecx, dword [ebx + 4]
mov dl, 1
push 0
call fcn.00406e50
add esp, 8
mov dword [ebp - 0x570], eax
cmp eax, 0xffffffff
jne 0x409cc8
push str.Failed_to_open_physical_disk
call fcn.0040c4e0
add esp, 4
push esi
call fcn.00413ba8
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 0x409d31
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 0x409d18
lea ebx, [ebx]
shr eax, 1
inc cl
test al, 1
jne 0x409d10
movsx eax, cl
push eax
push str.GetFirstUnusedDriveLetter__C:_...
mov byte [ebp - 0x55c], cl
call fcn.0040c4e0
add esp, 8
jmp 0x409da0
lea edi, [ebp - 0x154]
lea ecx, [edi + 1]
lea ebx, [ebx]
mov al, byte [edi]
inc edi
test al, al
jne 0x409d40
sub edi, ecx
test edi, edi
jle 0x409da0
lea ebx, [ebp - 0x154]
jmp 0x409d60
mov al, byte [ebx + edi - 1]
mov byte [ebp - 0x55c], al
lea eax, [ebp - 0x55c]
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 - 0x55c]
push eax
push str.Delete_mountpoint__s_ret:_u_code:_u
call fcn.0040c4e0
dec edi
add esp, 0x10
test edi, edi
jg 0x409d60
mov ebx, dword [ebp - 0x578]
mov al, byte [ebp - 0x55c]
mov byte [ebp - 0x555], al
movsx eax, al
push eax
push str.Will_use__C:_as_volume_mountpoint
call fcn.0040c4e0
mov esi, dword [ebp - 0x570]
lea eax, [ebp - 0x564]
add esp, 8
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
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
test esi, esi
jne 0x409e75
call edi
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 esi, eax
add esp, 8
mov dword [ebp - 0x578], esi
cmp esi, 0xffffffff
jne 0x409f0d
push str.Failed_to_GetPhysicalHandle_for_write.
call fcn.0040c4e0
mov esi, 1
add esp, 4
mov dword [ebp - 0x568], esi
jmp 0x40a355
push 0
lea eax, [ebp - 0x564]
push eax
push 0
push 0
push 0
push 0
push 0x70140
push esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov eax, dword [ebp - 0x588]
add eax, dword [ebp - 0x584]
mov ecx, dword [ebp - 0x590]
adc ecx, dword [ebp - 0x57c]
push 0
push 0xb
push 0x402
push dword [0x432910]
mov dword [0x432a08], esi
mov dword [0x432a00], eax
mov dword [0x432a04], ecx
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c3f0]
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]
cmp dword [ebp - 0x580], 1
jne 0x409fc2
cmp dword [ebx + 8], 0
jne 0x409fc2
push str.Wait_for_format_part1_...
call fcn.0040c4e0
add esp, 4
push 0x1388
call dword [sym.imp.KERNEL32.dll_Sleep]
push str.Formatting_part1_exFAT_...
call fcn.0040c4e0
add esp, 4
push dword [ebx + 0x14]
push dword [ebx + 0x10]
call fcn.004086a0
add esp, 8
test eax, eax
je 0x409feb
push str.FormatPart1exFAT_failed.
jmp 0x409ef5
push 0
push 0xc
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c3f8]
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.Writing_part2_FAT_img_...
call fcn.0040c4e0
add esp, 4
mov ecx, esi
push dword [ebp - 0x58c]
push dword [ebp - 0x594]
call fcn.00407f60
add esp, 8
test eax, eax
je 0x40a064
push str.FormatPart2Fat_failed.
jmp 0x409ef5
push 0
push 0x2e
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c418]
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.Writing_Boot_Image_.............................
call fcn.0040c4e0
mov edx, dword [ebp - 0x580]
add esp, 4
mov ecx, esi
call fcn.00408570
test eax, eax
je 0x40a0d4
push str.WriteGrubStage1ToPhyDrive_failed.
jmp 0x409ef5
push 0
push 0x2f
push 0x402
push dword [0x432910]
call dword [sym.imp.USER32.dll_SendMessageW]
movsd xmm0, qword [0x42c420]
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.Writing_Partition_Table_........................
call fcn.0040c4e0
add esp, 4
push 0
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp - 0x580], 0
push 0
je 0x40a2d0
mov ecx, dword [ebx + 0x10]
lea edx, [ebp - 0x574]
mov eax, dword [ebx + 0x14]
sub ecx, 0x200
push edx
sbb eax, 0
mov dword [ebp - 0x574], ecx
push eax
push ecx
push esi
mov dword [ebp - 0x570], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov edi, dword [ebp - 0x560]
lea edx, [ebp - 0x554]
mov ecx, edi
call fcn.0040db80
push 0
lea eax, [ebp - 0x564]
push eax
push 0x200
lea eax, [ebp - 0x554]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a1d2
mov esi, 1
mov dword [ebp - 0x568], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4400
push dword [ebp - 0x564]
push str.Write_GPT_Backup_Head_Failed__dwSize:_u___u__ErrCode:_u
call fcn.0040c4e0
add esp, 0x10
jmp 0x40a35b
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 esi
mov dword [ebp - 0x570], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x564]
push eax
push 0x4000
lea eax, [edi + 0x400]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a24e
mov esi, 1
mov dword [ebp - 0x568], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4400
push dword [ebp - 0x564]
push str.Write_GPT_Backup_Part_Table_Failed__dwSize:_u___u__ErrCode:_u
call fcn.0040c4e0
add esp, 0x10
jmp 0x40a35b
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 esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x564]
push eax
push 0x4400
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a2be
mov esi, 1
mov dword [ebp - 0x568], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4400
push dword [ebp - 0x564]
push str.Write_GPT_Info_Failed__dwSize:_u___u__ErrCode:_u
call fcn.0040c4e0
add esp, 0x10
jmp 0x40a35b
push str.Write_GPT_Info_OK_...
call fcn.0040c4e0
mov esi, dword [ebp - 0x560]
jmp 0x40a321
lea eax, [ebp - 0x564]
push eax
push 0x200
lea eax, [ebp - 0x354]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a311
mov esi, 1
mov dword [ebp - 0x568], esi
call edi
push eax
push dword [ebp - 0x564]
push str.Write_MBR_Failed__dwSize:_u_ErrCode:_u
call fcn.0040c4e0
add esp, 0xc
jmp 0x40a355
push str.Write_MBR_OK_...
call fcn.0040c4e0
lea esi, [ebp - 0x354]
add esp, 4
lea eax, [ebp - 0x564]
mov ecx, 0x80
lea edi, [ebx + 0x288]
rep movsd dword es:[edi], dword [esi]
push 0
push eax
push 0
push 0
push 0
push 0
push 0x70140
push dword [ebp - 0x578]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
xor esi, esi
mov edi, dword [ebp - 0x560]
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]
test esi, esi
jne 0x40a501
push str.Mounting_Ventoy_Partition_.......................
call fcn.0040c4e0
add esp, 4
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0x104
xor edi, edi
lea eax, [ebp - 0x154]
push edi
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
nop
mov cl, byte [ebp + esi - 0x154]
test cl, cl
je 0x40a458
mov byte [ebp - 0x55c], cl
call fcn.0040d340
test eax, eax
lea eax, [ebp - 0x55c]
push eax
je 0x40a43d
push str._s_is_ventoy_part2__delete_mountpoint
call fcn.0040c4e0
add esp, 8
lea eax, [ebp - 0x55c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteVolumeMountPointA]
jmp 0x40a44f
push str._s_is_ventoy_part1__already_mounted
call fcn.0040c4e0
add esp, 8
mov edi, 1
inc esi
cmp esi, 0x104
jb 0x40a400
cmp edi, 1
mov edi, dword [ebp - 0x560]
je 0x40a4ec
push str.need_to_mount_ventoy_part1...
call fcn.0040c4e0
add esp, 4
lea edx, [ebp - 0x154]
push 0
push ecx
push dword [ebp - 0x57c]
mov ecx, dword [ebx + 4]
push dword [ebp - 0x584]
call fcn.00406a10
add esp, 0x10
test eax, eax
jne 0x40a4df
mov al, byte [ebp - 0x555]
mov byte [ebp - 0x55c], al
lea eax, [ebp - 0x154]
push eax
lea eax, [ebp - 0x55c]
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 - 0x55c]
push eax
push str.SetVolumeMountPoint___s____s__bRet:_u_code:_u
call fcn.0040c4e0
add esp, 0x14
jmp 0x40a4ec
push str.Failed_to_find_ventoy_volume
call fcn.0040c4e0
add esp, 4
push 0x429f34
call fcn.0040c4e0
mov esi, dword [ebp - 0x568]
add esp, 4
jmp 0x40a508
mov edx, ebx
call fcn.0040bd20
test edi, edi
je 0x40a515
push edi
call fcn.00413ba8
add esp, 4
mov eax, dword [ebp - 0x578]
cmp eax, 0xffffffff
je 0x40a527
push eax
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