Function at 0x10086070
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x1c
push esi
mov esi, dword [esp + 0x24]
test esi, esi
je 0x10086091
push esi
call sym.leptonlib.dll_numaGetRefcount
add esp, 4
cmp eax, 8
jne 0x10086091
cmp dword [esp + 0x34], 0
jne 0x1008609b
mov eax, 1
pop esi
add esp, 0x1c
ret
push ebx
mov ebx, dword [esp + 0x30]
push ebp
mov ebp, dword [esp + 0x30]
cmp ebp, 1
je 0x100860d2
cmp ebp, 2
je 0x100860b9
cmp ebp, 3
je 0x100860b9
cmp ebp, 4
jne 0x100860c6
cmp ebx, 1
jl 0x100860c6
cmp ebx, 0x100
jle 0x100860d2
pop ebp
pop ebx
mov eax, 1
pop esi
add esp, 0x1c
ret
push edi
push 0
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x38]
push ecx
push esi
call sym.leptonlib.dll_pixGetDimensions
push esi
call sym.leptonlib.dll_pixGetData
push esi
mov edi, eax
call sym.leptonlib.dll_dpixGetRefcount
add esp, 0x18
mov dword [esp + 0x28], eax
cmp ebp, 1
jne 0x1008616e
xor ebp, ebp
cmp dword [esp + 0x14], ebp
jle 0x10086337
lea edx, [eax*4]
mov eax, dword [esp + 0x30]
mov dword [esp + 0x1c], edx
lea ebx, [ebx]
xor ebx, ebx
xor esi, esi
mov dword [esp + 0x24], ebx
test eax, eax
jle 0x10086149
lea esp, [esp]
push esi
push edi
call sym.leptonlib.dll_l_getDataByte
add ebx, eax
mov eax, dword [esp + 0x38]
inc esi
add esp, 8
cmp esi, eax
jl 0x10086130
mov dword [esp + 0x24], ebx
fild dword [esp + 0x24]
mov ecx, dword [esp + 0x40]
add edi, dword [esp + 0x1c]
inc ebp
cmp ebp, dword [esp + 0x14]
fidiv dword [esp + 0x30]
fstp dword [ecx + ebp*4 - 4]
jl 0x10086120
pop edi
pop ebp
pop ebx
xor eax, eax
pop esi
add esp, 0x1c
ret
mov esi, dword [sym.imp.MSVCR90.dll_calloc]
push 4
push ebx
call esi
push 4
push 0x100
mov ebp, eax
call esi
push 4
push ebx
mov dword [esp + 0x3c], eax
call esi
add esp, 0x18
xor ecx, ecx
mov dword [esp + 0x18], eax
xor esi, esi
jmp 0x100861a0
mov eax, esi
cdq
and edx, 0xff
add eax, edx
mov edx, dword [esp + 0x24]
sar eax, 8
mov dword [edx + ecx*4], eax
inc ecx
add esi, ebx
cmp ecx, 0x100
jl 0x100861a0
xor ecx, ecx
test ebx, ebx
jle 0x100861e8
mov esi, 0x80
jmp 0x100861d0
mov eax, esi
cdq
idiv ebx
mov edx, dword [esp + 0x18]
inc ecx
add esi, 0x100
cmp ecx, ebx
mov dword [edx + ecx*4 - 4], eax
jl 0x100861d0
cmp dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
jle 0x1008631d
mov eax, dword [esp + 0x28]
lea ecx, [eax*4]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edi
mov edi, edi
test ebx, ebx
jle 0x1008621c
mov ecx, ebx
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
xor esi, esi
cmp dword [esp + 0x30], esi
jle 0x10086248
mov edx, dword [esp + 0x20]
push esi
push edx
call sym.leptonlib.dll_l_getDataByte
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + eax*4]
inc dword [ebp + edx*4]
lea eax, [ebp + edx*4]
inc esi
add esp, 8
cmp esi, dword [esp + 0x30]
jl 0x10086224
mov eax, dword [esp + 0x34]
cmp eax, 2
jne 0x1008628d
mov eax, dword [esp + 0x30]
inc eax
cdq
sub eax, edx
xor esi, esi
sar eax, 1
xor ecx, ecx
test ebx, ebx
jle 0x10086302
add esi, dword [ebp + ecx*4]
cmp esi, eax
jge 0x10086279
inc ecx
cmp ecx, ebx
jl 0x10086267
jmp 0x10086302
mov eax, dword [esp + 0x18]
fild dword [eax + ecx*4]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x10]
fstp dword [ecx + edx*4]
jmp 0x10086302
xor edx, edx
cmp eax, 3
jne 0x100862d2
xor esi, esi
xor eax, eax
test ebx, ebx
jle 0x100862b1
lea esp, [esp]
mov ecx, dword [ebp + eax*4]
cmp ecx, edx
jle 0x100862ac
mov edx, ecx
mov esi, eax
inc eax
cmp eax, ebx
jl 0x100862a0
cmp edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x40]
jge 0x100862c6
fldz
fstp dword [ecx + eax*4]
jmp 0x10086302
mov edx, dword [esp + 0x18]
fild dword [edx + esi*4]
fstp dword [ecx + eax*4]
jmp 0x10086302
xor eax, eax
mov dword [esp + 0x28], edx
test ebx, ebx
jle 0x100862f3
lea esp, [esp]
mov ecx, dword [ebp + eax*4]
cmp ecx, edx
jle 0x100862ea
mov edx, ecx
inc eax
cmp eax, ebx
jl 0x100862e0
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x40]
fstp dword [eax + edx*4]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
add dword [esp + 0x20], ecx
inc eax
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x10], eax
jl 0x10086210
mov esi, dword [sym.imp.MSVCR90.dll_free]
push ebp
call esi
mov edx, dword [esp + 0x28]
push edx
call esi
mov eax, dword [esp + 0x20]
push eax
call esi
add esp, 0xc
pop edi
pop ebp
pop ebx
xor eax, eax
pop esi
add esp, 0x1c
ret