Function at 0x4076b0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x1c
xor ecx, ecx
xor eax, eax
push ebx
push ebp
mov ebp, dword [esp + 0x2c]
push esi
push edi
xor edx, edx
mov dl, byte [eax + ebp]
add ecx, edx
inc eax
cmp eax, 0x3df
jl 0x4076bf
xor eax, eax
and ecx, 0x800000ff
mov al, byte [ebp + 0x3df]
jns 0x4076e6
dec ecx
or ecx, 0xffffff00
inc ecx
cmp eax, ecx
je 0x407702
push 0x40dae0
call fcn.004025f2
add esp, 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x1c
ret
mov al, byte [ebp + 0x3dc]
mov edx, 4
cmp al, 0x41
jne 0x4078b8
movzx cx, byte [ebp]
movzx dx, byte [ebp + 1]
mov ebx, dword [esp + 0x40]
mov esi, 0x7f
shl ecx, 8
add ecx, edx
mov dword [esp + 0x10], 1
mov word [ebx], cx
mov dword [esp + 0x14], 0x218
movzx ax, byte [ebp + 2]
movzx cx, byte [ebp + 3]
shl eax, 8
add eax, ecx
mov dword [esp + 0x18], 0x39d
mov word [ebx + 2], ax
mov dword [esp + 0x34], esi
movzx dx, byte [ebp + 4]
movzx ax, byte [ebp + 5]
shl edx, 8
add edx, eax
mov word [ebx + 4], dx
movzx cx, byte [ebp + 6]
mov word [ebx + 6], cx
movzx dx, byte [ebp + 7]
shl edx, 1
mov word [ebx + 8], dx
movzx ax, byte [ebp + 8]
shl eax, 1
mov word [ebx + 0xa], ax
movzx cx, byte [ebp + 9]
shl ecx, 1
mov word [ebx + 0xc], cx
movzx dx, byte [ebp + 0xa]
mov word [ebx + 0xe], dx
movzx ax, byte [ebp + 0xb]
shl eax, 1
mov word [ebx + 0x10], ax
movzx cx, byte [ebp + 0xc]
shl ecx, 1
mov word [ebx + 0x12], cx
movzx dx, byte [ebp + 0xd]
mov word [ebx + 0x14], dx
movzx ax, byte [ebp + 0xe]
shl eax, 1
mov word [ebx + 0x16], ax
movzx cx, byte [ebp + 0xf]
shl ecx, 1
mov word [ebx + 0x18], cx
movzx dx, byte [ebp + 0x10]
mov word [ebx + 0x1a], dx
mov eax, dword [esp + 0x44]
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x30]
cmp eax, 2
je 0x407ab1
mov word [edi + esi*8 + 4], 0
mov byte [ecx + 2], 0
mov byte [ecx + 1], 0
mov byte [ecx], 0
mov byte [ecx + 0x14], 4
mov ax, word [edx + 2]
cmp ax, 0x80
jl 0x4076f7
cmp ax, 0x200
jg 0x4076f7
mov ax, word [edx]
cmp ax, 0x80
jl 0x4076f7
cmp ax, 0x200
jg 0x4076f7
cmp word [edx + 4], 0x12c
jl 0x4076f7
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4079dd
movsx ecx, word [esp + 0x14]
mov eax, 0x18
xor esi, esi
mov dword [esp + 0x40], eax
mov edx, dword [esp + 0x38]
cmp eax, ecx
jge 0x407888
mov cl, byte [esi + ebp]
inc esi
mov byte [eax + edx], cl
add eax, 0x19
movsx ecx, word [esp + 0x14]
cmp eax, ecx
jl 0x407871
mov eax, dword [esp + 0x40]
dec eax
mov dword [esp + 0x40], eax
jns 0x407869
mov al, byte [ebp + 0x3c0]
mov byte [edx + 7], al
mov cl, byte [ebp + 0x3c1]
mov byte [edx + 8], cl
mov al, byte [ebp + 0x3c5]
mov byte [edx + 9], al
mov cl, byte [ebp + 0x3c6]
mov byte [edx + 0xa], cl
jmp 0x407aa0
movzx cx, byte [ebp + 0x258]
movzx ax, byte [ebp + 0x259]
mov ebx, dword [esp + 0x40]
mov esi, 0x63
shl ecx, 8
add eax, ecx
mov dword [esp + 0x10], 0
mov word [ebx], ax
mov dword [esp + 0x14], 0x258
movzx ax, byte [ebp + 0x25a]
movzx cx, byte [ebp + 0x25b]
shl eax, 8
add eax, ecx
mov dword [esp + 0x18], 0x38e
mov word [ebx + 2], ax
mov dword [esp + 0x34], esi
movzx ax, byte [ebp + 0x25c]
mov ecx, eax
shl ecx, 6
sub ecx, eax
movzx ax, byte [ebp + 0x25d]
lea ecx, [eax + ecx*4]
mov word [ebx + 4], cx
movzx ax, byte [ebp + 0x60]
mov word [ebx + 6], ax
movzx cx, byte [ebp + 0x1c8]
shl ecx, 1
mov word [ebx + 8], cx
movzx ax, byte [ebp + 0x1b0]
shl eax, 1
test cx, cx
mov word [ebx + 0xa], ax
mov word [ebx + 0xc], 0x17a
je 0x407969
test ax, ax
je 0x407969
mov word [ebx + 0xe], 3
jmp 0x40796d
mov word [ebx + 0xe], dx
movzx cx, byte [ebp + 0x3c0]
shl ecx, 1
mov word [ebx + 0x10], cx
mov ecx, 1
movzx ax, byte [ebp + 0x3c1]
shl eax, 1
cmp word [ebx + 0x10], 0
mov word [ebx + 0x12], ax
je 0x4079a0
test ax, ax
je 0x4079a0
mov word [ebx + 0x14], cx
jmp 0x4079a4
mov word [ebx + 0x14], dx
movzx ax, byte [ebp + 0x3c5]
shl eax, 1
mov word [ebx + 0x16], ax
movzx ax, byte [ebp + 0x3c6]
shl eax, 1
cmp word [ebx + 0x16], 0
mov word [ebx + 0x18], ax
je 0x4077df
test ax, ax
je 0x4077df
mov word [ebx + 0x1a], cx
jmp 0x4077e3
mov esi, dword [esp + 0x38]
mov ecx, 6
xor eax, eax
mov edi, esi
xor edx, edx
rep stosd dword es:[edi], eax
mov dl, byte [ebp + 4]
mov al, byte [ebp + 5]
shl edx, 8
mov ecx, 0xfc
lea eax, [edx + eax + 1]
cdq
sub eax, edx
sar eax, 1
cdq
idiv ecx
xor eax, eax
xor ecx, ecx
mov byte [esi], dl
mov al, byte [ebp + 1]
xor edx, edx
mov dl, byte [ebp]
shl edx, 8
lea eax, [edx + eax + 1]
cdq
sub eax, edx
xor edx, edx
sar eax, 1
mov byte [esi + 1], al
mov cl, byte [ebp + 2]
mov dl, byte [ebp + 3]
shl ecx, 8
lea eax, [ecx + edx + 1]
cdq
sub eax, edx
sar eax, 1
mov byte [esi + 2], al
mov al, byte [ebp + 7]
mov byte [esi + 5], al
mov cl, byte [ebp + 8]
mov byte [esi + 6], cl
mov dl, byte [ebp + 0xb]
mov byte [esi + 7], dl
mov al, byte [ebp + 0xc]
mov byte [esi + 8], al
mov cl, byte [ebp + 0xe]
mov byte [esi + 9], cl
mov dl, byte [ebp + 0xf]
mov byte [esi + 0xa], dl
mov al, byte [ebp + 0x218]
mov byte [esi + 0xe], al
mov cl, byte [ebp + 6]
mov byte [esi + 0x14], cl
mov dl, byte [ebp + 0x16]
mov byte [esi + 0x16], dl
mov al, byte [ebp + 0x17]
mov edx, dword [esp + 0x38]
mov byte [esi + 0x17], al
lea esi, [ebp + 0x18]
mov ecx, 0x80
lea edi, [edx + 0x18]
or eax, 0xffffffff
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x10
lea edi, [edx + 0x218]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00408170
mov esi, dword [esp + 0x38]
add esp, 4
mov dx, word [ebx]
mov word [edi], dx
mov ax, word [ebx + 2]
cmp word [edi], 0
mov word [edi + 2], ax
mov dx, word [ebx + 4]
movsx ecx, word [esp + 0x14]
mov word [edi + 4], dx
mov al, byte [ebx + 6]
mov byte [edi + 6], al
jne 0x407b1d
cmp word [edi + 2], 0
jne 0x407b1d
mov esi, dword [esp + 0x30]
movsx eax, word [esi + 2]
cdq
sub eax, edx
sar eax, 1
mov word [ebx], ax
mov word [edi], ax
movsx eax, word [esi]
cdq
sub eax, edx
mov esi, dword [esp + 0x34]
sar eax, 1
mov word [ebx + 2], ax
mov word [edi + 2], ax
mov eax, 0x7e
mov word [ebx + 4], ax
mov word [edi + 4], ax
mov word [ebx + 6], 4
mov byte [edi + 6], 4
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x407b51
mov al, byte [ecx + ebp + 0xf]
mov byte [edi + esi*8 + 6], al
movzx ax, al
mov word [edi + esi*8 + 4], ax
mov dword [esp + 0x40], eax
movzx dx, byte [ecx + ebp + 6]
mov word [edi + esi*8], dx
movzx ax, byte [ecx + ebp + 7]
mov word [edi + esi*8 + 2], ax
jmp 0x407ba7
movzx ax, byte [ecx + ebp + 0xa]
mov esi, dword [esp + 0x34]
mov dword [esp + 0x40], eax
mov word [edi + esi*8 + 4], ax
movzx dx, byte [ecx + ebp]
mov word [edi + esi*8], dx
xor edx, edx
movzx ax, byte [ecx + ebp + 1]
mov word [edi + esi*8 + 2], ax
mov dl, byte [ebp + 0x30]
xor eax, eax
mov al, byte [ebp + 0x18]
lea eax, [edx + eax + 1]
cdq
sub eax, edx
sar eax, 1
cmp eax, 0xff
jle 0x407b97
mov eax, 0xff
mov byte [edi + esi*8 + 6], al
mov dl, byte [ecx + ebp + 2]
mov byte [edi + esi*8 + 7], dl
mov esi, dword [esp + 0x34]
cmp dword [esp + 0x44], 1
jne 0x407bb8
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret
mov eax, dword [esp + 0x10]
lea edx, [ecx + 0x10]
test eax, eax
je 0x407bc6
lea edx, [ecx + 0xb]
lea eax, [edx - 8]
lea esi, [edx - 1]
cmp eax, esi
jge 0x407be8
mov cl, byte [eax + ebp]
mov bl, byte [eax + ebp + 1]
cmp cl, bl
ja 0x407be0
inc eax
cmp eax, esi
jl 0x407bd0
cmp eax, esi
jl 0x4076f7
mov ecx, dword [esp + 0x34]
xor eax, eax
mov al, byte [edx + ebp - 1]
dec ecx
cmp eax, ecx
jg 0x4076f7
lea esi, [esp + 0x1c]
lea ecx, [edx + ebp - 8]
mov dword [esp + 0x3c], 8
movzx ax, byte [ecx]
add esi, 2
lea ebx, [edx + eax*2]
add eax, ebx
inc ecx
mov word [esi - 2], ax
mov eax, dword [esp + 0x3c]
dec eax
mov dword [esp + 0x3c], eax
jne 0x407c0b
movsx eax, word [esp + 0x1c]
cmp eax, edx
jl 0x4076f7
mov ax, word [esp + 0x2a]
cmp ax, word [esp + 0x18]
jg 0x4076f7
mov eax, 1
lea ecx, [esp + 0x1e]
mov si, word [ecx]
cmp si, word [ecx - 2]
jl 0x4076f7
inc eax
add ecx, 2
cmp eax, 8
jl 0x407c4d
movsx eax, word [esp + 0x1c]
cmp edx, eax
mov ebx, 1
jge 0x407cc9
or eax, 0xffffffff
lea esi, [edx + ebp + 1]
sub eax, ebp
lea ecx, [edi + 0xc]
mov dword [esp + 0x3c], eax
movsx eax, word [esp + 0x1c]
mov ebx, eax
mov eax, 0xaaaaaaab
sub ebx, edx
add ebx, 2
mul ebx
mov ebx, edx
shr ebx, 1
inc ebx
movzx dx, byte [esi - 1]
mov word [ecx - 4], dx
add ecx, 8
movzx ax, byte [esi]
mov word [ecx - 0xa], ax
mov eax, dword [esp + 0x3c]
movzx dx, byte [esi + 1]
add esi, 3
mov word [ecx - 8], dx
lea edx, [eax + esi]
movsx eax, word [esp + 0x1c]
cmp edx, eax
jl 0x407c99
movsx ecx, word [esp + 0x1c]
movsx eax, word [esp + 0x1e]
cmp ecx, eax
jge 0x407d23
movsx eax, word [esp + 0x1e]
mov edx, eax
mov eax, 0xaaaaaaab
sub edx, ecx
lea esi, [edi + ebx*8 + 4]
add edx, 2
mul edx
shr edx, 1
add ebx, edx
movzx ax, byte [ecx + ebp]
mov word [esi - 4], ax
add esi, 8
movzx dx, byte [ecx + ebp + 1]
mov word [esi - 0xa], dx
movzx ax, byte [ecx + ebp + 2]
add eax, 0xfc
add ecx, 3
mov word [esi - 8], ax
movsx eax, word [esp + 0x1e]
cmp ecx, eax
jl 0x407cf2
movsx esi, word [esp + 0x1e]
movsx eax, word [esp + 0x20]
cmp esi, eax
jge 0x407d7e
movsx eax, word [esp + 0x20]
mov edx, eax
mov eax, 0xaaaaaaab
sub edx, esi
lea ecx, [edi + ebx*8 + 4]
add edx, 2
mul edx
shr edx, 1
add ebx, edx
movzx ax, byte [esi + ebp]
mov word [ecx - 4], ax
add ecx, 8
movzx dx, byte [esi + ebp + 1]
add edx, 0x100
add esi, 3
mov word [ecx - 0xa], dx
movzx ax, byte [esi + ebp - 1]
mov word [ecx - 8], ax
movsx eax, word [esp + 0x20]
cmp esi, eax
jl 0x407d4c
movsx ecx, word [esp + 0x20]
movsx eax, word [esp + 0x22]
cmp ecx, eax
jge 0x407dde
movsx eax, word [esp + 0x22]
mov edx, eax
mov eax, 0xaaaaaaab
sub edx, ecx
lea esi, [edi + ebx*8 + 4]
add edx, 2
mul edx
shr edx, 1
add ebx, edx
movzx ax, byte [ecx + ebp]
mov word [esi - 4], ax
add esi, 8
movzx dx, byte [ecx + ebp + 1]
add edx, 0x100
add ecx, 3
mov word [esi - 0xa], dx
movzx ax, byte [ecx + ebp - 1]
add eax, 0xfc
mov word [esi - 8], ax
movsx eax, word [esp + 0x22]
cmp ecx, eax
jl 0x407da7
movsx esi, word [esp + 0x22]
movsx eax, word [esp + 0x24]
cmp esi, eax
jge 0x407e38
movsx eax, word [esp + 0x24]
mov edx, eax
mov eax, 0xaaaaaaab
sub edx, esi
lea ecx, [edi + ebx*8 + 4]
add edx, 2
mul edx
shr edx, 1
add ebx, edx
movzx ax, byte [esi + ebp]
add eax, 0x100
add esi, 3
mov word [ecx - 4], ax
add ecx, 8
movzx dx, byte [esi + ebp - 2]
mov word [ecx - 0xa], dx
movzx ax, byte [esi + ebp - 1]
mov word [ecx - 8], ax
movsx eax, word [esp + 0x24]
cmp esi, eax
jl 0x407e07
movsx ecx, word [esp + 0x24]
movsx eax, word [esp + 0x26]
cmp ecx, eax
jge 0x407e97
movsx eax, word [esp + 0x26]
mov edx, eax
mov eax, 0xaaaaaaab
sub edx, ecx
lea esi, [edi + ebx*8 + 4]
add edx, 2
mul edx
shr edx, 1
add ebx, edx
movzx ax, byte [ecx + ebp]
add eax, 0x100
add ecx, 3
mov word [esi - 4], ax
add esi, 8
movzx dx, byte [ecx + ebp - 2]
mov word [esi - 0xa], dx
movzx ax, byte [ecx + ebp - 1]
add eax, 0xfc
mov word [esi - 8], ax
movsx eax, word [esp + 0x26]
cmp ecx, eax
jl 0x407e61
movsx ecx, word [esp + 0x26]
movsx eax, word [esp + 0x28]
cmp ecx, eax
jge 0x407ef7
movsx eax, word [esp + 0x28]
mov edx, eax
mov eax, 0xaaaaaaab
sub edx, ecx
lea esi, [edi + ebx*8 + 4]
add edx, 2
mul edx
shr edx, 1
add ebx, edx
movzx ax, byte [ecx + ebp]
add eax, 0x100
add ecx, 3
mov word [esi - 4], ax
add esi, 8
movzx dx, byte [ecx + ebp - 2]
add edx, 0x100
mov word [esi - 0xa], dx
movzx ax, byte [ecx + ebp - 1]
mov word [esi - 8], ax
movsx eax, word [esp + 0x28]
cmp ecx, eax
jl 0x407ec0
movsx eax, word [esp + 0x28]
movsx ecx, word [esp + 0x2a]
cmp eax, ecx
jge 0x407f42
lea ebx, [edi + ebx*8 + 4]
movzx dx, byte [eax + ebp]
add edx, 0x100
add eax, 3
mov word [ebx - 4], dx
add ebx, 8
movzx dx, byte [eax + ebp - 2]
add edx, 0x100
mov word [ebx - 0xa], dx
movzx dx, byte [eax + ebp - 1]
add edx, 0xfc
cmp eax, ecx
mov word [ebx - 8], dx
jl 0x407f09
mov eax, dword [esp + 0x34]
movsx ecx, word [esp + 0x18]
cdq
sub eax, edx
sar eax, 1
movsx ebx, word [esp + 0x40]
add eax, ecx
cmp byte [eax + ebp], 0
jbe 0x407fb1
mov eax, ebx
cdq
sub eax, edx
sar eax, 1
lea esi, [eax + ecx]
cmp ecx, esi
jge 0x407f95
lea eax, [edi + 0xe]
xor edx, edx
mov dl, byte [ecx + ebp]
and edx, 0x8000000f
jns 0x407f80
dec edx
or edx, 0xfffffff0
inc edx
mov byte [eax], dl
mov dl, byte [ecx + ebp]
add eax, 8
shr dl, 4
mov byte [eax], dl
add eax, 8
inc ecx
cmp ecx, esi
jl 0x407f6e
mov eax, ebx
and eax, 0x80000001
jns 0x407fa3
dec eax
or eax, 0xfffffffe
inc eax
cmp eax, 1
jne 0x407fc4
mov cl, byte [esi + ebp]
mov byte [edi + ebx*8 + 6], cl
jmp 0x407fc4
cmp ebx, 1
jl 0x407fc4
lea eax, [edi + 0xe]
mov ecx, ebx
mov byte [eax], 0xff
add eax, 8
dec ecx
jne 0x407fbb
cmp dword [esp + 0x44], 0xa
jge 0x40809e
mov al, byte [ebp + 0x3dd]
cmp al, 0x40
je 0x40809e
test al, al
jbe 0x407ff6
and eax, 0xff
mov dword [esp + 0x44], eax
fild dword [esp + 0x44]
fmul qword [0x40b4d8]
jmp 0x407ffc
fld qword [0x40b4d0]
mov ebp, dword [esp + 0x30]
fstp dword [esp + 0x44]
cmp word [ebp + 4], 0x1f4
jne 0x408053
mov ax, word [ebp + 2]
cmp ax, 0x180
jge 0x408053
movsx edx, ax
mov dword [esp + 0x30], edx
fild dword [esp + 0x30]
fmul dword [esp + 0x44]
fadd qword [0x40b4c8]
call fcn.00408bf0
mov word [ebp + 2], ax
movsx eax, word [ebp]
mov dword [esp + 0x30], eax
fild dword [esp + 0x30]
fmul dword [esp + 0x44]
fadd qword [0x40b4c8]
call fcn.00408bf0
mov word [ebp], ax
test ebx, ebx
jl 0x4080a2
mov esi, edi
inc ebx
movsx ecx, word [esi]
mov dword [esp + 0x30], ecx
fild dword [esp + 0x30]
fmul dword [esp + 0x44]
fadd qword [0x40b4c8]
call fcn.00408bf0
mov word [esi], ax
movsx edx, word [esi + 2]
mov dword [esp + 0x30], edx
fild dword [esp + 0x30]
fmul dword [esp + 0x44]
fadd qword [0x40b4c8]
call fcn.00408bf0
mov word [esi + 2], ax
add esi, 8
dec ebx
jne 0x40805a
jmp 0x4080a2
mov ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x38]
push eax
push edi
push ecx
push ebp
call fcn.004080d0
mov eax, dword [esp + 0x44]
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret