Function at 0x403e46
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x34], esi
mov eax, dword [esi + 0x1c]
mov edx, dword [esi + 0x24]
mov edi, dword [esi + 0x28]
mov ecx, dword [esi + 0x2c]
mov ebx, dword [esi + 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x3c]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x38]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
and eax, 0x7fff
mov dword [ebp - 0x1c], edx
mov dword [ebp - 8], edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 0x88]
test eax, eax
jne 0x403ea4
cmp dword [esi + 0x80], eax
je 0x404271
test ebx, ebx
je 0x404271
mov eax, dword [ebp - 0x10]
mov edi, dword [esi + 0x88]
add eax, ebx
and eax, 0x7fff
mov dword [ebp - 0x2c], eax
mov eax, 0x1000
sub eax, ebx
cmp edi, eax
cmovb eax, edi
sub edi, eax
mov dword [ebp - 0x30], eax
add ebx, eax
mov dword [esi + 0x88], edi
mov edi, dword [ebp - 8]
mov dword [ebp - 0x28], ebx
test eax, eax
je 0x403f55
mov edi, dword [ebp - 0x2c]
mov ebx, eax
mov eax, 0x8000
mov ecx, ebx
sub eax, edi
cmp eax, ebx
cmovb ecx, eax
lea eax, [edi + 0x90]
push ecx
push dword [esi + 0x84]
add eax, esi
mov dword [ebp - 0x2c], ecx
push eax
call dword [0x4122b8]
mov eax, 0x101
add esp, 0xc
cmp edi, eax
jae 0x403f34
sub eax, edi
cmp dword [ebp - 0x2c], eax
cmovb eax, dword [ebp - 0x2c]
push eax
push dword [esi + 0x84]
lea eax, [esi + 0x8090]
add eax, edi
push eax
call dword [0x4122b8]
add esp, 0xc
mov eax, dword [ebp - 0x2c]
add edi, eax
add dword [esi + 0x84], eax
and edi, 0x7fff
sub ebx, eax
jne 0x403edf
mov edi, dword [ebp - 8]
mov ebx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x1c]
mov eax, 0x8000
sub eax, ebx
cmp eax, edx
cmovb edx, eax
cmp dword [esi + 0x80], 0
mov dword [ebp - 0x1c], edx
jne 0x403f79
cmp ebx, 0x1000
jb 0x404271
cmp ebx, 4
jb 0x4041a5
lea eax, [esi + 0x1926a]
mov dword [ebp - 0x3c], eax
xor eax, eax
mov ecx, dword [ebp - 0x10]
inc eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x24]
add eax, 0x90
add eax, esi
mov dword [ebp - 0x30], eax
mov eax, dword [eax]
and eax, 0xffffff
mov dword [ebp - 0x2c], eax
shr eax, 0x11
xor eax, dword [ebp - 0x2c]
and eax, 0xfff
movzx edi, word [esi + eax*2 + 0x29272]
mov word [esi + eax*2 + 0x29272], cx
mov eax, ecx
mov ecx, dword [ebp - 0x14]
sub eax, edi
movzx eax, ax
mov dword [ebp - 0x38], edi
mov edi, dword [ebp - 8]
mov dword [ebp - 0x20], eax
cmp eax, edx
ja 0x4040ee
mov edx, dword [ebp - 0x38]
and edx, 0x7fff
add edx, 0x90
add edx, esi
mov eax, dword [edx]
and eax, 0xffffff
cmp eax, dword [ebp - 0x2c]
jne 0x4040ee
mov ecx, dword [ebp - 0x30]
push 0x20
pop edi
add ecx, 2
add edx, 2
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x404043
add ecx, 2
add edx, 2
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x404043
add ecx, 2
add edx, 2
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x404043
add ecx, 2
add edx, 2
mov ax, word [ecx]
cmp ax, word [edx]
jne 0x404043
dec edi
jne 0x404008
mov al, byte [ecx]
mov dword [ebp - 0x28], edx
mov edx, ecx
mov esi, dword [ebp - 0x28]
xor ecx, ecx
sub edx, dword [ebp - 0x30]
sar edx, 1
cmp al, byte [esi]
mov esi, dword [ebp - 0x34]
sete cl
test edi, edi
mov edi, dword [ebp - 8]
lea eax, [ecx + edx*2]
mov ecx, dword [ebp - 0x20]
jne 0x404074
mov eax, ecx
neg eax
sbb eax, eax
and eax, 0x102
cmp eax, 3
jb 0x4040e3
jne 0x404083
cmp ecx, 0x2000
jae 0x4040e3
cmp eax, ebx
mov edx, ebx
dec ecx
cmovb edx, eax
mov word [edi + 1], cx
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x28], edx
lea eax, [edx - 3]
mov byte [edi], al
add edi, 3
mov al, byte [ecx]
shr al, 1
or al, 0x80
mov byte [ecx], al
mov eax, dword [ebp - 0x20]
and eax, 0x1ff
movzx ecx, byte [eax + 0x40f240]
mov eax, dword [ebp - 0x20]
shr eax, 8
cmp dword [ebp - 0x20], 0x200
movzx eax, byte [eax + 0x40f1c0]
cmovb eax, ecx
mov ecx, dword [ebp - 0x14]
inc word [esi + eax*2 + 0x83d2]
movzx eax, word [edx*2 + 0x40f43a]
jmp 0x4040fc
mov ecx, dword [ebp - 0x14]
xor edx, edx
inc edx
mov dword [ebp - 0x28], edx
jmp 0x4040f1
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x2c]
mov byte [edi], al
inc edi
shr byte [ecx], 1
movzx eax, al
inc word [esi + eax*2 + 0x8192]
dec dword [ebp - 0xc]
mov dword [ebp - 8], edi
jne 0x40411c
mov ecx, edi
mov dword [ebp - 0xc], 8
inc edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 8], edi
mov eax, dword [ebp - 0x1c]
mov esi, 0x8000
add dword [ebp - 0x18], edx
add eax, edx
add dword [ebp - 0x10], edx
cmp eax, esi
mov edx, esi
mov esi, dword [ebp - 0x24]
cmovb edx, eax
add esi, dword [ebp - 0x28]
sub ebx, dword [ebp - 0x28]
and esi, 0x7fff
mov dword [ebp - 0x24], esi
mov esi, dword [ebp - 0x34]
mov dword [ebp - 0x1c], edx
cmp edi, dword [ebp - 0x3c]
jbe 0x40419c
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x24], edx
xor edx, edx
mov dword [esi + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x2c], ecx
mov ecx, esi
mov dword [esi + 0x20], ebx
mov dword [esi + 0x28], edi
mov dword [esi + 0x38], eax
call fcn.004037a9
mov ecx, eax
test ecx, ecx
jne 0x404294
mov eax, dword [esi + 0x3c]
mov edi, dword [esi + 0x28]
mov ecx, dword [esi + 0x2c]
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x38]
mov dword [ebp - 8], edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0xc], eax
cmp ebx, 4
jae 0x403f8b
test ebx, ebx
je 0x403e86
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x24]
inc dword [ebp - 0x18]
mov cl, byte [esi + ecx + 0x90]
mov byte [edi], cl
inc edi
mov byte [ebp - 1], cl
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 8], edi
shr byte [ecx], 1
dec eax
mov dword [ebp - 0xc], eax
jne 0x4041e1
mov ecx, edi
mov dword [ebp - 0xc], 8
inc edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 8], edi
movzx eax, byte [ebp - 1]
inc word [esi + eax*2 + 0x8192]
lea eax, [edx + 1]
inc dword [ebp - 0x10]
mov edx, 0x8000
cmp eax, edx
cmovb edx, eax
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x1c], edx
and eax, 0x7fff
dec ebx
mov dword [ebp - 0x24], eax
lea eax, [esi + 0x1926a]
cmp edi, eax
jbe 0x404261
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x24], edx
xor edx, edx
mov dword [esi + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x2c], ecx
mov ecx, esi
mov dword [esi + 0x20], ebx
mov dword [esi + 0x28], edi
mov dword [esi + 0x38], eax
call fcn.004037a9
mov ecx, eax
test ecx, ecx
jne 0x404294
mov eax, dword [esi + 0x3c]
mov edi, dword [esi + 0x28]
mov ecx, dword [esi + 0x2c]
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x38]
mov dword [ebp - 8], edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0xc], eax
jmp 0x404264
mov eax, dword [ebp - 0xc]
test ebx, ebx
jne 0x4041b0
jmp 0x403e86
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x3c], eax
mov eax, dword [ebp - 0xc]
mov dword [esi + 0x38], eax
xor eax, eax
mov dword [esi + 0x20], ebx
inc eax
mov dword [esi + 0x24], edx
mov dword [esi + 0x28], edi
mov dword [esi + 0x2c], ecx
jmp 0x40429b
xor eax, eax
test ecx, ecx
setns al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret