Function at 0x403d50
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
cmp dword [0x428da8], 3
push ebx
mov dword [ebp - 8], 0
mov ebx, 2
jg 0x403d76
call fcn.00403b30
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [0x428dac], 0
push esi
mov esi, dword [0x42cc30]
je 0x40400e
push edi
mov edi, dword [0x428db4]
jmp 0x403da3
mov ebx, dword [ebp - 4]
movzx eax, byte [esi + 0x4450e2]
mov edx, dword [0x42cc28]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x469940]
mov ecx, esi
and ecx, 0x7fff
test eax, eax
mov word [ecx*2 + 0x459940], ax
mov dword [0x428db4], edi
mov word [edi*2 + 0x469940], si
mov dword [0x42cc20], ebx
mov dword [ebp - 0xc], edx
mov dword [ebp - 4], 2
je 0x403e41
cmp ebx, dword [0x428db0]
jae 0x403e41
mov ecx, esi
sub ecx, eax
cmp ecx, 0x7efa
ja 0x403e41
push eax
call fcn.004038a0
mov ecx, dword [0x428dac]
add esp, 4
cmp eax, ecx
mov dword [ebp - 4], eax
jbe 0x403e25
mov dword [ebp - 4], ecx
mov eax, ecx
cmp eax, 3
jne 0x403e41
mov edx, esi
sub edx, dword [0x42cc28]
cmp edx, 0x1000
jbe 0x403e41
mov dword [ebp - 4], 2
cmp ebx, 3
jb 0x403f30
cmp dword [ebp - 4], ebx
ja 0x403f30
sub esi, dword [ebp - 0xc]
add ebx, 0xfffffffd
push ebx
sub esi, 1
push esi
call fcn.00404ab0
mov ecx, dword [0x42cc20]
mov edi, dword [0x428db4]
mov esi, dword [0x42cc30]
mov edx, 1
sub edx, ecx
add dword [0x428dac], edx
add esp, 8
sub ecx, 2
jmp 0x403e90
movzx edx, byte [esi + 0x4450e3]
add esi, 1
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
mov bx, word [edi*2 + 0x469940]
mov edx, esi
and edx, 0x7fff
sub ecx, 1
mov word [edx*2 + 0x459940], bx
mov word [edi*2 + 0x469940], si
jne 0x403e90
add esi, 1
test eax, eax
mov dword [0x42cc20], ecx
mov dword [0x428db4], edi
mov dword [ebp - 8], 0
mov dword [ebp - 4], 2
mov dword [0x42cc30], esi
je 0x403fb0
mov ecx, dword [0x42cc2c]
test ecx, ecx
jl 0x403f09
lea eax, [ecx + 0x4450e0]
jmp 0x403f0b
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00405070
mov esi, dword [0x42cc30]
mov edi, dword [0x428db4]
add esp, 0xc
mov dword [0x42cc2c], esi
jmp 0x403fb0
cmp dword [ebp - 8], 0
je 0x403f9a
movzx eax, byte [esi + 0x4450df]
push eax
push 0
call fcn.00404ab0
add esp, 8
test eax, eax
je 0x403f82
mov ecx, dword [0x42cc2c]
test ecx, ecx
jl 0x403f5e
lea eax, [ecx + 0x4450e0]
jmp 0x403f60
xor eax, eax
mov edx, dword [0x42cc30]
push 0
sub edx, ecx
push edx
push eax
call fcn.00405070
mov esi, dword [0x42cc30]
add esp, 0xc
mov dword [0x42cc2c], esi
jmp 0x403f88
mov esi, dword [0x42cc30]
mov edi, dword [0x428db4]
add esi, 1
sub dword [0x428dac], 1
jmp 0x403faa
mov eax, 1
add esi, eax
sub dword [0x428dac], eax
mov dword [ebp - 8], eax
mov dword [0x42cc30], esi
mov ebx, 0x106
cmp dword [0x428dac], ebx
jae 0x403fe2
lea ecx, [ecx]
cmp dword [0x428da4], 0
jne 0x403fd6
call fcn.00403a20
cmp dword [0x428dac], ebx
jb 0x403fc0
mov esi, dword [0x42cc30]
mov edi, dword [0x428db4]
cmp dword [0x428dac], 0
jne 0x403da0
cmp dword [ebp - 8], 0
pop edi
je 0x40400e
movzx eax, byte [esi + 0x4450df]
push eax
push 0
call fcn.00404ab0
mov esi, dword [0x42cc30]
add esp, 8
mov ecx, dword [0x42cc2c]
test ecx, ecx
jl 0x404032
push 1
sub esi, ecx
lea eax, [ecx + 0x4450e0]
push esi
push eax
call fcn.00405070
add esp, 0xc
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.00405070
add esp, 0xc
pop esi
pop ebx
mov esp, ebp
pop ebp
ret