Function at 0x407824
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0xb0
mov dword [esp + 0x3c], ecx
lea ecx, [esp + 0x5c]
mov esi, dword [ebp + 0x10]
mov eax, dword [ebp + 0xc]
lea edi, [esp + 0x68]
mov dword [esp + 0x2c], edx
and dword [ecx], 0
mov dword [ecx + 4], 1
and dword [ecx + 8], 0
mov ecx, edi
push esi
push eax
push dword [ebp + 8]
call fcn.00410710
add esp, 0xc
mov eax, dword [edi]
mov ecx, dword [edi + 0xc]
mov edx, dword [edi + 0x18]
mov ebx, dword [edi + 0x1c]
mov dword [esp + 0x20], 0
mov dword [esp + 0x4c], eax
mov eax, dword [edi + 4]
mov esi, ecx
mov dword [esp + 0x44], edx
mov dword [esp + 0x40], ecx
and esi, 0xffffff00
mov dword [esp + 0x48], esi
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 8]
mov dword [esp + 0x50], eax
mov eax, dword [edi + 0x10]
mov dword [esp + 0x28], eax
mov eax, dword [edi + 0x24]
mov dword [esp + 0xc], eax
mov eax, dword [edi + 0x30]
mov dword [esp + 0x10], eax
mov eax, dword [edi + 0x34]
mov dword [esp + 8], eax
mov eax, dword [edi + 0x38]
mov dword [esp + 0x34], eax
mov eax, dword [edi + 0x3c]
mov esi, eax
mov dword [esp + 0x18], eax
sub esi, edx
mov dh, cl
mov ecx, eax
dec eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x54], eax
cmp dword [esp + 0x4c], 0
je 0x407a58
movzx eax, dh
mov ecx, dword [esp + 0xc]
mov edi, dword [esp + 0x10]
mov byte [esp + 7], dh
or eax, dword [esp + 0x48]
mov esi, ecx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x24], esi
cmp eax, esi
mov esi, dword [esp + 0x24]
cmova esi, eax
cmp ecx, 0xffffffff
cmove esi, eax
mov eax, 0
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x24]
cmove esi, eax
mov eax, dword [esp + 0x54]
add eax, ebx
cmp eax, dword [esp + 8]
jae 0x407b76
mov cl, byte [edi + eax]
xor eax, eax
xor edx, edx
inc edx
shld eax, edx, cl
mov edx, edi
xor edi, edi
inc edi
shl edi, cl
test cl, 0x20
mov ecx, 0
cmovne eax, edi
cmovne edi, ecx
and eax, dword [esp + 0x58]
and edi, dword [esp + 0x50]
or edi, eax
je 0x4079fb
mov edi, dword [esp + 0x30]
lea ecx, [edx + ebx]
cmp edi, dword [esp + 0x18]
jae 0x4079ab
lea edx, [ebx + edi]
mov eax, edi
cmp edx, dword [esp + 8]
jae 0x407bac
mov edx, dword [esp + 0x34]
lea edi, [eax + 1]
mov dl, byte [edx + eax]
cmp dl, byte [ecx + eax]
je 0x407970
sub ebx, dword [esp + 0x28]
mov ecx, dword [esp + 0xc]
mov edi, dword [esp + 0x10]
cmp ecx, 0xffffffff
lea ebx, [ebx + eax + 1]
je 0x407929
jmp 0x407a24
mov ecx, dword [esp + 0x28]
mov edi, dword [esp + 0x10]
cmp esi, ecx
jae 0x407a33
dec ecx
cmp ecx, dword [esp + 0x18]
jae 0x407bc5
lea eax, [ecx + ebx]
cmp eax, dword [esp + 8]
jae 0x407bd3
mov edx, dword [esp + 0x34]
mov dl, byte [edx + ecx]
cmp dl, byte [edi + eax]
je 0x4079b3
mov ecx, dword [esp + 0xc]
add ebx, dword [esp + 0x44]
cmp ecx, 0xffffffff
je 0x407929
mov eax, dword [esp + 0x38]
mov dword [esp + 0x14], eax
mov esi, eax
jmp 0x407902
mov ecx, dword [esp + 0xc]
mov esi, dword [esp + 0x14]
add ebx, dword [esp + 0x18]
mov eax, 0
mov edi, edx
cmp ecx, 0xffffffff
cmovne esi, eax
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0x24]
cmovne esi, eax
jmp 0x407902
mov dword [esp + 0x14], 0
xor esi, esi
jmp 0x407902
mov eax, dword [esp + 0x18]
cmp dword [esp + 0xc], 0xffffffff
mov ecx, dword [esp + 0x14]
lea edi, [ebx + eax]
mov eax, 0
cmovne ecx, eax
mov eax, ebx
mov ebx, edi
mov dword [esp + 0xc], ecx
jmp 0x407b3e
test dword [esp + 0x40], 0xff0000
mov esi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x10]
jne 0x407b76
mov eax, dword [esp + 8]
test esi, esi
je 0x407a8f
mov eax, dword [esp + 8]
sub eax, esi
jbe 0x407a89
cmp byte [ecx + esi], 0xbf
jg 0x407a8f
jmp 0x407be3
jne 0x407be3
test eax, eax
je 0x407b2b
mov dl, byte [ecx + esi]
movzx eax, dl
test dl, dl
jns 0x407af6
movzx edi, byte [ecx + esi + 1]
and eax, 0x1f
and edi, 0x3f
cmp dl, 0xdf
jbe 0x407ae8
movzx ecx, byte [ecx + esi + 2]
shl edi, 6
and ecx, 0x3f
or ecx, edi
cmp dl, 0xf0
mov edi, ecx
jb 0x407aed
mov ecx, dword [esp + 0x10]
mov byte [esp + 7], dh
and eax, 7
shl edi, 6
shl eax, 0x12
movzx edx, byte [ecx + esi + 3]
and edx, 0x3f
or edx, edi
or eax, edx
mov dh, byte [esp + 7]
jmp 0x407af6
shl eax, 6
jmp 0x407af4
mov ecx, dword [esp + 0x10]
shl eax, 0xc
or eax, edi
test dh, dh
jne 0x407b2f
cmp eax, 0x110000
je 0x407b76
cmp eax, 0x80
mov edx, 1
jb 0x407b22
cmp eax, 0x800
push 2
pop edx
jb 0x407b22
cmp eax, 0x10000
push 4
pop edx
sbb edx, 0
add esi, edx
mov dh, 1
jmp 0x407a6e
test dh, dh
je 0x407b76
xor dh, 1
mov edi, esi
mov dword [esp + 0x1c], esi
mov eax, esi
mov byte [esp + 7], dh
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x20]
lea esi, [esp + 0x5c]
add edx, ecx
add eax, ecx
mov ecx, esi
push eax
call fcn.0040d0ee
pop eax
mov edx, 0x453d98
mov ecx, esi
push 0x453d98
call fcn.0040d0ee
pop eax
mov dh, byte [esp + 7]
mov dword [esp + 0x20], edi
jmp 0x4078da
mov ecx, dword [esp + 0x2c]
mov eax, dword [ebp + 8]
mov edx, dword [esp + 0x20]
lea esi, [esp + 0x5c]
add eax, ecx
add edx, ecx
mov ecx, esi
push eax
call fcn.0040d0ee
pop eax
mov eax, dword [esi + 8]
mov ecx, dword [esp + 0x3c]
movsd xmm0, qword [esi]
mov dword [ecx + 8], eax
movsd qword [ecx], xmm0
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 8]
add ecx, ebx
cmp edx, ecx
cmova ecx, edx
push 0x4510d8
call fcn.00445d90
mov edx, dword [esp + 0x18]
push 0x4510b8
call fcn.00445d90
mov edx, dword [esp + 8]
mov ecx, eax
push 0x4510c8
call fcn.00445d90
mov edx, dword [esp + 8]
push 0x451a98
push edx
push esi
call fcn.00446250