Function at 0x4033c0
Capabilities:
Encode data using xor

Disassembly:
push esi
push ebp
push ebx
sub esp, 0x18
movzx ebx, word [0x40f4b4]
xor al, al
xor ebp, ebp
mov edx, dword [0x40f544]
test edx, edx
mov byte [esp + 0x14], al
mov eax, 0
mov word [0x40f4ac], ax
je 0x40371d
mov eax, dword [0x40f5c0]
mov edx, dword [0x40f4a8]
shl ebx, 5
movzx eax, byte [eax + edx + 2]
mov ecx, dword [0x40f57c]
xor ebx, eax
and edx, 0x7fff
and ebx, 0x7fff
mov eax, dword [0x40f578]
mov esi, eax
movzx eax, word [ecx + ebx*2]
mov word [esi + edx*2], ax
movzx edx, word [0x40f4a8]
mov ecx, dword [0x40f57c]
test eax, eax
mov word [ecx + ebx*2], dx
movzx esi, word [0x40f4ac]
mov word [0x40f4b0], bp
mov ebp, 2
je 0x4034d0
movzx edx, word [0x40f4b0]
movsx ecx, word [0x40f554]
cmp edx, ecx
jge 0x4034d7
mov ecx, dword [0x40f4a8]
sub ecx, eax
cmp ecx, 0x7efa
ja 0x4034d7
mov word [esp], ax
call fcn.004031d0
mov ebp, eax
mov eax, dword [0x40f544]
cmp ebp, eax
jbe 0x40348c
mov ebp, eax
cmp ebp, 3
jne 0x4034c0
movzx eax, word [0x40f4ac]
mov edx, dword [0x40f4a8]
sub edx, eax
cmp edx, 0x1000
jle 0x40376c
movzx edx, word [0x40f4b0]
dec ebp
jmp 0x4034d7
movzx edx, word [0x40f4b0]
jmp 0x4034d7
movzx edx, word [0x40f4b0]
cmp edx, 3
jl 0x4034e4
cmp ebp, edx
jbe 0x4035b0
mov al, byte [esp + 0x14]
test al, al
jne 0x403510
mov eax, dword [0x40f4a8]
mov edx, dword [0x40f544]
inc eax
dec edx
mov dword [0x40f4a8], eax
mov dword [0x40f544], edx
mov al, 1
mov byte [esp + 0x14], al
jmp 0x4036cb
mov eax, dword [0x40f5c0]
mov edx, dword [0x40f4a8]
lea ecx, [esp + 0x10]
movzx eax, byte [eax + edx - 1]
mov dword [esp + 8], ecx
mov word [esp + 4], ax
xor eax, eax
mov word [esp], ax
call fcn.00404ed0
test eax, eax
je 0x4037ca
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40358e
mov eax, dword [0x40f54c]
test eax, eax
jl 0x403780
mov edx, eax
add edx, dword [0x40f5c0]
mov ecx, dword [0x40f4a8]
mov dword [esp], edx
sub ecx, eax
mov dword [esp + 8], 0
mov dword [esp + 4], ecx
call fcn.00406360
movsx edx, ax
test edx, edx
jne 0x4037c3
mov eax, dword [0x40f4a8]
mov dword [0x40f54c], eax
mov eax, dword [0x40f4a8]
mov edx, dword [0x40f544]
inc eax
dec edx
mov dword [0x40f4a8], eax
mov dword [0x40f544], edx
jmp 0x4036cb
mov eax, dword [0x40f4a8]
add edx, 0xfffffffd
dec eax
lea ecx, [esp + 0x10]
sub eax, esi
mov dword [esp + 8], ecx
mov word [esp], ax
mov word [esp + 4], dx
call fcn.00404ed0
test eax, eax
je 0x4037b7
movzx eax, word [0x40f4b0]
mov edx, dword [0x40f544]
mov ecx, 0xffffffff
add ecx, eax
add eax, 0xfffffffe
sub edx, ecx
mov word [0x40f4b0], ax
mov dword [0x40f544], edx
mov esi, esi
mov eax, dword [0x40f4a8]
mov edx, dword [0x40f5c0]
mov ecx, 1
add ecx, eax
shl ebx, 5
mov dword [0x40f4a8], ecx
movzx edx, byte [edx + eax + 3]
mov eax, dword [0x40f57c]
xor ebx, edx
and ecx, 0x7fff
and ebx, 0x7fff
mov edx, dword [0x40f578]
movzx eax, word [eax + ebx*2]
mov word [edx + ecx*2], ax
movzx eax, word [0x40f4a8]
mov edx, dword [0x40f57c]
mov word [edx + ebx*2], ax
movzx eax, word [0x40f4b0]
dec eax
movzx edx, ax
mov word [0x40f4b0], ax
test edx, edx
jne 0x403600
mov eax, dword [0x40f4a8]
mov edx, dword [esp + 0x10]
inc eax
test edx, edx
mov dword [0x40f4a8], eax
mov al, 0
mov ebp, 2
mov byte [esp + 0x14], al
je 0x4036cb
mov eax, dword [0x40f54c]
test eax, eax
jl 0x403790
mov edx, eax
add edx, dword [0x40f5c0]
mov ecx, dword [0x40f4a8]
mov dword [esp], edx
sub ecx, eax
mov dword [esp + 8], 0
mov dword [esp + 4], ecx
call fcn.00406360
movsx edx, ax
test edx, edx
jne 0x4037d6
mov eax, dword [0x40f4a8]
mov dword [0x40f54c], eax
mov eax, dword [0x40f544]
cmp eax, 0x106
jge 0x4036e5
mov edx, dword [0x40f548]
test edx, edx
je 0x4037a0
test eax, eax
jne 0x4033ee
mov al, byte [esp + 0x14]
test al, al
je 0x40371d
mov eax, dword [0x40f5c0]
mov edx, dword [0x40f4a8]
lea ecx, [esp + 0x10]
movzx eax, byte [eax + edx - 1]
mov dword [esp + 8], ecx
mov word [esp + 4], ax
xor eax, eax
mov word [esp], ax
call fcn.00404ed0
mov eax, dword [0x40f54c]
test eax, eax
jl 0x4037b0
mov edx, eax
add edx, dword [0x40f5c0]
mov ecx, dword [0x40f4a8]
mov dword [esp], edx
sub ecx, eax
mov dword [esp + 8], 1
mov dword [esp + 4], ecx
call fcn.00406360
movsx edx, ax
test edx, edx
je 0x40375c
add esp, 0x18
pop ebx
pop ebp
pop esi
ret
mov word [0x40f4b4], bx
add esp, 0x18
xor eax, eax
pop ebx
pop ebp
pop esi
ret
movzx edx, word [0x40f4b0]
jmp 0x4034d7
xor edx, edx
jmp 0x40355d
xor edx, edx
jmp 0x40369a
call fcn.00402d50
mov eax, dword [0x40f544]
jmp 0x4036e5
xor edx, edx
jmp 0x403732
add esp, 0x18
mov eax, 0xfffffff5
pop ebx
pop ebp
pop esi
ret
add esp, 0x18
pop ebx
pop ebp
pop esi
ret
add esp, 0x18
mov eax, 0xfffffff5
pop ebx
pop ebp
pop esi
ret
add esp, 0x18
pop ebx
pop ebp
pop esi
ret