Function at 0x407170
Capabilities:
Check os version
Clear file content
Create directory
Get disk information
Get disk size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x463fb6
mov eax, dword fs:[0]
push eax
sub esp, 0x4b4
mov eax, dword [0x484540]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x460], ebx
mov eax, dword fs:[0x2c]
mov edx, dword [eax]
mov eax, dword [0x488d00]
cmp eax, dword [edx + 4]
jle 0x407207
push 0x488d00
call fcn.00449aab
add esp, 4
cmp dword [0x488d00], 0xffffffff
jne 0x407207
call fcn.0042f5de
mov ecx, eax
test ecx, ecx
je 0x407c97
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x467f40
mov dword [0x488d04], eax
call fcn.00449dbd
add esp, 4
push 0x488d00
call fcn.00449a61
add esp, 4
push 0x104
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x218]
push 0x5c
push eax
call fcn.0044b011
add esp, 8
test eax, eax
je 0x407235
xor ecx, ecx
mov word [eax], cx
mov eax, dword [0x484f88]
mov dword [0x488b40], 0
cmp eax, 0xffffffff
jne 0x407344
push 0x118
lea eax, [ebp - 0x334]
mov dword [0x484f88], 0
push 0
push eax
call fcn.0044bb10
add esp, 0xc
mov dword [ebp - 0x338], 0x11c
lea eax, [ebp - 0x338]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
mov eax, dword [ebp - 0x334]
cmp eax, 5
jbe 0x4072ae
cmp eax, 6
jne 0x40729d
cmp dword [ebp - 0x330], 1
jbe 0x4072ae
mov dword [0x484f88], 1
mov eax, str.CdmResourcediskspddiskspd32.exe
jmp 0x4072bd
mov dword [0x484f88], 0
mov eax, str.CdmResourcediskspddiskspd32L.exe
push eax
lea eax, [ebp - 0x218]
push eax
push str._s_s
push 0x488b80
call fcn.00408490
push 0x478294
push dword [0x488b80]
lea eax, [ebp - 0x48c]
push eax
call fcn.004547f9
add esp, 0x1c
test eax, eax
jne 0x407c60
mov eax, dword [ebp - 0x48c]
test eax, eax
je 0x407c60
push eax
call fcn.00454c19
mov eax, dword [ebx + 0x37c]
add esp, 4
inc eax
mov dword [0x488c54], eax
mov eax, dword [ebx + 0x360]
mov ecx, dword [eax - 0x10]
lea esi, [eax - 0x10]
mov dword [ebp - 0x474], eax
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi + 0xc], 0
mov ecx, eax
lea eax, [esi + 0xc]
jl 0x407356
cmp ecx, dword [esi]
jne 0x407356
lock inc dword [eax]
jmp 0x407387
test eax, eax
je 0x4072b8
mov eax, str.CdmResourcediskspddiskspd32.exe
jmp 0x4072bd
mov eax, dword [ecx]
lea edi, [esi + 4]
push 2
push dword [edi]
call dword [eax]
mov esi, eax
test esi, esi
je 0x407ca1
mov eax, dword [edi]
mov dword [esi + 4], eax
mov eax, dword [edi]
inc eax
push eax
push dword [ebp - 0x474]
push eax
lea eax, [esi + 0x10]
push eax
call fcn.00402de0
add esp, 0x10
add esi, 0x10
mov dword [ebp - 0x478], esi
mov dword [ebp - 4], 0
cmp dword [esi - 0xc], 0
jl 0x4073c4
push 0x472bd8
push esi
call fcn.0044b0b5
add esp, 8
test eax, eax
je 0x4073c4
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
je 0x4073c4
push esi
call fcn.004503da
add esp, 4
cdq
jmp 0x4073d5
push esi
call fcn.004503da
cdq
add esp, 4
shld edx, eax, 0xa
shl eax, 0xa
mov dword [0x488c58], eax
mov eax, dword [ebx + 0x38c]
mov dword [0x488c60], eax
mov eax, dword [ebx + 0x3b0]
mov dword [0x488c84], eax
mov eax, dword [ebx + 0x3d4]
mov dword [0x488ca8], eax
mov eax, dword [ebx + 0x3f8]
mov dword [0x488ccc], eax
mov eax, dword [ebx + 0x390]
mov dword [0x488c64], eax
mov eax, dword [ebx + 0x3b4]
mov dword [0x488c88], eax
mov eax, dword [ebx + 0x3d8]
mov dword [0x488cac], eax
mov eax, dword [ebx + 0x3fc]
mov dword [0x488cd0], eax
mov eax, dword [ebx + 0x394]
mov dword [0x488c68], eax
mov eax, dword [ebx + 0x3b8]
mov dword [0x488c8c], eax
mov eax, dword [ebx + 0x3dc]
mov dword [0x488cb0], eax
mov eax, dword [ebx + 0x400]
mov dword [0x488cd4], eax
mov eax, dword [ebx + 0x398]
mov dword [0x488c6c], eax
mov eax, dword [ebx + 0x3bc]
mov dword [0x488c90], eax
mov eax, dword [ebx + 0x3e0]
mov dword [0x488cb4], eax
mov eax, dword [ebx + 0x404]
mov dword [0x488cd8], eax
mov eax, dword [ebx + 0x39c]
mov dword [0x488c70], eax
mov eax, dword [ebx + 0x3c0]
mov dword [0x488c94], eax
mov eax, dword [ebx + 0x3e4]
mov dword [0x488cb8], eax
mov eax, dword [ebx + 0x408]
mov dword [0x488cdc], eax
mov eax, dword [ebx + 0x3a0]
mov dword [0x488c74], eax
mov eax, dword [ebx + 0x3c4]
mov dword [0x488c98], eax
mov eax, dword [ebx + 0x3e8]
mov dword [0x488cbc], eax
mov eax, dword [ebx + 0x40c]
mov dword [0x488ce0], eax
mov eax, dword [ebx + 0x3a4]
mov dword [0x488c78], eax
mov eax, dword [ebx + 0x3c8]
mov dword [0x488c9c], eax
mov eax, dword [ebx + 0x3ec]
mov dword [0x488cc0], eax
mov eax, dword [ebx + 0x410]
mov dword [0x488ce4], eax
mov eax, dword [ebx + 0x3a8]
mov dword [0x488c7c], eax
mov eax, dword [ebx + 0x3cc]
mov dword [0x488ca0], eax
mov eax, dword [ebx + 0x3f0]
mov dword [0x488cc4], eax
mov eax, dword [ebx + 0x414]
mov dword [0x488ce8], eax
mov eax, dword [ebx + 0x3ac]
mov dword [0x488c80], eax
mov eax, dword [ebx + 0x3d0]
mov dword [0x488ca4], eax
mov eax, dword [ebx + 0x3f4]
mov dword [0x488cc8], eax
mov eax, dword [ebx + 0x418]
mov dword [0x488c5c], edx
mov dword [0x488cec], eax
call fcn.0042f5de
mov ecx, eax
test ecx, ecx
je 0x407ca6
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x464], eax
mov byte [ebp - 4], 1
mov eax, dword [ebx + 0x374]
cmp eax, dword [ebx + 0x384]
je 0x407875
mov eax, dword [ebx + 0x364]
cmp dword [eax - 0xc], 0
jl 0x407cb0
movzx edi, word [eax]
push edi
push 0x472870
push 0x488d04
call fcn.00408490
add esp, 0xc
lea eax, [ebp - 0x488]
push eax
lea eax, [ebp - 0x470]
push eax
lea eax, [ebp - 0x4b0]
push eax
push dword [0x488d04]
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
mov edx, dword [ebp - 0x46c]
mov esi, dword [ebp - 0x470]
cmp edx, 2
ja 0x4076d2
jb 0x407605
test esi, esi
jae 0x4076d2
sub esi, dword [ebp - 0x488]
mov dword [ebp - 0x458], esi
sbb edx, dword [ebp - 0x484]
mov eax, edx
mov dword [ebp - 0x45c], str._C:__.1f_____.1f__.1f_MiB_
mov ecx, eax
and eax, 0x7fffffff
mov dword [ebp - 0x454], eax
and ecx, 0x80000000
fild qword [ebp - 0x458]
mov dword [ebp - 0x454], ecx
mov dword [ebp - 0x458], 0
fild qword [ebp - 0x458]
shrd esi, edx, 0xa
fchs
faddp st(1)
shr edx, 0xa
fstp qword [ebp - 0x458]
fld qword [ebp - 0x458]
mov eax, dword [ebp - 0x470]
mov ecx, dword [ebp - 0x46c]
mov dword [ebp - 0x458], eax
mov eax, ecx
and ecx, 0x7fffffff
and eax, 0x80000000
mov dword [ebp - 0x454], ecx
fild qword [ebp - 0x458]
mov dword [ebp - 0x454], eax
mov dword [ebp - 0x458], 0
fild qword [ebp - 0x458]
fchs
faddp st(1)
fstp qword [ebp - 0x458]
fdiv qword [ebp - 0x458]
mov eax, dword [ebp - 0x470]
mov ecx, dword [ebp - 0x46c]
shrd eax, ecx, 0xa
shr ecx, 0xa
jmp 0x40779a
sub esi, dword [ebp - 0x488]
mov dword [ebp - 0x458], esi
sbb edx, dword [ebp - 0x484]
mov eax, edx
mov dword [ebp - 0x45c], str._C:__.1f_____.1f__.1f_GiB_
mov ecx, eax
and eax, 0x7fffffff
mov dword [ebp - 0x454], eax
and ecx, 0x80000000
fild qword [ebp - 0x458]
mov dword [ebp - 0x454], ecx
mov dword [ebp - 0x458], 0
fild qword [ebp - 0x458]
shrd esi, edx, 0x14
fchs
faddp st(1)
shr edx, 0x14
fstp qword [ebp - 0x458]
fld qword [ebp - 0x458]
mov eax, dword [ebp - 0x470]
mov ecx, dword [ebp - 0x46c]
mov dword [ebp - 0x458], eax
mov eax, ecx
and ecx, 0x7fffffff
and eax, 0x80000000
mov dword [ebp - 0x454], ecx
fild qword [ebp - 0x458]
mov dword [ebp - 0x454], eax
mov dword [ebp - 0x458], 0
fild qword [ebp - 0x458]
fchs
faddp st(1)
fstp qword [ebp - 0x458]
fdiv qword [ebp - 0x458]
mov eax, dword [ebp - 0x470]
mov ecx, dword [ebp - 0x46c]
shrd eax, ecx, 0x14
shr ecx, 0x14
mov dword [ebp - 0x458], eax
sub esp, 0x18
mov eax, ecx
and ecx, 0x7fffffff
mov dword [ebp - 0x454], ecx
and eax, 0x80000000
fild qword [ebp - 0x458]
mov dword [ebp - 0x454], eax
mov eax, edx
mov dword [ebp - 0x458], 0
and edx, 0x7fffffff
and eax, 0x80000000
fild qword [ebp - 0x458]
fchs
faddp st(1)
fstp qword [ebp - 0x458]
fld qword [ebp - 0x458]
fld qword [0x47a958]
fmul st(1), st(0)
fxch st(1)
mov dword [ebp - 0x454], edx
mov dword [ebp - 0x458], esi
fstp qword [esp + 0x10]
fild qword [ebp - 0x458]
mov dword [ebp - 0x454], eax
lea eax, [ebx + 0x368]
mov dword [ebp - 0x458], 0
fild qword [ebp - 0x458]
fchs
faddp st(1)
fstp qword [ebp - 0x458]
fmul qword [ebp - 0x458]
fstp qword [esp + 8]
fmul qword [0x47a998]
fstp qword [esp]
push edi
push dword [ebp - 0x45c]
push eax
call fcn.00408490
add esp, 0x24
lea eax, [ebp - 0x464]
push edi
push str._c:_
push eax
call fcn.00408490
mov esi, dword [ebp - 0x478]
add esp, 0xc
jmp 0x407899
lea eax, [ebx + 0x36c]
push eax
lea ecx, [ebp - 0x464]
call fcn.004027d0
push 1
push 0x472bd4
lea ecx, [ebp - 0x464]
call fcn.00408320
mov ebx, dword [sym.imp.WINMM.dll_timeGetTime]
call ebx
mov edi, dword [ebp - 0x464]
push eax
push edi
push str._sCrystalDiskMark_08X
push 0x488b7c
mov dword [ebp - 0x454], edi
call fcn.00408490
add esp, 0x10
push 0
push dword [0x488b7c]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
call ebx
push eax
push dword [0x488b7c]
push str._sCrystalDiskMark_08X.tmp
push 0x488b78
call fcn.00408490
add esp, 0x10
lea eax, [ebp - 0x4a4]
push 0
push 0
push eax
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationW]
lea eax, [ebp - 0x450]
mov dword [ebp - 0x450], 0x114
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
lea eax, [ebp - 0x4a0]
push eax
lea eax, [ebp - 0x4b8]
push eax
lea eax, [ebp - 0x4c0]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
mov ecx, dword [ebp - 0x4a0]
mov eax, dword [ebp - 0x49c]
shrd ecx, eax, 0x14
shr eax, 0x14
cmp dword [0x488c5c], eax
jb 0x40798d
ja 0x40795c
cmp dword [0x488c58], ecx
jbe 0x40798d
mov ebx, dword [ebp - 0x460]
push 0
push 0
push dword [ebx + 0x47c]
call fcn.004374ef
mov dword [ebx + 0x234], 0
or ebx, 0xffffffff
mov dword [ebp - 0x45c], 0
jmp 0x407be2
call fcn.0042f5de
mov ecx, eax
test ecx, ecx
je 0x407cba
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x47c], eax
lea eax, [ebp - 0x47c]
mov byte [ebp - 4], 2
push str.Preparing..._Create_Test_File
push eax
call fcn.00408490
mov ebx, dword [ebp - 0x460]
lea eax, [ebp - 0x47c]
add esp, 8
push 0
push eax
push 0x9002
push dword [ebx + 0x20]
call dword [sym.imp.USER32.dll_PostMessageW]
push 0
push 0x28000080
push 2
push 0
push 0
push 0xc0000000
push dword [0x488b78]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edx, eax
mov dword [0x488b84], edx
push 0
push 0
cmp edx, 0xffffffff
jne 0x407a1e
push dword [ebx + 0x48c]
call fcn.004374ef
jmp 0x407c47
mov ecx, dword [0x488c58]
mov eax, dword [0x488c5c]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
shld eax, ecx, 0x14
push eax
shl ecx, 0x14
push ecx
push edx
call ebx
push dword [0x488b84]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
push 0
push 0
push 0
push dword [0x488b84]
call ebx
push 0
lea eax, [ebp - 0x490]
mov dword [ebp - 0x494], 0
push eax
push 0
push 0
push 2
lea eax, [ebp - 0x494]
mov dword [ebp - 0x490], 0
push eax
push 0x9c040
push dword [0x488b84]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov eax, dword [0x488c58]
push 4
push 0x3000
push 0x100000
push 0
mov dword [ebp - 0x474], eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x45c], eax
test eax, eax
jne 0x407ad2
push eax
push eax
push str.Failed_VirtualAlloc__.
call fcn.004374ef
mov ebx, dword [ebp - 0x460]
jmp 0x407c47
mov ebx, dword [ebp - 0x460]
cmp dword [ebx + 0x424], 1
jne 0x407af3
push 0x100000
push 0
push eax
call fcn.0044bb10
add esp, 0xc
jmp 0x407b2b
mov edi, dword [ebp - 0x45c]
xor ebx, ebx
jmp 0x407b00
call fcn.00450419
and eax, 0x800000ff
jns 0x407b13
dec eax
or eax, 0xffffff00
inc eax
mov byte [ebx + edi], al
inc ebx
cmp ebx, 0x100000
jl 0x407b00
mov edi, dword [ebp - 0x454]
mov ebx, dword [ebp - 0x460]
cmp dword [ebp - 0x474], 0
mov dword [ebp - 0x460], 0
jle 0x407b95
mov esi, dword [ebp - 0x45c]
mov edi, dword [ebp - 0x474]
lea ebx, [ebx]
cmp dword [ebx + 0x234], 0
je 0x407c21
push 0
lea eax, [ebp - 0x4a8]
push eax
push 0x100000
push esi
push dword [0x488b84]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x460]
inc eax
mov dword [ebp - 0x460], eax
cmp eax, edi
jl 0x407b50
mov esi, dword [ebp - 0x478]
mov edi, dword [ebp - 0x464]
push 0x8000
push 0
push dword [ebp - 0x45c]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push dword [0x488b84]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x45c], 1
mov byte [ebp - 4], 1
or ebx, 0xffffffff
mov edx, dword [ebp - 0x47c]
mov eax, ebx
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x407be2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x407bfd
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x407c19
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x45c]
jmp 0x407c7b
push dword [0x488b84]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov esi, dword [ebp - 0x478]
mov edi, dword [ebp - 0x464]
mov dword [ebx + 0x234], 0
mov dword [ebp - 0x45c], 0
jmp 0x407bbe
push 0
push 0
push dword [ebx + 0x490]
call fcn.004374ef
mov dword [ebx + 0x234], 0
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0044998e
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00403110
call fcn.00402ef0
push 0x80004005
call fcn.00403110
push 0x80070057
call fcn.00403110
push 0x80004005
call fcn.00403110
int3