Function at 0x1004a300
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x28
push ebx
push ebp
push esi
mov ebp, ecx
xor esi, esi
push ebp
mov dword [esp + 0x20], ebp
call sym.FreeImage.dll__FreeImage_GetWidth_4
mov ebx, eax
push ebp
mov dword [esp + 0x1c], ebx
call sym.FreeImage.dll__FreeImage_GetHeight_4
push esi
push esi
push esi
push 8
push eax
push ebx
mov dword [esp + 0x28], eax
call sym.FreeImage.dll__FreeImage_Allocate_24
mov dword [esp + 0x14], eax
test eax, eax
jne 0x1004a33f
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push edi
lea ebp, [ebx*4]
push ebp
call fcn.101fc42d
mov edi, eax
push ebp
mov dword [esp + 0x18], edi
call fcn.101fc42d
lea ecx, [ebx*4]
mov ebp, eax
push ecx
push 0
push edi
mov dword [esp + 0x38], ebp
call fcn.101f9320
lea eax, [ebx*4]
push eax
push 0
push ebp
call fcn.101f9320
mov eax, dword [esp + 0x34]
add esp, 0x20
xor edi, edi
test eax, eax
jle 0x1004a3e6
xor ebp, ebp
nop
imul esi, esi, 0x41c64e6d
push edi
push dword [esp + 0x24]
add esi, 0x3039
call sym.FreeImage.dll__FreeImage_GetScanLine_8
mov ecx, 0x81
xor ebx, ebx
push edi
push dword [esp + 0x1c]
movzx eax, byte [eax]
add ebp, eax
mov eax, esi
sar eax, 0xc
cdq
idiv ecx
mov eax, 0xff
add edx, 0x3f
cmp ebp, edx
cmovg ebx, eax
sub ebp, ebx
call sym.FreeImage.dll__FreeImage_GetScanLine_8
inc edi
mov byte [eax], bl
mov eax, dword [esp + 0x14]
cmp edi, eax
jl 0x1004a390
mov ebp, dword [esp + 0x24]
mov ebx, dword [esp + 0x1c]
xor edi, edi
test eax, eax
jle 0x1004a44a
xor ebp, ebp
jmp 0x1004a3f2
mov ebx, ecx
imul esi, esi, 0x41c64e6d
push edi
push dword [esp + 0x24]
add esi, 0x3039
call sym.FreeImage.dll__FreeImage_GetScanLine_8
mov ecx, 0x81
push edi
push dword [esp + 0x1c]
movzx eax, byte [eax + ebx - 1]
xor ebx, ebx
add ebp, eax
mov eax, esi
sar eax, 0xc
cdq
idiv ecx
mov eax, 0xff
add edx, 0x3f
cmp ebp, edx
cmovg ebx, eax
sub ebp, ebx
call sym.FreeImage.dll__FreeImage_GetScanLine_8
mov ecx, dword [esp + 0x1c]
inc edi
mov byte [eax + ecx - 1], bl
cmp edi, dword [esp + 0x14]
jl 0x1004a3f0
mov ebp, dword [esp + 0x24]
push dword [esp + 0x20]
call sym.FreeImage.dll__FreeImage_GetBits_4
push dword [esp + 0x18]
mov dword [esp + 0x30], eax
call sym.FreeImage.dll__FreeImage_GetBits_4
mov edi, dword [esp + 0x1c]
xor ecx, ecx
mov dword [esp + 0x28], ecx
test edi, edi
jle 0x1004a4fb
mov ebp, dword [esp + 0x2c]
sub eax, ebp
mov dword [esp + 0x1c], eax
jmp 0x1004a484
mov ecx, dword [esp + 0x2c]
movzx eax, byte [ebp]
lea ebp, [ebp + 1]
add ecx, eax
imul esi, esi, 0x41c64e6d
mov ebx, 0x81
add esi, 0x3039
mov eax, esi
sar eax, 0xc
cdq
idiv ebx
xor ebx, ebx
mov eax, 0xff
add edx, 0x3f
cmp ecx, edx
cmovg ebx, eax
mov eax, dword [esp + 0x1c]
sub ecx, ebx
mov dword [esp + 0x2c], ecx
mov byte [eax + ebp - 1], bl
mov eax, 0x7f
movzx ecx, byte [ebp - 1]
sub eax, ecx
cdq
sub eax, edx
mov edx, dword [esp + 0x28]
sar eax, 1
neg ebx
sbb ebx, ebx
and ebx, 0xff
sub eax, ebx
add eax, ecx
mov ecx, dword [esp + 0x10]
mov dword [ecx + edx*4], eax
inc edx
mov dword [esp + 0x28], edx
cmp edx, edi
jl 0x1004a480
mov ebp, dword [esp + 0x24]
jmp 0x1004a4ff
mov ecx, dword [esp + 0x10]
mov eax, 1
mov dword [esp + 0x1c], eax
cmp dword [esp + 0x14], eax
jle 0x1004a659
lea ecx, [edi*4]
add ecx, 0xfffffffc
lea ebx, [edi - 1]
mov dword [esp + 0x34], ecx
push eax
push dword [esp + 0x24]
call sym.FreeImage.dll__FreeImage_GetScanLine_8
push dword [esp + 0x1c]
mov esi, eax
push dword [esp + 0x1c]
mov dword [esp + 0x2c], esi
call sym.FreeImage.dll__FreeImage_GetScanLine_8
movzx esi, byte [esi]
mov edi, eax
xor ecx, ecx
mov dword [esp + 0x28], edi
mov eax, 0xff
cmp byte [edi], cl
cmovne ecx, eax
mov eax, 0x7f
sub eax, esi
cdq
sub eax, edx
sar eax, 1
sub eax, ecx
mov ecx, 1
add eax, esi
mov dword [ebp], eax
cmp ebx, ecx
jle 0x1004a5e8
mov edx, dword [esp + 0x24]
lea esi, [edi + 1]
mov edi, dword [esp + 0x10]
mov eax, ebp
sub eax, edi
sub edx, dword [esp + 0x28]
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], edx
nop dword [eax]
mov edx, dword [eax + edi]
lea eax, [edx*8]
sub eax, edx
mov edx, dword [edi + 8]
lea edx, [edx + edx*2]
add eax, edx
mov edx, dword [edi + 4]
lea edx, [edx + edx*4]
add eax, edx
add eax, dword [edi]
cdq
and edx, 0xf
add eax, edx
mov edx, dword [esp + 0x2c]
sar eax, 4
movzx edx, byte [edx + esi]
add eax, edx
cmp eax, 0x7f
jle 0x1004a5d0
mov byte [esi], 0xff
add eax, 0xffffff01
jmp 0x1004a5d3
mov byte [esi], 0
mov dword [ebp + ecx*4], eax
inc esi
mov eax, dword [esp + 0x30]
inc ecx
add edi, 4
cmp ecx, ebx
jl 0x1004a590
mov edi, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
xor ecx, ecx
cmp byte [edi], cl
movzx esi, byte [eax]
mov eax, 0xff
cmovne ecx, eax
mov eax, 0x7f
sub eax, esi
cdq
sub eax, edx
sar eax, 1
sub eax, ecx
xor ecx, ecx
add eax, esi
mov dword [ebp], eax
mov eax, dword [esp + 0x24]
cmp byte [ebx + edi], cl
movzx esi, byte [ebx + eax]
mov eax, 0xff
cmovne ecx, eax
mov eax, 0x7f
sub eax, esi
cdq
sub eax, edx
sar eax, 1
sub eax, ecx
mov ecx, dword [esp + 0x34]
add eax, esi
mov dword [ecx + ebp], eax
mov ecx, ebp
mov eax, dword [esp + 0x10]
mov ebp, eax
mov eax, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], eax
cmp eax, dword [esp + 0x14]
jl 0x1004a523
push ecx
call fcn.101fc1cd
push ebp
call fcn.101fc1cd
mov eax, dword [esp + 0x20]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret