Function at 0x40aa20
Capabilities:
Get disk information
Get disk size
Get volume information via ioctl
Read file on windows

Disassembly:
sub esp, 0x4d8
mov eax, dword [0x42d0f0]
xor eax, esp
mov dword [esp + 0x4d4], eax
mov eax, dword [esp + 0x4e0]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x4e8]
push edi
xor edi, edi
mov dword [esi], edi
mov dword [esi + 0x20], edi
mov dword [esi + 0x24], edi
mov dword [esi + 0x28], edi
mov dword [esi + 0xfc], edi
mov dword [esi + 0x110], edi
mov dword [esi + 0x114], edi
mov dword [esi + 0x148], edi
mov dword [esi + 0x14c], edi
mov dword [esi + 0x150], edi
mov dword [esi + 0x154], edi
mov dword [esi + 0x158], edi
mov dword [esi + 0x15c], edi
mov dword [esi + 0x160], edi
mov dword [esi + 0x164], edi
mov dword [esi + 0x168], edi
mov dword [esi + 0x16c], edi
mov dword [esi + 0x170], edi
mov dword [esi + 0x174], edi
mov dword [esi + 0x178], edi
mov dword [esi + 0x17c], edi
mov dword [esi + 0x180], edi
mov dword [esi + 0x184], edi
mov dword [esp + 0x10], eax
xor ecx, ecx
mov word [esi + 0x2c], cx
xor edx, edx
mov word [esi + 0x94], dx
mov dword [esi + 0x128], edi
mov dword [esi + 0x12c], edi
mov dword [esi + 0x130], edi
mov dword [esi + 0x134], edi
mov dword [esi + 0x138], edi
mov dword [esi + 0x13c], edi
lea eax, [esp + 0x4c]
push eax
mov dword [esi + 0x14], edi
mov dword [esi + 0x1b0], edi
mov dword [esi + 0x1b4], edi
mov dword [esi + 0x1b8], edi
mov dword [esi + 0x1bc], edi
mov dword [esi + 0x1c0], edi
mov dword [esi + 0x1c4], edi
mov dword [esi + 0x1c8], edi
mov dword [esi + 0x1cc], edi
mov dword [esi + 0x1d0], edi
mov dword [esi + 0x1d4], edi
mov dword [esi + 0x1d8], edi
mov dword [esi + 0x1dc], edi
mov dword [esi + 0x1e0], edi
mov dword [esi + 0x1e4], edi
mov dword [esi + 0x188], edi
mov dword [esi + 0x18c], edi
mov dword [esi + 0x190], edi
mov dword [esi + 0x194], edi
mov dword [esi + 0x198], edi
mov dword [esi + 0x19c], edi
mov dword [esi + 0x1a0], edi
mov dword [esi + 0x1a4], edi
mov dword [esi + 0x1a8], edi
mov dword [esi + 0x1ac], edi
mov dword [esi + 0x1f0], edi
mov dword [esi + 0x1f4], edi
mov dword [esi + 0x1f8], edi
mov dword [esi + 0x1fc], edi
call fcn.00411e0a
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x50]
add esp, 4
push edi
push 0x3e8
push ecx
push edx
call fcn.00412be0
mov ecx, eax
movzx eax, word [esp + 0x54]
mov ebx, edx
cdq
add ecx, eax
adc ebx, edx
mov eax, ebx
mov dword [esi + 0x21c], eax
mov eax, dword [esi + 0x118]
mov edx, ecx
mov dword [esi + 0x208], ecx
mov dword [esi + 0x20c], ebx
mov dword [esi + 0x218], edx
mov dword [esi + 0x210], edi
mov dword [esi + 0x214], edi
cmp eax, edi
je 0x40acf9
mov dword [esp + 0x18], edi
cmp dword [eax], edi
je 0x40acc0
xor ebx, ebx
jmp 0x40ac20
mov ecx, dword [esi + 0x118]
mov ebp, dword [ebx + ecx]
mov edx, dword [esp + 0x10]
push ebp
push edx
call sym.JkDefrag.exe_MatchMask
add esp, 8
cmp eax, 1
je 0x40acc0
push 0x2a
push ebp
call fcn.0041246b
add esp, 8
test eax, eax
jne 0x40aca1
mov eax, dword [esi + 0x118]
mov ebx, dword [ebx + eax]
mov eax, ebx
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40ac60
sub eax, edx
sar eax, 1
cmp eax, 3
ja 0x40aca1
mov ecx, dword [esp + 0x10]
movzx eax, word [ecx]
lea edx, [eax - 0x41]
cmp dx, 0x19
ja 0x40ac87
add eax, 0x20
movzx ecx, ax
movzx eax, word [ebx]
lea edx, [eax - 0x41]
cmp dx, 0x19
ja 0x40ac99
add eax, 0x20
movzx eax, ax
cmp cx, ax
je 0x40acc0
mov eax, dword [esp + 0x18]
inc eax
lea ebx, [eax*4]
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0x118]
cmp dword [ebx + eax], edi
jne 0x40ac20
mov ecx, dword [esi + 0x118]
mov edx, dword [esp + 0x18]
cmp dword [ecx + edx*4], edi
lea eax, [ecx + edx*4]
je 0x40acf9
mov eax, dword [eax]
mov ecx, dword [esp + 0x10]
mov edx, dword [esi + 0x238]
push eax
mov eax, dword [edx + 0xbc]
push ecx
mov ecx, dword [esi + 0x22c]
push eax
push edi
push edi
call ecx
add esp, 0x14
jmp 0x40b591
mov edx, dword [esi + 0x238]
mov ebx, dword [esp + 0x10]
mov eax, dword [edx + 0x38]
mov ecx, dword [esi + 0x234]
push ebx
push eax
call ecx
add esp, 8
lea edx, [esp + 0x1c]
push edx
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x40ad8b
lea eax, [esp + 0x34]
push eax
push str.SeBackupPrivilege
push edi
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
test eax, eax
je 0x40ad8b
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
push edi
push edi
push 0x10
lea eax, [esp + 0x48]
push eax
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x2c]
push edi
push ecx
mov dword [esp + 0x54], 1
mov dword [esp + 0x5c], edx
mov dword [esp + 0x60], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x40ad9e
mov edx, dword [esi + 0x22c]
push str.Info:_could_not_elevate_to_SeBackupPrivilege.
push edi
push 3
call edx
jmp 0x40ad9b
mov eax, dword [esi + 0x22c]
push str.Info:_could_not_elevate_to_SeBackupPrivilege.
push edi
push 3
call eax
add esp, 0xc
push ebx
call fcn.004129b8
add esp, 4
mov dword [esi + 0x24], eax
cmp eax, edi
je 0x40b591
mov ecx, eax
lea ebp, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, di
jne 0x40adb7
sub ecx, ebp
sar ecx, 1
inc ecx
push ecx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetVolumePathNameW]
test eax, eax
jne 0x40adfe
mov eax, ebx
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40ade0
mov ecx, dword [esi + 0x24]
sub eax, edx
sar eax, 1
push ebx
inc eax
push eax
push ecx
call fcn.00411f80
add esp, 0xc
mov eax, dword [esi + 0x24]
push edi
push eax
call fcn.0041246b
add esp, 8
cmp eax, dword [esi + 0x24]
je 0x40ae1e
sub eax, 2
cmp word [eax], 0x5c
jne 0x40ae1e
xor edx, edx
mov word [eax], dx
mov eax, dword [esi + 0x24]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40ae24
sub eax, edx
sar eax, 1
lea ebx, [eax + 2]
lea eax, [ebx + ebx]
push eax
call fcn.00412a5f
add esp, 4
mov dword [esi + 0x28], eax
cmp eax, edi
jne 0x40ae52
mov ecx, dword [esi + 0x24]
push ecx
jmp 0x40b589
mov edx, dword [esi + 0x24]
push edx
push 0x424bcc
push ebx
push eax
call fcn.00411311
mov eax, dword [esi + 0x28]
add esp, 0x10
push 0x104
lea ebx, [esi + 0x94]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetVolumeNameForVolumeMountPointW]
test eax, eax
jne 0x40af11
mov edx, dword [esi + 0x28]
mov eax, edx
lea ebx, [eax + 2]
jmp 0x40ae90
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40ae90
sub eax, ebx
sar eax, 1
cmp eax, 0x2f
jbe 0x40aefa
push 0x200
lea ecx, [esp + 0xe8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.JkDefrag.exe_SystemErrorStr
mov eax, dword [esi + 0x28]
mov ecx, dword [esi + 0x238]
lea edx, [esp + 0xf0]
push edx
mov edx, dword [ecx + 0xa0]
push eax
mov eax, dword [esi + 0x22c]
push edx
push edi
push edi
call eax
mov ecx, dword [esi + 0x24]
push ecx
call fcn.00412c14
mov edx, dword [esi + 0x28]
push edx
call fcn.00412c14
add esp, 0x28
jmp 0x40b591
push edx
push str.._s
push 0x34
lea ebx, [esi + 0x94]
push ebx
call fcn.00411311
add esp, 0x10
push ebx
push 0x33
lea ebx, [esi + 0x2c]
push ebx
call fcn.00411f80
push edi
push ebx
call fcn.0041246b
add esp, 0x14
cmp eax, ebx
je 0x40af39
sub eax, 2
cmp word [eax], 0x5c
jne 0x40af39
xor ecx, ecx
mov word [eax], cx
mov eax, dword [esi + 0x28]
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40af40
sub eax, edx
sar eax, 1
lea ebp, [eax + 0xe]
lea edx, [ebp + ebp]
push edx
call fcn.00412a5f
mov ebx, eax
add esp, 4
cmp ebx, edi
jne 0x40af7f
mov eax, dword [esi + 0x28]
push eax
call fcn.00412c14
mov ecx, dword [esi + 0x24]
push ecx
call fcn.00412c14
add esp, 8
jmp 0x40b591
mov edx, dword [esi + 0x28]
push edx
push str._shiberfil.sys
push ebp
push ebx
call fcn.00411311
push 0x424b94
lea eax, [esp + 0x34]
push ebx
push eax
call fcn.004110d7
add esp, 0x1c
test eax, eax
jne 0x40affe
mov eax, dword [esp + 0x20]
cmp eax, edi
je 0x40affe
push eax
push 1
lea ecx, [esp + 0x1c]
push 4
push ecx
mov dword [esp + 0x24], edi
call fcn.0041321a
add esp, 0x10
cmp eax, 1
jne 0x40affe
cmp dword [esp + 0x14], edi
je 0x40affe
mov edx, dword [esi + 0x22c]
push str.Will_not_process_this_disk__it_contains_hybernated_data.
push edi
push edi
call edx
mov eax, dword [esi + 0x24]
push eax
call fcn.00412c14
mov ecx, dword [esi + 0x28]
push ecx
call fcn.00412c14
push ebx
call fcn.00412c14
add esp, 0x18
jmp 0x40b591
push ebx
call fcn.00412c14
mov edx, dword [esi + 0x24]
mov eax, dword [esi + 0x238]
mov ecx, dword [eax + 0x74]
push edx
mov edx, dword [esi + 0x22c]
lea ebx, [esi + 0x2c]
push ebx
push ecx
push edi
push edi
call edx
add esp, 0x18
push edi
push edi
push 3
push edi
push 3
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi + 0x20], eax
cmp eax, 0xffffffff
jne 0x40b08e
push 0x200
lea eax, [esp + 0xe8]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.JkDefrag.exe_SystemErrorStr
mov edx, dword [esi + 0x24]
mov eax, dword [esi + 0x22c]
lea ecx, [esp + 0xf0]
push ecx
push edx
push ebx
push str.Cannot_open_volume__s_at_mountpoint__s:__s
push edi
push 1
call eax
mov ecx, dword [esi + 0x24]
push ecx
call fcn.00412c14
mov edx, dword [esi + 0x28]
push edx
call fcn.00412c14
add esp, 0x2c
jmp 0x40b591
mov ebp, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push edi
lea ecx, [esp + 0x18]
push ecx
push 0x18
lea edx, [esp + 0xd8]
push edx
push 8
lea ecx, [esp + 0x40]
push ecx
push 0x9006f
push eax
mov dword [esp + 0x4c], edi
mov dword [esp + 0x50], edi
call ebp
test eax, eax
jne 0x40b113
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
je 0x40b113
cmp eax, 0xea
je 0x40b113
mov edx, dword [esi + 0x24]
mov eax, dword [esi + 0x238]
mov ecx, dword [eax + 0x80]
push edx
mov edx, dword [esi + 0x22c]
push ebx
push ecx
push edi
push edi
call edx
mov eax, dword [esi + 0x20]
add esp, 0x14
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi + 0x24]
push ecx
call fcn.00412c14
mov edx, dword [esi + 0x28]
push edx
call fcn.00412c14
add esp, 8
jmp 0x40b591
mov eax, dword [esp + 0xd4]
add eax, dword [esp + 0xcc]
mov ecx, dword [esp + 0xd8]
adc ecx, dword [esp + 0xd0]
lea edx, [esp + 0xc4]
push edx
mov edx, dword [esp + 0x14]
mov dword [esi + 0x178], eax
lea eax, [esp + 0x28]
mov dword [esi + 0x17c], ecx
push eax
lea ecx, [esp + 0xc4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
test eax, eax
je 0x40b188
mov eax, dword [esi + 0x17c]
mov ecx, dword [esi + 0x178]
mov edx, dword [esp + 0x28]
push eax
mov eax, dword [esp + 0x28]
push ecx
push edx
push eax
call fcn.00412e10
mov dword [esi + 0x180], eax
mov dword [esi + 0x184], edx
mov eax, dword [esi + 0x20]
push edi
lea ecx, [esp + 0x18]
push ecx
push 0x60
lea edx, [esp + 0x68]
push edx
push edi
push edi
push 0x90064
push eax
call ebp
test eax, eax
je 0x40b35f
mov eax, dword [esp + 0x88]
mov edx, dword [esp + 0x94]
mov ebx, dword [esp + 0x9c]
mov ebp, dword [esp + 0xa0]
xor ecx, ecx
push ecx
mov dword [esi + 0x184], ecx
mov ecx, dword [esp + 0x9c]
push eax
push ecx
push edx
mov dword [esi + 0x180], eax
mov dword [esi + 0x148], ebx
mov dword [esi + 0x14c], ebp
call fcn.00412b30
mov ecx, ebx
add ecx, eax
mov dword [esi + 0x150], ecx
mov ecx, dword [esp + 0xac]
mov dword [esi + 0x158], ecx
mov ecx, dword [esp + 0xb0]
mov dword [esi + 0x15c], ecx
mov ecx, dword [esp + 0xb4]
push edx
mov dword [esi + 0x160], ecx
mov ecx, dword [esp + 0xbc]
adc ebp, edx
push eax
mov dword [esi + 0x164], ecx
mov ecx, dword [esp + 0xac]
mov dword [esi + 0x154], ebp
mov ebp, dword [esp + 0xb0]
mov dword [esi + 0x168], ecx
add ecx, eax
mov eax, dword [esp + 0xac]
mov dword [esi + 0x16c], ebp
adc ebp, edx
mov edx, dword [esp + 0xb0]
push edx
mov edx, dword [esp + 0xc0]
push eax
mov eax, dword [esp + 0xc0]
mov dword [esi + 0x170], ecx
mov ecx, dword [esp + 0xc8]
push ecx
mov ecx, dword [esp + 0xc0]
push edx
mov edx, dword [esp + 0xb8]
push eax
mov eax, dword [esi + 0x238]
push ecx
push edx
mov edx, dword [esi + 0x22c]
mov dword [esi + 0x174], ebp
mov ecx, dword [eax + 0x84]
push ebx
push ecx
push edi
push 3
call edx
mov eax, dword [esi + 0x154]
mov ecx, dword [esi + 0x150]
mov edx, dword [esi + 0x14c]
push eax
mov eax, dword [esi + 0x148]
push ecx
mov ecx, dword [esi + 0x238]
push edi
push edx
mov edx, dword [ecx + 0x88]
push eax
mov eax, dword [esi + 0x22c]
push edi
push edx
push edi
push 3
call eax
mov ecx, dword [esi + 0x164]
mov edx, dword [esi + 0x160]
add esp, 0x58
push ecx
mov eax, dword [esi + 0x15c]
mov ecx, dword [esi + 0x158]
push edx
mov edx, dword [esi + 0x238]
push 1
push eax
mov eax, dword [edx + 0x88]
push ecx
mov ecx, dword [esi + 0x22c]
push 1
push eax
push edi
push 3
call ecx
mov edx, dword [esi + 0x174]
mov eax, dword [esi + 0x170]
mov ecx, dword [esi + 0x16c]
push edx
mov edx, dword [esi + 0x168]
push eax
mov eax, dword [esi + 0x238]
push 2
push ecx
mov ecx, dword [eax + 0x88]
push edx
mov edx, dword [esi + 0x22c]
push 2
push ecx
push edi
push 3
call edx
add esp, 0x48
mov eax, dword [esp + 0x10]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40b366
sub eax, edx
sar eax, 1
lea ebx, [eax + 3]
lea eax, [ebx + ebx]
push eax
call fcn.00412a5f
add esp, 4
mov dword [esi + 0x18], eax
cmp eax, edi
je 0x40b591
mov ebp, dword [esp + 0x10]
push ebp
push ebx
push eax
call fcn.00411f80
mov eax, ebp
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40b3a3
sub eax, edx
sar eax, 1
cmp eax, 2
je 0x40b3eb
mov eax, ebp
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40b3c0
sub eax, edx
sar eax, 1
cmp eax, 3
je 0x40b3eb
push 0x2a
push ebp
call fcn.0041246b
add esp, 8
test eax, eax
jne 0x40b414
push ebp
push 0x424ab8
jmp 0x40b407
movzx eax, word [ebp]
lea edx, [eax - 0x41]
cmp dx, 0x19
ja 0x40b3fb
add eax, 0x20
movzx eax, ax
movzx eax, ax
push eax
push str._c:
mov ecx, dword [esi + 0x18]
push ebx
push ecx
call fcn.00411311
add esp, 0x10
mov edx, dword [esi + 0x18]
mov eax, dword [esi + 0x22c]
push edx
push str.Input_mask:__s
push edi
push edi
call eax
push esi
call sym.JkDefrag.exe_ShowDiskmap
mov ecx, dword [esi + 8]
add esp, 0x14
cmp dword [ecx], edi
jne 0x40b440
push esi
call fcn.004085c0
add esp, 4
mov edx, dword [esi + 8]
mov ebx, dword [esp + 0x4f4]
cmp dword [edx], edi
jne 0x40b45c
cmp ebx, 1
jne 0x40b45c
push esi
call fcn.00409090
add esp, 4
mov eax, dword [esi + 8]
cmp dword [eax], edi
jne 0x40b4a6
cmp ebx, 2
je 0x40b46d
cmp ebx, 3
jne 0x40b4a6
push esi
call fcn.00409090
mov ecx, dword [esi + 8]
add esp, 4
cmp dword [ecx], edi
jne 0x40b486
push esi
call fcn.00408bc0
add esp, 4
mov edx, dword [esi + 8]
cmp dword [edx], edi
jne 0x40b496
push esi
call fcn.0040a3b0
add esp, 4
mov eax, dword [esi + 8]
cmp dword [eax], edi
jne 0x40b4a6
push esi
call fcn.00408bc0
add esp, 4
mov ecx, dword [esi + 8]
cmp dword [ecx], edi
jne 0x40b4bb
cmp ebx, 4
jne 0x40b4bb
push esi
call fcn.004094f0
add esp, 4
mov edx, dword [esi + 8]
cmp dword [edx], edi
jne 0x40b4d0
cmp ebx, 5
jne 0x40b4d0
push esi
call fcn.0040a6e0
add esp, 4
mov eax, dword [esi + 8]
cmp dword [eax], edi
jne 0x40b4e6
cmp ebx, 6
jne 0x40b4e6
push edi
push esi
call fcn.00409ff0
add esp, 8
mov ecx, dword [esi + 8]
cmp dword [ecx], edi
jne 0x40b4fd
cmp ebx, 7
jne 0x40b4fd
push 1
push esi
call fcn.00409ff0
add esp, 8
mov edx, dword [esi + 8]
cmp dword [edx], edi
jne 0x40b514
cmp ebx, 8
jne 0x40b514
push 2
push esi
call fcn.00409ff0
add esp, 8
mov eax, dword [esi + 8]
cmp dword [eax], edi
jne 0x40b52b
cmp ebx, 9
jne 0x40b52b
push 3
push esi
call fcn.00409ff0
add esp, 8
mov ecx, dword [esi + 8]
cmp dword [ecx], edi
jne 0x40b542
cmp ebx, 0xa
jne 0x40b542
push 4
push esi
call fcn.00409ff0
add esp, 8
push 0xffffffffffffffff
push 7
push esi
call sym.JkDefrag.exe_CallShowStatus
mov eax, dword [esi + 0x20]
add esp, 0xc
cmp eax, edi
je 0x40b562
cmp eax, 0xffffffff
je 0x40b562
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi + 0x110]
push edx
call sym.JkDefrag.exe_DeleteItemTree
mov eax, dword [esi + 0x24]
add esp, 4
cmp eax, edi
je 0x40b581
push eax
call fcn.00412c14
add esp, 4
mov esi, dword [esi + 0x28]
cmp esi, edi
je 0x40b591
push esi
call fcn.00412c14
add esp, 4
mov ecx, dword [esp + 0x4e4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00411002
add esp, 0x4d8
ret