Function at 0x404750
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0xcc
mov eax, dword [0x44a5a8]
xor eax, esp
mov dword [esp + 0xc8], eax
mov eax, dword [esp + 0xd4]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0xd8]
push ebx
mov ebx, dword [esp + 0xd4]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0xe0]
mov dword [esp + 0x38], eax
mov eax, dword [ebx]
mov dword [esp + 0x28], ebx
mov dword [eax + 8], 0
mov eax, dword [esp + 0xe4]
mov dword [esp + 0x10], eax
cmp eax, 4
ja 0x405015
push ebp
push ebx
call fcn.00408d40
mov ebp, dword [ebx]
add esp, 4
test eax, eax
jne 0x4047e4
push eax
push dword [ebp + 8]
push ebx
call fcn.00409070
add esp, 0xc
xor eax, eax
pop ebp
pop ebx
mov ecx, dword [esp + 0xc8]
xor ecx, esp
call fcn.00418b49
add esp, 0xcc
ret
mov eax, dword [esp + 0x14]
mov ebp, dword [ebp + 8]
mov dword [esp + 0x20], ebp
test eax, eax
jne 0x404804
cmp ebp, 3
setge al
lea eax, [eax*2 + 1]
mov dword [esp + 0x14], eax
cmp ebp, 3
jne 0x40482e
cmp dword [ebx + 0x47ec], ebp
je 0x404823
cmp dword [ebx + 0x47e8], 0
jne 0x40482e
cmp dword [ebx + 0x47e4], 0
jne 0x40482e
mov ecx, 1
mov dword [esp + 0x24], ecx
jmp 0x40483d
xor ecx, ecx
mov dword [esp + 0x24], ecx
cmp ebp, 3
jne 0x4048f1
cmp eax, 3
jge 0x4048f1
test ecx, ecx
jne 0x4048f1
mov ebp, 1
mov dword [esp + 0x20], ebp
push esi
xorps xmm0, xmm0
mov dword [esp + 0xc], 0
lea esi, [ebx + 0x46a0]
push edi
movups xmmword [esp + 0x48], xmm0
lea edi, [esp + 0x64]
mov dword [esp + 0x18], esi
mov eax, dword [ebx]
mov eax, dword [eax]
add eax, 3
push eax
call fcn.0041d0fe
add esp, 4
mov dword [esi + 0x34], eax
test eax, eax
je 0x404fe8
mov eax, dword [ebx + 0x4684]
cdq
idiv dword [esi]
mov dword [edi + 0x10], 0
mov dword [esp + 0x20], eax
mov dword [edi], eax
mov eax, dword [ebx + 0x4688]
cdq
idiv dword [esi + 4]
xor edx, edx
mov esi, eax
mov eax, dword [esp + 0x20]
mov ecx, esi
mov dword [edi + 4], esi
sar ecx, 1
dec eax
mov dword [edi + 0xc], ecx
mov ecx, dword [ebx]
mov ecx, dword [ecx]
add eax, ecx
mov ecx, dword [esp + 0x20]
div ecx
mov dword [edi + 8], eax
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 0x28]
mov dword [edi - 4], eax
mov dword [edi - 8], eax
cmp ecx, 1
jne 0x40492e
cmp esi, ecx
jne 0x404922
mov eax, 0x405880
jmp 0x404951
mov dword [esp + 0x24], ecx
test ebp, ebp
jg 0x404857
push 0
push ebp
push ebx
call fcn.00409070
add esp, 0xc
xor eax, eax
pop ebp
pop ebx
mov ecx, dword [esp + 0xc8]
xor ecx, esp
call fcn.00418b49
add esp, 0xcc
ret
cmp esi, 2
jne 0x40494c
mov eax, 0x4130d0
jmp 0x404951
cmp ecx, 2
jne 0x40494c
cmp esi, 1
jne 0x40493f
mov eax, 0x412dc0
jmp 0x404951
cmp esi, 2
jne 0x40494c
mov eax, dword [ebx + 0x4814]
jmp 0x404951
mov eax, 0x412d60
mov esi, dword [esp + 0x18]
mov dword [edi - 0xc], eax
add esi, 0x48
mov eax, dword [esp + 0x10]
add edi, 0x20
inc eax
mov dword [esp + 0x18], esi
mov dword [esp + 0x10], eax
cmp eax, ebp
jl 0x404877
mov eax, dword [ebx]
mov ecx, dword [esp + 0x1c]
mov edi, dword [eax + 4]
mov esi, dword [eax]
test ecx, ecx
js 0x404fe8
test esi, esi
js 0x404fe8
je 0x4049a0
mov eax, 0x7fffffff
cdq
idiv esi
cmp ecx, eax
jg 0x404fe8
mov ebp, esi
imul ebp, ecx
test ebp, ebp
js 0x404fe8
test edi, edi
js 0x404fe8
je 0x4049c7
mov eax, 0x7fffffff
cdq
idiv edi
cmp ebp, eax
jg 0x404fe8
imul esi, edi
imul esi, ecx
cmp esi, 0x7ffffffe
jg 0x404fe8
lea eax, [esi + 1]
push eax
call fcn.0041d0fe
mov ecx, eax
add esp, 4
mov eax, dword [ebx]
mov dword [esp + 0x18], ecx
test ecx, ecx
je 0x404fea
xor edx, edx
mov dword [esp + 0x38], edx
cmp dword [eax + 4], edx
jbe 0x404f8c
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x18], ecx
jmp 0x404a14
mov ecx, dword [esp + 0x18]
mov esi, dword [eax]
imul esi, edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x10], 0
imul esi, edx
add esi, ecx
cmp dword [esp + 0x28], 0
mov dword [esp + 0x24], esi
jle 0x404af2
mov esi, dword [esp + 0x2c]
lea ebp, [ebx + 0x46bc]
mov ebx, dword [esp + 0x28]
lea edi, [esp + 0x70]
jmp 0x404a54
mov ecx, dword [esp + 0x18]
mov eax, dword [edi - 8]
mov edx, ebx
sar eax, 1
mov dword [esp + 0x28], esi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x18], ecx
cmp dword [edi], eax
jl 0x404a7d
mov ebx, dword [esp + 0x20]
mov eax, dword [edi - 0x10]
mov ecx, dword [edi - 0x14]
mov dword [esp + 0x18], ebx
mov ebx, edx
jmp 0x404a83
mov eax, dword [edi - 0x14]
mov ecx, dword [edi - 0x10]
push dword [edi - 0xc]
push dword [edi - 4]
push ecx
push eax
push dword [ebp + 0x18]
call dword [edi - 0x18]
mov ecx, dword [esp + 0x24]
add esp, 0x14
mov dword [esp + ecx*4 + 0x48], eax
mov eax, dword [edi]
inc eax
mov dword [edi], eax
cmp eax, dword [edi - 8]
jl 0x404ac5
inc dword [edi + 4]
mov eax, dword [edi + 4]
mov edx, dword [edi - 0x10]
mov dword [edi], 0
mov dword [edi - 0x14], edx
cmp eax, dword [ebp]
jge 0x404ac5
mov eax, dword [ebp + 4]
add eax, edx
mov dword [edi - 0x10], eax
inc ecx
add edi, 0x20
add ebp, 0x48
mov dword [esp + 0x10], ecx
cmp ecx, ebx
jl 0x404a50
mov ebp, dword [esp + 0x48]
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x28], ebx
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x2c], esi
mov esi, dword [esp + 0x24]
mov eax, dword [ebx]
cmp edx, 3
jl 0x404d2f
mov ecx, dword [eax + 8]
cmp ecx, 3
jne 0x404b81
cmp dword [esp + 0x2c], 0
je 0x404b62
xor edi, edi
cmp dword [eax], edi
jbe 0x404d28
mov ecx, dword [esp + 0x4c]
add esi, 2
mov eax, dword [esp + 0x50]
mov dword [esp + 0x24], ebp
sub ebp, ecx
sub eax, ecx
mov dword [esp + 0x24], eax
nop dword [eax + eax]
movzx eax, byte [ecx + ebp]
lea ecx, [ecx + 1]
mov byte [esi - 2], al
inc edi
movzx eax, byte [ecx - 1]
mov byte [esi - 1], al
mov eax, dword [esp + 0x24]
movzx eax, byte [eax + ecx - 1]
mov byte [esi], al
mov byte [esi + 1], 0xff
add esi, edx
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x404b30
mov ebp, dword [esp + 0x48]
jmp 0x404f7a
push edx
push dword [eax]
mov eax, dword [ebx + 0x4810]
push dword [esp + 0x58]
push dword [esp + 0x58]
push ebp
push esi
call eax
mov eax, dword [ebx]
add esp, 0x18
jmp 0x404f7a
cmp ecx, 4
jne 0x404d08
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x404c49
mov dword [esp + 0x10], ecx
cmp dword [eax], ecx
jbe 0x404d28
mov edx, dword [esp + 0x54]
mov eax, ebp
mov ecx, dword [esp + 0x4c]
sub eax, edx
mov edi, dword [esp + 0x1c]
sub ecx, edx
mov dword [esp + 0x20], ecx
add esi, 2
mov ecx, dword [esp + 0x50]
mov ebp, edx
sub ecx, edx
mov dword [esp + 0x14], eax
mov dword [esp + 0x30], ecx
nop dword [eax]
movzx ecx, byte [eax + ebp]
lea ebp, [ebp + 1]
movzx edx, byte [ebp - 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 2], al
mov eax, dword [esp + 0x20]
movzx ecx, byte [eax + ebp - 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 1], al
mov eax, dword [esp + 0x30]
movzx ecx, byte [eax + ebp - 1]
imul ecx, edx
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [esp + 0x10]
shr eax, 8
inc ecx
mov byte [esi], al
add esi, edi
mov eax, dword [ebx]
mov dword [esp + 0x10], ecx
cmp ecx, dword [eax]
mov eax, dword [esp + 0x14]
jb 0x404bd0
mov ebp, dword [esp + 0x48]
mov eax, dword [ebx]
jmp 0x404f7a
mov eax, dword [eax]
mov edi, dword [ebx + 0x4810]
push edx
push eax
push dword [esp + 0x58]
push dword [esp + 0x58]
push ebp
push esi
cmp ecx, 2
jne 0x404cfc
call edi
mov eax, dword [ebx]
add esp, 0x18
mov dword [esp + 0x14], 0
cmp dword [eax], 0
jbe 0x404d28
mov edi, dword [esp + 0x1c]
add esi, 2
mov ebp, dword [esp + 0x14]
nop dword [eax]
mov eax, dword [esp + 0x54]
movzx edx, byte [eax + ebp]
inc ebp
movzx eax, byte [esi - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 2], al
movzx eax, byte [esi - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 1], al
movzx eax, byte [esi]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi], al
add esi, edi
mov eax, dword [ebx]
cmp ebp, dword [eax]
jb 0x404c90
mov ebp, dword [esp + 0x48]
jmp 0x404f7a
call edi
mov eax, dword [ebx]
add esp, 0x18
jmp 0x404f7a
xor ecx, ecx
cmp dword [eax], ecx
jbe 0x404d28
inc esi
nop
mov al, byte [ecx + ebp]
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 0x404d10
mov eax, dword [ebx]
jmp 0x404f7a
cmp dword [esp + 0x2c], 0
je 0x404e01
mov ecx, dword [eax]
xor edi, edi
cmp edx, 1
jne 0x404da0
test ecx, ecx
je 0x404f7a
mov eax, dword [esp + 0x4c]
mov edx, ebp
mov ecx, dword [esp + 0x50]
sub eax, ebp
sub ecx, ebp
mov dword [esp + 0x14], eax
sub esi, ebp
mov dword [esp + 0x30], ecx
mov ebp, eax
movzx eax, byte [ecx + edx]
lea edx, [edx + 1]
imul ecx, eax, 0x1d
inc edi
movzx eax, byte [edx + ebp - 1]
imul eax, eax, 0x96
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
add ecx, eax
shr ecx, 8
mov byte [esi + edx - 1], cl
mov eax, dword [ebx]
mov ecx, dword [esp + 0x30]
cmp edi, dword [eax]
jb 0x404d65
mov ebp, dword [esp + 0x48]
jmp 0x404f7a
test ecx, ecx
je 0x404f7a
mov eax, dword [esp + 0x4c]
mov edx, ebp
mov ecx, dword [esp + 0x50]
sub eax, ebp
sub ecx, ebp
mov dword [esp + 0x14], eax
mov dword [esp + 0x30], ecx
mov ebp, eax
movzx eax, byte [edx + ecx]
lea edx, [edx + 1]
imul ecx, eax, 0x1d
lea esi, [esi + 2]
movzx eax, byte [edx + ebp - 1]
inc edi
imul eax, eax, 0x96
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
mov byte [esi - 1], 0xff
add ecx, eax
shr ecx, 8
mov byte [esi - 2], cl
mov eax, dword [ebx]
mov ecx, dword [esp + 0x30]
cmp edi, dword [eax]
jb 0x404dc0
mov ebp, dword [esp + 0x48]
jmp 0x404f7a
cmp dword [eax + 8], 4
jne 0x404f3f
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x404ee8
mov dword [esp + 0x10], ecx
cmp dword [eax], ecx
jbe 0x404f7a
mov edi, dword [esp + 0x54]
mov ecx, ebp
mov eax, dword [esp + 0x4c]
sub ecx, edi
mov ebp, dword [esp + 0x1c]
sub eax, edi
mov dword [esp + 0x14], eax
mov edx, edi
mov eax, dword [esp + 0x50]
sub eax, edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], ecx
mov dword [esp + 0x30], eax
nop
movzx edi, byte [edx + ecx]
movzx eax, byte [edx]
mov ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0x30]
imul edi, eax
movzx ecx, byte [edx + ecx]
movzx edx, byte [edx + ebx]
imul ecx, eax
imul edx, eax
sub edi, 0xffffff80
mov ebx, dword [esp + 0x34]
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
sub edx, 0xffffff80
shr eax, 8
add eax, ecx
shr eax, 8
movzx eax, al
imul ecx, eax, 0x96
mov eax, edx
shr eax, 8
add eax, edx
mov edx, dword [esp + 0x20]
shr eax, 8
inc edx
movzx eax, al
imul eax, eax, 0x1d
mov dword [esp + 0x20], edx
add ecx, eax
mov eax, edi
shr eax, 8
add eax, edi
shr eax, 8
movzx eax, al
imul eax, eax, 0x4d
add ecx, eax
shr ecx, 8
mov byte [esi], cl
add esi, ebp
mov ecx, dword [esp + 0x10]
mov eax, dword [ebx]
inc ecx
mov dword [esp + 0x10], ecx
cmp ecx, dword [eax]
mov ecx, dword [esp + 0x24]
jb 0x404e50
mov ebp, dword [esp + 0x48]
jmp 0x404f7a
cmp ecx, 2
jne 0x404f3f
xor edi, edi
cmp dword [eax], edi
jbe 0x404f7a
mov edx, dword [esp + 0x54]
mov ecx, ebp
mov ebp, dword [esp + 0x1c]
sub ecx, edx
mov dword [esp + 0x14], ecx
mov al, byte [ecx + edx]
lea edx, [edx + 1]
not al
inc edi
movzx ecx, al
movzx eax, byte [edx - 1]
imul ecx, eax
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [esp + 0x14]
shr eax, 8
mov byte [esi], al
add esi, ebp
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x404f07
mov ebp, dword [esp + 0x48]
jmp 0x404f7a
mov edi, dword [eax]
xor ecx, ecx
cmp edx, 1
jne 0x404f62
test edi, edi
je 0x404f7a
mov edx, ebp
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 0x404f50
jmp 0x404f7a
test edi, edi
je 0x404f7a
mov al, byte [ecx + ebp]
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 0x404f66
mov edx, dword [esp + 0x38]
inc edx
mov dword [esp + 0x38], edx
cmp edx, dword [eax + 4]
jb 0x404a10
push 0
push dword [eax + 8]
push ebx
call fcn.00409070
mov eax, dword [ebx]
add esp, 0xc
mov ecx, dword [esp + 0x3c]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [ebx]
mov ecx, dword [esp + 0x40]
mov eax, dword [eax + 4]
mov dword [ecx], eax
mov eax, dword [esp + 0x44]
test eax, eax
je 0x404fcb
mov ecx, dword [ebx]
xor edx, edx
cmp dword [ecx + 8], 3
setge dl
lea edx, [edx*2 + 1]
mov dword [eax], edx
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xc8]
xor ecx, esp
call fcn.00418b49
add esp, 0xcc
ret
mov eax, dword [ebx]
push 0
push dword [eax + 8]
push ebx
call fcn.00409070
mov ecx, dword [0x44b8a8]
add esp, 0xc
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.outofmem
xor eax, eax
jmp 0x404fcf
mov ecx, dword [0x44b8a8]
mov eax, dword fs:[0x2c]
pop ebx
mov eax, dword [eax + ecx*4]
mov ecx, dword [esp + 0xc8]
xor ecx, esp
mov dword [eax + 0xc], str.bad_req_comp
xor eax, eax
call fcn.00418b49
add esp, 0xcc
ret