Function at 0x10086350
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x20
push esi
mov esi, dword [esp + 0x28]
test esi, esi
je 0x10086371
push esi
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 8
jne 0x10086371
cmp dword [esp + 0x38], 0
jne 0x1008637b
mov eax, 1
pop esi
add esp, 0x20
ret
push ebp
mov ebp, dword [esp + 0x34]
push edi
mov edi, dword [esp + 0x34]
cmp edi, 1
je 0x100863b2
cmp edi, 2
je 0x10086399
cmp edi, 3
je 0x10086399
cmp edi, 4
jne 0x100863a6
cmp ebp, 1
jl 0x100863a6
cmp ebp, 0x100
jle 0x100863b2
pop edi
pop ebp
mov eax, 1
pop esi
add esp, 0x20
ret
push ebx
push 0
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x1c]
push ecx
push esi
call sym.leptonlib.dll_pixGetDimensions
push esi
call sym.leptonlib.dll_pixGetData
push esi
mov dword [esp + 0x38], eax
call sym.leptonlib.dll_dpixGetRefcount
add esp, 0x18
mov dword [esp + 0x1c], eax
cmp edi, 1
jne 0x10086441
xor ebx, ebx
cmp dword [esp + 0x14], ebx
jle 0x100865eb
mov eax, dword [esp + 0x10]
xor edi, edi
mov dword [esp + 0x34], edi
test eax, eax
jle 0x10086420
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
add ebp, ebp
add ebp, ebp
push ebx
push esi
call sym.leptonlib.dll_l_getDataByte
add dword [esp + 0x3c], eax
mov eax, dword [esp + 0x18]
inc edi
add esp, 8
add esi, ebp
cmp edi, eax
jl 0x10086407
fild dword [esp + 0x34]
mov edx, dword [esp + 0x44]
inc ebx
cmp ebx, dword [esp + 0x14]
fidiv dword [esp + 0x10]
fstp dword [edx + ebx*4 - 4]
jl 0x100863f1
pop ebx
pop edi
pop ebp
xor eax, eax
pop esi
add esp, 0x20
ret
mov esi, dword [sym.imp.MSVCR90.dll_calloc]
push 4
push ebp
call esi
mov ebx, eax
push 4
push 0x100
mov dword [esp + 0x34], ebx
call esi
mov edi, eax
push 4
push ebp
mov dword [esp + 0x44], edi
call esi
add esp, 0x18
xor ecx, ecx
mov dword [esp + 0x18], eax
xor esi, esi
mov eax, esi
cdq
and edx, 0xff
add eax, edx
sar eax, 8
mov dword [edi + ecx*4], eax
inc ecx
add esi, ebp
cmp ecx, 0x100
jl 0x10086471
xor ecx, ecx
test ebp, ebp
jle 0x100864b0
mov esi, 0x80
mov eax, esi
cdq
idiv ebp
mov edx, dword [esp + 0x18]
inc ecx
add esi, 0x100
cmp ecx, ebp
mov dword [edx + ecx*4 - 4], eax
jl 0x10086498
cmp dword [esp + 0x14], 0
mov dword [esp + 0x34], 0
jle 0x100865d5
xor edi, edi
cmp dword [esp + 0x10], edi
jle 0x10086503
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
add ebx, ebx
add ebx, ebx
mov eax, dword [esp + 0x34]
push eax
push esi
call sym.leptonlib.dll_l_getDataByte
mov ecx, dword [esp + 0x34]
mov edx, dword [ecx + eax*4]
mov eax, dword [esp + 0x2c]
inc dword [eax + edx*4]
lea eax, [eax + edx*4]
inc edi
add esp, 8
add esi, ebx
cmp edi, dword [esp + 0x10]
jl 0x100864d7
mov ebx, dword [esp + 0x24]
mov eax, dword [esp + 0x38]
cmp eax, 2
jne 0x10086547
mov eax, dword [esp + 0x10]
inc eax
cdq
sub eax, edx
xor esi, esi
sar eax, 1
xor ecx, ecx
test ebp, ebp
jle 0x100865be
add esi, dword [ebx + ecx*4]
cmp esi, eax
jge 0x10086533
inc ecx
cmp ecx, ebp
jl 0x10086522
jmp 0x100865b2
mov edx, dword [esp + 0x18]
fild dword [edx + ecx*4]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x34]
fstp dword [eax + ecx*4]
jmp 0x100865b2
xor edx, edx
cmp eax, 3
jne 0x10086587
xor esi, esi
xor eax, eax
test ebp, ebp
jle 0x10086566
mov ecx, dword [ebx + eax*4]
cmp ecx, edx
jle 0x10086561
mov edx, ecx
mov esi, eax
inc eax
cmp eax, ebp
jl 0x10086556
cmp edx, dword [esp + 0x40]
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x44]
jge 0x1008657b
fldz
fstp dword [edx + eax*4]
jmp 0x100865b2
mov ecx, dword [esp + 0x18]
fild dword [ecx + esi*4]
fstp dword [edx + eax*4]
jmp 0x100865b2
xor eax, eax
mov dword [esp + 0x28], edx
test ebp, ebp
jle 0x100865a3
mov ecx, dword [ebx + eax*4]
cmp ecx, edx
jle 0x1008659a
mov edx, ecx
inc eax
cmp eax, ebp
jl 0x10086591
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x34]
fstp dword [ecx + edx*4]
test ebp, ebp
jle 0x100865be
mov ecx, ebp
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x34]
inc eax
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x34], eax
jl 0x100864c3
mov edi, dword [esp + 0x2c]
mov esi, dword [sym.imp.MSVCR90.dll_free]
push ebx
call esi
push edi
call esi
mov eax, dword [esp + 0x20]
push eax
call esi
add esp, 0xc
pop ebx
pop edi
pop ebp
xor eax, eax
pop esi
add esp, 0x20
ret