Function at 0x423067
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x10
xor edx, edx
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov edi, dword [esp + 0x24]
mov eax, dword [esi + 0x79c]
xor ecx, ecx
xor ebx, ebx
mov ebp, dword [eax + 4]
mov cx, word [eax + 2]
mov eax, dword [edi + 0x20]
div ecx
xor edx, edx
mov ecx, eax
mov eax, dword [edi + 0x24]
div ecx
mov dword [edi + 0x20], ecx
mov bl, byte [ebp + 1]
cmp eax, ebx
jge 0x42337e
mov ecx, dword [esi + 0x79c]
xor edx, edx
lea eax, [ebx + ebx]
mov dx, word [ecx + 2]
cmp eax, edx
mov edx, dword [esi + 0x7b4]
setg al
mov byte [esi + 0xbc2], al
and eax, 0xff
add edx, eax
mov dword [esi + 0x7b4], edx
mov ecx, dword [ecx + 4]
mov eax, dword [edi + 0x20]
xor edx, edx
mov dl, byte [ecx + 1]
mov ecx, edx
imul eax, ecx
cmp eax, 0x1000000
mov dword [edi + 0x20], eax
jae 0x423132
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 0x14]
cmp eax, ecx
jb 0x4230ff
mov ecx, edi
call fcn.00409fc6
test al, al
jne 0x4230ff
mov byte [esp + 0x24], 0xff
jmp 0x42310c
mov eax, dword [edi + 0x10]
mov cl, byte [eax]
inc eax
mov byte [esp + 0x24], cl
mov dword [edi + 0x10], eax
mov edx, dword [edi + 0x24]
mov eax, dword [esp + 0x24]
mov ecx, dword [edi + 0x20]
and eax, 0xff
shl edx, 8
shl ecx, 8
or edx, eax
mov eax, ecx
cmp eax, 0x1000000
mov dword [edi + 0x24], edx
mov dword [edi + 0x20], ecx
jb 0x4230e3
mov edx, 4
mov dword [esi + 0x7a4], ebp
add ebx, edx
mov byte [ebp + 1], bl
mov eax, dword [esi + 0x79c]
add word [eax + 2], dx
cmp ebx, 0x7c
jle 0x423405
mov ecx, dword [esi + 0x79c]
mov eax, dword [esi + 0x7a4]
xor ebp, ebp
mov bp, word [ecx]
mov edi, dword [ecx + 4]
mov dword [esp + 0x10], ebp
dec ebp
cmp eax, edi
mov dword [esp + 0x24], ebp
je 0x4231bd
lea ecx, [eax - 6]
mov edx, eax
mov ebx, eax
sub eax, 6
mov edi, dword [edx]
mov dx, word [edx + 4]
mov word [esp + 0x1c], dx
mov edx, ecx
mov ebp, dword [edx]
mov dword [ebx], ebp
mov dx, word [edx + 4]
mov word [ebx + 4], dx
mov edx, ecx
sub ecx, 6
mov dword [edx], edi
mov di, word [esp + 0x1c]
mov word [edx + 4], di
mov edx, dword [esi + 0x79c]
cmp eax, dword [edx + 4]
jne 0x423179
mov ebp, dword [esp + 0x24]
mov edx, 4
mov ecx, dword [esi + 0x79c]
xor edi, edi
mov ecx, dword [ecx + 4]
mov bl, byte [ecx + 1]
add bl, dl
mov byte [ecx + 1], bl
mov ecx, dword [esi + 0x79c]
xor ebx, ebx
add word [ecx + 2], dx
mov edx, dword [esi + 0x79c]
xor ecx, ecx
mov di, word [edx + 2]
mov cl, byte [eax + 1]
sub edi, ecx
mov ecx, dword [esi + 0x7b0]
test ecx, ecx
setne bl
xor ecx, ecx
mov dword [esp + 0x14], ebx
mov cl, byte [eax + 1]
add ecx, ebx
sar ecx, 1
xor dx, dx
mov byte [eax + 1], cl
mov dl, cl
mov ecx, dword [esi + 0x79c]
mov word [ecx + 2], dx
add eax, 6
xor ecx, ecx
mov cl, byte [eax + 1]
sub edi, ecx
add ecx, ebx
sar ecx, 1
mov byte [eax + 1], cl
mov edx, dword [esi + 0x79c]
movzx cx, cl
add word [edx + 2], cx
mov dl, byte [eax + 1]
cmp dl, byte [eax - 5]
jbe 0x423292
mov edx, eax
mov ecx, eax
mov ebx, dword [edx]
mov dword [esp + 0x18], ebx
mov dx, word [edx + 4]
mov word [esp + 0x1c], dx
lea edx, [ecx - 6]
mov ebx, ecx
sub ecx, 6
mov ebp, dword [edx]
mov dword [ebx], ebp
mov dx, word [edx + 4]
mov word [ebx + 4], dx
mov edx, dword [esi + 0x79c]
cmp ecx, dword [edx + 4]
je 0x42327b
mov dl, byte [esp + 0x19]
mov bl, byte [ecx - 5]
cmp dl, bl
ja 0x423251
mov edx, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x24]
mov dword [ecx], edx
mov dx, word [esp + 0x1c]
mov word [ecx + 4], dx
dec ebp
mov dword [esp + 0x24], ebp
jne 0x423217
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x423324
mov cl, byte [eax - 6]
sub eax, 6
inc ebp
test cl, cl
je 0x4232a5
mov eax, dword [esi + 0x79c]
add edi, ebp
sub word [eax], bp
mov eax, dword [esi + 0x79c]
cmp word [eax], 1
jne 0x423324
mov eax, dword [eax + 4]
mov ecx, eax
mov edx, dword [ecx]
mov dword [esp + 0x18], edx
mov bp, word [ecx + 4]
mov cl, byte [esp + 0x19]
mov dl, cl
shr dl, 1
sar edi, 1
sub cl, dl
cmp edi, 1
jg 0x4232da
mov byte [esp + 0x19], cl
mov ecx, dword [esp + 0x10]
inc ecx
xor edx, edx
sar ecx, 1
mov dl, byte [ecx + esi + 0x29]
mov ecx, esi
push edx
push eax
call fcn.004221d0
mov eax, dword [esi + 0x79c]
mov ecx, dword [esp + 0x18]
add eax, 2
pop edi
mov dword [esi + 0x7a4], eax
pop esi
mov dword [eax], ecx
mov word [eax + 4], bp
pop ebp
pop ebx
add esp, 0x10
ret 4
mov eax, dword [esi + 0x79c]
mov edx, edi
sar edx, 1
sub edi, edx
add word [eax + 2], di
mov eax, dword [esp + 0x10]
mov edx, dword [esi + 0x79c]
lea ecx, [eax + 1]
xor eax, eax
mov ax, word [edx]
sar ecx, 1
inc eax
sar eax, 1
cmp ecx, eax
je 0x423365
push eax
push ecx
mov ecx, dword [edx + 4]
push ecx
mov ecx, esi
call fcn.00423510
mov edx, dword [esi + 0x79c]
mov dword [edx + 4], eax
mov eax, dword [esi + 0x79c]
pop edi
mov ecx, dword [eax + 4]
mov dword [esi + 0x7a4], ecx
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 4
mov ecx, dword [esi + 0x79c]
xor edx, edx
mov byte [esi + 0xbc2], 0
add ebp, 6
mov dx, word [ecx]
mov ecx, edx
xor edx, edx
mov dl, byte [ebp + 1]
dec ecx
add ebx, edx
cmp ebx, eax
jg 0x4233b2
dec ecx
je 0x42340f
add ebp, 6
xor edx, edx
mov dl, byte [ebp + 1]
add ebx, edx
cmp ebx, eax
jle 0x4233a1
mov eax, dword [edi + 0x20]
xor ecx, ecx
mov cl, byte [ebp + 1]
mov edx, dword [edi + 0x24]
sub ebx, ecx
imul eax, ecx
imul ebx, dword [edi + 0x20]
sub edx, ebx
mov ebx, 0x1000000
cmp eax, ebx
mov dword [edi + 0x24], edx
mov dword [edi + 0x20], eax
jae 0x4233fd
mov ecx, edi
call fcn.0040c8a0
mov edx, dword [edi + 0x24]
mov ecx, dword [edi + 0x20]
and eax, 0xff
shl edx, 8
or eax, edx
shl ecx, 8
mov dword [edi + 0x24], eax
mov eax, ecx
cmp eax, ebx
mov dword [edi + 0x20], ecx
jb 0x4233d7
push ebp
mov ecx, esi
call fcn.004235f0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 4
mov eax, dword [esi + 0x7a4]
xor ecx, ecx
mov cl, byte [eax]
mov eax, dword [esi + 0x79c]
mov dl, byte [ecx + esi + 0xac0]
xor ecx, ecx
mov byte [esi + 0xbc3], dl
mov edx, dword [edi + 0x20]
mov cx, word [eax + 2]
imul edx, ebx
mov eax, ecx
mov ecx, dword [edi + 0x24]
sub ecx, edx
sub eax, ebx
mov dword [edi + 0x24], ecx
mov ecx, dword [edi + 0x20]
imul ecx, eax
mov dword [edi + 0x20], ecx
mov ecx, edi
call fcn.004234b0
mov al, byte [esi + 0xbc0]
xor edx, edx
mov dl, byte [ebp]
mov byte [edx + esi + 0x7c0], al
mov ecx, dword [esi + 0x79c]
xor eax, eax
mov ax, word [ecx]
mov dword [esi + 0x7a4], 0
mov dword [esi + 0x7a8], eax
dec eax
mov cl, byte [esi + 0xbc0]
sub ebp, 6
xor edx, edx
dec eax
mov dl, byte [ebp]
mov byte [edx + esi + 0x7c0], cl
jne 0x423482
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 4