Function at 0x466258
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, ecx
push ebx
sub esp, 0x1c
mov ecx, dword [ecx]
mov ebx, dword [ebp + 8]
mov eax, ecx
not eax
test ax, 0x101
jne 0x466276
add dword [ebx + 8], 0xc
mov al, byte [esi]
mov byte [ebp - 0x19], al
test al, al
jns 0x4662a0
xor edx, edx
test byte [esi + 1], 2
je 0x466292
mov eax, dword [ebx + 0x14]
mov edi, 0x64
cdq
idiv edi
mov eax, dword [esi + 4]
sub eax, 0x13
imul eax, eax, 0x64
add eax, edx
mov dword [ebx + 0x14], eax
and cx, 0x402
cmp cx, 0x400
jne 0x466337
mov al, byte [ebp - 0x19]
not eax
test al, 0x18
je 0x466318
test byte [ebp - 0x19], 4
je 0x466318
mov eax, dword [ebx + 0x14]
add eax, 0x76c
call method.std._anonymous_namespace_::is_leap_int_
mov edi, dword [ebx + 0x1c]
movzx eax, al
mov edx, eax
mov dword [ebp - 0x20], eax
xor eax, eax
neg edx
and edx, 0x1a
movzx ecx, word [edx + eax*2 + 0x485840]
cmp ecx, edi
jg 0x4662ed
inc eax
jmp 0x4662de
test byte [ebp - 0x19], 8
jne 0x4662f9
lea edx, [eax - 1]
mov dword [ebx + 0x10], edx
test byte [ebp - 0x19], 0x10
jne 0x466315
imul edx, dword [ebp - 0x20], 0xd
lea eax, [eax + edx - 1]
movzx eax, word [eax + eax + 0x485840]
sub edi, eax
inc edi
mov dword [ebx + 0xc], edi
or byte [esi], 0x18
mov al, byte [esi]
mov edx, dword [ebx + 0x10]
mov byte [ebp - 0x19], al
test al, 8
jne 0x466329
cmp edx, 0xb
ja 0x466337
mov ecx, dword [ebx + 0xc]
mov eax, dword [ebx + 0x14]
call method.std._anonymous_namespace_::day_of_the_week_int__int__int_
mov dword [ebx + 0x18], eax
mov eax, dword [esi]
and ax, 0x404
cmp ax, 0x400
jne 0x466378
mov edi, dword [ebx + 0x10]
test byte [ebp - 0x19], 8
jne 0x466351
cmp edi, 0xb
ja 0x466378
mov eax, dword [ebx + 0x14]
add eax, 0x76c
call method.std._anonymous_namespace_::is_leap_int_
mov edx, dword [ebx + 0xc]
movzx eax, al
imul eax, eax, 0xd
add eax, edi
movzx eax, word [eax + eax + 0x485840]
lea eax, [edx + eax - 1]
mov dword [ebx + 0x1c], eax
test byte [ebp - 0x19], 0x60
je 0x46643d
test byte [ebp - 0x19], 2
je 0x46643d
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x20], eax
test byte [ebp - 0x19], 4
jne 0x4663e2
mov al, byte [ebp - 0x19]
mov ecx, 1
xor edx, edx
shr al, 5
and eax, 1
xor eax, 1
mov edi, eax
mov eax, dword [ebp - 0x20]
call method.std._anonymous_namespace_::day_of_the_week_int__int__int_
mov ecx, 7
sub eax, edi
mov edx, eax
mov eax, ecx
sub eax, edx
cdq
idiv ecx
mov al, byte [esi + 2]
and eax, 0x3f
dec eax
imul eax, eax, 7
lea esi, [edx + eax]
mov eax, dword [ebx + 0x18]
sub eax, edi
add eax, 7
cdq
idiv ecx
add esi, edx
mov dword [ebx + 0x1c], esi
mov al, byte [ebp - 0x19]
not eax
test al, 0x18
je 0x46643d
mov eax, dword [ebp - 0x20]
add eax, 0x76c
call method.std._anonymous_namespace_::is_leap_int_
xor ecx, ecx
movzx edx, al
mov eax, dword [ebx + 0x1c]
mov esi, edx
neg esi
and esi, 0x1a
movzx edi, word [esi + ecx*2 + 0x485840]
cmp edi, eax
jg 0x466416
inc ecx
jmp 0x466407
test byte [ebp - 0x19], 8
jne 0x466422
lea esi, [ecx - 1]
mov dword [ebx + 0x10], esi
test byte [ebp - 0x19], 0x10
jne 0x46643d
imul edx, edx, 0xd
lea edx, [ecx + edx - 1]
movzx edx, word [edx + edx + 0x485840]
sub eax, edx
inc eax
mov dword [ebx + 0xc], eax
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret 4