Function at 0x1003d260
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 0x1003d29f
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push edi
lea ebp, [ebx*4]
push ebp
call fcn.101e30cd
mov edi, eax
push ebp
mov dword [esp + 0x18], edi
call fcn.101e30cd
lea ecx, [ebx*4]
mov ebp, eax
push ecx
push 0
push edi
mov dword [esp + 0x38], ebp
call fcn.101dfee0
lea eax, [ebx*4]
push eax
push 0
push ebp
call fcn.101dfee0
mov eax, dword [esp + 0x34]
add esp, 0x20
xor edi, edi
test eax, eax
jle 0x1003d346
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 0x1003d2f0
mov ebp, dword [esp + 0x24]
mov ebx, dword [esp + 0x1c]
xor edi, edi
test eax, eax
jle 0x1003d3aa
xor ebp, ebp
jmp 0x1003d352
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 0x1003d350
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 0x1003d45b
mov ebp, dword [esp + 0x2c]
sub eax, ebp
mov dword [esp + 0x1c], eax
jmp 0x1003d3e4
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 0x1003d3e0
mov ebp, dword [esp + 0x24]
jmp 0x1003d45f
mov ecx, dword [esp + 0x10]
mov eax, 1
mov dword [esp + 0x1c], eax
cmp dword [esp + 0x14], eax
jle 0x1003d5b9
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 0x1003d548
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 0x1003d530
mov byte [esi], 0xff
add eax, 0xffffff01
jmp 0x1003d533
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 0x1003d4f0
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 0x1003d483
push ecx
call fcn.101e2e6d
push ebp
call fcn.101e2e6d
mov eax, dword [esp + 0x20]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret