Function at 0x526240
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd4
mov eax, dword [0x5be9c0]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 0x18], 4
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xc0], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xc4], eax
mov eax, dword [ebx]
push edi
mov dword [ebp - 0xd0], ebx
mov dword [eax + 8], 0
ja 0x526a79
push ebx
call fcn.00529e20
add esp, 4
test eax, eax
jne 0x5262b4
push ebx
call fcn.00528100
add esp, 4
xor eax, eax
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c2ee0
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x18]
test ecx, ecx
jne 0x5262ce
mov eax, dword [ebx]
cmp dword [eax + 8], 3
setge cl
lea ecx, [ecx*2 + 1]
mov dword [ebp + 0x18], ecx
mov edx, dword [ebx]
push esi
mov esi, dword [edx + 8]
mov dword [ebp - 0xb0], esi
cmp esi, 3
jne 0x526300
cmp dword [ebx + 0x47ec], esi
je 0x5262f9
cmp dword [ebx + 0x47e8], 0
jne 0x526300
cmp dword [ebx + 0x47e4], 0
jne 0x526300
mov eax, 1
jmp 0x526302
xor eax, eax
mov dword [ebp - 0xb4], eax
cmp esi, 3
jne 0x526327
cmp ecx, esi
jge 0x526327
test eax, eax
jne 0x526327
mov dword [ebp - 0xb0], 1
mov dword [ebp - 0x98], eax
jmp 0x526337
xor eax, eax
mov dword [ebp - 0x98], eax
test esi, esi
jle 0x526437
lea edi, [ebx + 0x46a0]
lea esi, [ebp - 0x84]
mov dword [ebp - 0xac], edi
lea esp, [esp]
mov eax, dword [edx]
add eax, 3
push eax
call fcn.0052ddd0
add esp, 4
mov dword [edi + 0x34], eax
test eax, eax
je 0x526458
mov eax, dword [ebx + 0x4684]
cdq
idiv dword [edi]
mov dword [esi + 0xc], 0
mov dword [ebp - 0x9c], eax
mov dword [esi - 4], eax
mov eax, dword [ebx + 0x4688]
cdq
idiv dword [edi + 4]
xor edx, edx
mov edi, eax
mov eax, dword [ebx]
mov ecx, edi
mov dword [esi], edi
sar ecx, 1
mov dword [esi + 8], ecx
mov ecx, dword [eax]
mov eax, dword [ebp - 0x9c]
dec eax
add eax, ecx
mov ecx, dword [ebp - 0x9c]
div ecx
mov dword [esi + 4], eax
mov eax, dword [ebp - 0xac]
mov eax, dword [eax + 0x28]
mov dword [esi - 8], eax
mov dword [esi - 0xc], eax
cmp ecx, 1
jne 0x5263e0
cmp edi, ecx
jne 0x5263d2
mov dword [esi - 0x10], fcn.0046df60
jmp 0x52640a
cmp edi, 2
jne 0x5263e0
mov dword [esi - 0x10], 0x531fb0
jmp 0x52640a
cmp ecx, 2
jne 0x526403
cmp edi, 1
jne 0x5263f3
mov dword [esi - 0x10], 0x531c70
jmp 0x52640a
cmp edi, 2
jne 0x526403
mov eax, dword [ebx + 0x4814]
mov dword [esi - 0x10], eax
jmp 0x52640a
mov dword [esi - 0x10], 0x531c30
mov eax, dword [ebp - 0x98]
add esi, 0x20
mov edi, dword [ebp - 0xac]
inc eax
mov edx, dword [ebx]
add edi, 0x48
mov dword [ebp - 0x98], eax
mov dword [ebp - 0xac], edi
cmp eax, dword [ebp - 0xb0]
jl 0x526350
mov eax, dword [ebx]
mov edi, dword [ebp + 0x18]
push 1
push dword [eax + 4]
push dword [eax]
push edi
call fcn.0052de10
mov esi, eax
add esp, 0x10
mov dword [ebp - 0xac], esi
test esi, esi
jne 0x52647e
push ebx
call fcn.00528100
push str.outofmem
call fcn.0052a160
add esp, 8
xor eax, eax
pop esi
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c2ee0
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx]
xor ecx, ecx
mov dword [ebp - 0x98], ecx
cmp dword [eax + 4], ecx
jbe 0x52682b
mov edx, dword [ebp + 0x18]
mov edi, dword [ebp - 0x14]
jmp 0x5264a0
mov esi, dword [eax]
imul esi, ecx
mov dword [ebp - 0x9c], 0
imul esi, edx
add esi, dword [ebp - 0xac]
cmp dword [ebp - 0xb0], 0
mov dword [ebp - 0xa4], esi
jle 0x52656c
mov esi, dword [ebp - 0xb0]
lea eax, [ebx + 0x46bc]
mov dword [ebp - 0xa0], eax
lea edi, [ebp - 0x7c]
mov ebx, eax
mov eax, dword [edi - 8]
xor ecx, ecx
sar eax, 1
cmp dword [edi], eax
setge cl
test ecx, ecx
je 0x5264fa
mov eax, dword [edi - 0x14]
mov ecx, dword [edi - 0x10]
jmp 0x526500
mov eax, dword [edi - 0x10]
mov ecx, dword [edi - 0x14]
push dword [edi - 0xc]
push dword [edi - 4]
push eax
push ecx
push dword [ebx + 0x18]
call dword [edi - 0x18]
mov edx, dword [ebp - 0x9c]
add esp, 0x14
mov dword [ebp + edx*4 - 0x14], eax
mov eax, dword [edi]
inc eax
mov dword [edi], eax
cmp eax, dword [edi - 8]
jl 0x526543
inc dword [edi + 4]
mov eax, dword [edi + 4]
mov ecx, dword [edi - 0x10]
mov dword [edi], 0
mov dword [edi - 0x14], ecx
cmp eax, dword [ebx]
jge 0x526543
mov eax, dword [ebx + 4]
add eax, ecx
mov dword [edi - 0x10], eax
inc edx
add edi, 0x20
add ebx, 0x48
mov dword [ebp - 0x9c], edx
cmp edx, esi
jl 0x5264e2
mov esi, dword [ebp - 0xa4]
mov ebx, dword [ebp - 0xd0]
mov edx, dword [ebp + 0x18]
mov edi, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x98]
mov eax, dword [ebx]
cmp edx, 3
jl 0x526792
mov ecx, dword [eax + 8]
cmp ecx, 3
jne 0x526611
cmp dword [ebp - 0xb4], 0
je 0x5265f6
cmp dword [eax], 0
mov dword [ebp - 0xa4], 0
jbe 0x52680d
mov ecx, dword [ebp - 0x10]
mov eax, edi
mov edi, dword [ebp - 0xc]
sub eax, ecx
add esi, 2
mov dword [ebp - 0x9c], eax
sub edi, ecx
mov dword [ebp - 0xa0], edi
mov edi, dword [ebp - 0xa4]
mov al, byte [eax + ecx]
lea ecx, [ecx + 1]
mov byte [esi - 2], al
inc edi
mov al, byte [ecx - 1]
mov byte [esi - 1], al
mov eax, dword [ebp - 0xa0]
mov al, byte [eax + ecx - 1]
mov byte [esi], al
mov byte [esi + 1], 0xff
add esi, edx
mov eax, dword [ebx]
cmp edi, dword [eax]
mov eax, dword [ebp - 0x9c]
jb 0x5265c0
mov edi, dword [ebp - 0x14]
jmp 0x52680d
push edx
push dword [eax]
mov eax, dword [ebx + 0x4810]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push edi
push esi
call eax
add esp, 0x18
jmp 0x52680a
cmp ecx, 4
jne 0x52676d
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x5266d3
mov dword [ebp - 0x9c], ecx
cmp dword [eax], ecx
jbe 0x52680d
mov eax, dword [ebp - 0x14]
add esi, 2
mov edx, dword [ebp - 0x10]
mov edi, eax
mov ecx, dword [ebp - 8]
sub edx, eax
mov dword [ebp - 0xa4], edx
sub ecx, eax
mov edx, dword [ebp - 0xc]
sub edx, eax
mov dword [ebp - 0xa8], ecx
mov dword [ebp - 0xa0], edx
nop
mov al, byte [ecx + edi]
mov byte [ebp - 0xbc], al
mov edx, dword [ebp - 0xbc]
movzx eax, byte [edi]
push edx
push eax
call fcn.00526e20
mov byte [esi - 2], al
mov eax, dword [ebp - 0xa4]
push edx
movzx eax, byte [eax + edi]
push eax
call fcn.00526e20
mov byte [esi - 1], al
mov eax, dword [ebp - 0xa0]
push edx
movzx eax, byte [eax + edi]
push eax
call fcn.00526e20
mov ecx, dword [ebp - 0x9c]
lea edi, [edi + 1]
mov edx, dword [ebp + 0x18]
inc ecx
mov byte [esi], al
add esp, 0x18
mov byte [esi + 1], 0xff
add esi, edx
mov eax, dword [ebx]
mov dword [ebp - 0x9c], ecx
cmp ecx, dword [eax]
mov ecx, dword [ebp - 0xa8]
jb 0x526660
mov edi, dword [ebp - 0x14]
jmp 0x52680d
push edx
push dword [eax]
mov eax, dword [ebx + 0x4810]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push edi
push esi
cmp ecx, 2
jne 0x526607
call eax
mov eax, dword [ebx]
add esp, 0x18
mov dword [ebp - 0xa8], 0
cmp dword [eax], 0
jbe 0x52680a
mov edi, dword [ebp - 0xa8]
add esi, 2
mov eax, dword [ebp - 8]
mov al, byte [eax + edi]
mov byte [ebp - 0xcc], al
or al, 0xff
sub al, byte [esi - 2]
mov edx, dword [ebp - 0xcc]
movzx eax, al
push edx
push eax
call fcn.00526e20
mov byte [esi - 2], al
or al, 0xff
sub al, byte [esi - 1]
movzx eax, al
push edx
push eax
call fcn.00526e20
mov byte [esi - 1], al
or al, 0xff
sub al, byte [esi]
movzx eax, al
push edx
push eax
call fcn.00526e20
mov edx, dword [ebp + 0x18]
inc edi
mov byte [esi], al
add esp, 0x18
mov eax, dword [ebx]
add esi, edx
cmp edi, dword [eax]
jb 0x526710
mov edi, dword [ebp - 0x14]
jmp 0x52680d
xor ecx, ecx
cmp dword [eax], ecx
jbe 0x52680d
inc esi
mov al, byte [edi + ecx]
inc ecx
mov byte [esi + 1], al
mov byte [esi], al
mov byte [esi - 1], al
mov byte [esi + 2], 0xff
add esi, edx
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x526778
jmp 0x52680d
cmp dword [ebp - 0xb4], 0
je 0x5268db
mov dword [ebp - 0xa8], 0
cmp edx, 1
jne 0x52687e
cmp dword [eax], 0
jbe 0x526813
mov edx, dword [ebp - 0x10]
mov ecx, edi
mov eax, dword [ebp - 0xc]
sub ecx, edx
mov edi, dword [ebp - 0xa8]
sub eax, edx
mov dword [ebp - 0xa4], eax
sub esi, edx
mov dword [ebp - 0xa0], ecx
movzx eax, byte [edx + eax]
push eax
movzx eax, byte [edx]
push eax
movzx eax, byte [edx + ecx]
push eax
call fcn.00528500
mov ecx, dword [ebp - 0xa0]
lea edx, [edx + 1]
mov byte [esi + edx - 1], al
inc edi
mov eax, dword [ebx]
add esp, 0xc
cmp edi, dword [eax]
mov eax, dword [ebp - 0xa4]
jb 0x5267d7
mov edi, dword [ebp - 0x14]
mov edx, dword [ebp + 0x18]
mov ecx, dword [ebp - 0x98]
mov eax, dword [ebx]
inc ecx
mov dword [ebp - 0x98], ecx
cmp ecx, dword [eax + 4]
jb 0x5264a0
mov esi, dword [ebp - 0xac]
push ebx
call fcn.00528100
mov eax, dword [ebx]
add esp, 4
mov ecx, dword [ebp - 0xc8]
mov edx, dword [ebp - 0xc4]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [ebx]
mov ecx, dword [ebp - 0xc0]
mov eax, dword [eax + 4]
mov dword [ecx], eax
test edx, edx
je 0x52686b
mov eax, dword [ebx]
xor ecx, ecx
cmp dword [eax + 8], 3
setge cl
lea ecx, [ecx*2 + 1]
mov dword [edx], ecx
mov eax, esi
pop esi
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c2ee0
mov esp, ebp
pop ebp
ret
cmp dword [eax], 0
jbe 0x526813
mov edx, dword [ebp - 0x10]
mov ecx, edi
mov eax, dword [ebp - 0xc]
mov edi, dword [ebp - 0xa8]
sub eax, edx
sub ecx, edx
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xa0], ecx
movzx eax, byte [edx + eax]
push eax
movzx eax, byte [edx]
push eax
movzx eax, byte [edx + ecx]
push eax
call fcn.00528500
mov ecx, dword [ebp - 0xa0]
lea edx, [edx + 1]
mov byte [esi], al
lea esi, [esi + 2]
mov byte [esi - 1], 0xff
inc edi
mov eax, dword [ebx]
add esp, 0xc
cmp edi, dword [eax]
mov eax, dword [ebp - 0xa4]
jb 0x5268a1
jmp 0x526807
mov ecx, dword [eax + 8]
cmp ecx, 4
jne 0x526a2e
cmp dword [ebx + 0x47e8], 0
jne 0x5269b7
cmp dword [eax], 0
mov dword [ebp - 0x9c], 0
jbe 0x52680d
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
sub ecx, edx
mov dword [ebp - 0xa4], ecx
sub eax, edx
mov ecx, edi
mov dword [ebp - 0xb8], eax
sub ecx, edx
mov edi, edx
mov dword [ebp - 0xa0], ecx
lea esp, [esp]
mov al, byte [eax + edi]
mov byte [ebp - 0xd4], al
mov edx, dword [ebp - 0xd4]
movzx eax, byte [edi]
push edx
push eax
call fcn.00526e20
add esp, 8
movzx eax, al
push eax
mov eax, dword [ebp - 0xa4]
push edx
movzx eax, byte [eax + edi]
push eax
call fcn.00526e20
add esp, 8
movzx eax, al
push eax
mov eax, dword [ebp - 0xa0]
push edx
movzx eax, byte [eax + edi]
push eax
call fcn.00526e20
add esp, 8
movzx eax, al
push eax
call fcn.00528500
mov ecx, dword [ebp - 0x9c]
lea edi, [edi + 1]
mov edx, dword [ebp + 0x18]
inc ecx
mov byte [esi], al
add esp, 0xc
mov byte [esi + 1], 0xff
add esi, edx
mov eax, dword [ebx]
mov dword [ebp - 0x9c], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xb8]
jb 0x526930
mov edi, dword [ebp - 0x14]
jmp 0x52680d
cmp ecx, 4
jne 0x526a2e
cmp dword [ebx + 0x47e8], 2
jne 0x526a2e
cmp dword [eax], 0
mov dword [ebp - 0x9c], 0
jbe 0x52680d
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
sub ecx, edx
mov edi, dword [ebp + 0x18]
mov dword [ebp - 0xb8], ecx
lea esp, [esp]
movzx eax, byte [edx + ecx]
push eax
or al, 0xff
sub al, byte [edx]
movzx eax, al
push eax
call fcn.00526e20
mov ecx, dword [ebp - 0x9c]
lea edx, [edx + 1]
mov byte [esi], al
inc ecx
mov byte [esi + 1], 0xff
add esp, 8
mov eax, dword [ebx]
add esi, edi
mov dword [ebp - 0x9c], ecx
cmp ecx, dword [eax]
mov ecx, dword [ebp - 0xb8]
jb 0x5269f0
jmp 0x526807
xor ecx, ecx
cmp edx, 1
jne 0x526a56
cmp dword [eax], ecx
jbe 0x52680d
mov edx, edi
sub edx, esi
mov al, byte [edx + esi]
lea esi, [esi + 1]
mov byte [esi - 1], al
inc ecx
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x526a41
jmp 0x52680a
cmp dword [eax], ecx
jbe 0x52680d
mov edi, edi
mov al, byte [edi + ecx]
lea esi, [esi + 2]
mov byte [esi - 2], al
inc ecx
mov byte [esi - 1], 0xff
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x526a60
jmp 0x52680d
push str.bad_req_comp
call fcn.0052a160
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
xor eax, eax
pop edi
pop ebx
call fcn.004c2ee0
mov esp, ebp
pop ebp
ret