Function at 0x512e68
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe4
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov esi, eax
mov eax, dword [ebp - 4]
call fcn.00405cd8
xor eax, eax
push ebp
push 0x513212
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
mov edx, dword [0x47e9c0]
call fcn.00405c74
cmp dword [ebp - 4], 0
je 0x5131e3
mov eax, dword [ebp - 4]
call fcn.00405998
mov dword [ebp - 0xc], eax
cmp dword [esi + 8], 2
je 0x512ece
cmp dword [esi + 0x10], 1
jne 0x512ef0
cmp dword [ebp - 0xc], 0x20
jl 0x512ef0
mov eax, dword [ebp - 0xc]
and eax, 0x8000000f
jns 0x512edd
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
jne 0x512ee7
mov byte [ebp - 0xd], 0x10
jmp 0x512f10
mov dl, 0x10
sub dl, al
mov byte [ebp - 0xd], dl
jmp 0x512f10
mov eax, dword [ebp - 0xc]
and eax, 0x8000000f
jns 0x512eff
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
jne 0x512f09
mov byte [ebp - 0xd], 0
jmp 0x512f10
mov dl, 0x10
sub dl, al
mov byte [ebp - 0xd], dl
cmp dword [esi + 0xc], 2
jne 0x512f37
xor eax, eax
mov al, byte [ebp - 0xd]
add eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
mov ecx, 1
mov edx, dword [0x47e9c0]
call fcn.00405b54
add esp, 4
jmp 0x512f57
xor eax, eax
mov al, byte [ebp - 0xd]
add eax, dword [ebp - 0xc]
inc eax
push eax
mov eax, dword [ebp - 8]
mov ecx, 1
mov edx, dword [0x47e9c0]
call fcn.00405b54
add esp, 4
push 0x10
lea eax, [ebp - 0x14]
mov ecx, 1
mov edx, dword [0x47e9c0]
call fcn.00405b54
add esp, 4
push 0
lea eax, [ebp - 0x1c]
mov ecx, 1
mov edx, dword [0x47e9c0]
call fcn.00405b54
add esp, 4
push 0
lea eax, [ebp - 0x18]
mov ecx, 1
mov edx, dword [0x47e9c0]
call fcn.00405b54
add esp, 4
cmp dword [esi + 4], 1
jne 0x512fbd
push 0x10
lea eax, [ebp - 0x1c]
mov ecx, 1
mov edx, dword [0x47e9c0]
call fcn.00405b54
add esp, 4
cmp dword [esi + 0xc], 2
jne 0x51310b
xor ebx, ebx
jmp 0x51307e
xor eax, eax
mov edx, dword [ebp - 0x14]
mov cl, byte [ebp - 0xd]
mov byte [edx + eax], cl
inc eax
cmp eax, 0x10
jne 0x512fd0
lea eax, [ebx + 0x10]
cmp eax, dword [ebp - 0xc]
jg 0x513000
mov eax, dword [ebp - 0x14]
push eax
push 0
push 0x10
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x480168]
call fcn.00481b90
jmp 0x51301b
mov eax, dword [ebp - 0x14]
push eax
push 0
mov eax, dword [ebp - 0xc]
sub eax, ebx
push eax
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x480168]
call fcn.00481b90
cmp dword [esi + 4], 1
jne 0x513039
test ebx, ebx
jle 0x513039
xor eax, eax
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x513027
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, esi
call fcn.00511ca4
cmp dword [esi + 4], 1
jne 0x513063
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [0x480168]
call fcn.00481b90
mov eax, dword [ebp - 8]
mov eax, dword [eax]
push eax
push ebx
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [0x480168]
call fcn.00481b90
add ebx, 0x10
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00405998
cmp ebx, eax
jl 0x512fce
cmp ebx, 0x10
jne 0x5131e3
xor eax, eax
mov edx, dword [ebp - 0x14]
mov cl, byte [ebp - 0xd]
mov byte [edx + eax], cl
inc eax
cmp eax, 0x10
jne 0x51309b
cmp dword [esi + 4], 1
jne 0x5130c4
xor eax, eax
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x5130b2
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, esi
call fcn.00511ca4
cmp dword [esi + 4], 1
jne 0x5130ee
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [0x480168]
call fcn.00481b90
mov eax, dword [ebp - 8]
mov eax, dword [eax]
push eax
push ebx
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [0x480168]
call fcn.00481b90
jmp 0x5131e3
xor ebx, ebx
cmp ebx, dword [ebp - 0xc]
jge 0x5131cd
xor eax, eax
mov edx, dword [ebp - 0x14]
mov byte [edx + eax], 0
inc eax
cmp eax, 0x10
jne 0x513118
lea eax, [ebx + 0x10]
cmp eax, dword [ebp - 0xc]
jg 0x513146
mov eax, dword [ebp - 0x14]
push eax
push 0
push 0x10
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x480168]
call fcn.00481b90
jmp 0x513161
mov eax, dword [ebp - 0x14]
push eax
push 0
mov eax, dword [ebp - 0xc]
sub eax, ebx
push eax
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x480168]
call fcn.00481b90
cmp dword [esi + 4], 1
jne 0x51317f
test ebx, ebx
jle 0x51317f
xor eax, eax
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x51316d
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, esi
call fcn.00511ca4
cmp dword [esi + 4], 1
jne 0x5131a9
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [0x480168]
call fcn.00481b90
mov eax, dword [ebp - 8]
mov eax, dword [eax]
push eax
push ebx
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
mov eax, dword [0x480168]
call fcn.00481b90
add ebx, 0x10
cmp ebx, dword [ebp - 0xc]
jl 0x513116
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00405998
mov edx, dword [ebp - 8]
mov edx, dword [edx]
mov cl, byte [ebp - 0xd]
inc ecx
mov byte [edx + eax], cl
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x513219
lea eax, [ebp - 0x1c]
mov edx, dword [0x47e9c0]
mov ecx, 3
call fcn.00405078
lea eax, [ebp - 4]
mov edx, dword [0x47e9c0]
call fcn.00405c74
ret