Function at 0x1004b3a0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x30
push ebx
push ebp
mov ebp, ecx
mov dword [esp + 0x18], 0
mov dword [esp + 0x28], ebp
push esi
push edi
test ebp, ebp
je 0x1004b3f8
mov edx, dword [ebp]
mov eax, 0x10
lea ecx, [edx + 0x130]
and ecx, 0xf
sub eax, ecx
neg ecx
sbb ecx, ecx
and ecx, eax
mov eax, 0x10
mov ebx, dword [ecx + edx + 0x13c]
lea ecx, [edx + 0x130]
and ecx, 0xf
sub eax, ecx
neg ecx
sbb ecx, ecx
and ecx, eax
mov ecx, dword [ecx + edx + 0x140]
jmp 0x1004b3fc
xor ebx, ebx
xor ecx, ecx
mov eax, ebx
mov dword [esp + 0x1c], ecx
cdq
mov esi, eax
mov dword [esp + 0x10], ebx
xor esi, edx
mov eax, ecx
sub esi, edx
cdq
mov edi, eax
mov dword [esp + 0x28], esi
xor edi, edx
sub edi, edx
test esi, esi
jle 0x1004bb5f
test edi, edi
jle 0x1004bb5f
push 4
call fcn.10271b4d
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
test ebx, ebx
je 0x1004bb5f
push 0
push 8
push edi
mov edx, esi
xor ecx, ecx
call fcn.10001f40
mov esi, eax
add esp, 0xc
test esi, esi
je 0x1004bb56
push 0x10
push esi
call fcn.10271841
add esp, 8
mov dword [ebx], eax
test eax, eax
je 0x1004bb56
push esi
push 0
push eax
call fcn.1026e960
mov esi, dword [ebx]
push 0x100
push 0xff
lea eax, [esi + 8]
mov dword [esi], 1
mov dword [esi + 4], 0
push eax
mov dword [esi + 0x10c], 0
mov dword [esi + 0x108], 0
call fcn.1026e960
add esp, 0x18
mov dword [esi + 0x120], 1
push ebx
call sym.FreeImage.dll__FreeImage_GetICCProfile_4
xor ecx, ecx
push 0x105a20a0
push 8
mov dword [eax + 4], 0
mov dword [eax + 8], 0
mov word [eax], cx
call fcn.10269403
add esp, 8
mov dword [esp + 0x2c], eax
test eax, eax
je 0x1004b508
mov dword [eax], 0
mov dword [eax + 4], 0
call fcn.100057f0
mov ecx, dword [esp + 0x2c]
mov dword [ecx], eax
jmp 0x1004b50a
xor ecx, ecx
push ebx
mov dword [esi + 0x11c], ecx
mov dword [esi + 0x124], 0
mov dword [esi + 0x128], 0
mov dword [esi + 0x12c], 0
call sym.FreeImage.dll__FreeImage_GetInfoHeader_4
mov edx, eax
mov ecx, 8
mov eax, dword [esp + 0x28]
mov dword [edx], 0x28
mov dword [edx + 4], eax
mov dword [edx + 8], edi
mov dword [edx + 0xc], 0x80001
mov dword [edx + 0x10], 0
call fcn.10001f20
push ebx
mov dword [edx + 0x20], eax
mov dword [edx + 0x24], eax
mov dword [edx + 0x18], 0xb13
mov dword [edx + 0x1c], 0xb13
call sym.FreeImage.dll__FreeImage_GetPalette_4
xor ecx, ecx
inc eax
nop dword [eax + eax]
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 0x1004b580
mov eax, dword [esp + 0x10]
lea esi, [eax*4]
push esi
mov dword [esp + 0x38], esi
call fcn.10271b4d
mov edi, eax
push esi
mov dword [esp + 0x2c], edi
call fcn.10271b4d
push esi
mov ebx, eax
push 0
push edi
mov dword [esp + 0x28], ebx
call fcn.1026e960
push esi
push 0
push ebx
call fcn.1026e960
mov eax, dword [esp + 0x3c]
xor esi, esi
add esp, 0x20
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], esi
test eax, eax
jle 0x1004b6c3
mov ebx, dword [esp + 0x18]
nop
test ebp, ebp
je 0x1004b62e
mov edi, dword [ebp]
cmp dword [edi + 0x120], 0
je 0x1004b62e
cmp dword [edi + 0x128], 0
je 0x1004b611
mov edi, dword [edi + 0x12c]
jmp 0x1004b61d
push ebp
call sym.FreeImage.dll__FreeImage_GetLine_4
lea edi, [eax + 3]
and edi, 0xfffffffc
push ebp
call sym.FreeImage.dll__FreeImage_GetBits_4
test eax, eax
je 0x1004b62e
imul edi, esi
add edi, eax
jmp 0x1004b630
xor edi, edi
mov esi, dword [ebx]
cmp dword [esi + 0x120], 0
je 0x1004b66b
cmp dword [esi + 0x128], 0
je 0x1004b64c
mov esi, dword [esi + 0x12c]
jmp 0x1004b658
push ebx
call sym.FreeImage.dll__FreeImage_GetLine_4
lea esi, [eax + 3]
and esi, 0xfffffffc
push ebx
call sym.FreeImage.dll__FreeImage_GetBits_4
test eax, eax
je 0x1004b66b
imul esi, dword [esp + 0x28]
add esi, eax
jmp 0x1004b66d
xor esi, esi
imul ecx, dword [esp + 0x20], 0x41c64e6d
movzx edi, byte [edi]
add edi, dword [esp + 0x2c]
add ecx, 0x3039
mov eax, ecx
mov dword [esp + 0x20], ecx
sar eax, 0xc
mov ecx, 0x81
cdq
idiv ecx
xor eax, eax
mov ecx, 0xff
add edx, 0x3f
cmp edi, edx
cmovg eax, ecx
mov byte [esi], al
sub edi, eax
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x1c]
inc esi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x28], esi
cmp esi, eax
jl 0x1004b5f0
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x28], 0
test eax, eax
jle 0x1004b830
mov ebx, dword [esp + 0x18]
nop
test ebp, ebp
je 0x1004b75c
mov esi, dword [ebp]
cmp dword [esi + 0x120], 0
je 0x1004b75c
cmp dword [esi + 0x128], 0
je 0x1004b701
mov edi, dword [esi + 0x12c]
jmp 0x1004b749
lea ecx, [esi + 0x130]
mov edx, 0x10
and ecx, 0xf
mov eax, 0x10
sub edx, ecx
neg ecx
sbb ecx, ecx
and edx, ecx
lea ecx, [esi + 0x130]
and ecx, 0xf
sub eax, ecx
neg ecx
sbb ecx, ecx
and ecx, eax
movzx edi, word [ecx + esi + 0x146]
imul edi, dword [edx + esi + 0x13c]
add edi, 7
shr edi, 3
add edi, 3
and edi, 0xfffffffc
push ebp
call sym.FreeImage.dll__FreeImage_GetBits_4
test eax, eax
je 0x1004b75c
imul edi, dword [esp + 0x28]
add edi, eax
jmp 0x1004b75e
xor edi, edi
mov esi, dword [ebx]
cmp dword [esi + 0x120], 0
je 0x1004b7ce
cmp dword [esi + 0x128], 0
je 0x1004b77a
mov esi, dword [esi + 0x12c]
jmp 0x1004b7bb
add esi, 0x130
mov edx, 0x10
mov ecx, esi
mov eax, 0x10
and ecx, 0xf
sub edx, ecx
neg ecx
sbb ecx, ecx
and edx, ecx
mov ecx, esi
add edx, esi
and ecx, 0xf
sub eax, ecx
neg ecx
sbb ecx, ecx
and ecx, eax
movzx esi, word [ecx + esi + 0x16]
imul esi, dword [edx + 0xc]
add esi, 7
shr esi, 3
add esi, 3
and esi, 0xfffffffc
push ebx
call sym.FreeImage.dll__FreeImage_GetBits_4
test eax, eax
je 0x1004b7ce
imul esi, dword [esp + 0x28]
add esi, eax
jmp 0x1004b7d0
xor esi, esi
imul ecx, dword [esp + 0x20], 0x41c64e6d
mov eax, dword [esp + 0x10]
movzx edi, byte [eax + edi - 1]
add ecx, 0x3039
mov eax, ecx
mov dword [esp + 0x20], ecx
sar eax, 0xc
mov ecx, 0x81
cdq
idiv ecx
add edi, dword [esp + 0x2c]
xor eax, eax
add edx, 0x3f
mov ecx, 0xff
cmp edi, edx
cmovg eax, ecx
mov ecx, dword [esp + 0x10]
sub edi, eax
mov dword [esp + 0x2c], edi
mov byte [ecx + esi - 1], al
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, dword [esp + 0x1c]
jl 0x1004b6e0
mov ebx, dword [esp + 0x14]
push ebp
call sym.FreeImage.dll__FreeImage_GetBits_4
mov edi, dword [esp + 0x18]
mov esi, eax
push edi
call sym.FreeImage.dll__FreeImage_GetBits_4
mov dword [esp + 0x28], eax
xor ecx, ecx
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2c], ecx
test eax, eax
jle 0x1004b8e2
mov ebp, dword [esp + 0x28]
mov edi, dword [esp + 0x20]
sub ebp, esi
movzx eax, byte [esi]
lea esi, [esi + 1]
add ecx, eax
imul edi, edi, 0x41c64e6d
mov ebx, 0x81
add edi, 0x3039
mov eax, edi
sar eax, 0xc
cdq
idiv ebx
xor ebx, ebx
mov eax, 0xff
add edx, 0x3f
cmp ecx, edx
cmovg ebx, eax
mov eax, 0x7f
sub ecx, ebx
mov byte [esi + ebp - 1], bl
mov dword [esp + 0x28], ecx
movzx ecx, byte [esi - 1]
sub eax, ecx
cdq
sub eax, edx
mov edx, dword [esp + 0x24]
sar eax, 1
neg ebx
sbb ebx, ebx
and ebx, 0xff
sub eax, ebx
add eax, ecx
mov ecx, dword [esp + 0x2c]
mov dword [edx + ecx*4], eax
inc ecx
cmp ecx, dword [esp + 0x10]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x28]
jl 0x1004b862
mov ebp, dword [esp + 0x30]
mov ebx, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
jmp 0x1004b8e6
mov edx, dword [esp + 0x24]
cmp dword [esp + 0x1c], 1
mov dword [esp + 0x28], 1
jle 0x1004bb3d
mov eax, dword [esp + 0x34]
add eax, 0xfffffffc
mov dword [esp + 0x3c], eax
test ebp, ebp
je 0x1004b984
mov esi, dword [ebp]
cmp dword [esi + 0x120], 0
je 0x1004b984
cmp dword [esi + 0x128], 0
je 0x1004b929
mov ebx, dword [esi + 0x12c]
jmp 0x1004b971
lea ecx, [esi + 0x130]
mov edx, 0x10
and ecx, 0xf
mov eax, 0x10
sub edx, ecx
neg ecx
sbb ecx, ecx
and edx, ecx
lea ecx, [esi + 0x130]
and ecx, 0xf
sub eax, ecx
neg ecx
sbb ecx, ecx
and ecx, eax
movzx ebx, word [ecx + esi + 0x146]
imul ebx, dword [edx + esi + 0x13c]
add ebx, 7
shr ebx, 3
add ebx, 3
and ebx, 0xfffffffc
push ebp
call sym.FreeImage.dll__FreeImage_GetBits_4
test eax, eax
je 0x1004b984
imul ebx, dword [esp + 0x28]
add ebx, eax
jmp 0x1004b986
xor ebx, ebx
mov esi, dword [edi]
mov dword [esp + 0x2c], ebx
cmp dword [esi + 0x120], 0
je 0x1004ba04
cmp dword [esi + 0x128], 0
je 0x1004b9a6
mov edi, dword [esi + 0x12c]
jmp 0x1004b9ee
lea ecx, [esi + 0x130]
mov edx, 0x10
and ecx, 0xf
mov eax, 0x10
sub edx, ecx
neg ecx
sbb ecx, ecx
and edx, ecx
lea ecx, [esi + 0x130]
and ecx, 0xf
sub eax, ecx
neg ecx
sbb ecx, ecx
and ecx, eax
movzx edi, word [ecx + esi + 0x146]
imul edi, dword [edx + esi + 0x13c]
add edi, 7
shr edi, 3
add edi, 3
and edi, 0xfffffffc
push dword [esp + 0x18]
call sym.FreeImage.dll__FreeImage_GetBits_4
test eax, eax
je 0x1004ba04
imul edi, dword [esp + 0x28]
add edi, eax
jmp 0x1004ba06
xor edi, edi
movzx esi, byte [ebx]
xor ecx, ecx
cmp byte [edi], cl
mov eax, 0xff
mov dword [esp + 0x20], edi
cmovne ecx, eax
mov eax, 0x7f
sub eax, esi
cdq
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
sub eax, ecx
mov ecx, 1
add eax, esi
mov dword [edx], eax
mov eax, dword [esp + 0x10]
dec eax
cmp eax, ecx
jle 0x1004bac1
mov ebp, dword [esp + 0x24]
lea esi, [edi + 1]
sub edx, ebp
sub ebx, edi
mov edi, dword [esp + 0x14]
mov dword [esp + 0x38], ebx
mov ebx, edx
mov dword [esp + 0x34], edx
nop word [eax + eax]
mov edx, dword [ebx + ebp]
lea eax, [edx*8]
sub eax, edx
mov edx, dword [ebp + 8]
lea edx, [edx + edx*2]
add eax, edx
mov edx, dword [ebp + 4]
lea edx, [edx + edx*4]
add eax, edx
add eax, dword [ebp]
cdq
and edx, 0xf
add eax, edx
mov edx, dword [esp + 0x38]
sar eax, 4
movzx edx, byte [edx + esi]
add eax, edx
cmp eax, 0x7f
jle 0x1004baa1
mov byte [esi], 0xff
add eax, 0xffffff01
jmp 0x1004baa4
mov byte [esi], 0
mov dword [edi + ecx*4], eax
inc esi
mov eax, dword [esp + 0x10]
inc ecx
dec eax
add ebp, 4
cmp ecx, eax
jl 0x1004ba60
mov edi, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x30]
movzx esi, byte [ebx]
xor ecx, ecx
cmp byte [edi], cl
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 + 0x14]
add eax, esi
mov dword [ecx], eax
xor ecx, ecx
mov eax, dword [esp + 0x10]
cmp byte [eax + edi - 1], cl
movzx esi, byte [eax + ebx - 1]
mov eax, 0xff
cmovne ecx, eax
mov ebx, dword [esp + 0x24]
mov edi, dword [esp + 0x18]
mov eax, 0x7f
sub eax, esi
cdq
sub eax, edx
mov edx, dword [esp + 0x3c]
sar eax, 1
sub eax, ecx
mov ecx, dword [esp + 0x14]
add eax, esi
mov dword [esp + 0x14], ebx
mov dword [edx + ecx], eax
mov edx, ecx
mov ecx, dword [esp + 0x28]
inc ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], ecx
cmp ecx, dword [esp + 0x1c]
jl 0x1004b904
push edx
call fcn.102718ed
push ebx
call fcn.102718ed
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
push ebx
call fcn.102718ed
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret