Function at 0x439620
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x28
mov eax, dword [esp + 0x3c]
mov ebx, dword [esp + 0x4c]
mov esi, dword [esp + 0x40]
mov edx, dword [esp + 0x44]
add edx, esi
sub edx, ebx
mov dword [eax + 8], 0
mov dword [eax + 4], 0
mov dword [eax], 0
cmp edx, esi
jbe 0x4398fd
mov ecx, dword [esp + 0x50]
lea eax, [ebx - 1]
mov dword [esp + 0x24], eax
xor edi, edi
xor ebp, ebp
mov dword [esp], 0
mov dword [esp + 0x1c], edx
jmp 0x4396a9
mov esi, dword [esp + 0x20]
mov dword [eax + ebx], esi
add edx, 4
mov edi, dword [esp + 0x3c]
mov dword [edi + 4], edx
mov ebx, dword [esp + 0x4c]
add esi, ebx
dec esi
mov edi, edx
mov edx, dword [esp + 0x1c]
inc esi
mov ebp, eax
cmp esi, edx
jae 0x4398fd
mov dword [esp + 8], edi
test ecx, ecx
je 0x4396b6
cmp byte [ecx], 0x3f
je 0x4396c5
movzx eax, byte [esi]
mov edi, dword [esp + 0x48]
cmp al, byte [edi]
jne 0x439831
cmp ebx, 2
jb 0x439700
xor eax, eax
jmp 0x4396ee
movzx ecx, byte [esi + eax + 1]
mov edi, dword [esp + 0x48]
cmp cl, byte [edi + eax + 1]
mov ecx, dword [esp + 0x50]
jne 0x43982f
inc eax
cmp dword [esp + 0x24], eax
je 0x439700
test ecx, ecx
je 0x4396d0
cmp byte [ecx + eax + 1], 0x3f
jne 0x4396d0
jmp 0x4396e7
mov dword [esp + 0x20], esi
mov edi, dword [esp + 8]
mov esi, edi
sub esi, ebp
mov ebx, ebp
not ebx
mov eax, ebp
mov edx, edi
cmp edi, dword [esp]
jne 0x4398b4
mov dword [esp], ebp
mov ecx, esi
sar ecx, 2
lea eax, [ecx + 1]
mov edi, ecx
shr edi, 1
add edi, ecx
cmp edi, eax
ja 0x439734
mov edi, eax
lea eax, [edi*4]
push eax
call fcn.0040ca10
add esp, 4
mov ebp, dword [esp]
test ebp, ebp
je 0x439897
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], esi
mov edx, ebp
mov ecx, dword [esp + 8]
xor edx, ecx
mov dword [esp + 4], ebx
mov edi, ebx
and edi, ecx
add edi, edi
mov ebx, edi
sub ebx, edx
cmp eax, ebp
jbe 0x43983c
lea ecx, [ebx + ebp]
cmp ecx, eax
jbe 0x43983c
mov esi, eax
test ebx, ebx
je 0x43987d
mov eax, dword [esp]
add eax, ebx
dec eax
lea ecx, [esi + ebx]
dec ecx
mov ebp, ebx
and ebp, 7
je 0x4397ca
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], edx
neg ebp
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, byte [eax + edi]
mov byte [ecx + edi], dl
dec edi
cmp ebp, edi
jne 0x4397b0
add eax, edi
add ecx, edi
add ebx, edi
mov edx, dword [esp + 0xc]
mov edi, dword [esp + 0x10]
sub edx, edi
cmp edx, 0xfffffff8
ja 0x43987d
neg ebx
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
movzx edx, byte [eax + edi]
mov byte [ecx + edi], dl
movzx edx, byte [eax + edi - 1]
mov byte [ecx + edi - 1], dl
movzx edx, byte [eax + edi - 2]
mov byte [ecx + edi - 2], dl
movzx edx, byte [eax + edi - 3]
mov byte [ecx + edi - 3], dl
movzx edx, byte [eax + edi - 4]
mov byte [ecx + edi - 4], dl
movzx edx, byte [eax + edi - 5]
mov byte [ecx + edi - 5], dl
movzx edx, byte [eax + edi - 6]
mov byte [ecx + edi - 6], dl
movzx edx, byte [eax + edi - 7]
mov byte [ecx + edi - 7], dl
add edi, 0xfffffff8
cmp ebx, edi
jne 0x4397e0
jmp 0x43987d
add esi, eax
mov eax, ebp
mov edi, dword [esp + 8]
jmp 0x43969e
mov ecx, ebx
shr ecx, 2
mov esi, ebp
mov edx, eax
mov edi, eax
xchg esi, esi
rep movsd dword es:[edi], dword [esi]
xchg esi, esi
mov eax, ebx
and eax, 0xfffffffc
mov esi, edx
lea ecx, [edx + eax]
add eax, ebp
mov ebp, ecx
mov ecx, ebx
shr ecx, 1
and ecx, 1
mov edx, eax
mov edi, ebp
xchg esi, edx
rep movsw word es:[edi], word [esi]
xchg esi, edx
test bl, 1
je 0x43987d
and ebx, 2
movzx eax, byte [eax + ebx]
mov byte [ebp + ebx], al
mov ebp, dword [esp]
push ebp
call fcn.0040ca20
add esp, 4
mov eax, esi
mov ebx, dword [esp + 4]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x3c]
mov dword [ecx], eax
lea edx, [eax + esi]
mov dword [ecx + 4], edx
lea edi, [eax + edi*4]
mov dword [esp], edi
mov dword [ecx + 8], edi
mov ecx, dword [esp + 0x50]
mov edi, dword [esp + 8]
and ebx, edi
not edi
and ebp, edi
sub ebx, ebp
cmp ebx, esi
jae 0x439680
mov dword [esp + 4], ebx
mov ecx, dword [esp + 4]
lea ebx, [eax + ecx]
mov ecx, dword [esp + 4]
lea ebp, [eax + ecx]
add ebp, 4
mov esi, ebx
mov edi, ebp
xor ecx, ecx
xchg esi, esi
rep movsd dword es:[edi], dword [esi]
xchg esi, esi
mov edi, ebp
xor ecx, ecx
xchg esi, ebx
rep movsw word es:[edi], word [esi]
xchg esi, ebx
mov ebx, dword [esp + 4]
mov ecx, dword [esp + 0x50]
jmp 0x439680
mov eax, dword [esp + 0x3c]
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret