Function at 0x40c180
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push esi
mov esi, eax
mov eax, dword [ebp + 8]
mov dword [edi + 4], 0
mov dword [edi], 0
cmp eax, 0x8000
jl 0x40c1a5
mov eax, 0x8000
push eax
mov eax, dword [edi + 8]
push esi
push eax
call fcn.0048e9c0
mov edx, dword [ebp + 8]
mov eax, 1
add esp, 0xc
xor cl, cl
cmp edx, eax
jle 0x40c1c9
xor cl, byte [eax + esi]
inc eax
cmp eax, edx
jl 0x40c1c1
mov eax, dword [edi + 4]
add eax, 8
mov edx, eax
sar edx, 3
add dword [edi], edx
and eax, 7
mov dword [edi + 4], eax
mov dword [ebx + 0x10], 0
cmp cl, byte [esi]
jne 0x40c543
push esi
mov esi, dword [ebp + 8]
call fcn.0040ca40
mov edx, eax
mov dword [ebp - 4], edx
test edx, edx
je 0x40c27c
inc dword [ebx + 4]
mov esi, dword [ebx + 4]
mov ecx, dword [ebx + 8]
cmp esi, ecx
jle 0x40c245
mov eax, ecx
cdq
and edx, 3
add eax, edx
sar eax, 2
lea eax, [eax + ecx + 0x20]
cmp esi, eax
jg 0x40c21f
mov esi, eax
mov ecx, dword [ebx]
lea eax, [esi + esi*4]
add eax, eax
add eax, eax
add eax, eax
push eax
push ecx
call fcn.00487fdb
add esp, 8
mov dword [ebx], eax
test eax, eax
jne 0x40c23f
call fcn.00405fb0
mov edx, dword [ebp - 4]
mov dword [ebx + 8], esi
mov eax, dword [ebx + 0x10]
lea ecx, [eax + 1]
mov dword [ebx + 0x10], ecx
mov ecx, dword [ebx]
lea eax, [eax + eax*4]
lea eax, [ecx + eax*8]
lea ecx, [eax + 0xc]
mov dword [ecx], edx
mov dword [eax + 0x14], ecx
mov ecx, 3
lea edx, [eax + 0x1c]
mov dword [eax], 0x36
mov dword [eax + 0x24], edx
mov dword [eax + 0x18], ecx
mov dword [eax + 8], ecx
mov dword [ebp + 8], 0
mov edx, dword [edi]
mov eax, dword [edi + 8]
movzx esi, byte [edx + eax]
lea ecx, [edx + eax]
movzx eax, byte [ecx + 1]
movzx ecx, byte [ecx + 2]
shl esi, 8
or eax, esi
mov esi, dword [edi + 4]
shl eax, 8
or eax, ecx
mov ecx, 8
sub ecx, esi
shr eax, cl
lea ecx, [esi + 1]
mov esi, ecx
sar esi, 3
add esi, edx
and ecx, 7
mov dword [edi], esi
mov dword [edi + 4], ecx
test eax, 0x8000
je 0x40c380
mov edx, edi
call fcn.0040c740
mov edx, dword [ebp + 8]
inc eax
xor esi, esi
mov dword [ebp - 8], eax
cmp dword [edi], edx
jge 0x40c543
jmp 0x40c2e3
mov eax, dword [ebp - 8]
cmp esi, eax
jge 0x40c380
mov ecx, dword [ebx + 0x28]
inc dword [ebx + 0x24]
cmp dword [ebx + 0x24], ecx
jle 0x40c333
mov eax, ecx
cdq
and edx, 3
add eax, edx
sar eax, 2
lea ecx, [eax + ecx + 0x20]
mov eax, dword [ebx + 0x24]
mov dword [ebp - 4], eax
cmp eax, ecx
jg 0x40c312
mov dword [ebp - 4], ecx
mov eax, dword [ebp - 4]
mov ecx, dword [ebx + 0x20]
push eax
push ecx
call fcn.00487fdb
add esp, 8
mov dword [ebx + 0x20], eax
test eax, eax
je 0x40c23a
mov edx, dword [ebp - 4]
mov dword [ebx + 0x28], edx
mov eax, dword [edi]
add eax, dword [edi + 8]
inc esi
movzx ecx, byte [eax]
movzx edx, byte [eax + 1]
movzx eax, byte [eax + 2]
shl ecx, 8
or edx, ecx
shl edx, 8
or edx, eax
mov ecx, 8
sub ecx, dword [edi + 4]
shr edx, cl
mov ecx, dword [ebx + 0x20]
shr edx, 8
mov byte [esi + ecx - 1], dl
mov eax, dword [edi + 4]
add eax, 8
mov edx, eax
and eax, 7
sar edx, 3
add dword [edi], edx
mov dword [edi + 4], eax
mov eax, dword [ebp + 8]
cmp dword [edi], eax
jl 0x40c2e0
mov ecx, dword [edi]
cmp ecx, dword [ebp + 8]
jge 0x40c543
jmp 0x40c390
inc dword [ebx + 4]
mov esi, dword [ebx + 4]
mov ecx, dword [ebx + 8]
cmp esi, ecx
jle 0x40c3d4
mov eax, ecx
cdq
and edx, 3
add eax, edx
sar eax, 2
lea eax, [eax + ecx + 0x20]
cmp esi, eax
jg 0x40c3b2
mov esi, eax
mov eax, dword [ebx]
lea edx, [esi + esi*4]
add edx, edx
add edx, edx
add edx, edx
push edx
push eax
call fcn.00487fdb
add esp, 8
mov dword [ebx], eax
test eax, eax
je 0x40c23a
mov dword [ebx + 8], esi
mov eax, dword [ebx + 0x10]
mov edx, dword [ebx]
lea ecx, [eax + eax*4]
lea esi, [edx + ecx*8]
mov ecx, dword [edi + 8]
add ecx, dword [edi]
mov dword [ebp - 4], esi
movzx edx, byte [ecx]
movzx eax, byte [ecx + 1]
movzx ecx, byte [ecx + 2]
shl edx, 8
or eax, edx
shl eax, 8
or eax, ecx
mov ecx, 8
sub ecx, dword [edi + 4]
shr eax, cl
and eax, 0xffff
test eax, 0x8000
jne 0x40c426
shr eax, 0xc
mov dword [esi], eax
mov eax, dword [edi + 4]
add eax, 4
mov edx, eax
sar edx, 3
add dword [edi], edx
jmp 0x40c43b
shr eax, 0xa
sub eax, 0x18
mov dword [esi], eax
mov eax, dword [edi + 4]
add eax, 6
mov ecx, eax
sar ecx, 3
add dword [edi], ecx
and eax, 7
mov dword [edi + 4], eax
mov edx, dword [esi]
test byte [edx + 0x4ca5e8], 4
je 0x40c48c
mov eax, dword [edi]
add eax, dword [edi + 8]
movzx ecx, byte [eax]
movzx edx, byte [eax + 1]
movzx eax, byte [eax + 2]
shl ecx, 8
or edx, ecx
shl edx, 8
or edx, eax
mov ecx, 8
sub ecx, dword [edi + 4]
shr edx, cl
shr edx, 0xf
and dl, 1
mov byte [esi + 4], dl
mov eax, dword [edi + 4]
inc eax
mov ecx, eax
sar ecx, 3
add dword [edi], ecx
and eax, 7
mov dword [edi + 4], eax
jmp 0x40c490
mov byte [esi + 4], 0
mov edx, dword [esi]
lea eax, [esi + 0x18]
mov dword [ebp - 0xc], eax
mov dword [eax], 3
lea ecx, [esi + 8]
mov dword [ecx], 3
movzx eax, byte [edx + 0x4ca5e8]
and eax, 3
mov dword [ebp - 8], eax
mov eax, 0
mov dword [esi + 0x24], eax
mov dword [esi + 0x14], eax
jle 0x40c535
movzx eax, byte [esi + 4]
push eax
mov esi, ecx
mov edx, edi
call fcn.0040c600
cmp dword [ebp - 8], 2
jne 0x40c4e9
mov ecx, dword [ebp - 4]
movzx edx, byte [ecx + 4]
mov esi, dword [ebp - 0xc]
push edx
mov edx, edi
call fcn.0040c600
jmp 0x40c535
mov eax, esi
cmp dword [eax], 1
jne 0x40c535
mov ecx, dword [ebp - 4]
mov edx, dword [ecx]
test byte [edx + 0x4ca5e8], 0x18
je 0x40c535
mov eax, dword [ecx + 0xc]
cmp eax, 0x100
jl 0x40c50f
sub eax, 0x100
jmp 0x40c532
cmp eax, 0x88
jl 0x40c51d
sub eax, 0x108
jmp 0x40c52f
cmp eax, 0x10
jl 0x40c527
sub eax, 8
jmp 0x40c52f
cmp eax, 8
jl 0x40c52f
sub eax, 0x10
add eax, dword [ebx + 0x10]
mov dword [ecx + 0xc], eax
mov eax, dword [ebp + 8]
inc dword [ebx + 0x10]
cmp dword [edi], eax
jl 0x40c390
inc dword [ebx + 4]
mov esi, dword [ebx + 4]
mov ecx, dword [ebx + 8]
cmp esi, ecx
jle 0x40c588
mov eax, ecx
cdq
and edx, 3
add eax, edx
sar eax, 2
lea eax, [eax + ecx + 0x20]
cmp esi, eax
jg 0x40c565
mov esi, eax
mov edx, dword [ebx]
lea ecx, [esi + esi*4]
add ecx, ecx
add ecx, ecx
add ecx, ecx
push ecx
push edx
call fcn.00487fdb
add esp, 8
mov dword [ebx], eax
test eax, eax
jne 0x40c585
call fcn.00405fb0
mov dword [ebx + 8], esi
mov eax, dword [ebx + 0x10]
lea ecx, [eax + 1]
mov dword [ebx + 0x10], ecx
lea edx, [eax + eax*4]
mov eax, dword [ebx]
lea eax, [eax + edx*8]
lea ecx, [eax + 0xc]
mov dword [eax + 0x14], ecx
mov ecx, 3
mov dword [eax + 0x18], ecx
mov dword [eax + 8], ecx
lea edx, [eax + 0x1c]
xor ecx, ecx
mov dword [eax], 0x16
mov dword [eax + 0x24], edx
cmp dword [ebx + 0x10], ecx
jle 0x40c5e5
xor edx, edx
nop
mov eax, dword [ebx]
add eax, edx
cmp dword [eax + 0x14], 0
jne 0x40c5d0
lea esi, [eax + 0xc]
mov dword [eax + 0x14], esi
cmp dword [eax + 0x24], 0
jne 0x40c5dc
lea esi, [eax + 0x1c]
mov dword [eax + 0x24], esi
inc ecx
add edx, 0x28
cmp ecx, dword [ebx + 0x10]
jl 0x40c5c0
cmp dword [ebp + 8], 0
pop esi
je 0x40c5f3
mov ecx, ebx
call fcn.0040c900
mov esp, ebp
pop ebp
ret 4