Function at 0x10056840
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x40
mov ecx, dword [esp + 0x44]
push ebx
push esi
xor esi, esi
mov ebx, dword [ecx + 0x1c]
mov eax, dword [ecx + 0x18]
sub eax, ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x60]
mov dword [eax], esi
mov eax, dword [esp + 0x5c]
dec eax
cmp eax, 0x1f
ja 0x10056d7a
mov edx, dword [esp + 0x54]
push ebp
push edi
mov edi, dword [ecx + 4]
xor ebp, ebp
mov eax, dword [edx]
mov dword [esp + 0x1c], eax
mov eax, dword [edx + 8]
mov edx, dword [ecx + 8]
mov dword [esp + 0x3c], edx
mov edx, dword [ecx + 0xc]
mov dword [ecx], edi
mov ecx, dword [ecx + 0x10]
mov dword [esp + 0x4c], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x48], edx
mov dword [esp + 0x44], ecx
mov dword [esp + 0x18], esi
mov dword [esp + 0x20], esi
cmp dword [esp + 0x60], esi
je 0x10056d59
nop dword [eax + eax]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
shr edi, 9
mov dword [esp + 0x14], eax
add edi, 3
mov eax, 0x80000000
xor ecx, ecx
nop dword [eax]
test edi, eax
jne 0x100568ec
inc ecx
shr eax, 1
cmp ecx, 0x20
jl 0x100568e0
mov ebp, dword [esp + 0x58]
mov edi, edx
mov eax, 0x1f
sub eax, ecx
cmp eax, edx
cmovbe edi, eax
mov eax, 1
mov ecx, edi
inc esi
shl eax, cl
dec eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], eax
mov eax, dword [ebp]
add ebp, 4
mov esi, dword [esp + 0x34]
mov ecx, eax
sar ecx, 0x1f
mov edx, ecx
mov dword [esp + 0x58], ebp
xor edx, eax
sub edx, ecx
and ecx, 1
add edx, edx
sub edx, ecx
mov ebx, edx
mov dword [esp + 0x40], edx
sub ebx, dword [esp + 0x18]
xor edx, edx
mov eax, ebx
mov dword [esp + 0x18], ebx
div esi
mov ecx, eax
cmp ecx, 9
jae 0x10056a12
imul eax, esi
mov edx, 1
mov esi, ebx
mov ebx, 0
sub esi, eax
sete bl
shl edx, cl
sub edi, ebx
dec edx
inc edi
add edi, ecx
mov eax, edi
mov dword [esp + 0x24], edi
sub eax, ecx
mov ecx, eax
lea eax, [esi + 1]
shl edx, cl
sub edx, ebx
add eax, edx
mov dword [esp + 0x34], eax
cmp edi, 0x19
ja 0x10056a12
mov eax, dword [esp + 0x54]
mov edi, 0x20
mov ebx, eax
mov ecx, 0x20
sub ecx, dword [esp + 0x24]
and eax, 7
sub edi, eax
shr ebx, 3
add ebx, dword [esp + 0x1c]
or esi, 0xffffffff
sub edi, dword [esp + 0x24]
shr esi, cl
mov ecx, edi
shl esi, cl
movzx edx, byte [ebx]
movzx eax, byte [ebx + 1]
shl edx, 8
add edx, eax
movzx eax, byte [ebx + 2]
shl edx, 8
add edx, eax
movzx eax, byte [ebx + 3]
shl edx, 8
add edx, eax
mov eax, esi
not eax
and edx, eax
mov eax, dword [esp + 0x34]
shl eax, cl
and eax, esi
or edx, eax
mov eax, edx
mov byte [ebx + 3], dl
sar eax, 0x18
mov byte [ebx], al
mov eax, edx
sar eax, 0x10
mov byte [ebx + 1], al
mov eax, edx
sar eax, 8
mov byte [ebx + 2], al
mov eax, dword [esp + 0x54]
add eax, dword [esp + 0x24]
mov dword [esp + 0x54], eax
jmp 0x10056b33
mov eax, dword [esp + 0x18]
mov ecx, 0x17
mov dword [esp + 0x10], eax
mov ebx, 0x1ff
mov eax, dword [esp + 0x64]
mov esi, ebx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x54]
mov edi, eax
and eax, 7
shr edi, 3
add edi, dword [esp + 0x1c]
sub ecx, eax
shl esi, cl
shl ebx, cl
and ebx, esi
movzx edx, byte [edi]
movzx eax, byte [edi + 1]
shl edx, 8
add edx, eax
movzx eax, byte [edi + 2]
shl edx, 8
add edx, eax
movzx eax, byte [edi + 3]
shl edx, 8
add edx, eax
mov eax, esi
not eax
and edx, eax
or edx, ebx
mov ebx, dword [esp + 0x54]
mov eax, edx
mov byte [edi + 3], dl
sar eax, 0x18
add ebx, 9
mov byte [edi], al
mov esi, ebx
mov eax, edx
shr esi, 3
add esi, dword [esp + 0x1c]
sar eax, 0x10
mov byte [edi + 1], al
mov eax, edx
mov edx, dword [esp + 0x14]
sar eax, 8
mov byte [edi + 2], al
mov eax, ebx
movzx ecx, byte [esi]
and eax, 7
shl ecx, 8
mov edi, 0x20
sub edi, eax
movzx eax, byte [esi + 1]
add ecx, eax
movzx eax, byte [esi + 2]
shl ecx, 8
add ecx, eax
movzx eax, byte [esi + 3]
shl ecx, 8
add ecx, eax
sub edi, edx
mov dword [esp + 0x54], ecx
jns 0x10056af1
mov eax, dword [esp + 0x10]
or edx, 0xffffffff
mov ecx, edi
neg ecx
shr edx, cl
not edx
shr eax, cl
and edx, dword [esp + 0x54]
lea ecx, [edi + 8]
or edx, eax
mov al, byte [esp + 0x10]
shl al, cl
mov byte [esi + 4], al
jmp 0x10056b11
or eax, 0xffffffff
mov ecx, 0x20
sub ecx, edx
mov edx, dword [esp + 0x10]
shr eax, cl
mov ecx, edi
shl eax, cl
shl edx, cl
and edx, eax
not eax
and eax, dword [esp + 0x54]
or edx, eax
mov eax, edx
mov byte [esi + 3], dl
sar eax, 0x18
mov byte [esi], al
mov eax, edx
sar eax, 0x10
mov byte [esi + 1], al
mov eax, edx
sar eax, 8
add ebx, dword [esp + 0x14]
mov byte [esi + 2], al
mov dword [esp + 0x54], ebx
mov edx, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
inc edx
mov eax, dword [esp + 0x38]
mov dword [esp + 0x20], edx
cmp eax, ebx
jl 0x10056b54
mov ecx, dword [esp + 0x30]
lea ebp, [ebp + ecx*4]
mov dword [esp + 0x58], ebp
mov edi, dword [esp + 0x28]
xor esi, esi
mov ecx, dword [esp + 0x40]
cmp eax, ebx
mov ebx, dword [esp + 0x60]
cmovl esi, eax
mov eax, dword [esp + 0x3c]
imul ecx, dword [esp + 0x3c]
imul eax, edi
shr eax, 9
sub ecx, eax
mov eax, 0xffff
add edi, ecx
cmp dword [esp + 0x18], 0xffff
mov dword [esp + 0x18], 0
cmova edi, eax
mov dword [esp + 0x28], edi
cmp edx, ebx
ja 0x10056d44
mov eax, edi
and eax, 0x3fffffff
cmp eax, 0x80
jae 0x10056d32
cmp edx, ebx
jae 0x10056d53
mov ecx, dword [esp + 0x2c]
xor ebx, ebx
mov dword [esp + 0x18], 1
mov dword [esp + 0x34], ebx
nop word [eax + eax]
cmp dword [ebp], 0
jne 0x10056c19
add ebp, 4
lea eax, [esi + 1]
inc ebx
mov dword [esp + 0x58], ebp
inc edx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x20], edx
cmp eax, ecx
jl 0x10056bfa
mov esi, dword [esp + 0x30]
lea ebp, [ebp + esi*4]
mov dword [esp + 0x58], ebp
xor esi, esi
cmp eax, ecx
cmovl esi, eax
cmp ebx, 0xffff
jae 0x10056c11
cmp edx, dword [esp + 0x60]
jb 0x10056bd0
jmp 0x10056c19
mov dword [esp + 0x18], 0
mov eax, 0x80000000
xor ecx, ecx
test edi, eax
jne 0x10056c2c
inc ecx
shr eax, 1
cmp ecx, 0x20
jl 0x10056c20
lea ebp, [edi + 0x10]
mov eax, ebx
shr ebp, 6
mov edi, 1
add ebp, 0xffffffe8
cdq
add ebp, ecx
mov ecx, ebp
shl edi, cl
dec edi
and edi, dword [esp + 0x44]
idiv edi
mov ecx, eax
cmp ecx, 9
jae 0x10056c8e
mov eax, ebx
xor ebx, ebx
cdq
idiv edi
mov eax, ecx
mov edi, edx
mov edx, 1
test edi, edi
sete bl
shl edx, cl
sub eax, ebx
dec edx
inc eax
add ebp, eax
mov eax, ebp
mov dword [esp + 0x28], ebp
sub eax, ecx
mov ecx, eax
shl edx, cl
sub edx, ebx
lea ebx, [edi + 1]
add ebx, edx
mov dword [esp + 0x24], ebx
cmp ebp, 0x19
jbe 0x10056ca1
mov ebx, dword [esp + 0x34]
add ebx, 0x1ff0000
mov ebp, 0x19
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebp
mov eax, dword [esp + 0x54]
mov ebx, 0x20
mov edx, eax
mov ecx, 0x20
and eax, 7
shr edx, 3
sub ebx, eax
sub ecx, ebp
sub ebx, ebp
or edi, 0xffffffff
mov ebp, dword [esp + 0x1c]
add ebp, edx
shr edi, cl
mov ecx, ebx
mov ebx, dword [esp + 0x60]
shl edi, cl
movzx edx, byte [ebp]
movzx eax, byte [ebp + 1]
shl edx, 8
add edx, eax
movzx eax, byte [ebp + 2]
shl edx, 8
add edx, eax
movzx eax, byte [ebp + 3]
shl edx, 8
add edx, eax
mov eax, edi
not eax
and edx, eax
mov eax, dword [esp + 0x24]
shl eax, cl
and eax, edi
or edx, eax
mov eax, edx
mov byte [ebp + 3], dl
sar eax, 0x18
mov byte [ebp], al
mov eax, edx
sar eax, 0x10
mov byte [ebp + 1], al
mov eax, edx
mov edx, dword [esp + 0x20]
sar eax, 8
mov byte [ebp + 2], al
mov eax, dword [esp + 0x54]
add eax, dword [esp + 0x28]
xor edi, edi
mov dword [esp + 0x54], eax
mov dword [esp + 0x28], edi
jmp 0x10056d36
mov eax, dword [esp + 0x54]
cmp edx, ebx
mov edx, dword [esp + 0x48]
jb 0x100568c0
jmp 0x10056d57
mov ebp, 0xffffffce
pop edi
mov eax, ebp
pop ebp
pop esi
pop ebx
add esp, 0x40
ret
mov eax, dword [esp + 0x54]
xor ebp, ebp
sub eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x68]
push eax
push dword [esp + 0x60]
mov dword [ecx], eax
call fcn.10054280
add esp, 8
pop edi
mov eax, ebp
pop ebp
pop esi
pop ebx
add esp, 0x40
ret
pop esi
mov eax, 0xffffffce
pop ebx
add esp, 0x40
ret