Function at 0x10040a4
Capabilities:
Generate random numbers via winapi
Get common file path
Get disk information
Get disk size

Disassembly:
push ebp
lea ebp, [esp - 0x524]
sub esp, 0x59c
mov eax, dword [0x100a028]
push ebx
mov dword [ebp + 0x520], eax
push edi
xor edi, edi
cmp byte [0x100a900], 0
lea eax, [ebp + 0x50c]
mov dword [ebp - 0x18], 0x5c3a63
mov byte [ebp - 0x1a], 0x63
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x5c], 0xc
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], edi
mov dword [ebp - 0x34], edi
mov ebx, 0x100a900
je 0x100410e
push edi
push edi
push ebx
call fcn.010039d3
test eax, eax
jne 0x1004508
mov byte [0x100a900], al
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x50]
push eax
call fcn.01003330
test eax, eax
jne 0x100412a
push 0xffffffffffffffff
jmp 0x1004502
push esi
push 1
lea eax, [ebp + 0x50c]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x10041c2
push 2
push 0x100
lea eax, [ebp + 0x3ec]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x10041c2
push dword [ebp - 0x50]
mov esi, dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
mov edi, 0x10000000
push edi
push 2
lea eax, [ebp + 0x3ec]
push eax
call esi
test eax, eax
je 0x10041c0
push dword [ebp - 0x30]
lea eax, [ebp + 0x3ec]
push edi
push 2
push eax
call esi
test eax, eax
je 0x10041c0
push dword [ebp - 0x20]
lea eax, [ebp + 0x3ec]
push edi
push 2
push eax
call esi
test eax, eax
je 0x10041c0
push 0
lea eax, [ebp + 0x3ec]
push eax
push 1
lea eax, [ebp + 0x50c]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x10041c0
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x34], eax
xor edi, edi
cmp dword [0x101ac60], edi
jne 0x10041e3
cmp dword [0x100a06c], edi
je 0x10041e3
push ebx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
jmp 0x100444c
push 0xffff
push 0x100ac60
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov al, byte [0x100ac60]
or al, 0x20
mov byte [ebp - 0x19], al
mov dword [ebp - 0x3c], edi
mov dword [ebp - 0x38], edi
mov byte [ebp - 0x18], 0x61
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
mov esi, eax
push 2
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
add esp, 0xc
push 0x400
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 0x1e], 0
call dword [sym.imp.KERNEL32.dll_QueryDosDeviceA]
cmp esi, 3
je 0x1004247
cmp esi, 6
jne 0x10042c4
cmp eax, edi
je 0x10042c4
lea eax, [ebp - 0x14]
push 0x10022f4
push eax
call dword [sym.imp.msvcrt.dll__strlwr]
pop ecx
push eax
call dword [sym.imp.msvcrt.dll_strstr]
test eax, eax
pop ecx
pop ecx
jne 0x10042c4
lea eax, [ebp - 0x18]
push eax
call fcn.01002553
test eax, eax
je 0x10042c4
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x44]
push eax
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
test eax, eax
je 0x10042c4
mov eax, dword [ebp - 0x4c]
imul eax, dword [ebp - 0x44]
mul dword [ebp - 0x48]
mov cl, byte [ebp - 0x18]
cmp cl, byte [ebp - 0x19]
mov esi, edx
jne 0x10042af
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], esi
jmp 0x10042c4
cmp esi, dword [ebp - 0x28]
jb 0x10042c4
ja 0x10042bb
cmp eax, dword [ebp - 0x2c]
jbe 0x10042c4
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], esi
mov byte [ebp - 0x1a], cl
inc byte [ebp - 0x18]
cmp byte [ebp - 0x18], 0x7a
jle 0x1004207
mov eax, dword [0x100a020]
cmp eax, 0xcab00eee
je 0x10042eb
xor ecx, ecx
cmp dword [ebp - 0x28], ecx
ja 0x100430b
jb 0x10042eb
cmp dword [ebp - 0x2c], eax
jae 0x100430b
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x28], eax
ja 0x100430b
jb 0x10042fd
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [ebp - 0x3c]
jae 0x100430b
mov ecx, dword [ebp - 0x3c]
mov dword [ebp - 0x28], eax
mov al, byte [ebp - 0x19]
mov dword [ebp - 0x2c], ecx
jmp 0x100430e
mov al, byte [ebp - 0x1a]
push 0xf0000000
push 1
push edi
mov byte [ebp - 0x18], al
push edi
lea eax, [ebp - 0x40]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
je 0x10043ee
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x20], edi
mov edi, dword [sym.imp.msvcrt.dll_sprintf]
lea eax, [ebp + 0x4ec]
push eax
push 0x10
push dword [ebp - 0x40]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
je 0x100439a
lea eax, [ebp - 0x18]
push eax
push 0x10022f0
push ebx
call edi
xor ecx, ecx
mov cl, byte [ebp + 0x4ec]
add esp, 0xc
push 0
pop esi
and ecx, 7
add ecx, 9
mov dword [ebp - 0x38], ecx
je 0x100439a
lea ebx, [eax + 0x100a900]
movzx eax, byte [ebp + esi + 0x4ec]
push eax
push 0x10022e8
push ebx
call edi
add esp, 0xc
inc esi
inc ebx
inc ebx
cmp esi, dword [ebp - 0x38]
jb 0x1004379
mov ebx, 0x100a900
cmp byte [0x100a900], 0
je 0x10043b9
xor esi, esi
inc esi
push esi
push dword [ebp - 0x34]
push ebx
call fcn.010039d3
test eax, eax
je 0x10043c0
mov dword [ebp - 0x24], esi
jmp 0x10043c0
mov dword [ebp - 0x30], 1
inc dword [ebp - 0x20]
cmp dword [ebp - 0x24], 0
jne 0x10043dc
cmp dword [ebp - 0x30], 0
jne 0x10043dc
cmp dword [ebp - 0x20], 0x2710
jb 0x1004338
push 0
push dword [ebp - 0x40]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
xor edi, edi
cmp dword [ebp - 0x24], edi
jne 0x100444c
push ebx
push 0x10022dc
lea eax, [ebp - 0x18]
push eax
call fcn.0100259f
mov esi, eax
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTime]
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0x78]
push eax
call dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
mov eax, dword [ebp - 0x64]
imul eax, dword [0x100a018]
push esi
and eax, 0xffff
push eax
call fcn.01002667
xor esi, esi
inc esi
push esi
push dword [ebp - 0x34]
push ebx
call fcn.010039d3
test eax, eax
jne 0x1004449
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
jmp 0x10041d2
mov dword [ebp - 0x24], esi
cmp dword [0x101ac60], edi
jne 0x10044ec
cmp dword [0x100a06c], edi
jne 0x1004476
mov eax, dword [0x100a018]
push 3
pop ecx
mul ecx
cmp dword [ebp - 0x28], edx
ja 0x10044ec
jb 0x1004476
cmp dword [ebp - 0x2c], eax
jae 0x10044ec
push edi
push 0x1003491
push dword [0x100a7a4]
push 0x6b
push dword [0x100a05c]
call dword [sym.imp.USER32.dll_DialogBoxParamA]
cmp eax, 0xffffffff
je 0x1004123
cmp eax, edi
je 0x10044e5
cmp byte [eax], 0
je 0x10044e5
mov ecx, eax
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x10044a7
sub ecx, esi
inc ecx
cmp ecx, 0x104
jae 0x1004500
mov edx, ebx
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x10044bd
xor esi, esi
push esi
push esi
push ebx
call fcn.010039d3
test eax, eax
je 0x10044dc
mov dword [ebp - 0x24], 1
cmp dword [ebp - 0x24], esi
jne 0x1004507
xor edi, edi
jmp 0x1004476
push 0x4c7
jmp 0x1004502
cmp dword [ebp - 0x24], edi
jne 0x1004507
push 1
push dword [ebp - 0x34]
push ebx
call fcn.010039d3
test eax, eax
jne 0x1004507
push 0x52
call fcn.01002fd0
pop esi
mov ecx, dword [ebp + 0x520]
pop edi
pop ebx
call fcn.0100515e
add ebp, 0x524
leave
ret