Function at 0x502288
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffadc
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x524], ebx
mov dword [ebp - 0x520], ebx
mov dword [ebp - 0x51c], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov ebx, edx
test ebx, ebx
js 0x5022be
shr ebx, 2
mov esi, dword [eax + ebx*4]
dec ebx
push esi
jns 0x5022b7
mov eax, esp
mov dword [ebp - 0xc], ecx
mov ebx, eax
xor eax, eax
push ebp
push 0x50251d
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0xc]
call fcn.004072fc
lea eax, [ebp - 0x118]
xor ecx, ecx
mov edx, pe_nt_image_headers32
call fcn.00404e10
lea eax, [ebp - 0x318]
xor ecx, ecx
mov edx, 0x200
call fcn.00404e10
lea eax, [ebp - 0x518]
xor ecx, ecx
mov edx, 0x200
call fcn.00404e10
movzx eax, byte [ebx + 0x42]
mov ecx, 6
xor edx, edx
div ecx
and eax, 1
mov dword [ebp - 0x18], eax
mov edi, 0x10
lea eax, [ebx + 0x34]
lea edx, [ebp - 0x118]
movzx ecx, byte [eax]
mov byte [edx], cl
inc edx
inc eax
dec edi
jne 0x502332
movzx eax, byte [ebx + 0x42]
and al, 0xf7
movzx edx, byte [ebp - 0x18]
and dl, 2
add edx, edx
add edx, edx
or al, dl
mov byte [ebp - 0x10a], al
mov edi, 0x18
xor esi, esi
mov dword [ebp - 0x10], 0xfffffff1
lea ebx, [ebp - 0x10a]
shl esi, 8
movzx eax, byte [ebx]
cdq
xor eax, edx
sub eax, edx
or esi, eax
mov eax, esi
mov ecx, 0x18
cdq
idiv ecx
mov byte [ebx], al
mov ecx, 0x18
mov eax, esi
cdq
idiv ecx
mov esi, edx
dec ebx
inc dword [ebp - 0x10]
jne 0x502369
movzx eax, word [esi*2 + 0x5103d8]
mov word [ebp + edi*2 - 0x318], ax
mov dword [ebp - 0x14], esi
dec edi
test edi, edi
jge 0x50235a
lea eax, [ebp - 8]
lea edx, [ebp - 0x318]
mov ecx, pe_nt_image_headers32
call fcn.00407eb4
cmp dword [ebp - 0x18], 0
je 0x50249d
lea edx, [ebp - 0x318]
lea eax, [ebp - 0x518]
call fcn.0041d9d4
lea eax, [ebp - 4]
lea edx, [ebp - 0x518]
mov ecx, pe_nt_image_headers32
call fcn.00407eb4
cmp dword [ebp - 0x14], 0
jle 0x502447
lea eax, [ebp - 8]
push eax
mov ecx, dword [ebp - 0x14]
mov edx, 2
mov eax, dword [ebp - 4]
call fcn.004081d4
lea eax, [ebp - 8]
mov edx, 0x502548
call fcn.0040800c
mov ebx, dword [ebp - 4]
test ebx, ebx
je 0x502420
sub ebx, 4
mov ebx, dword [ebx]
lea eax, [ebp - 0x51c]
push eax
mov edx, dword [ebp - 0x14]
add edx, 2
mov ecx, ebx
mov eax, dword [ebp - 4]
call fcn.004081d4
mov edx, dword [ebp - 0x51c]
lea eax, [ebp - 8]
call fcn.0040800c
jmp 0x50249d
cmp dword [ebp - 0x14], 0
jne 0x50249d
lea eax, [ebp - 8]
lea edx, [ebp - 0x318]
mov ecx, pe_nt_image_headers32
call fcn.00407eb4
lea eax, [ebp - 8]
mov edx, 0x502548
call fcn.0040800c
mov ebx, dword [ebp - 4]
test ebx, ebx
je 0x502479
sub ebx, 4
mov ebx, dword [ebx]
lea eax, [ebp - 0x520]
push eax
mov ecx, ebx
mov edx, 2
mov eax, dword [ebp - 4]
call fcn.004081d4
mov edx, dword [ebp - 0x520]
lea eax, [ebp - 8]
call fcn.0040800c
xor edi, edi
mov eax, edi
mov ecx, 5
cdq
idiv ecx
test edx, edx
jne 0x5024c6
test edi, edi
jle 0x5024c6
cmp edi, 0x19
jge 0x5024c6
mov eax, dword [ebp - 0xc]
mov edx, 0x502558
call fcn.0040800c
mov eax, dword [ebp - 0xc]
lea eax, [ebp - 0x524]
mov edx, dword [ebp - 8]
movzx edx, word [edx + edi*2]
call fcn.00407e38
mov edx, dword [ebp - 0x524]
mov eax, dword [ebp - 0xc]
call fcn.0040800c
mov eax, dword [ebp - 0xc]
inc edi
cmp edi, 0x100
jne 0x50249f
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x502524
lea eax, [ebp - 0x524]
mov edx, 3
call fcn.0040735c
lea eax, [ebp - 8]
mov edx, 2
call fcn.0040735c
ret