Function at 0x4d9f40
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff0
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov byte [ebp - 5], dl
mov dword [ebp - 4], eax
mov esi, dword [ebp + 0x34]
mov byte [ebp - 0xd], 0
mov eax, dword [ebp + 0x2c]
xor edx, edx
test eax, eax
je 0x4d9f66
mov al, 1
jmp 0x4d9f70
mov eax, dword [ebp + 0x24]
xor edx, edx
test eax, eax
setne al
test al, al
je 0x4d9f95
cmp dword [ebp - 4], 0
je 0x4da36a
mov ecx, 0x402
mov edx, 0xa52
mov eax, dword [ebp - 4]
call fcn.0043e1d4
jmp 0x4da36a
mov ebx, dword [ebp - 0xc]
add ebx, 0x1be
cmp dword [ebp + 0xc], 0
jne 0x4d9fcb
cmp dword [ebp + 8], 0
jne 0x4d9fcb
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax + 0x25]
test al, al
je 0x4d9fb9
cmp al, 1
jne 0x4d9fcb
mov word [ebx + 0x40], 0
mov eax, dword [ebp - 0xc]
add eax, 0x1b8
xor edx, edx
mov dword [eax], edx
cmp esi, 0xffffffff
jne 0x4da182
or edi, 0xffffffff
xor esi, esi
cmp word [ebx + 0x40], 0xaa55
jne 0x4d9fec
mov eax, esi
add eax, eax
cmp byte [ebx + eax*8 + 4], 0
jne 0x4da01b
mov eax, esi
add eax, eax
cmp dword [ebx + eax*8 + 8], 0
je 0x4da03c
mov ecx, esi
add ecx, ecx
mov eax, dword [ebx + ecx*8 + 8]
xor edx, edx
cmp edx, dword [ebp + 0x2c]
jne 0x4da01b
cmp eax, dword [ebp + 0x28]
jne 0x4da01b
mov eax, dword [ebx + ecx*8 + 0xc]
xor edx, edx
cmp edx, dword [ebp + 0x24]
jne 0x4da01b
cmp eax, dword [ebp + 0x20]
je 0x4da03c
cmp edi, 0xffffffff
jne 0x4da036
mov eax, esi
add eax, eax
mov eax, dword [ebx + eax*8 + 8]
xor edx, edx
cmp edx, dword [ebp + 0x2c]
jne 0x4da036
cmp eax, dword [ebp + 0x28]
jne 0x4da036
mov edi, esi
inc esi
cmp esi, 4
jl 0x4d9fd9
cmp esi, 4
jl 0x4da047
test edi, edi
jl 0x4da047
mov esi, edi
cmp esi, 4
jl 0x4da09d
cmp word [ebx + 0x40], 0xaa55
je 0x4da058
xor esi, esi
jmp 0x4da09d
dec esi
mov eax, esi
add eax, eax
cmp byte [ebx + eax*8 + 4], 0
je 0x4da09d
test esi, esi
jne 0x4da058
cmp dword [ebp - 4], 0
je 0x4da36a
cmp byte [ebp - 5], 0
je 0x4da07f
mov edi, 0x58b
jmp 0x4da081
xor edi, edi
push edi
push 0x402
push 0
xor ecx, ecx
mov edx, 0x59a
mov eax, dword [ebp - 4]
call fcn.0043e188
jmp 0x4da36a
cmp word [ebx + 0x40], 0xaa55
jne 0x4da108
mov edi, esi
cmp edi, 3
jge 0x4da108
inc edi
mov eax, edi
add eax, eax
cmp byte [ebx + eax*8 + 4], 0
je 0x4da0d0
mov eax, edi
add eax, eax
mov eax, dword [ebx + eax*8 + 8]
xor edx, edx
cmp edx, dword [ebp + 0x2c]
jne 0x4da0ce
cmp eax, dword [ebp + 0x28]
jb 0x4da0d0
jmp 0x4da108
jge 0x4da108
mov eax, edi
add eax, eax
cmp byte [ebx + eax*8 + 4], 0
je 0x4da103
mov eax, edi
sub eax, esi
mov ecx, eax
shl ecx, 4
mov eax, esi
add eax, eax
lea edx, [ebx + eax*8]
mov eax, esi
add eax, eax
lea eax, [ebx + eax*8 + 0x10]
call fcn.00402da0
mov esi, edi
mov eax, esi
add eax, eax
mov byte [ebx + eax*8 + 4], 0
cmp edi, 3
jl 0x4da0ac
mov edi, esi
test esi, esi
jle 0x4da167
cmp word [ebx + 0x40], 0xaa55
jne 0x4da139
mov eax, esi
add eax, eax
cmp byte [ebx + eax*8 - 0xc], 0
je 0x4da139
mov eax, esi
add eax, eax
mov eax, dword [ebx + eax*8 - 8]
xor edx, edx
cmp edx, dword [ebp + 0x2c]
jne 0x4da137
cmp eax, dword [ebp + 0x28]
ja 0x4da139
jmp 0x4da167
jle 0x4da167
dec esi
cmp word [ebx + 0x40], 0xaa55
jne 0x4da14d
mov eax, esi
add eax, eax
cmp byte [ebx + eax*8 + 4], 0
jne 0x4da163
mov eax, esi
add eax, eax
mov edx, edi
add edx, edx
push esi
lea esi, [ebx + eax*8]
lea edi, [ebx + edx*8]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
pop esi
mov edi, esi
test esi, esi
jg 0x4da10e
cmp esi, edi
jge 0x4da182
sub edi, esi
mov ecx, edi
shl ecx, 4
mov eax, esi
add eax, eax
lea edx, [ebx + eax*8 + 0x10]
lea eax, [ebx + eax*8]
call fcn.00402da0
cmp word [ebx + 0x40], 0xaa55
jne 0x4da194
mov eax, dword [ebp - 0xc]
call fcn.004d9f18
jmp 0x4da201
xor edi, edi
mov eax, edi
add eax, eax
mov byte [ebx + eax*8 + 4], 0
mov byte [ebx + eax*8], 0
inc edi
cmp edi, 4
jne 0x4da196
mov word [ebx + 0x40], 0xaa55
cmp dword [ebp + 0xc], 0
jne 0x4da201
cmp dword [ebp + 8], 0
jne 0x4da201
mov eax, dword [ebp - 0xc]
add eax, 0x1b8
cmp dword [eax], 0
jne 0x4da201
xor edi, edi
mov eax, pe_nt_image_headers32
call fcn.00403024
lea edx, [edi + 0x1b8]
mov ecx, dword [ebp - 0xc]
mov byte [ecx + edx], al
inc edi
cmp edi, 4
jne 0x4da1ca
mov eax, dword [ebp - 0xc]
add eax, 0x1b8
cmp dword [eax], 0
jne 0x4da201
mov eax, dword [ebp - 0xc]
add eax, 0x1b8
mov dword [eax], 1
mov eax, esi
add eax, eax
lea edi, [ebx + eax*8]
mov byte [edi], 0
mov eax, dword [ebp + 0x1c]
xor edx, edx
test eax, eax
je 0x4da221
mov esi, 0x3ff
mov bl, 0x3e
mov byte [edi + 1], 0xfe
jmp 0x4da27c
mov eax, dword [ebp + 0x18]
mov ecx, eax
mov eax, ecx
mov edx, dword [ebp + 0x10]
mov edx, dword [edx]
movzx esi, word [edx + 0x14ee]
xor edx, edx
div esi
mov ebx, edx
mov eax, ecx
xor edx, edx
div esi
mov esi, eax
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
movzx eax, word [eax + 0x14ec]
push eax
mov eax, esi
pop edx
mov ecx, edx
xor edx, edx
div ecx
mov byte [edi + 1], dl
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
movzx ecx, word [eax + 0x14ec]
mov eax, esi
xor edx, edx
div ecx
mov esi, eax
cmp esi, 0x3ff
jbe 0x4da27c
mov esi, 0x3ff
lea edx, [ebx + 1]
mov eax, esi
call fcn.00481ff0
mov word [edi + 2], ax
movzx eax, byte [ebp + 0x30]
mov byte [edi + 4], al
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp + 0x1c]
add eax, dword [ebp + 0x20]
adc edx, dword [ebp + 0x24]
mov eax, edx
xor edx, edx
test eax, eax
je 0x4da2b2
mov esi, 0x400
mov bl, 0x3e
mov byte [edi + 5], 0xff
jmp 0x4da31f
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp + 0x1c]
add eax, dword [ebp + 0x20]
adc edx, dword [ebp + 0x24]
sub eax, 1
sbb edx, 0
mov esi, eax
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
movzx eax, word [eax + 0x14ee]
push eax
mov eax, esi
pop edx
mov ecx, edx
xor edx, edx
div ecx
mov ebx, edx
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
movzx ecx, word [eax + 0x14ee]
mov eax, esi
xor edx, edx
div ecx
mov esi, eax
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
movzx eax, word [eax + 0x14ec]
push eax
mov eax, esi
pop edx
mov ecx, edx
xor edx, edx
div ecx
mov byte [edi + 5], dl
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
movzx ecx, word [eax + 0x14ec]
mov eax, esi
xor edx, edx
div ecx
mov esi, eax
cmp esi, 0x3ff
jbe 0x4da33c
mov esi, 0x3ff
cmp byte [edi + 4], 5
jne 0x4da33c
cmp byte [ebp + 0x14], 0
je 0x4da33c
mov byte [edi + 4], 0xf
cmp byte [edi + 4], 5
jne 0x4da34c
cmp byte [ebp + 0x14], 0
je 0x4da34c
mov byte [edi + 4], 0xf
lea edx, [ebx + 1]
mov eax, esi
call fcn.00481ff0
mov word [edi + 6], ax
mov eax, dword [ebp + 0x28]
mov dword [edi + 8], eax
mov eax, dword [ebp + 0x20]
mov dword [edi + 0xc], eax
mov byte [ebp - 0xd], 1
movzx eax, byte [ebp - 0xd]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x30