Function at 0x100120d0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd44
push esi
push edi
cmp dword [ebp + 0x1c], 4
jl 0x100120e5
xor eax, eax
jne 0x100120e1
mov dword [ebp - 8], 0x10000
jmp 0x100120f7
mov ecx, dword [ebp - 8]
sub ecx, 1
mov dword [ebp - 8], ecx
cmp dword [ebp - 8], 0
jl 0x1001210c
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0x14]
mov dword [eax + edx*4], 0
jmp 0x100120ee
mov ecx, 1
imul ecx, ecx, 0
mov edx, dword [ebp + 0xc]
movzx eax, byte [edx + ecx]
shl eax, 8
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0x18]
sub ecx, 1
mov dword [ebp - 8], ecx
jmp 0x10012135
mov edx, dword [ebp - 8]
sub edx, 4
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 3
jl 0x1001222a
xor eax, eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x10]
mov word [edx + ecx*2], ax
mov eax, dword [ebp - 4]
sar eax, 8
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 8]
movzx edx, byte [ecx]
shl edx, 8
or eax, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
add edx, 1
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov dword [ecx + eax*4], edx
xor edx, edx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0x10]
mov word [ecx + eax*2 - 2], dx
mov edx, dword [ebp - 4]
sar edx, 8
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 8]
movzx ecx, byte [eax - 1]
shl ecx, 8
or edx, ecx
mov dword [ebp - 4], edx
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
add ecx, 1
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 0x14]
mov dword [eax + edx*4], ecx
xor ecx, ecx
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0x10]
mov word [eax + edx*2 - 4], cx
mov ecx, dword [ebp - 4]
sar ecx, 8
mov edx, dword [ebp + 0xc]
add edx, dword [ebp - 8]
movzx eax, byte [edx - 2]
shl eax, 8
or ecx, eax
mov dword [ebp - 4], ecx
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0x14]
mov eax, dword [edx + ecx*4]
add eax, 1
mov ecx, dword [ebp - 4]
mov edx, dword [ebp + 0x14]
mov dword [edx + ecx*4], eax
xor eax, eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x10]
mov word [edx + ecx*2 - 6], ax
mov eax, dword [ebp - 4]
sar eax, 8
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 8]
movzx edx, byte [ecx - 3]
shl edx, 8
or eax, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
add edx, 1
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov dword [ecx + eax*4], edx
jmp 0x1001212c
jmp 0x10012235
mov edx, dword [ebp - 8]
sub edx, 1
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 0
jl 0x10012275
xor eax, eax
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x10]
mov word [edx + ecx*2], ax
mov eax, dword [ebp - 4]
sar eax, 8
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 8]
movzx edx, byte [ecx]
shl edx, 8
or eax, edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
add edx, 1
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x14]
mov dword [ecx + eax*4], edx
jmp 0x1001222c
mov dword [ebp - 8], 0
jmp 0x10012287
mov edx, dword [ebp - 8]
add edx, 1
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 0x22
jge 0x100122b2
mov eax, dword [ebp + 0x18]
add eax, dword [ebp - 8]
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
mov cl, byte [ecx]
mov byte [edx + eax], cl
mov edx, dword [ebp + 0x18]
add edx, dword [ebp - 8]
xor eax, eax
mov ecx, dword [ebp + 0x10]
mov word [ecx + edx*2], ax
jmp 0x1001227e
cmp dword [ebp + 0x1c], 4
jl 0x100122bc
xor edx, edx
jne 0x100122b8
mov dword [ebp - 8], 1
jmp 0x100122ce
mov eax, dword [ebp - 8]
add eax, 1
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0x10000
jg 0x100122f5
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x14]
mov eax, dword [edx + ecx*4]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x14]
add eax, dword [edx + ecx*4 - 4]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0x14]
mov dword [edx + ecx*4], eax
jmp 0x100122c5
mov eax, 1
imul eax, eax, 0
mov ecx, dword [ebp + 0xc]
movzx edx, byte [ecx + eax]
shl edx, 8
mov word [ebp - 0xc], dx
mov eax, dword [ebp + 0x18]
sub eax, 1
mov dword [ebp - 8], eax
jmp 0x1001231f
mov ecx, dword [ebp - 8]
sub ecx, 4
mov dword [ebp - 8], ecx
cmp dword [ebp - 8], 3
jl 0x10012442
movzx edx, word [ebp - 0xc]
sar edx, 8
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 8]
movzx ecx, byte [eax]
shl ecx, 8
or edx, ecx
mov word [ebp - 0xc], dx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
sub ecx, 1
mov dword [ebp - 4], ecx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 4]
mov dword [eax + edx*4], ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 8]
mov dword [eax + edx*4], ecx
movzx edx, word [ebp - 0xc]
sar edx, 8
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 8]
movzx ecx, byte [eax - 1]
shl ecx, 8
or edx, ecx
mov word [ebp - 0xc], dx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
sub ecx, 1
mov dword [ebp - 4], ecx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 4]
mov dword [eax + edx*4], ecx
mov edx, dword [ebp - 8]
sub edx, 1
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov dword [ecx + eax*4], edx
movzx edx, word [ebp - 0xc]
sar edx, 8
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 8]
movzx ecx, byte [eax - 2]
shl ecx, 8
or edx, ecx
mov word [ebp - 0xc], dx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
sub ecx, 1
mov dword [ebp - 4], ecx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 4]
mov dword [eax + edx*4], ecx
mov edx, dword [ebp - 8]
sub edx, 2
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov dword [ecx + eax*4], edx
movzx edx, word [ebp - 0xc]
sar edx, 8
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 8]
movzx ecx, byte [eax - 3]
shl ecx, 8
or edx, ecx
mov word [ebp - 0xc], dx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
sub ecx, 1
mov dword [ebp - 4], ecx
movzx edx, word [ebp - 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 4]
mov dword [eax + edx*4], ecx
mov edx, dword [ebp - 8]
sub edx, 3
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov dword [ecx + eax*4], edx
jmp 0x10012316
jmp 0x1001244d
mov edx, dword [ebp - 8]
sub edx, 1
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 0
jl 0x10012497
movzx eax, word [ebp - 0xc]
sar eax, 8
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 8]
movzx edx, byte [ecx]
shl edx, 8
or eax, edx
mov word [ebp - 0xc], ax
movzx eax, word [ebp - 0xc]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
sub edx, 1
mov dword [ebp - 4], edx
movzx eax, word [ebp - 0xc]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp - 4]
mov dword [ecx + eax*4], edx
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 8]
mov dword [ecx + eax*4], edx
jmp 0x10012444
mov dword [ebp - 8], 0
jmp 0x100124a9
mov eax, dword [ebp - 8]
add eax, 1
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xff
jg 0x100124cc
mov ecx, dword [ebp - 8]
mov byte [ebp + ecx - 0x144], 0
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov dword [ebp + edx*4 - 0x544], eax
jmp 0x100124a0
mov dword [ebp - 0x18], 1
mov ecx, dword [ebp - 0x18]
imul ecx, ecx, 3
add ecx, 1
mov dword [ebp - 0x18], ecx
cmp dword [ebp - 0x18], 0x100
jle 0x100124d3
mov eax, dword [ebp - 0x18]
cdq
mov ecx, 3
idiv ecx
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x18]
mov dword [ebp - 8], edx
jmp 0x10012507
mov eax, dword [ebp - 8]
add eax, 1
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xff
jg 0x100125b6
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + ecx*4 - 0x544]
mov dword [ebp - 0x2c], edx
mov eax, dword [ebp - 8]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 4]
sub ecx, dword [ebp - 0x18]
mov edx, dword [ebp + ecx*4 - 0x544]
add edx, 1
shl edx, 8
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 0x18]
mov ecx, dword [ebp + eax*4 - 0x544]
shl ecx, 8
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp + 0x14]
mov edx, dword [eax + edx*4]
sub edx, dword [esi + ecx*4]
mov eax, dword [ebp - 0x2c]
add eax, 1
shl eax, 8
mov ecx, dword [ebp - 0x2c]
shl ecx, 8
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 0x14]
mov eax, dword [esi + eax*4]
sub eax, dword [edi + ecx*4]
cmp edx, eax
jbe 0x100125a4
mov ecx, dword [ebp - 4]
sub ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 4]
mov eax, dword [ebp + ecx*4 - 0x544]
mov dword [ebp + edx*4 - 0x544], eax
mov ecx, dword [ebp - 4]
sub ecx, dword [ebp - 0x18]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 0x18]
sub edx, 1
cmp dword [ebp - 4], edx
jg 0x100125a2
jmp 0x100125a4
jmp 0x10012527
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x2c]
mov dword [ebp + eax*4 - 0x544], ecx
jmp 0x100124fe
cmp dword [ebp - 0x18], 1
jne 0x100124e8
mov dword [ebp - 0x40], 0
mov dword [ebp - 8], 0
jmp 0x100125d9
mov edx, dword [ebp - 8]
add edx, 1
mov dword [ebp - 8], edx
cmp dword [ebp - 8], 0xff
jg 0x10012977
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + eax*4 - 0x544]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 4], 0
jmp 0x10012605
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
cmp dword [ebp - 4], 0xff
jg 0x100126d5
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x14]
je 0x100126d0
mov ecx, dword [ebp - 0x14]
shl ecx, 8
add ecx, dword [ebp - 4]
mov dword [ebp - 0x20], ecx
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
and ecx, 0x200000
jne 0x100126b8
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
and ecx, 0xffdfffff
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4 + 4]
and ecx, 0xffdfffff
sub ecx, 1
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x34]
cmp edx, dword [ebp - 0x30]
jle 0x100126b8
cmp dword [ebp + 0x1c], 4
jl 0x10012675
xor eax, eax
jne 0x10012671
mov ecx, dword [ebp + 0x20]
push ecx
push 2
mov edx, dword [ebp - 0x34]
push edx
mov eax, dword [ebp - 0x30]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.10011630
add esp, 0x20
mov edx, dword [ebp - 0x34]
sub edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x40]
lea ecx, [eax + edx + 1]
mov dword [ebp - 0x40], ecx
mov edx, dword [ebp + 0x20]
cmp dword [edx], 0
jge 0x100126b8
jmp 0x10012981
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
or edx, 0x200000
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 0x14]
mov dword [ecx + eax*4], edx
jmp 0x100125fc
xor edx, edx
jne 0x100126d5
mov dword [ebp - 4], 0
jmp 0x100126eb
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xff
jg 0x10012737
mov ecx, dword [ebp - 4]
shl ecx, 8
add ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0x14]
mov eax, dword [edx + ecx*4]
and eax, 0xffdfffff
mov ecx, dword [ebp - 4]
mov dword [ebp + ecx*4 - 0x944], eax
mov edx, dword [ebp - 4]
shl edx, 8
add edx, dword [ebp - 0x14]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4 + 4]
and ecx, 0xffdfffff
sub ecx, 1
mov edx, dword [ebp - 4]
mov dword [ebp + edx*4 - 0xd44], ecx
jmp 0x100126e2
mov eax, dword [ebp - 0x14]
shl eax, 8
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
and edx, 0xffdfffff
mov dword [ebp - 4], edx
jmp 0x10012757
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 4]
cmp edx, dword [ebp + ecx*4 - 0x944]
jge 0x100127ca
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax*4]
sub edx, 1
mov dword [ebp - 0x1c], edx
jns 0x10012780
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp + 0x18]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 0x1c]
mov dl, byte [ecx]
mov byte [ebp - 0xd], dl
movzx eax, byte [ebp - 0xd]
movzx ecx, byte [ebp + eax - 0x144]
test ecx, ecx
jne 0x100127c8
movzx edx, byte [ebp - 0xd]
mov eax, dword [ebp + edx*4 - 0x944]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x1c]
mov dword [ecx + eax*4], edx
movzx eax, byte [ebp - 0xd]
mov ecx, dword [ebp + eax*4 - 0x944]
add ecx, 1
movzx edx, byte [ebp - 0xd]
mov dword [ebp + edx*4 - 0x944], ecx
jmp 0x1001274e
mov eax, dword [ebp - 0x14]
add eax, 1
shl eax, 8
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx + eax*4]
and edx, 0xffdfffff
sub edx, 1
mov dword [ebp - 4], edx
jmp 0x100127f0
mov eax, dword [ebp - 4]
sub eax, 1
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 4]
cmp edx, dword [ebp + ecx*4 - 0xd44]
jle 0x10012863
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax*4]
sub edx, 1
mov dword [ebp - 0x1c], edx
jns 0x10012819
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp + 0x18]
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp + 0xc]
add ecx, dword [ebp - 0x1c]
mov dl, byte [ecx]
mov byte [ebp - 0xd], dl
movzx eax, byte [ebp - 0xd]
movzx ecx, byte [ebp + eax - 0x144]
test ecx, ecx
jne 0x10012861
movzx edx, byte [ebp - 0xd]
mov eax, dword [ebp + edx*4 - 0xd44]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x1c]
mov dword [ecx + eax*4], edx
movzx eax, byte [ebp - 0xd]
mov ecx, dword [ebp + eax*4 - 0xd44]
sub ecx, 1
movzx edx, byte [ebp - 0xd]
mov dword [ebp + edx*4 - 0xd44], ecx
jmp 0x100127e7
xor eax, eax
jne 0x10012863
mov dword [ebp - 4], 0
jmp 0x10012879
mov ecx, dword [ebp - 4]
add ecx, 1
mov dword [ebp - 4], ecx
cmp dword [ebp - 4], 0xff
jg 0x100128a8
mov edx, dword [ebp - 4]
shl edx, 8
add edx, dword [ebp - 0x14]
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
or ecx, 0x200000
mov edx, dword [ebp - 4]
shl edx, 8
add edx, dword [ebp - 0x14]
mov eax, dword [ebp + 0x14]
mov dword [eax + edx*4], ecx
jmp 0x10012870
mov ecx, dword [ebp - 0x14]
mov byte [ebp + ecx - 0x144], 1
cmp dword [ebp - 8], 0xff
jge 0x10012972
mov edx, dword [ebp - 0x14]
shl edx, 8
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
and ecx, 0xffdfffff
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x14]
add edx, 1
shl edx, 8
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + edx*4]
and ecx, 0xffdfffff
sub ecx, dword [ebp - 0x44]
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x28], 0
mov edx, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x28]
sar edx, cl
cmp edx, 0xfffe
jle 0x10012912
mov eax, dword [ebp - 0x28]
add eax, 1
mov dword [ebp - 0x28], eax
jmp 0x100128f7
mov ecx, dword [ebp - 0x3c]
sub ecx, 1
mov dword [ebp - 4], ecx
jmp 0x10012926
mov edx, dword [ebp - 4]
sub edx, 1
mov dword [ebp - 4], edx
cmp dword [ebp - 4], 0
jl 0x1001296e
mov eax, dword [ebp - 0x44]
add eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + eax*4]
mov dword [ebp - 0x38], edx
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x28]
sar eax, cl
mov word [ebp - 0x24], ax
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp + 0x10]
mov ax, word [ebp - 0x24]
mov word [edx + ecx*2], ax
cmp dword [ebp - 0x38], 0x22
jge 0x1001296c
mov ecx, dword [ebp - 0x38]
add ecx, dword [ebp + 0x18]
mov edx, dword [ebp + 0x10]
mov ax, word [ebp - 0x24]
mov word [edx + ecx*2], ax
jmp 0x1001291d
xor ecx, ecx
jne 0x1001296e
jmp 0x100125d0
cmp dword [ebp + 0x1c], 4
jl 0x10012981
xor edx, edx
jne 0x1001297d
pop edi
pop esi
mov esp, ebp
pop ebp
ret