Function at 0x408e60
Capabilities:
Delete drive layout via ioctl
Get disk information
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1188
call fcn.0042c9d0
mov eax, dword [0x468600]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
xor ebx, ebx
push 0x7fe
mov esi, ecx
lea edx, [ebp - 0x112a]
xor ecx, ecx
push ebx
push edx
mov dword [ebp - 0x1130], eax
mov dword [ebp - 0x1140], ebx
mov dword [ebp - 0x116c], ebx
mov dword [ebp - 0x114c], 0xffffffff
mov word [ebp - 0x112c], cx
call fcn.00429d20
add esp, 0xc
push 0x206
lea ecx, [ebp - 0x242]
xor eax, eax
push ebx
push ecx
mov word [ebp - 0x244], ax
call fcn.00429d20
mov edx, dword [esi + 0x10]
xor eax, eax
lea edi, [esi + 0x10]
add esp, 0xc
mov dword [ebp - 0x1164], ebx
mov dword [ebp - 0x1160], eax
mov dword [ebp - 0x115c], eax
mov dword [ebp - 0x1158], eax
mov dword [ebp - 0x1154], eax
mov dword [ebp - 0x1150], eax
mov dword [ebp - 0x1138], ebx
mov dword [ebp - 0x1148], ebx
mov dword [ebp - 0x1144], ebx
cmp dword [edx - 0xc], ebx
jne 0x408f5f
mov eax, dword [esi + 0x28]
mov esi, dword [esi + 0x14]
mov edi, dword [eax]
cmp esi, ebx
jne 0x408f5b
call fcn.004292b7
xor esi, esi
cmp edi, dword [esi + 0x14]
jne 0x408f39
call fcn.004292b7
mov ecx, dword [edi + 8]
push ecx
push 0x45d374
lea edx, [ebp - 0x112c]
push 0x400
push edx
call fcn.004296cf
add esp, 0x10
jmp 0x408fe1
mov esi, dword [esi]
jmp 0x408f2f
mov eax, edx
push eax
push 0x45d374
lea ecx, [ebp - 0x112c]
push 0x400
push ecx
call fcn.004296cf
mov edx, dword [edi]
mov esi, dword [edx - 0xc]
mov eax, edx
push str.0123456789
push eax
call fcn.00429870
add esp, 0x18
cmp eax, ebx
jne 0x408f96
or eax, 0xffffffff
jmp 0x408f9a
sub eax, dword [edi]
sar eax, 1
sub esi, eax
push esi
lea eax, [ebp - 0x113c]
push eax
mov ecx, edi
call fcn.00405ce0
mov eax, dword [eax]
push 0xa
push ebx
push eax
call fcn.004296a3
mov dword [ebp - 0x114c], eax
mov eax, dword [ebp - 0x113c]
add eax, 0xfffffff0
add esp, 0xc
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408fe1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ebx
push 0x80
push 3
push ebx
push 3
push 0xc0000000
lea ecx, [ebp - 0x112c]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40903f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [ebp - 0x1130]
lea edx, [ebp - 0x112c]
push edx
push 0x45dd40
push 0x100
push eax
call fcn.004296cf
add esp, 0x14
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00427f57
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x1168]
push ecx
lea edx, [ebp - 0x1170]
push edx
push edi
call fcn.00448700
add esp, 0xc
test eax, eax
jne 0x409077
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [ebp - 0x1130]
push 0x45dd6c
push 0x100
push eax
jmp 0x4097ab
mov esi, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push ebx
lea ecx, [ebp - 0x1134]
push ecx
push ebx
push ebx
push ebx
push ebx
push 0x7c100
push edi
call esi
test eax, eax
jne 0x4090b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x1130]
push eax
push str.IOCTL_DISK_DELETE_DRIVE_LAYOUT
push 0x100
push edx
jmp 0x4097ab
push ebx
mov dword [ebp - 0x1188], ebx
call fcn.00429082
add esp, 4
push ebx
mov dword [ebp - 0x1184], eax
lea eax, [ebp - 0x1134]
push eax
push ebx
push ebx
push 0x18
lea ecx, [ebp - 0x1188]
push ecx
push 0x7c058
push edi
call esi
test eax, eax
jne 0x409103
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x1130]
push eax
push str.IOCTL_DISK_CREATE_DISK
push 0x100
push edx
jmp 0x4097ab
push ebx
lea eax, [ebp - 0x1134]
push eax
push ebx
push ebx
push ebx
push ebx
push 0x70140
push edi
call esi
test eax, eax
je 0x409793
push ebx
lea edx, [ebp - 0x1134]
push edx
push 0x18
lea eax, [ebp - 0x1164]
push eax
push ebx
push ebx
push 0x70000
push edi
call esi
test eax, eax
jne 0x40914f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_GET_DRIVE_GEOMETRY
jmp 0x40979f
mov eax, dword [ebp - 0x1150]
mul dword [ebp - 0x1154]
mov ecx, dword [ebp - 0x1158]
push 0
push ecx
push edx
push eax
call fcn.0042c720
mov ecx, dword [ebp - 0x1160]
push ecx
mov ecx, dword [ebp - 0x1164]
push ecx
push edx
push eax
call fcn.0042c720
push 1
push 0x150
mov esi, eax
mov ebx, edx
call fcn.00429830
add esp, 8
mov dword [ebp - 0x1148], eax
test eax, eax
jne 0x4091ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x1130]
push eax
push 0x45def0
push 0x100
push edx
jmp 0x4097ab
push 0
call fcn.00429082
mov ecx, dword [ebp - 0x1148]
mov dword [ecx + 8], eax
mov dword [ecx], 0
mov dword [ecx + 4], 1
mov dword [ecx + 0x30], 0
mov eax, dword [ebp - 0x1150]
mul dword [ebp - 0x1154]
add esp, 4
push 0
sub esi, eax
mov dword [ecx + 0x3c], edx
sbb ebx, edx
lea edx, [ebp - 0x1134]
push edx
push 0
push 0
push 0x150
push ecx
mov dword [ecx + 0x38], eax
mov dword [ecx + 0x40], esi
mov dword [ecx + 0x44], ebx
mov dword [ecx + 0x48], 1
mov byte [ecx + 0x4c], 1
mov byte [ecx + 0x50], 7
mov byte [ecx + 0x51], 1
mov byte [ecx + 0x52], 1
mov eax, dword [ebp - 0x1154]
push 0x7c054
push edi
mov dword [ecx + 0x54], eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x409288
cmp dword [ebp - 0x1130], eax
je 0x409288
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [ebp - 0x1130]
push eax
push str.IOCTL_DISK_SET_DRIVE_LAYOUT_EX
push 0x100
push ebx
call fcn.004296cf
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
add esp, 0x10
push ebx
call esi
push 0x45df74
call esi
push 0x100
push 0
push ebx
call fcn.00429d20
add esp, 0xc
push 0
lea eax, [ebp - 0x1134]
push eax
push 0
push 0
push 0
push 0
push 0x70140
push edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x409793
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [ebp - 0x1138]
push edx
call fcn.00408020
add esp, 4
mov dword [ebp - 0x113c], eax
test eax, eax
jne 0x4092fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x45df78
mov eax, dword [ebp - 0x1130]
push 0x100
push eax
call fcn.004296cf
add esp, 0x10
jmp 0x4097cd
xor ebx, ebx
test eax, eax
jbe 0x409596
mov esi, dword [ebp - 0x116c]
mov edi, dword [ebp - 0x1138]
mov ecx, dword [edi + ebx*4]
push ecx
call fcn.00408190
add esp, 4
cmp dword [ebp - 0x114c], eax
jne 0x409581
mov ecx, dword [edi + ebx*4]
lea edx, [ebp - 0x244]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x409334
lea edi, [ebp - 0x244]
add edi, 0xfffffffe
mov edi, edi
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x409350
mov edx, dword [0x45dfa0]
mov esi, dword [sym.imp.KERNEL32.dll_GetVolumeNameForVolumeMountPointW]
push 0x104
lea eax, [ebp - 0x244]
push eax
mov ecx, eax
push ecx
mov dword [edi], edx
call esi
test eax, eax
je 0x4093b6
lea edx, [ebp - 0x1134]
push edx
push 0x104
lea eax, [ebp - 0x244]
push eax
mov ecx, eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetVolumePathNamesForVolumeNameW]
test eax, eax
je 0x4093b6
cmp dword [ebp - 0x1134], 0
je 0x4093b6
cmp word [ebp - 0x244], 0
jne 0x4095b4
xor edx, edx
push 0x32
push edx
lea eax, [ebp - 0x3a]
push eax
mov word [ebp - 0x3c], dx
call fcn.00429d20
add esp, 0xc
xor ecx, ecx
push 0xce
push ecx
lea edx, [ebp - 0x312]
push edx
mov word [ebp - 0x314], cx
call fcn.00429d20
add esp, 0xc
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x722]
push ecx
mov word [ebp - 0x724], ax
call fcn.00429d20
add esp, 0xc
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0x92a]
push eax
mov word [ebp - 0x92c], dx
call fcn.00429d20
add esp, 0xc
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x51a]
push edx
mov word [ebp - 0x51c], cx
call fcn.00429d20
add esp, 0xc
lea eax, [ebp - 0x314]
push eax
push 0x68
call dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsW]
lea ecx, [ebp - 0x314]
movzx eax, word [ecx]
test ax, ax
je 0x409489
cmp ax, 0x41
jb 0x409471
cmp ax, 0x5a
ja 0x409471
movzx eax, ax
jmp 0x409477
movzx eax, ax
sub eax, 0x20
add ecx, 8
mov edx, 1
mov word [ebp + eax*2 - 0xbe], dx
jne 0x409458
mov eax, 0x44
mov edi, edi
movzx ecx, ax
cmp word [ebp + ecx*2 - 0xbe], 0
je 0x4094a5
inc eax
cmp ax, 0x5a
jbe 0x409490
movzx edi, ax
push edi
push 0x45dfd0
lea edx, [ebp - 0x244]
push 0x104
push edx
call fcn.004296cf
push edi
push str._C:_
lea eax, [ebp - 0x51c]
push 0x104
push eax
call fcn.004296cf
mov edx, dword [ebp - 0x1138]
mov eax, dword [edx + ebx*4]
add esp, 0x20
push 0x104
lea ecx, [ebp - 0x724]
push ecx
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_QueryDosDeviceW]
mov edi, dword [sym.imp.KERNEL32.dll_DefineDosDeviceW]
lea ecx, [ebp - 0x724]
push ecx
lea edx, [ebp - 0x244]
push edx
push 1
call edi
test eax, eax
je 0x409704
push 0x104
lea eax, [ebp - 0x92c]
push eax
lea ecx, [ebp - 0x51c]
push ecx
call esi
test eax, eax
je 0x409729
lea edx, [ebp - 0x724]
push edx
lea eax, [ebp - 0x244]
push eax
push 7
call edi
test eax, eax
je 0x40974e
lea ecx, [ebp - 0x92c]
push ecx
lea edx, [ebp - 0x51c]
push edx
call dword [sym.imp.KERNEL32.dll_SetVolumeMountPointW]
test eax, eax
je 0x40975f
push 0x1f4
mov esi, 1
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [ebp - 0x1138]
inc ebx
cmp ebx, dword [ebp - 0x113c]
jb 0x409313
test esi, esi
jne 0x409781
mov edx, dword [ebp - 0x1130]
push str.b_rN0R
push 0x100
push edx
call fcn.004296cf
add esp, 0xc
jmp 0x4097cd
push 1
push 0x10000
mov dword [ebp - 0x1134], 0x10000
call fcn.00429830
mov esi, eax
add esp, 8
mov dword [ebp - 0x1144], esi
test esi, esi
jne 0x4095fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [ebp - 0x1130]
push 0x45def0
push 0x100
push eax
call fcn.004296cf
add esp, 0x10
jmp 0x4097c0
movzx ecx, word [ebp - 0x244]
push ecx
push str.._C:
lea edx, [ebp - 0x112c]
push 0x400
push edx
call fcn.004296cf
add esp, 0x10
push 0
push 0x80
push 3
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0x112c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x409671
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x1130]
push eax
lea ecx, [ebp - 0x112c]
push ecx
push 0x45dd40
push 0x100
push edx
call fcn.004296cf
add esp, 0x14
jmp 0x4097c0
push edi
call fcn.00448880
add esp, 4
push edi
call fcn.00448820
add esp, 4
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x1134]
xor edx, edx
push eax
div dword [ebp - 0x1168]
mov edx, edi
mov ecx, eax
call fcn.00407fb0
add esp, 4
test eax, eax
jne 0x4096e5
mov ecx, dword [ebp - 0x1134]
push eax
lea eax, [ebp - 0x1134]
push eax
push ecx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4096e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x1130]
push eax
push 0x45dfa4
push 0x100
push edx
jmp 0x4097ab
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov word [ebp - 0x240], ax
mov dword [ebp - 0x1140], 1
jmp 0x4097c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x1130]
push eax
push str.DefineDosDevice__DDD_RAW_TARGET_PATH_
push 0x100
push ecx
call fcn.004296cf
add esp, 0x10
jmp 0x4097cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x1130]
push eax
push str.GetVolumeNameForVolumeMountPoint
push 0x100
push edx
call fcn.004296cf
add esp, 0x10
jmp 0x4097cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DefineDosDevice__DDD_RAW_TARGET_PATHDDD_REMOVE_DEFINITIONDDD_EXACT_MATCH_ON_REMOVE_
jmp 0x4092e4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x1130]
push eax
push str.SetVolumeMountPoint
push 0x100
push ecx
call fcn.004296cf
add esp, 0x10
jmp 0x4097cd
mov esi, dword [ebp - 0x1144]
mov dword [ebp - 0x1140], 1
jmp 0x4097c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.IOCTL_DISK_UPDATE_PROPERTIES
mov ecx, dword [ebp - 0x1130]
push 0x100
push ecx
call fcn.004296cf
add esp, 0x10
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x1144]
test esi, esi
je 0x4097cd
push esi
call fcn.004297a2
add esp, 4
mov eax, dword [ebp - 0x1148]
test eax, eax
je 0x4097e0
push eax
call fcn.004297a2
add esp, 4
mov edi, dword [ebp - 0x1138]
test edi, edi
je 0x409816
mov ebx, dword [ebp - 0x113c]
xor esi, esi
test ebx, ebx
jbe 0x40980d
cmp dword [edi + esi*4], 0
je 0x409808
mov eax, dword [edi + esi*4]
push eax
call fcn.004297a2
add esp, 4
inc esi
cmp esi, ebx
jb 0x4097f6
push edi
call fcn.004297a2
add esp, 4
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x1140]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00427f57
mov esp, ebp
pop ebp
ret