Function at 0x40f540
Capabilities:
Check os version
Query environment variable

Disassembly:
push 0xffffffffffffffff
push 0x4aebe2
mov eax, dword fs:[0]
push eax
sub esp, 0x5d4
mov eax, dword [0x4df5dc]
xor eax, esp
mov dword [esp + 0x5cc], eax
push ebx
push esi
push edi
mov eax, dword [0x4df5dc]
xor eax, esp
push eax
lea eax, [esp + 0x5e4]
mov dword fs:[0], eax
mov edi, edx
mov esi, ecx
mov dword [esp + 0x14], 0
mov ecx, dword [0x4e28d0]
mov dword [esp + 0x30], esi
test cl, 1
jne 0x40f5e4
or ecx, 1
mov dword [0x4e28d0], ecx
mov dword [esp + 0x5ec], 1
push 0x18
mov dword [0x4e28d4], 0
call fcn.0048e0a6
add esp, 4
mov dword [0x4e28d4], eax
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x4bd9a0
call fcn.0048e01f
add esp, 4
mov byte [esp + 0x5ec], 0
mov ecx, dword [0x4e28d0]
mov eax, dword [0x4e28d4]
mov dword [esp + 0x50], 0x4e28d4
test eax, eax
je 0x40f602
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x4e28d0]
mov dword [esp + 0x5ec], 2
test cl, 2
jne 0x40f654
or ecx, 2
mov dword [0x4e28d0], ecx
mov byte [esp + 0x5ec], 3
xor eax, eax
push 0x4bd940
mov dword [0x4e28cc], 7
mov dword [0x4e28c8], 0
mov word [0x4e28b8], ax
call fcn.0048e01f
add esp, 4
mov byte [esp + 0x5ec], 2
cmp dword [0x4e28c8], 0
je 0x40f6bb
mov ecx, 0x4e28b8
call fcn.00434640
test al, al
jne 0x40f675
mov ecx, 0x4e28b8
call fcn.00434840
xor eax, eax
mov dword [esi + 0x14], 7
push 0xffffffffffffffff
push eax
mov dword [esi + 0x10], 0
mov ecx, esi
push 0x4e28b8
mov word [esi], ax
call fcn.00402030
mov dword [esp + 0x14], 1
mov byte [esp + 0x5ec], 0
mov ecx, dword [0x4e28d4]
test ecx, ecx
je 0x40fd73
push ecx
jmp 0x40fd6d
xor eax, eax
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], 0
mov word [esp + 0x34], ax
mov byte [esp + 0x5ec], 4
lea ecx, [esp + 0x4c]
mov dword [esp + 0x4c], eax
call fcn.0041eb80
mov byte [esp + 0x5ec], 5
call fcn.00402c80
test al, al
je 0x40f71a
call fcn.0041f0e0
test al, al
jne 0x40f71a
lea ecx, [esp + 0x4c]
call fcn.0041ee70
xor eax, eax
push 0x40e
push eax
mov word [esp + 0x1d4], ax
lea eax, [esp + 0x1d6]
push eax
call fcn.00492dc0
add esp, 0xc
mov dword [esp + 0xb4], 0x114
lea eax, [esp + 0xb8]
push 0x110
push 0
push eax
call fcn.00492dc0
add esp, 0xc
lea eax, [esp + 0xb4]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x40f78c
cmp dword [esp + 0xb8], 6
jb 0x40f78c
push 0x208
lea eax, [esp + 0x1d0]
push eax
push 0x4c5930
jmp 0x40f79e
push 0x208
lea eax, [esp + 0x1d0]
push eax
push str._ALLUSERSPROFILE_Application_Data
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
setne bl
cmp word [esp + 0x1cc], 0
jne 0x40f7b8
xor ecx, ecx
jmp 0x40f7d1
lea ecx, [esp + 0x1cc]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f7c2
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [esp + 0x1d0]
push eax
lea ecx, [esp + 0x3c]
call fcn.004024f0
test bl, bl
jne 0x40f802
cmp dword [esp + 0x48], 8
lea eax, [esp + 0x34]
mov dword [esp + 0x44], 0
cmovae eax, dword [esp + 0x34]
xor ecx, ecx
mov word [eax], cx
cmp dword [esp + 0x44], 0
je 0x40f83d
mov edx, 0x10
lea ecx, [esp + 0x34]
call fcn.00433790
push 0x13
push str.2345PackStatService
lea ecx, [esp + 0x3c]
call fcn.0040a280
push 0x5c
push 1
lea ecx, [esp + 0x3c]
call fcn.00407330
lea ecx, [esp + 0x34]
call fcn.00434840
lea ecx, [esp + 0x34]
call fcn.00434640
test al, al
je 0x40f883
lea ecx, [esp + 0x34]
call fcn.0040f340
test al, al
je 0x40f883
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x3c]
mov ecx, 0x4e28b8
push eax
call fcn.00402030
lea eax, [esp + 0x34]
mov ecx, esi
push eax
call fcn.00404d30
mov dword [esp + 0x14], 1
jmp 0x40fd1d
xor eax, eax
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x80], 7
mov dword [esp + 0x7c], 0
mov word [esp + 0x6c], ax
mov byte [esp + 0x5ec], 6
cmp dword [edi + 0x10], eax
jne 0x40f94d
lea ecx, [esp + 0x18]
call fcn.0040f190
mov edi, eax
mov byte [esp + 0x5ec], 7
lea eax, [esp + 0x6c]
cmp eax, edi
je 0x40f919
cmp dword [esp + 0x80], 8
jb 0x40f8f2
push dword [esp + 0x6c]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x80], 7
push edi
lea ecx, [esp + 0x70]
mov dword [esp + 0x80], 0
mov word [esp + 0x70], ax
call fcn.004056b0
mov byte [esp + 0x5ec], 6
cmp dword [esp + 0x2c], 8
jb 0x40f934
push dword [esp + 0x18]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x2c], 7
mov dword [esp + 0x28], 0
mov word [esp + 0x18], ax
jmp 0x40f9bc
cmp dword [edi + 0x14], 8
jb 0x40f955
mov edi, dword [edi]
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov edx, eax
lea ecx, [esp + 0x54]
call fcn.00431b70
mov byte [esp + 0x5ec], 8
lea edx, [esp + 0x6c]
lea ecx, [esp + 0x54]
call fcn.00433e40
mov edx, 0x10
lea ecx, [esp + 0x6c]
call fcn.00433790
mov byte [esp + 0x5ec], 6
cmp dword [esp + 0x68], 8
jb 0x40f9a5
push dword [esp + 0x54]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x68], 7
mov dword [esp + 0x64], 0
mov word [esp + 0x54], ax
push str.config
lea edx, [esp + 0x70]
lea ecx, [esp + 0x88]
call fcn.0040a460
add esp, 4
mov byte [esp + 0x5ec], 9
lea ecx, [esp + 0x84]
push 0x5c
push 1
call fcn.00407330
lea ecx, [esp + 0x84]
call fcn.00434640
test al, al
jne 0x40fa08
lea ecx, [esp + 0x84]
call fcn.00442ff0
lea ecx, [esp + 0x84]
call fcn.00434640
test al, al
je 0x40fb6e
push str.2345packStatData.cst
lea ecx, [esp + 0x1c]
call fcn.00401e30
mov byte [esp + 0x5ec], 0xa
lea eax, [esp + 0x18]
push eax
lea edx, [esp + 0x88]
lea ecx, [esp + 0x58]
call fcn.00433910
add esp, 4
mov byte [esp + 0x5ec], 0xc
cmp dword [esp + 0x2c], 8
jb 0x40fa65
push dword [esp + 0x18]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x2c], 7
lea ecx, [esp + 0x84]
mov dword [esp + 0x28], 0
mov word [esp + 0x18], ax
call fcn.0040f340
test al, al
je 0x40fb3c
lea ecx, [esp + 0x54]
call fcn.00410000
test al, al
je 0x40fb3c
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x8c]
mov ecx, 0x4e28b8
push eax
call fcn.00402030
lea eax, [esp + 0x84]
mov ecx, esi
push eax
call fcn.00404d30
mov dword [esp + 0x14], 1
mov byte [esp + 0x5ec], 9
lea ecx, [esp + 0x54]
call fcn.00401e90
mov byte [esp + 0x5ec], 6
lea ecx, [esp + 0x84]
call fcn.00401e90
mov byte [esp + 0x5ec], 5
lea ecx, [esp + 0x6c]
call fcn.00401e90
mov byte [esp + 0x5ec], 4
lea ecx, [esp + 0x4c]
call fcn.0041efe0
mov byte [esp + 0x5ec], 2
lea ecx, [esp + 0x34]
call fcn.00401e90
mov byte [esp + 0x5ec], 0
lea ecx, [esp + 0x50]
call fcn.00402d20
jmp 0x40fd7b
mov byte [esp + 0x5ec], 9
cmp dword [esp + 0x68], 8
jb 0x40fb57
push dword [esp + 0x54]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x68], 7
mov dword [esp + 0x64], 0
mov word [esp + 0x54], ax
lea ecx, [esp + 0x34]
call fcn.00434640
test al, al
jne 0x40fb84
lea ecx, [esp + 0x34]
call fcn.00434840
lea ecx, [esp + 0x34]
call fcn.0040f340
test al, al
jne 0x40fba2
lea eax, [esp + 0x34]
push eax
call fcn.0041f210
mov ecx, eax
call fcn.0041f9b0
lea ecx, [esp + 0x34]
call fcn.00434640
test al, al
je 0x40fc90
push 0x4c59e0
lea edx, [esp + 0x88]
lea ecx, [esp + 0xa0]
call fcn.0040a460
add esp, 4
mov byte [esp + 0x5ec], 0xd
xorps xmm0, xmm0
movq qword [esp + 0x54], xmm0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
mov byte [esp + 0x5ec], 0xe
lea eax, [esp + 0x9c]
push eax
lea ecx, [esp + 0x58]
call fcn.0040a030
push 0x4c4fb4
lea ecx, [esp + 0x1c]
call fcn.00401e30
mov byte [esp + 0x5ec], 0xf
sub esp, 8
lea eax, [esp + 0x20]
lea edx, [esp + 0x5c]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.0040ef00
add esp, 0x10
mov byte [esp + 0x5ec], 0xe
lea ecx, [esp + 0x18]
call fcn.00401e90
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x3c]
mov ecx, 0x4e28b8
push eax
call fcn.00402030
mov byte [esp + 0x5ec], 0xd
lea ecx, [esp + 0x54]
call fcn.00409ff0
mov byte [esp + 0x5ec], 9
lea ecx, [esp + 0x9c]
call fcn.00401e90
lea eax, [esp + 0x34]
mov ecx, esi
push eax
call fcn.00404d30
mov dword [esp + 0x14], 1
mov byte [esp + 0x5ec], 6
cmp dword [esp + 0x98], 8
jb 0x40fcc5
push dword [esp + 0x84]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x98], 7
mov dword [esp + 0x94], 0
mov word [esp + 0x84], ax
mov byte [esp + 0x5ec], 5
cmp dword [esp + 0x80], 8
jb 0x40fd03
push dword [esp + 0x6c]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x80], 7
mov dword [esp + 0x7c], 0
mov word [esp + 0x6c], ax
mov byte [esp + 0x5ec], 4
lea ecx, [esp + 0x4c]
call fcn.0041efe0
mov byte [esp + 0x5ec], 2
cmp dword [esp + 0x48], 8
jb 0x40fd49
push dword [esp + 0x34]
call fcn.0048e056
add esp, 4
xor eax, eax
mov dword [esp + 0x48], 7
mov dword [esp + 0x44], eax
mov word [esp + 0x34], ax
mov byte [esp + 0x5ec], al
mov eax, dword [0x4e28d4]
test eax, eax
je 0x40fd73
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0x50], 0
mov eax, esi
mov ecx, dword [esp + 0x5e4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x5cc]
xor ecx, esp
call fcn.0048d894
add esp, 0x5e0
ret