Function at 0x405c26
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x24
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x74]
cmp eax, 0x105
ja 0x405c70
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._fill_window
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x74]
cmp eax, 0x105
ja 0x405c62
cmp dword [ebp + 0xc], 0
jne 0x405c62
mov eax, 0
jmp 0x4062c4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x74]
test eax, eax
je 0x406189
mov dword [ebp - 0xc], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x74]
cmp eax, 2
jbe 0x405d11
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x48]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
mov ecx, eax
shl edx, cl
mov ecx, edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
add eax, 2
add eax, edx
movzx eax, byte [eax]
movzx eax, al
xor ecx, eax
mov edx, ecx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
and edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x48], edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x40]
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x6c]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
and eax, ecx
add eax, eax
add eax, edx
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x44]
mov edx, dword [ebp + 8]
mov edx, dword [edx + 0x48]
add edx, edx
add edx, ecx
movzx edx, word [edx]
mov word [eax], dx
movzx eax, word [eax]
movzx eax, ax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x44]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x48]
add eax, eax
add edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov word [edx], ax
cmp dword [ebp - 0xc], 0
je 0x405d4b
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
sub eax, dword [ebp - 0xc]
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x2c]
sub eax, 0x106
cmp edx, eax
ja 0x405d4b
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._longest_match
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x60], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
cmp eax, 2
jbe 0x406023
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
sub eax, 3
mov byte [ebp - 0x11], al
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x70]
sub edx, eax
mov eax, edx
mov word [ebp - 0x14], ax
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1698]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
lea ecx, [eax + 1]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16a0], ecx
add eax, ebx
movzx edx, word [ebp - 0x14]
mov byte [eax], dl
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1698]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
lea ecx, [eax + 1]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16a0], ecx
add eax, ebx
movzx edx, word [ebp - 0x14]
shr dx, 8
mov byte [eax], dl
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1698]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
lea ecx, [eax + 1]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16a0], ecx
lea edx, [ebx + eax]
movzx eax, byte [ebp - 0x11]
mov byte [edx], al
movzx eax, word [ebp - 0x14]
sub eax, 1
mov word [ebp - 0x14], ax
movzx eax, byte [ebp - 0x11]
movzx eax, byte [eax + 0x410b20]
movzx eax, al
add eax, 0x101
mov edx, dword [ebp + 8]
lea ecx, [eax + 0x24]
movzx edx, word [edx + ecx*4 + 4]
lea ecx, [edx + 1]
mov edx, dword [ebp + 8]
add eax, 0x24
mov word [edx + eax*4 + 4], cx
cmp word [ebp - 0x14], 0xff
ja 0x405e42
movzx eax, word [ebp - 0x14]
movzx eax, byte [eax + 0x410920]
movzx eax, al
jmp 0x405e5c
movzx eax, word [ebp - 0x14]
shr ax, 7
movzx eax, ax
add eax, 0x100
movzx eax, byte [eax + 0x410920]
movzx eax, al
mov edx, dword [ebp + 8]
lea ecx, [eax + 0x260]
movzx edx, word [edx + ecx*4 + 8]
lea ecx, [edx + 1]
mov edx, dword [ebp + 8]
add eax, 0x260
mov word [edx + eax*4 + 8], cx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x16a0]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a4]
cmp edx, eax
sete al
movzx eax, al
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x74]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
sub edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x74], edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x60]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x80]
cmp edx, eax
ja 0x405fab
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x74]
cmp eax, 2
jbe 0x405fab
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
lea edx, [eax - 1]
mov eax, dword [ebp + 8]
mov dword [eax + 0x60], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
lea edx, [eax + 1]
mov eax, dword [ebp + 8]
mov dword [eax + 0x6c], edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x48]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
mov ecx, eax
shl edx, cl
mov ecx, edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
add eax, 2
add eax, edx
movzx eax, byte [eax]
movzx eax, al
xor ecx, eax
mov edx, ecx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
and edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x48], edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x40]
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x6c]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
and eax, ecx
add eax, eax
add eax, edx
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x44]
mov edx, dword [ebp + 8]
mov edx, dword [edx + 0x48]
add edx, edx
add edx, ecx
movzx edx, word [edx]
mov word [eax], dx
movzx eax, word [eax]
movzx eax, ax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x44]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x48]
add eax, eax
add edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov word [edx], ax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
lea edx, [eax - 1]
mov eax, dword [ebp + 8]
mov dword [eax + 0x60], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
test eax, eax
jne 0x405ee0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
lea edx, [eax + 1]
mov eax, dword [ebp + 8]
mov dword [eax + 0x6c], edx
jmp 0x4060fc
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x6c]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x60]
add edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x6c], edx
mov eax, dword [ebp + 8]
mov dword [eax + 0x60], 0
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
add eax, edx
movzx eax, byte [eax]
movzx edx, al
mov eax, dword [ebp + 8]
mov dword [eax + 0x48], edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x48]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
mov ecx, eax
shl edx, cl
mov ecx, edx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
add eax, 1
add eax, edx
movzx eax, byte [eax]
movzx eax, al
xor ecx, eax
mov edx, ecx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
and edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x48], edx
jmp 0x4060fc
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
add eax, edx
movzx eax, byte [eax]
mov byte [ebp - 0x15], al
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1698]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
lea ecx, [eax + 1]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16a0], ecx
add eax, ebx
mov byte [eax], 0
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1698]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
lea ecx, [eax + 1]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16a0], ecx
add eax, ebx
mov byte [eax], 0
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 0x1698]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
lea ecx, [eax + 1]
mov edx, dword [ebp + 8]
mov dword [edx + 0x16a0], ecx
lea edx, [ebx + eax]
movzx eax, byte [ebp - 0x15]
mov byte [edx], al
movzx eax, byte [ebp - 0x15]
mov edx, dword [ebp + 8]
lea ecx, [eax + 0x24]
movzx edx, word [edx + ecx*4 + 4]
lea ecx, [edx + 1]
mov edx, dword [ebp + 8]
add eax, 0x24
mov word [edx + eax*4 + 4], cx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x16a0]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a4]
cmp edx, eax
sete al
movzx eax, al
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x74]
lea edx, [eax - 1]
mov eax, dword [ebp + 8]
mov dword [eax + 0x74], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
lea edx, [eax + 1]
mov eax, dword [ebp + 8]
mov dword [eax + 0x6c], edx
cmp dword [ebp - 0x10], 0
je 0x405c2d
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
sub edx, eax
mov eax, edx
mov ecx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
test eax, eax
js 0x406134
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
add eax, edx
jmp 0x406139
mov eax, 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.__tr_flush_block
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x5c], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp], eax
call sym._flush_pending
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x405c2d
mov eax, 0
jmp 0x4062c4
nop
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
cmp eax, 2
jbe 0x40619a
mov eax, 2
mov edx, dword [ebp + 8]
mov dword [edx + 0x16b4], eax
cmp dword [ebp + 0xc], 4
jne 0x406236
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
sub edx, eax
mov eax, edx
mov ecx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
test eax, eax
js 0x4061db
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
add eax, edx
jmp 0x4061e0
mov eax, 0
mov dword [esp + 0xc], 1
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.__tr_flush_block
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x5c], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp], eax
call sym._flush_pending
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x40622c
mov eax, 2
jmp 0x4062c4
mov eax, 3
jmp 0x4062c4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x16a0]
test eax, eax
je 0x4062bf
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
sub edx, eax
mov eax, edx
mov ecx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
test eax, eax
js 0x406271
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x5c]
add eax, edx
jmp 0x406276
mov eax, 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym.__tr_flush_block
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x6c]
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x5c], edx
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [esp], eax
call sym._flush_pending
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x4062bf
mov eax, 0
jmp 0x4062c4
mov eax, 1
add esp, 0x24
pop ebx
pop ebp
ret