Function at 0x1004fb60
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x20
mov dword [esp + 4], edx
mov eax, 0x10
mov dword [esp + 0x1c], ecx
push ebx
push ebp
push esi
push edi
test ecx, ecx
je 0x1004fba4
mov edi, dword [ecx]
mov edx, eax
mov esi, edi
and esi, 0xf
sub eax, esi
sub edx, esi
mov ecx, esi
neg ecx
sbb ecx, ecx
and ecx, eax
xor eax, eax
test esi, esi
cmovne eax, edx
mov ebx, dword [ecx + edi + 0x13c]
mov ecx, dword [edi + eax + 0x140]
jmp 0x1004fba8
xor ebx, ebx
xor ecx, ecx
mov eax, ebx
mov dword [esp + 0x18], ecx
cdq
mov esi, eax
mov dword [esp + 0x10], ebx
xor esi, edx
mov eax, ecx
sub esi, edx
cdq
mov ebp, eax
mov dword [esp + 0x1c], esi
xor ebp, edx
sub ebp, edx
test esi, esi
jle 0x1004fec7
test ebp, ebp
jle 0x1004fec7
push 4
call fcn.102709ea
mov edi, eax
add esp, 4
test edi, edi
je 0x1004fec7
push 0
push 8
push ebp
mov edx, esi
xor ecx, ecx
call fcn.10001ab0
add esp, 0xc
mov dword [esp + 0x20], eax
test eax, eax
je 0x1004febe
push 0x10
push eax
call fcn.102705fd
mov esi, eax
add esp, 8
mov dword [edi], esi
test esi, esi
je 0x1004febe
push dword [esp + 0x20]
push 0
push esi
call fcn.1026c8e0
push 0x100
lea eax, [esi + 8]
mov dword [esi], 1
mov dword [esi + 4], 0
push 0xff
push eax
mov dword [esi + 0x10c], 0
mov dword [esi + 0x108], 0
call fcn.1026c8e0
mov dword [esi + 0x120], 1
xor eax, eax
push 0x103d71d5
push 8
mov dword [esi + 0x114], 0
mov dword [esi + 0x118], 0
mov word [esi + 0x110], ax
call fcn.10269fcd
add esp, 0x20
mov dword [esp + 0x20], eax
test eax, eax
je 0x1004fcc9
push 0x18
mov dword [eax], 0
mov dword [eax + 4], 0
call fcn.10269f9d
mov ecx, dword [esp + 0x24]
add esp, 4
mov dword [eax], eax
mov dword [eax + 4], eax
mov dword [eax + 8], eax
mov word [eax + 0xc], 0x101
mov dword [ecx], eax
jmp 0x1004fccb
xor ecx, ecx
mov dword [esi + 0x11c], ecx
mov eax, esi
and eax, 0xf
mov dword [esi + 0x124], 0
mov ecx, 0x10
mov dword [esi + 0x128], 0
sub ecx, eax
mov dword [esi + 0x12c], 0
neg eax
push edi
sbb eax, eax
and eax, ecx
mov ecx, dword [esp + 0x20]
mov dword [eax + esi + 0x140], ebp
mov ebp, 1
mov dword [eax + esi + 0x138], 0x28
mov dword [eax + esi + 0x13c], ecx
mov dword [eax + esi + 0x144], 0x80001
mov dword [eax + esi + 0x148], 0
mov dword [eax + esi + 0x158], 0x100
mov dword [eax + esi + 0x15c], 0x100
mov dword [eax + esi + 0x150], 0xb13
mov dword [eax + esi + 0x154], 0xb13
call sym.FreeImage32.dll__FreeImage_GetPalette_4
xor ecx, ecx
inc eax
nop
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
mov byte [eax - 5], cl
inc ecx
cmp ecx, 0x100
jl 0x1004fd70
mov ecx, dword [esp + 0x14]
shl ebp, cl
mov esi, ebp
imul esi, ebp
push esi
mov dword [esp + 0x28], esi
call fcn.102709ea
xor ecx, ecx
mov dword [esp + 0x20], eax
add esp, 4
mov dword [esp + 0x20], ecx
test esi, esi
jle 0x1004fe37
movsd xmm2, qword [0x103efa18]
movsd xmm3, qword [0x103efbe0]
movd xmm1, esi
mov dword [esp + 0x28], edi
mov edi, eax
cvtdq2pd xmm1, xmm1
nop dword [eax]
mov eax, ecx
mov ebx, dword [esp + 0x14]
cdq
idiv ebp
mov eax, ecx
mov esi, edx
cdq
idiv ebp
mov edx, eax
xor eax, eax
test ebx, ebx
jle 0x1004fe09
mov ecx, edx
add eax, eax
xor ecx, esi
sar edx, 1
and ecx, 1
dec ebx
or ecx, eax
mov eax, esi
add ecx, ecx
sar esi, 1
and eax, 1
or eax, ecx
test ebx, ebx
jg 0x1004fde8
mov ecx, dword [esp + 0x20]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
addsd xmm0, xmm2
divsd xmm0, xmm1
mulsd xmm0, xmm3
cvttsd2si eax, xmm0
mov byte [ecx + edi], al
inc ecx
mov dword [esp + 0x20], ecx
cmp ecx, dword [esp + 0x24]
jl 0x1004fdd0
mov edi, dword [esp + 0x28]
mov ebx, dword [esp + 0x10]
xor esi, esi
mov dword [esp + 0x14], esi
cmp dword [esp + 0x18], esi
jle 0x1004fea8
push esi
push dword [esp + 0x30]
call sym.FreeImage32.dll__FreeImage_GetScanLine_8
push esi
push edi
mov dword [esp + 0x28], eax
call sym.FreeImage32.dll__FreeImage_GetScanLine_8
xor ecx, ecx
mov dword [esp + 0x28], eax
test ebx, ebx
jle 0x1004fe9d
mov eax, esi
mov esi, dword [esp + 0x20]
cdq
idiv ebp
mov ebx, edx
imul ebx, ebp
mov eax, ecx
cdq
idiv ebp
mov al, byte [ecx + esi]
mov esi, dword [esp + 0x1c]
add edx, ebx
cmp byte [edx + esi], al
mov edx, dword [esp + 0x28]
mov esi, dword [esp + 0x20]
sbb al, al
mov byte [edx + ecx], al
inc ecx
cmp ecx, dword [esp + 0x10]
jl 0x1004fe70
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x10]
inc esi
mov dword [esp + 0x14], esi
cmp esi, dword [esp + 0x18]
jl 0x1004fe43
push dword [esp + 0x1c]
call fcn.10270662
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
push edi
call fcn.10270662
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret