Function at 0x415350
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x28
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov al, byte [ebp + 0x473a]
mov cx, word [ebp + 0x4734]
mov dl, byte [ebp + 0x473b]
mov bx, word [ebp + 0x4736]
mov di, word [ebp + 0x4738]
mov byte [esp + 0x20], al
mov al, byte [ebp + 0x473c]
mov word [esp + 0x24], cx
mov byte [esp + 0x18], al
mov al, byte [esp + 0x4c]
test al, 2
mov byte [esp + 0x1c], dl
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], edi
je 0x415445
lea ecx, [esp + 0x30]
push 4
push ecx
mov ecx, ebp
call fcn.0040bbc0
mov cl, byte [esp + 0x18]
mov eax, dword [esp + 0x24]
mov esi, edi
mov edi, dword [esp + 0x30]
mov edx, edi
and esi, 0xffff
shr edx, cl
and eax, 0xffff
mov cl, byte [esp + 0x1c]
mov dword [esp + 0x14], eax
and ebx, 0xffff
and edx, esi
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div esi
mov edx, edi
shr edx, cl
mov cl, byte [esp + 0x20]
shr edi, cl
mov ecx, dword [esp + 0x14]
and edx, ebx
and edi, ecx
mov esi, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ebx
and esi, 0xff
xor edx, edx
or esi, 0x200
mov ebx, dword [esp + 0x28]
shl esi, 8
and eax, 0xff
or esi, eax
mov eax, edi
shl eax, 8
sub eax, edi
mov edi, dword [esp + 0x2c]
div ecx
shl esi, 8
and eax, 0xff
or esi, eax
mov dword [0x44a2b0], esi
jmp 0x41544b
mov esi, dword [0x44a2b0]
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
push esi
push edx
mov edx, dword [esp + 0x44]
push eax
push ecx
push edx
mov ecx, ebp
call fcn.0040cc40
test byte [esp + 0x4c], 4
je 0x41550a
lea eax, [esp + 0x34]
push 4
push eax
mov ecx, ebp
call fcn.0040bbc0
mov esi, dword [esp + 0x34]
mov cl, byte [esp + 0x18]
mov eax, dword [esp + 0x24]
mov edx, esi
shr edx, cl
and edi, 0xffff
and eax, 0xffff
mov dword [esp + 0x14], eax
mov cl, byte [esp + 0x1c]
and ebx, 0xffff
and edx, edi
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div edi
mov edx, esi
shr edx, cl
mov cl, byte [esp + 0x20]
shr esi, cl
mov ecx, dword [esp + 0x14]
and edx, ebx
and esi, ecx
mov edi, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ebx
and edi, 0xff
xor edx, edx
or edi, 0x200
mov ebx, dword [esp + 0x28]
shl edi, 8
and eax, 0xff
or edi, eax
mov eax, esi
shl eax, 8
sub eax, esi
div ecx
shl edi, 8
and eax, 0xff
or edi, eax
mov dword [0x44a2b4], edi
test byte [esp + 0x4c], 8
je 0x4156ec
lea ecx, [esp + 0x10]
push 1
push ecx
mov ecx, ebp
call fcn.0040bbc0
mov al, byte [esp + 0x4c]
mov edi, dword [ebp + 0x4dc]
test al, 0x10
mov eax, dword [esp + 0x10]
je 0x415680
and eax, 0xff
mov ecx, ebp
lea edx, [eax + eax*2]
shl edx, 1
push edx
push edi
call fcn.0040bbc0
mov al, byte [esp + 0x10]
mov dword [esp + 0x4c], 0
test al, al
jbe 0x4156ec
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x18]
and eax, 0xff
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x20]
and eax, 0xff
and ecx, 0xff
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x24]
and esi, 0xffff
and ebx, 0xffff
and eax, 0xffff
mov dword [esp + 0x48], ecx
mov dword [esp + 0x44], esi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x14], eax
jmp 0x4155b7
mov ecx, dword [esp + 0x48]
mov esi, dword [esp + 0x44]
mov ebx, dword [edi]
add edi, 4
mov edx, ebx
shr edx, cl
mov ecx, dword [esp + 0x2c]
and edx, esi
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div esi
mov edx, ebx
shr edx, cl
mov ecx, dword [esp + 0x28]
and edx, ecx
mov esi, eax
mov eax, edx
shl eax, 8
sub eax, edx
xor edx, edx
div ecx
mov ecx, dword [esp + 0x20]
and esi, 0xff
shr ebx, cl
mov ecx, dword [esp + 0x14]
or esi, 0x200
shl esi, 8
xor edx, edx
and ebx, ecx
and eax, 0xff
or esi, eax
mov eax, ebx
shl eax, 8
sub eax, ebx
div ecx
shl esi, 8
and eax, 0xff
or esi, eax
xor eax, eax
mov dword [0x44a2b4], esi
mov al, byte [edi]
mov edx, eax
and eax, 0xf
shr edx, 4
mov ebx, eax
inc edi
xor eax, eax
push esi
mov al, byte [edi]
mov ecx, eax
and eax, 0xf
shr ecx, 4
inc ecx
inc eax
push eax
mov eax, dword [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x48]
add ebx, eax
add edx, ecx
push ebx
push edx
mov ecx, ebp
inc edi
call fcn.0040cc40
mov eax, dword [esp + 0x4c]
mov edx, dword [esp + 0x10]
inc eax
and edx, 0xff
cmp eax, edx
mov dword [esp + 0x4c], eax
jl 0x4155af
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 0x14
and eax, 0xff
mov ecx, ebp
shl eax, 1
push eax
push edi
call fcn.0040bbc0
mov al, byte [esp + 0x10]
xor esi, esi
test al, al
jbe 0x4156ec
xor eax, eax
mov al, byte [edi]
mov edx, eax
and eax, 0xf
shr edx, 4
mov ebx, eax
inc edi
xor eax, eax
mov al, byte [edi]
mov ecx, eax
and eax, 0xf
shr ecx, 4
inc ecx
inc eax
mov dword [esp + 0x4c], eax
mov eax, dword [0x44a2b4]
push eax
mov eax, dword [esp + 0x50]
push eax
mov eax, dword [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x4c]
add ebx, ecx
add edx, eax
push ebx
push edx
mov ecx, ebp
inc edi
call fcn.0040cc40
mov ecx, dword [esp + 0x10]
inc esi
and ecx, 0xff
cmp esi, ecx
jl 0x41569a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 0x14