Function at 0x401f40
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
push ebx
xor ecx, ecx
push esi
push edi
mov eax, 0xcf
mov esi, 0x3f4e
mov ebx, 0x6a77
xor edi, edi
mov dword [ebp - 8], ecx
mov dword [ebp - 4], ecx
mov dword [ebp - 0xc], 0x2a6d
mov dword [ebp - 0x10], 0x7ea9
mov dword [ebp - 0x14], 0x1b
mov dword [ebp - 0x18], ecx
mov edx, 0x58b6
mov dword [ebp - 0x1c], 0x3f
cmp eax, 0x3f
cmovg eax, dword [ebp - 0x1c]
dec edx
jne 0x401f86
cmp dword [ebp + 8], ecx
je 0x4024e0
cmp dword [ebp + 0xc], ecx
je 0x4024e0
mov eax, dword [ebp + 0x10]
lea edx, [eax + 0x1cc]
mov eax, dword [eax + 0x370]
xor eax, dword [edx]
cmp dword [ebp + 0xc], eax
jl 0x4024e0
lea esp, [esp]
mov eax, 0x10624dd3
imul ebx
sar edx, 3
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
jne 0x401fc0
call fcn.00403610
mov ecx, dword [ebp + 0x10]
mov edi, 0x1ea7
lea esi, [ecx + 0x1cc]
mov dword [ecx + 0xe4], eax
mov eax, dword [esi]
xor dword [ecx + 0x74], eax
mov eax, 0x17ad2209
imul edi
sar edx, 4
mov edi, edx
shr edi, 0x1f
add edi, edx
jne 0x401ff1
mov eax, 0x227
lea esp, [esp]
dec eax
jne 0x402010
mov eax, dword [ebp + 0xc]
xor edx, edx
div dword [ecx + 0x74]
mov dword [ecx + 0x180], esi
mov ebx, eax
mov dword [ecx + 0x364], ebx
lea esp, [esp]
inc edi
mov eax, edi
and eax, 0x80000007
jns 0x40203f
dec eax
or eax, 0xfffffff8
inc eax
jne 0x402042
inc edi
cmp edi, 0x6fb
jl 0x402030
imul ebx, dword [ecx + 0x74]
mov edi, ecx
mov eax, 0x202d
mov dword [edi + 0x1c], ebx
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
test eax, eax
jne 0x402058
xor esi, esi
test ebx, ebx
je 0x4020b4
mov ebx, dword [ebp + 8]
mov edi, edi
mov eax, dword [edi + 0x180]
inc esi
mov al, byte [eax]
xor byte [esi + ebx - 1], al
movzx ecx, byte [esi + ebx - 1]
mov eax, dword [edi + 0x180]
mov dl, byte [eax + 1]
xor dl, cl
mov byte [esi + ebx - 1], dl
mov eax, dword [edi + 0x180]
mov cl, byte [eax + 2]
xor cl, dl
mov byte [esi + ebx - 1], cl
mov eax, dword [edi + 0x180]
mov al, byte [eax + 3]
xor al, cl
mov byte [esi + ebx - 1], al
cmp esi, dword [edi + 0x1c]
jb 0x402070
mov eax, dword [edi + 0x74]
xor esi, esi
dec eax
je 0x40213c
mov eax, dword [edi + 0x74]
dec eax
push eax
push 1
push edi
call fcn.00403490
mov bl, al
mov eax, dword [ebp - 8]
add esp, 0xc
inc eax
cmp eax, 5
jl 0x4020d5
mov dword [ebp - 8], eax
xor ecx, ecx
cmp bl, byte [edi + ecx + 0x1e0]
je 0x4020f0
inc ecx
cmp ecx, esi
jbe 0x4020e0
jmp 0x4020f2
xor bl, bl
mov edx, dword [ebp - 4]
cmp edx, 0x5f47
jge 0x402128
mov ecx, 0x5f46
sub ecx, edx
mov eax, 0x24924925
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
mov edx, dword [ebp - 4]
shr ecx, 2
add edx, 7
lea eax, [ecx*8]
sub eax, ecx
add edx, eax
mov dword [ebp - 4], edx
test bl, bl
je 0x402134
mov byte [edi + esi + 0x1e0], bl
inc esi
mov eax, dword [edi + 0x74]
dec eax
cmp esi, eax
jb 0x4020c0
mov ecx, 0x6e04
mov eax, 0x86d90545
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x402141
push 0x2c
push ecx
lea eax, [ebp - 0x7b]
push eax
mov byte [ebp - 0x7c], cl
call fcn.00403350
lea eax, [ebp - 0x7c]
push eax
call fcn.00402cd0
add esp, 0x10
mov ecx, 0x241e
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x402176
mov dword [ebp - 0x38], 0xbd6dc294
mov dword [ebp - 0x34], 0xb5d47435
mov dword [ebp - 0x30], 0xb7eb1104
mov dword [ebp - 0x2c], 0x15c14183
mov dword [ebp - 0x28], 0x1dc8ddff
mov dword [ebp - 0x24], ecx
mov edi, 0x187b
mov eax, 0x214d0215
imul edi
sar edx, 4
mov edi, edx
shr edi, 0x1f
add edi, edx
jne 0x4021b6
mov edi, dword [ebp + 0x10]
xor ebx, ebx
mov edi, edi
inc ebx
mov eax, 0x92492493
imul ebx
add edx, ebx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax*8]
sub ecx, eax
mov eax, ebx
sub eax, ecx
jne 0x4021f6
add ebx, 2
cmp ebx, 0x7b05
jl 0x4021d0
movq xmm0, qword [ebp - 0x38]
lea ebx, [edi + 0x188]
mov dword [ebp - 0x1c], ebx
movq qword [ebx], xmm0
movq xmm0, qword [ebp - 0x30]
movq qword [ebx + 8], xmm0
movq xmm0, qword [ebp - 0x28]
movq qword [ebx + 0x10], xmm0
mov byte [ebx + 0x18], 0
xor eax, eax
lea ebx, [ebx]
xor byte [ebp + eax - 0x7c], 0x3f
inc eax
cmp eax, 0x2b
jb 0x402230
mov edi, 0x4fcf
mov eax, 0x66666667
imul edi
sar edx, 2
mov edi, edx
shr edi, 0x1f
add edi, edx
jne 0x402240
mov edi, dword [ebp + 0x10]
xor eax, eax
mov dword [ebp - 8], eax
cmp dword [edi + 0x74], eax
jbe 0x4023aa
jmp 0x402270
movzx ebx, byte [eax + edi + 0x1e0]
imul ebx, dword [edi + 0x364]
add ebx, dword [ebp + 8]
push 0x2c
lea eax, [ebp - 0x4b]
push 0
push eax
mov dword [edi + 0x100], ebx
mov byte [ebp - 0x4c], 0
call fcn.00403350
push 0x2c
lea eax, [ebp - 0x4c]
push ebx
push eax
call fcn.00403320
mov ecx, dword [ebp - 0xc]
add esp, 0x18
test ecx, ecx
je 0x4022c6
nop
mov eax, 0x1948b0fd
imul ecx
sar edx, 3
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x4022b0
mov dword [ebp - 0xc], ecx
mov ecx, 0xa
lea esi, [ebp - 0x7c]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp - 0x10]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
test ecx, ecx
je 0x4022f6
lea esp, [esp]
mov eax, 0x7e07e07f
imul ecx
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x4022e0
mov dword [ebp - 0x10], ecx
mov edi, dword [ebp + 0x10]
mov eax, dword [edi + 0x100]
call eax
push 0x2c
lea eax, [ebp - 0x4c]
push eax
push ebx
call fcn.00403320
mov ecx, dword [ebp - 0x14]
add esp, 0xc
mov eax, 0xc5d
mov edx, 0xea
lea ecx, [ecx]
cmp ecx, edx
cmovg ecx, edx
dec eax
jne 0x402320
xor esi, esi
mov dword [ebp - 0x14], ecx
cmp dword [edi + 0x364], esi
jbe 0x40237c
mov eax, dword [edi + 0x180]
inc esi
mov al, byte [eax + 3]
xor byte [esi + ebx - 1], al
movzx ecx, byte [esi + ebx - 1]
mov eax, dword [edi + 0x180]
mov dl, byte [eax + 2]
xor dl, cl
mov byte [esi + ebx - 1], dl
mov eax, dword [edi + 0x180]
mov cl, byte [eax + 1]
xor cl, dl
mov byte [esi + ebx - 1], cl
mov eax, dword [edi + 0x180]
mov al, byte [eax]
xor al, cl
mov byte [esi + ebx - 1], al
cmp esi, dword [edi + 0x364]
jb 0x402335
mov ecx, dword [ebp - 0x18]
cmp ecx, 0x2594
jge 0x40239a
mov eax, 0x2593
sub eax, ecx
shr eax, 3
lea ecx, [ecx + eax*8]
add ecx, 8
mov dword [ebp - 0x18], ecx
mov eax, dword [ebp - 8]
inc eax
mov dword [ebp - 8], eax
cmp eax, dword [edi + 0x74]
jb 0x402270
call fcn.00403610
mov esi, eax
mov dword [edi + 0x7c], esi
mov ecx, 0x838
lea esp, [esp]
mov eax, 0x8a42f871
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x4023c0
xor ebx, ebx
inc ebx
mov eax, 0x55555556
imul ebx
mov eax, edx
shr eax, 0x1f
add eax, edx
mov ecx, ebx
lea eax, [eax + eax*2]
sub ecx, eax
jne 0x4023f2
add ebx, 2
cmp ebx, 0x21a
jl 0x4023d7
lea eax, [esi - 2]
push eax
push dword [edi + 0xe4]
call fcn.00401110
mov ebx, dword [ebp - 0x1c]
add esp, 8
mov ecx, 0x21a3
mov eax, 0x94458095
imul ecx
add edx, ecx
sar edx, 7
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x402414
mov edi, 0x4ed0
mov edi, edi
mov eax, 0x6bca1af3
imul edi
sar edx, 6
mov edi, edx
shr edi, 0x1f
add edi, edx
jne 0x402430
push 0x240150f
push ebx
call fcn.00401d50
mov edi, dword [ebp + 0x10]
add esp, 8
mov ecx, 0x4110
lea esp, [esp]
mov eax, 0x8d3dcb09
imul ecx
add edx, ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x402460
mov ecx, 0x278d
lea ebx, [ebx]
dec ecx
jne 0x402480
mov eax, dword [ebp + 0xc]
cdq
and edx, 0xff
mov ebx, 0x1b60
lea esi, [edx + eax]
sar esi, 8
jmp 0x4024a0
mov eax, 0x2c0b02c1
imul ebx
sar edx, 5
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
jne 0x4024a0
lea ebx, [edi + 0x188]
test esi, esi
je 0x402515
mov edi, dword [ebp + 8]
push ebx
push 0x100
push edi
call fcn.00403380
add esp, 0xc
add edi, 0x100
dec esi
jne 0x4024c0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
inc ecx
mov eax, ecx
and eax, 0x80000001
jns 0x4024ef
dec eax
or eax, 0xfffffffe
inc eax
jne 0x4024f2
inc ecx
cmp ecx, 0x5de0
jl 0x4024e0
lea ebx, [ebx]
mov eax, 0xb92143fb
imul esi
add edx, esi
sar edx, 7
mov esi, edx
shr esi, 0x1f
add esi, edx
jne 0x402500
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret