Function at 0x406040
Capabilities:
Enumerate files on windows
Get disk information
Set registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x664
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x660], eax
push ebx
push esi
push edi
push 0x200
lea eax, [esp + 0x46c]
mov dword [esp + 0x10], 0xffffffff
push 0
push eax
call fcn.0040bf00
push 0x200
lea eax, [esp + 0x278]
push 0
push eax
call fcn.0040bf00
push 0x250
lea eax, [esp + 0x34]
push 0
push eax
call fcn.0040bf00
add esp, 0x24
mov dword [esp + 0x14], 0
lea eax, [esp + 0x468]
mov dword [esp + 0x10], 0
or esi, 0xffffffff
push eax
push 0xff
call dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsW]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea edi, [esp + 0x468]
xor eax, eax
mov dword [esp + 0x65e], eax
mov dword [esp + 0x662], eax
mov word [esp + 0x666], ax
cmp ax, word [esp + 0x468]
je 0x406334
nop word [eax + eax]
cmp dword [esp + 0xc], 0
je 0x406334
push edi
call dword [sym.imp.KERNEL32.dll_GetDriveTypeW]
cmp eax, 5
je 0x406326
push 0xff
lea eax, [esp + 0x26c]
push edi
push eax
call fcn.0040e084
xor eax, eax
push 0xff
mov word [esp + 0x476], ax
lea eax, [esp + 0x278]
push 0x42e420
push eax
call fcn.0040de40
xor eax, eax
add esp, 0x18
mov word [esp + 0x466], ax
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x26c]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x406326
nop word [eax + eax]
test dword [esp + 0x18], 0x10
je 0x4061a0
lea eax, [esp + 0x44]
push str.Wegame
push eax
call fcn.0040df83
add esp, 8
test eax, eax
je 0x4061b5
lea eax, [esp + 0x18]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x406180
jmp 0x40631c
xor eax, eax
push 0xff
mov word [esp + 0x284], ax
lea eax, [esp + 0x26c]
push str.Wegame
push eax
call fcn.0040de40
add esp, 0xc
lea eax, [esp + 0x14]
push eax
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x40631c
lea eax, [esp + 0x10]
push eax
push str.App_Paths
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40621d
push eax
call ebx
mov dword [esp + 0x10], 0
lea eax, [esp + 0x10]
push eax
push str.App_PathsWeGame.exe
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyW]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x406244
push eax
call ebx
mov dword [esp + 0x10], 0
lea eax, [esp + 0x10]
push eax
push str.App_PathsWeGame.exe
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x40630e
lea ecx, [esp + 0x268]
lea edx, [ecx + 2]
nop word [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406270
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
lea eax, [esp + 0x26c]
push eax
push 1
push str.InstallPath
push 0
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_RegSetKeyValueW]
push 0xff
lea eax, [esp + 0x26c]
push str.wegame.exe
push eax
call fcn.0040de40
lea eax, [esp + 0x274]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4062c6
sub eax, edx
sar eax, 1
lea eax, [eax*2 + 2]
push eax
lea eax, [esp + 0x26c]
push eax
push 1
push str.ExeFile
push 0
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_RegSetKeyValueW]
push dword [esp + 0x10]
call ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
push dword [esp + 0x14]
call ebx
mov dword [esp + 0x14], 0
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
or esi, 0xffffffff
add edi, 8
xor eax, eax
cmp ax, word [edi]
jne 0x406100
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40633f
push eax
call ebx
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x40634a
push ecx
call ebx
cmp esi, 0xffffffff
je 0x406356
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [esp + 0x66c]
mov eax, dword [esp + 0xc]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040a851
mov esp, ebp
pop ebp
ret