Function at 0x409840
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51e04d
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ebx
sub esp, 0x68
movaps xmm0, xmmword [0x545990]
movups xmmword [ebp - 0x41], xmm0
push esi
movaps xmm0, xmmword [0x542f90]
mov dword [ebp - 0x20], ecx
xor ecx, ecx
push edi
mov byte [ebp - 0x31], 0x94
movups xmmword [ebp - 0x30], xmm0
lea eax, [ecx - 0x15]
xor byte [ebp + ecx - 0x41], al
inc ecx
cmp ecx, 0x18
jb 0x409890
mov dword [0x558520], ecx
xorps xmm0, xmm0
lea ecx, [ebp - 0x41]
mov byte [ebp - 0x29], 0
movups xmmword [ebp - 0x74], xmm0
mov dword [ebp - 0x64], 0
lea edx, [ecx + 1]
mov dword [ebp - 0x60], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4098c2
sub ecx, edx
lea eax, [ebp - 0x41]
push ecx
push eax
lea ecx, [ebp - 0x74]
call fcn.00402b20
mov dword [ebp - 4], 0
lea esi, [ebp - 0x74]
cmp dword [ebp - 0x60], 0x10
movaps xmm0, xmmword [0x543ff0]
cmovae esi, dword [ebp - 0x74]
xor ecx, ecx
mov word [ebp - 0x32], 0x9885
movups xmmword [ebp - 0x30], xmm0
nop dword [eax]
lea eax, [ecx - 0x15]
xor byte [ebp + ecx - 0x32], al
inc ecx
cmp ecx, 9
jb 0x409900
mov dword [0x5585e0], ecx
xorps xmm0, xmm0
lea ecx, [ebp - 0x32]
mov byte [ebp - 0x29], 0
movups xmmword [ebp - 0x5c], xmm0
mov dword [ebp - 0x4c], 0
lea edx, [ecx + 1]
mov dword [ebp - 0x48], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x409932
sub ecx, edx
lea eax, [ebp - 0x32]
push ecx
push eax
lea ecx, [ebp - 0x5c]
call fcn.00402b20
cmp dword [ebp - 0x48], 0x10
lea eax, [ebp - 0x5c]
cmovae eax, dword [ebp - 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x14], eax
cmp ecx, 0x10
jb 0x409999
mov edx, dword [ebp - 0x5c]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40998f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409adc
push ecx
push edx
call fcn.004f7c11
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x60]
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0xf
mov byte [ebp - 0x5c], 0
cmp ecx, 0x10
jb 0x4099e6
mov edx, dword [ebp - 0x74]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4099dc
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409adc
push ecx
push edx
call fcn.004f7c11
add esp, 8
mov dword [ebp - 0x64], 0
xor edi, edi
mov dword [ebp - 0x60], 0xf
mov byte [ebp - 0x74], 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x409aa9
mov esi, dword [0x556474]
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
push esi
mov edi, eax
push edi
push 0x40
call dword [ebp - 0x14]
mov ecx, eax
mov eax, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 0x1c], ecx
cmp ecx, 0xc0000004
jne 0x409a71
push edi
mov edi, dword [ebp - 0x18]
push 0
push edi
call eax
add esi, esi
cmp esi, 0x10000000
ja 0x409a93
push esi
push 0
push edi
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
push esi
mov edi, eax
push edi
push 0x40
call dword [ebp - 0x14]
mov ecx, eax
mov dword [ebp - 0x1c], eax
mov eax, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp ecx, 0xc0000004
je 0x409a37
test ecx, ecx
jns 0x409aaf
push edi
push 0
push dword [ebp - 0x18]
call eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
or eax, 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
mov esi, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x20]
mov eax, dword [0x556474]
cmp esi, 0x200000
cmovbe eax, esi
mov dword [0x556474], eax
mov eax, dword [ebp - 0x20]
mov dword [eax], edi
mov eax, ecx
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.004fceb0
int3