Function at 0x411220
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x60
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], eax
mov ebp, dword [esp + 0x8c]
movsx eax, byte [0x5947b8]
mov dword [esp + 0x48], eax
test eax, eax
je 0x41131b
mov eax, 0x3fa00000
mov dword [0x7dec20], eax
mov dword [0x7dec24], eax
movsx edx, byte [0x7dec28]
test edx, edx
jne 0x41131b
mov byte [0x7dec28], 1
xor edx, edx
fld qword [0x56f338]
fld qword [0x56f330]
mov dword [esp + 0x30], edx
fild dword [esp + 0x30]
fsub st(1)
fld qword [0x56f338]
fmul st(1)
fadd st(2)
fnstcw word [esp]
movzx eax, word [esp]
or eax, 0xc00
mov dword [esp + 8], eax
fldcw word [esp + 8]
fistp dword [esp + 0x28]
fldcw word [esp]
mov eax, dword [esp + 0x28]
test eax, eax
jl 0x4112c5
cmp eax, 0xff
jle 0x4112c7
mov eax, 0xff
jmp 0x4112c7
xor eax, eax
mov byte [edx + 0x7d7800], al
fmul st(2)
fadd st(1)
fnstcw word [esp]
movzx eax, word [esp]
or eax, 0xc00
mov dword [esp + 8], eax
fldcw word [esp + 8]
fistp dword [esp + 0x28]
fldcw word [esp]
mov eax, dword [esp + 0x28]
test eax, eax
jl 0x411302
cmp eax, 0xff
jle 0x411304
mov eax, 0xff
jmp 0x411304
xor eax, eax
mov byte [edx + 0x7d7900], al
inc edx
cmp edx, 0x100
jl 0x411280
fstp st(0)
fstp st(0)
mov eax, 0x51eb851f
mov ebp, dword [esp + 0x24]
imul ebp
sar edx, 5
mov eax, ebp
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x3c], edx
lea eax, [edx + edx]
add eax, eax
sub eax, edx
lea ecx, [edx + eax*8]
add ecx, ecx
add ecx, ecx
neg ecx
add ecx, ebp
mov esi, dword [esp + 0x80]
mov eax, 0x51eb851f
imul esi
sar edx, 5
mov eax, esi
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x38], edx
lea eax, [edx + edx]
add eax, eax
sub eax, edx
lea ebx, [edx + eax*8]
add ebx, ebx
add ebx, ebx
neg ebx
add ebx, esi
mov esi, dword [esp + 0x94]
mov eax, 0x51eb851f
imul esi
sar edx, 5
mov eax, esi
sar eax, 0x1f
sub edx, eax
mov dword [esp + 0x4c], edx
mov edi, dword [esp + 0x98]
mov eax, 0x51eb851f
imul edi
sar edx, 5
sar edi, 0x1f
sub edx, edi
mov dword [esp + 0x54], edx
shl ecx, 8
mov eax, 0x51eb851f
imul ecx
mov edi, edx
sar edi, 5
sar ecx, 0x1f
sub edi, ecx
mov dword [esp + 0x40], edi
shl ebx, 8
mov eax, 0x51eb851f
imul ebx
sar edx, 5
sar ebx, 0x1f
sub edx, ebx
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], edx
mov eax, dword [esp + 0x84]
sub eax, ebp
mov dword [esp + 0x44], eax
cmp esi, eax
mov ecx, dword [esp + 0x3c]
mov edi, dword [esp + 0x4c]
mov ebp, dword [esp + 0x8c]
jge 0x411406
xor eax, eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x94]
mov edx, dword [esp + 0x44]
cmp eax, edx
jl 0x41141b
xor eax, eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x88]
sub eax, dword [esp + 0x80]
mov dword [esp + 0x5c], eax
mov edx, dword [esp + 0x98]
cmp edx, eax
jge 0x41143e
xor eax, eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x98]
mov edx, dword [esp + 0x5c]
cmp eax, edx
jl 0x411453
xor eax, eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x98]
lea eax, [eax - 0x64]
mov esi, dword [esp + 0x94]
add esi, 0xffffff9c
jne 0x41146e
mov esi, 0x64
test eax, eax
jne 0x411477
mov eax, 0x64
mov edx, dword [esp + 0x54]
test edx, edx
jle 0x4114e2
xor ebx, ebx
mov dword [esp + 0xc], ebx
cdq
mov ebx, edx
mov dword [esp + 0x4c], edi
mov dword [esp + 0x50], esi
mov dword [esp + 0x58], eax
mov dword [esp + 0x3c], ecx
mov ebp, dword [esp + 0xc]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x5c]
imul esi
push ebx
mov ecx, dword [esp + 0x5c]
push ecx
push edx
push eax
call fcn.0045f4a0
add eax, edi
mov dword [ebp*4 + 0x797400], eax
add esi, 0x100
inc ebp
mov ecx, dword [esp + 0x54]
cmp ebp, ecx
jl 0x4114a4
mov edi, dword [esp + 0x4c]
mov esi, dword [esp + 0x50]
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x8c]
mov edx, dword [esp + 0x48]
test edx, edx
je 0x411522
mov edx, dword [esp + 0x54]
test edx, edx
jle 0x411522
xor eax, eax
mov ebx, edx
mov edx, dword [eax*4 + 0x797400]
movzx ebp, dl
and edx, 0xffffff00
movzx ebp, byte [ebp + 0x7d7900]
or edx, ebp
mov dword [eax*4 + 0x797400], edx
inc eax
cmp eax, ebx
jl 0x4114f6
mov ebp, dword [esp + 0x8c]
test edi, edi
jle 0x4115d1
xor ebx, ebx
mov dword [esp + 0xc], ebx
mov eax, esi
cdq
mov dword [esp + 0x4c], edi
mov dword [esp + 0x58], edx
mov dword [esp + 0x50], esi
mov dword [esp + 0x3c], ecx
mov ebp, dword [esp + 0x18]
mov eax, dword [esp + 0x44]
imul ebp
mov ecx, dword [esp + 0x58]
push ecx
mov esi, dword [esp + 0x54]
push esi
push edx
push eax
call fcn.0045f4a0
mov edx, dword [esp + 0x40]
add eax, edx
mov ecx, dword [esp + 0x48]
test ecx, ecx
je 0x41157d
movzx edx, al
and eax, 0xffffff00
movzx ecx, byte [edx + 0x7d7800]
or eax, ecx
movzx edx, al
mov edi, edx
shl edi, 0x10
add edi, edx
xor ecx, ecx
shld ecx, edx, 0x10
mov esi, edx
shl esi, 0x10
add esi, edx
adc ecx, 0
add edi, ecx
mov dword [ebx*8 + 0x7b7600], esi
mov dword [ebx*8 + 0x7b7604], edi
sar eax, 8
add eax, eax
add eax, eax
mov dword [ebx*4 + 0x7a7500], eax
add ebp, 0x100
inc ebx
mov eax, dword [esp + 0x4c]
cmp ebx, eax
jl 0x411547
mov edi, eax
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x8c]
mov eax, dword [esp + 0x54]
mov dword [esp + 0x14], eax
test eax, eax
jle 0x41185a
xor ebx, ebx
xor eax, eax
mov dword [esp + 0x3c], ecx
mov esi, dword [esp + 0x54]
mov ecx, dword [esp + 0x38]
mov ebp, dword [esp + 0x90]
mov edx, dword [eax*4 + 0x797400]
sar edx, 8
add edx, ecx
test edx, edx
jge 0x41160b
lea ebx, [eax + 1]
cmp edx, ebp
jge 0x411846
inc eax
cmp eax, esi
jl 0x4115f8
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x8c]
mov dword [esp + 0x5c], edi
test edi, edi
jle 0x41183f
xor esi, esi
xor eax, eax
mov edx, dword [eax*4 + 0x7a7500]
sar edx, 2
add edx, ecx
test edx, edx
jge 0x411646
lea esi, [eax + 1]
cmp edx, ebp
jge 0x411836
inc eax
cmp eax, edi
jl 0x411633
mov eax, dword [esp + 0x14]
cmp ebx, eax
jge 0x411663
mov eax, dword [esp + 0x5c]
cmp esi, eax
jl 0x411682
add edi, edi
add edi, edi
mov eax, dword [esp + 0x54]
imul eax, edi
push eax
mov edx, dword [esp + 0x20]
push edx
call dword [0x5b1480]
add esp, 0x68
pop ebx
pop ebp
pop esi
pop edi
ret
add edi, edi
add edi, edi
mov eax, ebx
imul eax, edi
push eax
mov edx, dword [esp + 0x20]
push edx
call dword [0x5b1480]
mov ecx, dword [esp + 0x1c]
mov edx, ecx
imul edx, edi
add edx, dword [esp + 0x24]
mov eax, dword [esp + 0x5c]
imul eax, edi
neg ecx
imul ecx, edi
add eax, ecx
push eax
push edx
call dword [0x5b1480]
add esp, 0x10
movsx ecx, byte [0x5946f4]
test ecx, ecx
jle 0x41180d
mov dword [0x78f604], 0x15
xor edi, edi
xor eax, eax
mov edx, dword [esp + 0x14]
sub edx, ebx
mov dword [esp + 0x18], esi
mov esi, eax
mov ebp, edx
jmp 0x4116f2
mov ebp, dword [esp + 0x40]
mov ebx, dword [esp + 0x44]
mov dword [esi + 0x78f608], ebx
mov eax, ebp
cdq
idiv ecx
add eax, ebx
mov dword [esi + 0x78f60c], eax
mov dword [esp + 0x40], ebp
mov dword [esp + 0x44], ebx
mov ebx, dword [esp + 0x98]
mov ebp, dword [esp + 0x94]
mov edx, dword [esp + 0x18]
mov dword [esi + 0x78f610], edx
mov ecx, dword [esp + 0x5c]
mov dword [esi + 0x78f614], ecx
mov edx, dword [esp + 0x24]
mov dword [esi + 0x78f618], edx
mov edx, dword [esp + 0x80]
mov dword [esi + 0x78f61c], edx
mov edx, dword [esp + 0x84]
mov dword [esi + 0x78f620], edx
mov edx, dword [esp + 0x88]
mov dword [esi + 0x78f624], edx
mov edx, dword [esp + 0x8c]
mov dword [esi + 0x78f628], edx
mov edx, dword [esp + 0x90]
mov dword [esi + 0x78f62c], edx
mov dword [esi + 0x78f630], ebp
mov dword [esi + 0x78f634], ebx
mov edx, dword [esp + 0x1c]
mov dword [esi + 0x78f638], edx
mov edx, dword [esp + 0x20]
mov dword [esi + 0x78f63c], edx
push dword [edi*4 + 0x791000]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0xffffffffffffffff
push dword [edi*4 + 0x791100]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
inc edi
movsx ecx, byte [0x5946f4]
cmp edi, ecx
jge 0x41180d
lea eax, [edi + edi]
add eax, eax
sub eax, edi
lea esi, [edi + eax*4]
add esi, esi
add esi, esi
add esi, esi
mov dword [esi + 0x78f604], 0x15
test edi, edi
je 0x4116ea
cmp edi, 1
jne 0x41171b
mov eax, dword [esp + 0x40]
cdq
idiv ecx
add eax, dword [esp + 0x44]
mov dword [esi + 0x78f608], eax
mov ecx, dword [esp + 0x14]
mov dword [esi + 0x78f60c], ecx
jmp 0x41171b
test ecx, ecx
jle 0x41182e
xor ebx, ebx
push 0xffffffffffffffff
push dword [ebx*4 + 0x791200]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
inc ebx
movsx eax, byte [0x5946f4]
cmp ebx, eax
jl 0x411813
add esp, 0x60
pop ebx
pop ebp
pop esi
pop edi
ret
mov dword [esp + 0x5c], eax
jmp 0x411653
xor esi, esi
jmp 0x411653
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x8c]
mov dword [esp + 0x14], eax
jmp 0x411623
xor ebx, ebx
jmp 0x411623