Function at 0x508d96
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0xee37e4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, edx
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
push esi
mov eax, dword [ebx + 0x30]
mov esi, dword [ebx + 0x10]
push edi
movzx edi, byte [ebx + 0x18]
mov dword [ebp - 0x18], eax
mov eax, esi
imul eax, edi
mov dword [ebp - 0x30], edi
mov edi, dword [ebx + 0x1c]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], edx
sub edi, eax
mov dword [ebp - 0x1c], ecx
xor eax, eax
mov dword [ebp - 0x38], edi
test ecx, ecx
je 0x508deb
mov esi, ecx
lea edi, [ebp - 0x14]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
jmp 0x508dfc
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebx + 0x14]
mov dword [ebp - 8], eax
xor eax, eax
mov dword [ebp - 0xc], esi
mov edx, dword [edx + 0x20]
mov ecx, dword [ebp - 0x2c]
push eax
push eax
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00509d70
mov esi, eax
add esp, 0x10
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x40], esi
mov edi, dword [esi + 0x30]
mov eax, dword [eax + 0x20]
mov ecx, dword [eax + 0xc]
cmp ecx, dword [esi + 0x10]
jne 0x508e39
mov ecx, dword [eax + 0x10]
cmp ecx, dword [esi + 0x14]
jne 0x508e39
xor eax, eax
and dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
jmp 0x508e3c
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x508e5c
mov ecx, dword [edx]
sub ecx, eax
movzx eax, byte [esi + 0x18]
imul ecx, eax
mov eax, dword [edx + 4]
sub eax, dword [ebp - 0x10]
imul eax, dword [esi + 0x1c]
add edi, eax
add edi, ecx
movzx eax, byte [esi + 0x18]
mov ecx, ebx
mov edx, dword [esi + 0x1c]
imul eax, dword [ecx + 0x10]
sub edx, eax
cmp dword [ecx + 0x10], 0
mov dword [ebp - 0x34], edx
je 0x508f38
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x508f38
mov esi, dword [ebp - 0x18]
mov edx, dword [ebp - 0x24]
dec eax
mov dword [ebp - 0x3c], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0x1c], eax
mov al, byte [edx + 0x14]
xor ecx, ecx
cmp byte [edi], cl
jne 0x508eb6
test al, al
je 0x508f13
lea ebx, [edx + 0x3c]
mov al, byte [ebx]
lea ebx, [ebx + 4]
mov byte [ecx + esi], al
inc ecx
movzx eax, byte [edx + 0x14]
cmp ecx, eax
jl 0x508ea3
jmp 0x508f13
mov dword [ebp - 0x18], ecx
test al, al
je 0x508f13
lea ebx, [edx + 0x3c]
mov dword [ebp - 0x20], ebx
movzx eax, byte [ecx + esi]
sub eax, dword [ebx]
movzx ecx, byte [edi]
imul eax, eax, 0xff
cdq
idiv ecx
mov edx, 0xff
mov ebx, eax
mov eax, dword [ebp - 0x20]
add ebx, dword [eax]
mov eax, edx
cmp ebx, edx
movzx ecx, bl
cmovl eax, ecx
xor edx, edx
test ebx, ebx
movzx ecx, al
mov ebx, dword [ebp - 0x20]
cmovg edx, ecx
mov ecx, dword [ebp - 0x18]
add ebx, 4
mov dword [ebp - 0x20], ebx
mov byte [ecx + esi], dl
inc ecx
mov edx, dword [ebp - 0x24]
mov dword [ebp - 0x18], ecx
movzx eax, byte [edx + 0x14]
cmp ecx, eax
jl 0x508ec3
add esi, dword [ebp - 0x30]
inc edi
sub dword [ebp - 0x1c], 1
jne 0x508e93
add edi, dword [ebp - 0x34]
add esi, dword [ebp - 0x38]
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x28]
test eax, eax
jne 0x508e86
mov esi, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x2c]
mov edx, esi
call fcn.00536bbd
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.006f3e28
leave
ret