Function at 0x401830
Capabilities:
Encode data using xor
Get system information on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x48
mov eax, dword [esp + 0x5c]
mov ebp, dword [eax + 0x3c]
cmp dword [eax + ebp], 0x4550
jne 0x401bdf
add ebp, eax
movzx eax, word [ebp + 4]
cmp eax, 0x14c
jne 0x401bdf
mov eax, dword [ebp + 0x38]
test al, 1
jne 0x401bdf
movzx ecx, word [ebp + 6]
test ecx, ecx
je 0x40188a
movzx edx, word [ebp + 0x14]
lea ebx, [edx + ebp]
add ebx, 0x18
cmp cx, 8
jae 0x401891
xor esi, esi
mov edx, ebx
xor edi, edi
jmp 0x401a94
xor esi, esi
jmp 0x401ab5
mov edx, ecx
and edx, 0xfffffff8
mov dword [esp], edx
lea edx, [edx*8]
lea edi, [edx + edx*4]
lea edx, [ebx + edi]
movd xmm0, eax
pshufd xmm0, xmm0, 0
movdqu xmmword [esp + 4], xmm0
add ebx, 0x128
xor esi, esi
pxor xmm1, xmm1
pxor xmm2, xmm2
nop word cs:[eax + eax]
movdqu xmmword [esp + 0x14], xmm1
movd xmm3, dword [ebx + esi - 0xa0]
movd xmm4, dword [ebx + esi - 0xc8]
punpckldq xmm4, xmm3
movd xmm3, dword [ebx + esi - 0xf0]
movd xmm5, dword [ebx + esi - 0x118]
punpckldq xmm5, xmm3
punpcklqdq xmm5, xmm4
movd xmm3, dword [ebx + esi]
movd xmm4, dword [ebx + esi - 0x28]
punpckldq xmm4, xmm3
movd xmm3, dword [ebx + esi - 0x50]
movd xmm6, dword [ebx + esi - 0x78]
punpckldq xmm6, xmm3
punpcklqdq xmm6, xmm4
movd xmm3, dword [ebx + esi - 0xa4]
movd xmm7, dword [ebx + esi - 0xcc]
punpckldq xmm7, xmm3
movd xmm3, dword [ebx + esi - 0xf4]
movd xmm4, dword [ebx + esi - 0x11c]
punpckldq xmm4, xmm3
punpcklqdq xmm4, xmm7
movd xmm3, dword [ebx + esi - 4]
movd xmm0, dword [ebx + esi - 0x2c]
punpckldq xmm0, xmm3
movd xmm7, dword [ebx + esi - 0x54]
movd xmm3, dword [ebx + esi - 0x7c]
punpckldq xmm3, xmm7
movdqa xmm7, xmm5
pxor xmm1, xmm1
pcmpeqd xmm7, xmm1
punpcklqdq xmm3, xmm0
movdqu xmm1, xmmword [esp + 4]
movdqa xmm0, xmm1
pand xmm0, xmm7
pandn xmm7, xmm5
por xmm7, xmm0
movdqa xmm5, xmm6
pcmpeqd xmm5, xmmword [0x4041f0]
paddd xmm7, xmm4
pand xmm1, xmm5
pandn xmm5, xmm6
por xmm5, xmm1
paddd xmm5, xmm3
movdqa xmm0, xmm7
movdqa xmm4, xmmword [0x4041e0]
pxor xmm0, xmm4
movdqu xmm1, xmmword [esp + 0x14]
movdqa xmm3, xmm1
pxor xmm3, xmm4
pcmpgtd xmm0, xmm3
pand xmm7, xmm0
pandn xmm0, xmm1
movdqa xmm1, xmm0
por xmm1, xmm7
movdqa xmm0, xmm5
pxor xmm0, xmm4
movdqa xmm3, xmm2
pxor xmm3, xmm4
pcmpgtd xmm0, xmm3
pand xmm5, xmm0
pandn xmm0, xmm2
movdqa xmm2, xmm0
por xmm2, xmm5
add esi, 0x140
cmp edi, esi
jne 0x4018d0
movdqa xmm0, xmm2
pxor xmm0, xmm4
movdqa xmm3, xmm1
pxor xmm3, xmm4
pcmpgtd xmm3, xmm0
pand xmm1, xmm3
pandn xmm3, xmm2
por xmm3, xmm1
pshufd xmm0, xmm3, 0xee
movdqa xmm1, xmm3
pxor xmm1, xmm4
movdqa xmm2, xmm0
pxor xmm2, xmm4
pcmpgtd xmm1, xmm2
pand xmm3, xmm1
pandn xmm1, xmm0
por xmm1, xmm3
pshufd xmm0, xmm1, 0x55
movdqa xmm2, xmm1
pxor xmm2, xmm4
pxor xmm4, xmm0
pcmpgtd xmm2, xmm4
pand xmm1, xmm2
pandn xmm2, xmm0
por xmm2, xmm1
movd esi, xmm2
mov edi, dword [esp]
cmp edi, ecx
je 0x401ab5
add edx, 0x10
sub ecx, edi
nop dword [eax]
mov edi, dword [edx]
test edi, edi
cmove edi, eax
add edi, dword [edx - 4]
cmp edi, esi
cmova esi, edi
add edx, 0x28
dec ecx
jne 0x401aa0
lea eax, [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_GetNativeSystemInfo]
mov eax, dword [esp + 0x28]
lea edi, [eax - 1]
add edi, dword [ebp + 0x50]
lea ecx, [eax + esi]
dec ecx
neg eax
and edi, eax
and eax, ecx
cmp edi, eax
jne 0x401bdf
push 4
push 0x3000
push edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
je 0x401bdf
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x30
push 8
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
je 0x401bd1
mov ebx, eax
mov dword [eax + 4], esi
mov dword [eax + 8], edi
movzx eax, word [ebp + 0x16]
shr eax, 0xd
and eax, 1
mov dword [ebx + 0x18], eax
mov eax, dword [esp + 0x28]
mov dword [ebx + 0x2c], eax
mov eax, dword [ebp + 0x54]
cmp eax, dword [esp + 0x60]
ja 0x401bc6
push eax
mov edi, dword [esp + 0x60]
push edi
push esi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov eax, dword [edi + 0x3c]
lea ecx, [esi + eax]
mov dword [ebx], ecx
mov dword [esi + eax + 0x34], esi
mov ecx, edi
mov edx, dword [esp + 0x60]
push ebx
push ebp
call fcn.00402140
add esp, 8
test eax, eax
je 0x401bc6
mov eax, dword [ebx]
mov edx, dword [eax + 0x34]
mov eax, 1
sub edx, dword [ebp + 0x34]
je 0x401b7d
mov ecx, ebx
call fcn.00402210
mov dword [ebx + 0x1c], eax
mov ecx, ebx
call fcn.004022a0
test eax, eax
je 0x401bc6
mov ecx, ebx
call fcn.00402400
test eax, eax
je 0x401bc6
mov ecx, ebx
call fcn.00402620
mov eax, dword [ebx]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x401be9
mov ecx, esi
add ecx, eax
cmp dword [ebx + 0x18], 0
je 0x401bf2
push dword [esp + 0x64]
push 1
push esi
call ecx
test eax, eax
je 0x401bc6
mov dword [ebx + 0x14], 1
jmp 0x401bf5
push ebx
call fcn.00402040
add esp, 4
jmp 0x401bdf
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
add esp, 0x48
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebx + 0x28], 0
jmp 0x401bf5
mov dword [ebx + 0x28], ecx
push ebx
call fcn.00402040
add esp, 4
mov al, 1
jmp 0x401be1