Function at 0x40eb40
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
cmp dword [ebp + 8], 0
je 0x40eb55
mov eax, dword [ebp + 8]
cmp dword [eax + 4], 0
jne 0x40eb64
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40f0f8
mov eax, dword [ebp + 0xc]
shr eax, 0x10
and eax, 0xffff
movzx eax, ax
test eax, eax
jne 0x40ebdc
mov eax, dword [ebp + 0xc]
and eax, 0xffff
movzx eax, ax
mov ecx, dword [ebp + 8]
cmp eax, dword [ecx + 8]
jae 0x40eb98
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40f0f8
mov eax, dword [ebp + 0xc]
and eax, 0xffff
movzx eax, ax
mov ecx, dword [ebp + 8]
sub eax, dword [ecx + 8]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 4]
cmp ecx, dword [eax + 4]
jbe 0x40ebc6
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40f0f8
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 4]
mov eax, dword [eax + ecx*4]
jmp 0x40f0f8
push dword [ebp + 0xc]
call fcn.00401b90
pop ecx
mov dword [ebp - 0xc], eax
and dword [ebp - 8], 0
mov eax, dword [ebp + 8]
cmp dword [eax + 0x10], 0
je 0x40f0d0
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x10], 0xfeedbeef
mov dword [ebp - 0x20], 0x9e3779b9
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xc
jb 0x40ede2
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax]
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 1]
shl ecx, 8
add eax, ecx
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 2]
shl ecx, 0x10
add eax, ecx
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 3]
shl ecx, 0x18
add ecx, dword [ebp - 0x1c]
add ecx, eax
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 4]
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 5]
shl ecx, 8
add eax, ecx
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 6]
shl ecx, 0x10
add eax, ecx
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 7]
shl ecx, 0x18
add ecx, dword [ebp - 0x20]
add ecx, eax
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 8]
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 9]
shl ecx, 8
add eax, ecx
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 0xa]
shl ecx, 0x10
add eax, ecx
mov ecx, dword [ebp - 0x18]
movzx ecx, byte [ecx + 0xb]
shl ecx, 0x18
add ecx, dword [ebp - 0x10]
add ecx, eax
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
shr eax, 0xd
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
shl eax, 8
xor eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
shr eax, 0xd
xor eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
shr eax, 0xc
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
shl eax, 0x10
xor eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
shr eax, 5
xor eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
shr eax, 3
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
shl eax, 0xa
xor eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
shr eax, 0xf
xor eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
xor eax, eax
jne 0x40ecb5
mov eax, dword [ebp - 0x18]
add eax, 0xc
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
sub eax, 0xc
mov dword [ebp - 0x14], eax
jmp 0x40ec19
mov eax, dword [ebp - 0x10]
add eax, dword [ebp - 0xc]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
dec eax
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0xa
ja case.default.0x40ee05
mov eax, dword [ebp - 0x30]
jmp dword [eax*4 + 0x40f0fa]
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 0xa]
shl eax, 0x18
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 9]
shl eax, 0x10
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 8]
shl eax, 8
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 7]
shl eax, 0x18
add eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 6]
shl eax, 0x10
add eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 5]
shl eax, 8
add eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 4]
add eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 3]
shl eax, 0x18
add eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 2]
shl eax, 0x10
add eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax + 1]
shl eax, 8
add eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
movzx eax, byte [eax]
add eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
shr eax, 0xd
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
shl eax, 8
xor eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
shr eax, 0xd
xor eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
shr eax, 0xc
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
shl eax, 0x10
xor eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
shr eax, 5
xor eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
shr eax, 3
xor eax, dword [ebp - 0x1c]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
shl eax, 0xa
xor eax, dword [ebp - 0x20]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
shr eax, 0xf
xor eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
xor eax, eax
jne case.default.0x40ee05
xor eax, eax
jne 0x40ebf9
xor eax, eax
jne 0x40ebf9
and dword [ebp - 8], 0
mov eax, dword [ebp + 8]
cmp dword [eax + 0x10], 0
je 0x40f0c8
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
mov eax, dword [eax + 8]
mov eax, dword [eax + 4]
dec eax
and eax, dword [ebp - 0x10]
mov dword [ebp - 0x24], eax
xor eax, eax
jne 0x40efec
xor eax, eax
inc eax
je 0x40f0c8
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
mov eax, dword [eax + 8]
mov ecx, dword [ebp - 0x24]
imul ecx, ecx, 0xc
mov eax, dword [eax]
cmp dword [ecx + eax], 0
je 0x40f054
lea eax, [ebp - 8]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
mov eax, dword [eax + 8]
mov ecx, dword [ebp - 0x24]
imul ecx, ecx, 0xc
mov eax, dword [eax]
mov edx, dword [ebp + 8]
mov edx, dword [edx + 0x10]
mov edx, dword [edx + 8]
mov eax, dword [eax + ecx]
sub eax, dword [edx + 0x14]
mov ecx, dword [ebp - 0x28]
mov dword [ecx], eax
xor eax, eax
jne 0x40f023
jmp 0x40f058
and dword [ebp - 8], 0
cmp dword [ebp - 8], 0
je 0x40f0c0
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x24]
cmp eax, dword [ebp - 0x10]
jne 0x40f08e
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x20]
cmp eax, dword [ebp - 0xc]
jne 0x40f08e
push dword [ebp - 0xc]
push dword [ebp + 0xc]
mov eax, dword [ebp - 8]
push dword [eax + 0x1c]
call fcn.00401c9a
add esp, 0xc
test eax, eax
jne 0x40f08e
jmp 0x40f0c0
mov eax, dword [ebp - 8]
cmp dword [eax + 0x18], 0
je 0x40f0ba
lea eax, [ebp - 8]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x10]
mov eax, dword [eax + 8]
mov ecx, dword [ebp - 8]
mov ecx, dword [ecx + 0x18]
sub ecx, dword [eax + 0x14]
mov eax, dword [ebp - 0x2c]
mov dword [eax], ecx
xor eax, eax
jne 0x40f097
jmp 0x40f0be
and dword [ebp - 8], 0
jmp 0x40f058
xor eax, eax
jne 0x40f00c
xor eax, eax
jne 0x40efdb
xor eax, eax
jne 0x40ebe8
xor eax, eax
jne 0x40ebdc
cmp dword [ebp - 8], 0
jne 0x40f0f2
push 0x7f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x40f0f8
mov eax, dword [ebp - 8]
mov eax, dword [eax + 4]
leave
ret