Function at 0x10041a20
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x28
push ebx
push ebp
xor ebp, ebp
push esi
push edi
cmp eax, ebp
je 0x10041a6f
mov eax, dword [eax]
lea ecx, [eax + 0x128]
mov edx, ecx
and edx, 0xf
je 0x10041a49
mov eax, 0x10
sub eax, edx
jmp 0x10041a4b
xor eax, eax
mov eax, dword [eax + ecx + 0xc]
mov edx, ecx
and edx, 0xf
mov dword [esp + 0x20], eax
je 0x10041b5e
mov eax, 0x10
sub eax, edx
mov ecx, dword [eax + ecx + 0x10]
mov dword [esp + 0x1c], ecx
jmp 0x10041a77
mov dword [esp + 0x20], ebp
mov dword [esp + 0x1c], ebp
mov eax, dword [esp + 0x20]
cdq
mov edi, eax
mov eax, dword [esp + 0x1c]
xor edi, edx
sub edi, edx
cdq
mov esi, eax
xor esi, edx
sub esi, edx
cmp edi, ebp
mov dword [esp + 0x30], esi
jle 0x10041c5b
cmp esi, ebp
jle 0x10041c5b
push 4
call fcn.1014f4ab
mov ebx, eax
add esp, 4
mov dword [esp + 0x28], ebx
cmp ebx, ebp
je 0x10041c5b
xor eax, eax
push edi
push ebp
lea ecx, [eax + 8]
mov edx, esi
call fcn.100013a0
mov esi, eax
add esp, 8
cmp esi, ebp
je 0x10041c52
push 0x10
push esi
call fcn.1014f831
add esp, 8
mov dword [ebx], eax
test eax, eax
je 0x10041c52
push esi
push 0
push eax
call fcn.101527d0
mov esi, dword [ebx]
add esp, 0xc
xor eax, eax
push 0x100
lea edx, [esi + 0x10]
mov dword [esi], 1
mov dword [esi + 4], eax
push 0xff
push edx
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
call fcn.101527d0
add esp, 0xc
push ebx
mov dword [esi + 0x120], 1
call sym.FreeImage.dll__FreeImage_GetICCProfile_4
xor ecx, ecx
push 0x1029a760
push 0x20
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov word [eax], cx
call fcn.1014f8fe
add esp, 8
mov dword [esp + 0x2c], eax
test eax, eax
je 0x10041b6d
mov edx, eax
push edx
call fcn.10003cb0
mov eax, dword [esp + 0x2c]
jmp 0x10041b6f
xor eax, eax
mov ecx, dword [eax + ecx + 0x10]
mov dword [esp + 0x1c], ecx
jmp 0x10041a77
xor eax, eax
push ebx
mov dword [esi + 0x11c], eax
mov dword [esi + 0x124], ebp
call sym.FreeImage.dll__FreeImage_GetInfoHeader_4
mov esi, eax
mov eax, dword [esp + 0x30]
mov ecx, 1
mov edx, 8
mov word [esi + 0xc], cx
mov ecx, edx
mov dword [esi], 0x28
mov dword [esi + 4], edi
mov dword [esi + 8], eax
mov dword [esi + 0x10], ebp
mov word [esi + 0xe], dx
call fcn.10001380
mov dword [esi + 0x20], eax
mov dword [esi + 0x24], eax
mov eax, 0xb13
push ebx
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
call sym.FreeImage.dll__FreeImage_GetPalette_4
xor ecx, ecx
inc eax
lea esp, [esp]
mov byte [eax + 1], cl
mov byte [eax], cl
mov byte [eax - 1], cl
inc ecx
add eax, 4
cmp ecx, 0x100
jl 0x10041bd0
mov esi, dword [esp + 0x20]
add esi, esi
add esi, esi
push esi
mov dword [esp + 0x38], esi
call fcn.1014f4ab
add esp, 4
mov ebx, eax
push esi
mov dword [esp + 0x30], ebx
call fcn.1014f4ab
add esp, 4
push esi
mov edi, eax
push 0
push ebx
mov dword [esp + 0x3c], edi
call fcn.101527d0
add esp, 0xc
push esi
xor ebx, ebx
push ebx
push edi
call fcn.101527d0
add esp, 0xc
cmp dword [esp + 0x1c], ebx
mov dword [esp + 0x18], ebx
jle 0x10041cf9
mov edi, dword [esp + 0x3c]
test edi, edi
je 0x10041c48
mov eax, dword [edi]
cmp dword [eax + 0x120], 0
jne 0x10041c65
mov dword [esp + 0x24], 0
jmp 0x10041c82
push ebx
call fcn.1014f3ce
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push edi
call sym.FreeImage.dll__FreeImage_GetLine_4
mov esi, eax
add esi, 3
push edi
and esi, 0xfffffffc
call sym.FreeImage.dll__FreeImage_GetBits_4
imul esi, ebx
add eax, esi
mov dword [esp + 0x24], eax
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx]
cmp dword [edx + 0x120], 0
jne 0x10041c95
xor edi, edi
jmp 0x10041cb2
mov edi, ecx
push edi
call sym.FreeImage.dll__FreeImage_GetLine_4
mov esi, eax
add esi, 3
push edi
and esi, 0xfffffffc
call sym.FreeImage.dll__FreeImage_GetBits_4
imul esi, ebx
mov edi, eax
add edi, esi
mov eax, dword [esp + 0x24]
imul ebp, ebp, 0x41c64e6d
movzx ecx, byte [eax]
add ebp, 0x3039
mov eax, ebp
sar eax, 0xc
cdq
mov esi, 0x81
idiv esi
add ecx, dword [esp + 0x18]
xor eax, eax
add edx, 0x3f
cmp ecx, edx
setle al
inc ebx
dec eax
and eax, 0xff
sub ecx, eax
cmp ebx, dword [esp + 0x1c]
mov dword [esp + 0x18], ecx
mov byte [edi], al
jl 0x10041c35
xor eax, eax
cmp dword [esp + 0x1c], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], eax
jle 0x10041e32
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x10041d20
mov eax, dword [eax]
cmp dword [eax + 0x120], 0
jne 0x10041d24
xor edi, edi
jmp 0x10041d78
add eax, 0x128
mov edx, eax
and edx, 0xf
je 0x10041d39
mov ecx, 0x10
sub ecx, edx
jmp 0x10041d3b
xor ecx, ecx
mov edi, dword [ecx + eax + 0xc]
mov edx, eax
and edx, 0xf
je 0x10041d4f
mov ecx, 0x10
sub ecx, edx
jmp 0x10041d51
xor ecx, ecx
movzx esi, word [ecx + eax + 0x16]
mov ecx, dword [esp + 0x3c]
imul esi, edi
add esi, 7
shr esi, 3
add esi, 3
push ecx
and esi, 0xfffffffc
call sym.FreeImage.dll__FreeImage_GetBits_4
imul esi, dword [esp + 0x14]
mov edi, eax
add edi, esi
mov edx, dword [esp + 0x28]
mov eax, dword [edx]
cmp dword [eax + 0x120], 0
jne 0x10041d8b
xor ebx, ebx
jmp 0x10041ddf
add eax, 0x128
mov edx, eax
and edx, 0xf
je 0x10041da0
mov ecx, 0x10
sub ecx, edx
jmp 0x10041da2
xor ecx, ecx
mov ebx, dword [ecx + eax + 0xc]
mov edx, eax
and edx, 0xf
je 0x10041db6
mov ecx, 0x10
sub ecx, edx
jmp 0x10041db8
xor ecx, ecx
movzx esi, word [ecx + eax + 0x16]
mov eax, dword [esp + 0x28]
imul esi, ebx
add esi, 7
shr esi, 3
add esi, 3
push eax
and esi, 0xfffffffc
call sym.FreeImage.dll__FreeImage_GetBits_4
imul esi, dword [esp + 0x14]
mov ebx, eax
add ebx, esi
mov esi, dword [esp + 0x20]
imul ebp, ebp, 0x41c64e6d
movzx ecx, byte [esi + edi - 1]
add ebp, 0x3039
mov eax, ebp
sar eax, 0xc
cdq
mov edi, 0x81
idiv edi
add ecx, dword [esp + 0x18]
xor eax, eax
add edx, 0x3f
cmp ecx, edx
setle al
dec eax
and eax, 0xff
sub ecx, eax
mov byte [esi + ebx - 1], al
mov eax, dword [esp + 0x14]
inc eax
cmp eax, dword [esp + 0x1c]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], eax
jl 0x10041d0d
mov ecx, dword [esp + 0x3c]
push ecx
call sym.FreeImage.dll__FreeImage_GetBits_4
mov edx, dword [esp + 0x28]
push edx
mov edi, eax
call sym.FreeImage.dll__FreeImage_GetBits_4
xor ebx, ebx
cmp dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
jle 0x10041eca
sub eax, edi
mov dword [esp + 0x24], eax
lea ebx, [ebx]
imul ebp, ebp, 0x41c64e6d
add ebp, 0x3039
mov eax, ebp
sar eax, 0xc
cdq
mov ecx, 0x81
idiv ecx
movzx esi, byte [edi]
add esi, dword [esp + 0x18]
xor ecx, ecx
mov eax, 0x7f
add edx, 0x3f
cmp esi, edx
mov edx, dword [esp + 0x24]
setle cl
dec ecx
and ecx, 0xff
sub esi, ecx
mov byte [edx + edi], cl
mov dword [esp + 0x18], esi
movzx esi, byte [edi]
sub eax, esi
cdq
sub eax, edx
sar eax, 1
neg ecx
sbb ecx, ecx
and ecx, 0xff
sub eax, ecx
mov ecx, dword [esp + 0x2c]
add eax, esi
mov dword [ecx + ebx*4], eax
inc ebx
inc edi
cmp ebx, dword [esp + 0x20]
jl 0x10041e60
mov ebx, dword [esp + 0x30]
mov eax, 1
cmp dword [esp + 0x1c], eax
mov dword [esp + 0x14], eax
jle 0x100420d6
mov edx, dword [esp + 0x20]
dec edx
mov dword [esp + 0x20], edx
lea ebx, [ebx]
mov ebp, dword [esp + 0x3c]
test ebp, ebp
je 0x10041f04
mov eax, dword [ebp]
cmp dword [eax + 0x120], 0
jne 0x10041f0e
mov dword [esp + 0x24], 0
jmp 0x10041f60
add eax, 0x128
mov edx, eax
and edx, 0xf
je 0x10041f23
mov ecx, 0x10
sub ecx, edx
jmp 0x10041f25
xor ecx, ecx
mov edi, dword [ecx + eax + 0xc]
mov edx, eax
and edx, 0xf
je 0x10041f39
mov ecx, 0x10
sub ecx, edx
jmp 0x10041f3b
xor ecx, ecx
movzx esi, word [ecx + eax + 0x16]
imul esi, edi
add esi, 7
shr esi, 3
add esi, 3
push ebp
and esi, 0xfffffffc
call sym.FreeImage.dll__FreeImage_GetBits_4
imul esi, dword [esp + 0x14]
add eax, esi
mov dword [esp + 0x24], eax
mov ebp, dword [esp + 0x28]
mov eax, dword [ebp]
cmp dword [eax + 0x120], 0
jne 0x10041f74
xor edi, edi
jmp 0x10041fc4
add eax, 0x128
mov edx, eax
and edx, 0xf
je 0x10041f89
mov ecx, 0x10
sub ecx, edx
jmp 0x10041f8b
xor ecx, ecx
mov edi, dword [ecx + eax + 0xc]
mov edx, eax
and edx, 0xf
je 0x10041f9f
mov ecx, 0x10
sub ecx, edx
jmp 0x10041fa1
xor ecx, ecx
movzx esi, word [ecx + eax + 0x16]
imul esi, edi
add esi, 7
shr esi, 3
add esi, 3
push ebp
and esi, 0xfffffffc
call sym.FreeImage.dll__FreeImage_GetBits_4
imul esi, dword [esp + 0x14]
mov edi, eax
add edi, esi
mov esi, dword [esp + 0x24]
movzx ecx, byte [esi]
mov eax, 0x7f
sub eax, ecx
cdq
sub eax, edx
movzx edx, byte [edi]
sar eax, 1
neg edx
sbb edx, edx
and edx, 0xff
sub eax, edx
add eax, ecx
mov ebp, 1
cmp dword [esp + 0x20], ebp
mov dword [ebx], eax
jle 0x10042069
mov ecx, dword [esp + 0x2c]
mov eax, ebx
sub eax, ecx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x24]
sub eax, edi
lea esi, [edi + 1]
mov dword [esp + 0x18], eax
mov edi, edi
mov eax, dword [esp + 0x30]
mov edx, dword [eax + ecx]
lea eax, [edx*8]
sub eax, edx
mov edx, dword [ecx + 8]
lea edx, [edx + edx*2]
add eax, edx
mov edx, dword [ecx + 4]
lea edx, [edx + edx*4]
add eax, edx
add eax, dword [ecx]
cdq
and edx, 0xf
add eax, edx
mov edx, dword [esp + 0x18]
movzx edx, byte [edx + esi]
sar eax, 4
add eax, edx
cmp eax, 0x7f
jle 0x10042054
mov byte [esi], 0xff
add eax, 0xffffff01
jmp 0x10042057
mov byte [esi], 0
mov dword [ebx + ebp*4], eax
inc ebp
inc esi
add ecx, 4
cmp ebp, dword [esp + 0x20]
jl 0x10042010
mov esi, dword [esp + 0x24]
movzx ecx, byte [esi]
mov eax, 0x7f
sub eax, ecx
cdq
sub eax, edx
movzx edx, byte [edi]
sar eax, 1
neg edx
sbb edx, edx
and edx, 0xff
sub eax, edx
add eax, ecx
mov dword [ebx], eax
mov eax, dword [esp + 0x20]
movzx ecx, byte [eax + esi]
movzx esi, byte [eax + edi]
neg esi
sbb esi, esi
mov eax, 0x7f
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
and esi, 0xff
sub eax, esi
add eax, ecx
mov ecx, dword [esp + 0x34]
mov dword [ecx + ebx - 4], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x2c], ebx
mov ebx, eax
mov eax, dword [esp + 0x14]
inc eax
cmp eax, dword [esp + 0x1c]
mov dword [esp + 0x14], eax
jl 0x10041ef0
mov edx, dword [esp + 0x2c]
push edx
call fcn.1014f3ce
add esp, 4
push ebx
call fcn.1014f3ce
mov eax, dword [esp + 0x2c]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret