Function at 0x410f70
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 [0x5957b8]
mov dword [esp + 0x48], eax
test eax, eax
je 0x41106b
mov eax, 0x3fa00000
mov dword [0x7dfc0c], eax
mov dword [0x7dfc10], eax
movsx edx, byte [0x7dfc14]
test edx, edx
jne 0x41106b
mov byte [0x7dfc14], 1
xor edx, edx
fld qword [0x570338]
fld qword [0x570330]
mov dword [esp + 0x30], edx
fild dword [esp + 0x30]
fsub st(1)
fld qword [0x570338]
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 0x411015
cmp eax, 0xff
jle 0x411017
mov eax, 0xff
jmp 0x411017
xor eax, eax
mov byte [edx + 0x7d8800], 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 0x411052
cmp eax, 0xff
jle 0x411054
mov eax, 0xff
jmp 0x411054
xor eax, eax
mov byte [edx + 0x7d8900], al
inc edx
cmp edx, 0x100
jl 0x410fd0
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 0x411156
xor eax, eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x94]
mov edx, dword [esp + 0x44]
cmp eax, edx
jl 0x41116b
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 0x41118e
xor eax, eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x98]
mov edx, dword [esp + 0x5c]
cmp eax, edx
jl 0x4111a3
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 0x4111be
mov esi, 0x64
test eax, eax
jne 0x4111c7
mov eax, 0x64
mov edx, dword [esp + 0x54]
test edx, edx
jle 0x411232
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.0045ff00
add eax, edi
mov dword [ebp*4 + 0x798400], eax
add esi, 0x100
inc ebp
mov ecx, dword [esp + 0x54]
cmp ebp, ecx
jl 0x4111f4
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 0x411272
mov edx, dword [esp + 0x54]
test edx, edx
jle 0x411272
xor eax, eax
mov ebx, edx
mov edx, dword [eax*4 + 0x798400]
movzx ebp, dl
and edx, 0xffffff00
movzx ebp, byte [ebp + 0x7d8900]
or edx, ebp
mov dword [eax*4 + 0x798400], edx
inc eax
cmp eax, ebx
jl 0x411246
mov ebp, dword [esp + 0x8c]
test edi, edi
jle 0x411321
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.0045ff00
mov edx, dword [esp + 0x40]
add eax, edx
mov ecx, dword [esp + 0x48]
test ecx, ecx
je 0x4112cd
movzx edx, al
and eax, 0xffffff00
movzx ecx, byte [edx + 0x7d8800]
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 + 0x7b8600], esi
mov dword [ebx*8 + 0x7b8604], edi
sar eax, 8
add eax, eax
add eax, eax
mov dword [ebx*4 + 0x7a8500], eax
add ebp, 0x100
inc ebx
mov eax, dword [esp + 0x4c]
cmp ebx, eax
jl 0x411297
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 0x4115aa
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 + 0x798400]
sar edx, 8
add edx, ecx
test edx, edx
jge 0x41135b
lea ebx, [eax + 1]
cmp edx, ebp
jge 0x411596
inc eax
cmp eax, esi
jl 0x411348
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x8c]
mov dword [esp + 0x5c], edi
test edi, edi
jle 0x41158f
xor esi, esi
xor eax, eax
mov edx, dword [eax*4 + 0x7a8500]
sar edx, 2
add edx, ecx
test edx, edx
jge 0x411396
lea esi, [eax + 1]
cmp edx, ebp
jge 0x411586
inc eax
cmp eax, edi
jl 0x411383
mov eax, dword [esp + 0x14]
cmp ebx, eax
jge 0x4113b3
mov eax, dword [esp + 0x5c]
cmp esi, eax
jl 0x4113d2
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 [0x5b2480]
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 [0x5b2480]
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 [0x5b2480]
add esp, 0x10
movsx ecx, byte [0x5956f4]
test ecx, ecx
jle 0x41155d
mov dword [0x790604], 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 0x411442
mov ebp, dword [esp + 0x40]
mov ebx, dword [esp + 0x44]
mov dword [esi + 0x790608], ebx
mov eax, ebp
cdq
idiv ecx
add eax, ebx
mov dword [esi + 0x79060c], 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 + 0x790610], edx
mov ecx, dword [esp + 0x5c]
mov dword [esi + 0x790614], ecx
mov edx, dword [esp + 0x24]
mov dword [esi + 0x790618], edx
mov edx, dword [esp + 0x80]
mov dword [esi + 0x79061c], edx
mov edx, dword [esp + 0x84]
mov dword [esi + 0x790620], edx
mov edx, dword [esp + 0x88]
mov dword [esi + 0x790624], edx
mov edx, dword [esp + 0x8c]
mov dword [esi + 0x790628], edx
mov edx, dword [esp + 0x90]
mov dword [esi + 0x79062c], edx
mov dword [esi + 0x790630], ebp
mov dword [esi + 0x790634], ebx
mov edx, dword [esp + 0x1c]
mov dword [esi + 0x790638], edx
mov edx, dword [esp + 0x20]
mov dword [esi + 0x79063c], edx
push dword [edi*4 + 0x792000]
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0xffffffffffffffff
push dword [edi*4 + 0x792100]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
inc edi
movsx ecx, byte [0x5956f4]
cmp edi, ecx
jge 0x41155d
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 + 0x790604], 0x15
test edi, edi
je 0x41143a
cmp edi, 1
jne 0x41146b
mov eax, dword [esp + 0x40]
cdq
idiv ecx
add eax, dword [esp + 0x44]
mov dword [esi + 0x790608], eax
mov ecx, dword [esp + 0x14]
mov dword [esi + 0x79060c], ecx
jmp 0x41146b
test ecx, ecx
jle 0x41157e
xor ebx, ebx
push 0xffffffffffffffff
push dword [ebx*4 + 0x792200]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
inc ebx
movsx eax, byte [0x5956f4]
cmp ebx, eax
jl 0x411563
add esp, 0x60
pop ebx
pop ebp
pop esi
pop edi
ret
mov dword [esp + 0x5c], eax
jmp 0x4113a3
xor esi, esi
jmp 0x4113a3
mov ecx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x8c]
mov dword [esp + 0x14], eax
jmp 0x411373
xor ebx, ebx
jmp 0x411373