Function at 0x513880
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x64
mov ecx, dword [0x58eee8]
shl ecx, 4
mov eax, 0x2aaaaaab
imul ecx
push ebx
push ebp
sar edx, 4
push esi
mov esi, edx
shr esi, 0x1f
add esi, edx
mov eax, esi
cdq
and edx, 3
add eax, edx
mov ebx, eax
lea eax, [esi + 0xf]
cdq
push edi
and edx, 0xf
add eax, edx
mov edi, eax
sar edi, 4
add edi, edi
mov ebp, edi
imul ebp, esi
sar ebx, 2
push ebp
mov dword [esp + 0x24], ebx
call fcn.004a47b0
push ebp
push 0
push eax
mov dword [esp + 0x24], eax
call fcn.00549ff0
add esp, 0xc
test esi, esi
jle 0x51390c
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x14], esi
lea esp, [esp]
test edi, edi
jle 0x513903
push edi
push 0xff
push ebp
call fcn.00549ff0
add esp, 0xc
add ebp, edi
sub dword [esp + 0x14], 1
jne 0x5138f0
mov eax, ebx
cdq
sub eax, edx
mov ecx, eax
mov eax, esi
cdq
sub eax, edx
sar ecx, 1
sar eax, 1
test ebx, ebx
lea eax, [eax + ecx - 1]
mov dword [esp + 0x28], eax
mov ebp, eax
mov eax, 1
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x10], eax
jle 0x5139b6
mov eax, ebp
mov edx, edi
neg edx
sub eax, ecx
imul eax, edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], ebx
mov edi, edi
cmp dword [esp + 0x10], 0
jle 0x51399c
mov eax, ebp
and eax, 0x80000007
jns 0x513965
dec eax
or eax, 0xfffffff8
inc eax
mov ecx, 7
sub ecx, eax
mov eax, ebp
cdq
and edx, 7
add eax, edx
sar eax, 3
add eax, dword [esp + 0x14]
mov bl, 1
shl bl, cl
add eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
xor byte [eax], bl
add eax, edi
sub ecx, 1
jne 0x513987
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
add dword [esp + 0x10], 2
add eax, edx
sub ebp, 1
sub dword [esp + 0x1c], 1
mov dword [esp + 0x14], eax
jne 0x513950
mov eax, 1
mov dword [esp + 0x50], edi
mov edi, dword [esp + 0x18]
lea ecx, [esp + 0x44]
push ecx
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], esi
mov word [esp + 0x58], ax
mov dword [esp + 0x5c], edi
mov word [esp + 0x5a], ax
call dword [sym.imp.GDI32.dll_CreateBitmapIndirect]
push edi
mov dword [esp + 0x28], eax
call fcn.004a4810
mov edi, esi
imul edi, esi
add edi, edi
add edi, edi
push edi
call fcn.004a47b0
push edi
mov ebp, eax
push 0
push ebp
call fcn.00549ff0
add esp, 0xc
push 0x12
call dword [sym.imp.USER32.dll_GetSysColor]
mov edi, dword [esp + 0x28]
movzx ecx, al
or ecx, 0xffffff00
movzx edx, ah
shl ecx, 8
shr eax, 0x10
or ecx, edx
movzx eax, al
shl ecx, 8
or ecx, eax
test ebx, ebx
mov dword [esp + 0x10], 1
jle 0x513a97
mov edx, edi
sub edx, dword [esp + 0x2c]
mov eax, esi
neg eax
imul edx, esi
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], ebx
cmp dword [esp + 0x10], 0
jle 0x513a86
mov ebx, dword [esp + 0x10]
lea eax, [edx + edi]
lea eax, [ebp + eax*4]
mov dword [esp + 0x1c], ebx
lea ecx, [ecx]
lea ebx, [esi*4]
mov dword [eax], ecx
add eax, ebx
sub dword [esp + 0x1c], 1
jne 0x513a70
mov eax, dword [esp + 0x28]
add dword [esp + 0x10], 2
sub edi, 1
add edx, eax
sub dword [esp + 0x18], 1
jne 0x513a57
lea edx, [esp + 0x5c]
lea ecx, [esi*4]
push edx
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], esi
mov dword [esp + 0x6c], ecx
mov word [esp + 0x70], 1
mov dword [esp + 0x74], ebp
mov word [esp + 0x72], 0x20
call dword [sym.imp.GDI32.dll_CreateBitmapIndirect]
push ebp
mov esi, eax
call fcn.004a4810
mov ebx, dword [esp + 0x24]
xor eax, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x34], 1
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], esi
call dword [sym.imp.USER32.dll_CreateIconIndirect]
push esi
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
mov edi, eax
call esi
push ebx
call esi
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x64
ret