Function at 0x40ac40
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [0x45b414]
push esi
mov esi, dword [0x45b418]
push edi
xor edi, edi
test ebx, ebx
mov dword [0x45b3fc], 2
je 0x40ac01
mov ecx, dword [0x45b424]
push ebp
lea ebx, [ebx]
movzx eax, byte [esi + 0x4735ba]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
movzx ecx, word [eax*2 + 0x497e08]
mov edx, esi
and edx, 0x7fff
test ecx, ecx
mov word [edx*2 + 0x487e08], cx
mov dword [0x45b424], eax
mov word [eax*2 + 0x497e08], si
je 0x40aaa6
mov eax, esi
sub eax, ecx
cmp eax, 0x7efa
ja 0x40aaa6
push ecx
call fcn.0040a7c0
mov edi, eax
add esp, 4
cmp edi, ebx
jbe 0x40aaa6
mov edi, ebx
cmp edi, 3
jb 0x40ab57
mov ebp, dword [0x45b404]
lea ecx, [edi - 3]
push ecx
sub esi, ebp
push esi
call fcn.0040fa00
mov ebx, dword [0x45b414]
mov ecx, dword [0x45b41c]
mov esi, dword [0x45b418]
sub ebx, edi
add esp, 8
cmp edi, ecx
mov dword [0x45b414], ebx
ja 0x40ab30
mov ecx, dword [0x45b424]
dec edi
lea esp, [esp]
movzx edx, byte [esi + 0x4735bb]
inc esi
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov ecx, edx
mov bp, word [ecx*2 + 0x497e08]
mov edx, esi
and edx, 0x7fff
dec edi
mov word [edx*2 + 0x487e08], bp
mov word [ecx*2 + 0x497e08], si
jne 0x40aaf0
mov dword [0x45b424], ecx
jmp 0x40ab82
movzx ecx, byte [esi + edi + 0x4735b8]
movzx edx, byte [esi + edi + 0x4735b9]
add esi, edi
shl ecx, 5
xor ecx, edx
xor edi, edi
and ecx, 0x7fff
mov dword [0x45b424], ecx
jmp 0x40ab83
movzx eax, byte [esi + 0x4735b8]
push eax
push 0
call fcn.0040fa00
mov ebx, dword [0x45b414]
mov esi, dword [0x45b418]
mov ecx, dword [0x45b424]
add esp, 8
dec ebx
mov dword [0x45b414], ebx
inc esi
test eax, eax
mov dword [0x45b418], esi
je 0x40abc7
mov ecx, dword [0x45b410]
test ecx, ecx
jl 0x40ab9f
lea eax, [ecx + 0x4735b8]
jmp 0x40aba1
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00410010
mov esi, dword [0x45b418]
mov ebx, dword [0x45b414]
mov ecx, dword [0x45b424]
add esp, 0xc
mov dword [0x45b410], esi
cmp ebx, 0x106
jae 0x40abf8
nop
mov eax, dword [0x45b408]
test eax, eax
jne 0x40abf8
call fcn.0040a910
mov ebx, dword [0x45b414]
cmp ebx, 0x106
mov esi, dword [0x45b418]
mov ecx, dword [0x45b424]
jb 0x40abd0
test ebx, ebx
jne 0x40aa50
pop ebp
mov ecx, dword [0x45b410]
test ecx, ecx
jl 0x40ac23
push 1
sub esi, ecx
lea eax, [ecx + 0x4735b8]
push esi
push eax
call fcn.00410010
add esp, 0xc
pop edi
pop esi
pop ebx
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.00410010
add esp, 0xc
pop edi
pop esi
pop ebx
ret
sub esp, 8
cmp dword [0x45b40c], 3
push ebx
mov dword [esp + 8], 0
mov ebx, 2
jg 0x40ac63
pop ebx
add esp, 8
jmp 0x40aa20
mov eax, dword [0x45b414]
test eax, eax
push esi
mov esi, dword [0x45b418]
je 0x40af01
push ebp
push edi
mov edi, dword [0x45b424]
jmp 0x40ac90
mov ebx, dword [esp + 0x10]
jmp 0x40ac90
movzx eax, byte [esi + 0x4735ba]
mov ebp, dword [0x45b404]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x497e08]
mov ecx, esi
and ecx, 0x7fff
test eax, eax
mov word [ecx*2 + 0x487e08], ax
mov dword [0x45b424], edi
mov word [edi*2 + 0x497e08], si
mov dword [0x45b3fc], ebx
mov dword [esp + 0x10], 2
je 0x40ad30
cmp ebx, dword [0x45b41c]
jae 0x40ad30
mov edx, esi
sub edx, eax
cmp edx, 0x7efa
ja 0x40ad30
push eax
call fcn.0040a7c0
mov ecx, dword [0x45b414]
add esp, 4
cmp eax, ecx
mov dword [esp + 0x10], eax
jbe 0x40ad12
mov dword [esp + 0x10], ecx
mov eax, ecx
cmp eax, 3
jne 0x40ad30
mov edx, dword [0x45b404]
mov eax, esi
sub eax, edx
cmp eax, 0x1000
jbe 0x40ad30
mov dword [esp + 0x10], 2
cmp ebx, 3
jb 0x40ae1c
cmp dword [esp + 0x10], ebx
ja 0x40ae1c
add ebx, 0xfffffffd
sub esi, ebp
push ebx
dec esi
push esi
call fcn.0040fa00
mov ecx, dword [0x45b3fc]
mov esi, dword [0x45b414]
mov edi, dword [0x45b424]
mov edx, 1
sub edx, ecx
add esi, edx
add esp, 8
mov dword [0x45b414], esi
mov esi, dword [0x45b418]
sub ecx, 2
lea ecx, [ecx]
movzx edx, byte [esi + 0x4735bb]
inc esi
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
mov bx, word [edi*2 + 0x497e08]
mov edx, esi
and edx, 0x7fff
dec ecx
mov word [edx*2 + 0x487e08], bx
mov word [edi*2 + 0x497e08], si
jne 0x40ad80
inc esi
test eax, eax
mov dword [0x45b3fc], ecx
mov dword [0x45b424], edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [0x45b418], esi
je 0x40ae9e
mov ecx, dword [0x45b410]
test ecx, ecx
jl 0x40adf5
lea eax, [ecx + 0x4735b8]
jmp 0x40adf7
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00410010
mov esi, dword [0x45b418]
mov edi, dword [0x45b424]
add esp, 0xc
mov dword [0x45b410], esi
jmp 0x40ae9e
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40ae84
movzx eax, byte [esi + 0x4735b7]
push eax
push 0
call fcn.0040fa00
add esp, 8
test eax, eax
je 0x40ae76
mov ecx, dword [0x45b410]
test ecx, ecx
jl 0x40ae4c
lea eax, [ecx + 0x4735b8]
jmp 0x40ae4e
xor eax, eax
mov edx, dword [0x45b418]
push 0
sub edx, ecx
push edx
push eax
call fcn.00410010
mov esi, dword [0x45b418]
mov edi, dword [0x45b424]
add esp, 0xc
mov dword [0x45b410], esi
jmp 0x40ae8c
mov esi, dword [0x45b418]
mov edi, dword [0x45b424]
jmp 0x40ae8c
mov dword [esp + 0x14], 1
mov eax, dword [0x45b414]
inc esi
dec eax
mov dword [0x45b418], esi
mov dword [0x45b414], eax
mov eax, dword [0x45b414]
mov ebx, 0x106
cmp eax, ebx
jae 0x40aed2
lea esp, [esp]
mov eax, dword [0x45b408]
test eax, eax
jne 0x40aed2
call fcn.0040a910
cmp dword [0x45b414], ebx
mov esi, dword [0x45b418]
mov edi, dword [0x45b424]
jb 0x40aeb0
mov eax, dword [0x45b414]
test eax, eax
jne 0x40ac81
mov eax, dword [esp + 0x14]
test eax, eax
pop edi
pop ebp
je 0x40af01
movzx eax, byte [esi + 0x4735b7]
push eax
push 0
call fcn.0040fa00
mov esi, dword [0x45b418]
add esp, 8
mov ecx, dword [0x45b410]
test ecx, ecx
jl 0x40af25
push 1
sub esi, ecx
lea eax, [ecx + 0x4735b8]
push esi
push eax
call fcn.00410010
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.00410010
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret