Function at 0x413920
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x10
push esi
mov esi, dword [esp + 0x20]
cmp esi, dword [esp + 0x1c]
jne 0x413937
mov eax, dword [esp + 0x18]
pop esi
add esp, 0x10
ret
push ebx
push ebp
test esi, esi
js 0x413c8f
mov ebx, dword [esp + 0x2c]
test ebx, ebx
js 0x413c8f
je 0x41395f
mov eax, 0x7fffffff
cdq
idiv ebx
cmp esi, eax
jg 0x413c8f
mov ecx, esi
imul ecx, ebx
mov dword [esp + 0x28], ecx
test ecx, ecx
js 0x413c8f
mov ebp, dword [esp + 0x30]
test ebp, ebp
js 0x413c8f
je 0x41398e
mov eax, 0x7fffffff
cdq
idiv ebp
cmp ecx, eax
jg 0x413c8f
mov eax, ecx
imul eax, ebp
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ecx, eax
add esp, 4
mov dword [esp + 0x18], ecx
test ecx, ecx
je 0x413c8f
push edi
mov edi, dword [esp + 0x24]
test ebp, ebp
jle 0x413c79
mov eax, dword [esp + 0x28]
lea edx, [esi - 0xa]
mov esi, edi
mov dword [esp + 0x14], edi
lea edx, [edx + eax*8]
imul eax, ebx
mov dword [esp + 0x10], edx
mov dword [esp + 0x28], eax
mov eax, ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x18], eax
nop dword [eax]
cmp edx, 0x19
ja case.default.0x4139f0
movzx ecx, byte [edx + 0x413ce4]
jmp dword [ecx*4 + 0x413cb0]
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 1]
mov byte [eax + 1], 0xff
lea eax, [eax + 2]
jns 0x413a02
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x413a25
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
nop dword [eax + eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
mov byte [eax - 1], 0xff
jns 0x413a50
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
nop word [eax + eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 2]
lea eax, [eax + 1]
jns 0x413a80
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
nop
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x413aa0
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x413ac6
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 3]
movzx ecx, byte [esi - 2]
lea eax, [eax + 4]
mov byte [eax - 3], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 2], cl
mov byte [eax - 1], 0xff
jns 0x413af3
jmp 0x413c4e
lea edi, [ebx - 1]
test edi, edi
js case.0x4139f0.3
nop word [eax + eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 1], dl
jns 0x413b30
jmp 0x413c4e
lea edi, [ebx - 1]
test edi, edi
js case.0x4139f0.3
nop dword [eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
mov byte [eax - 1], 0xff
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 2], dl
jns 0x413b70
jmp 0x413c4e
lea edi, [ebx - 1]
test edi, edi
js case.0x4139f0.3
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 1], dl
jns 0x413bb1
jmp 0x413c4e
lea edi, [ebx - 1]
test edi, edi
js case.0x4139f0.3
nop word [eax + eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 2], dl
mov cl, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x413bf0
jmp 0x413c4e
lea edx, [ebx - 1]
test edx, edx
js 0x413c4e
nop dword [eax]
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 4]
movzx ecx, byte [esi - 3]
lea eax, [eax + 3]
mov byte [eax - 2], cl
movzx ecx, byte [esi - 2]
mov byte [eax - 1], cl
jns 0x413c30
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add esi, dword [esp + 0x28]
add eax, ecx
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], eax
sub ebp, 1
jne 0x4139e0
mov edi, dword [esp + 0x24]
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x10
ret
push dword [esp + 0x20]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov dword [0x49ddd0], 0x47ee7c
xor eax, eax
pop ebp
pop ebx
pop esi
add esp, 0x10
ret