Function at 0x412a10
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x4c
mov eax, dword [esp + 0x50]
push ebx
push ebp
push esi
xor ebp, ebp
lea esi, [eax - 1]
cmp word [0x421da2], bp
push edi
mov dword [esp + 0x48], esi
je 0x412a3e
mov eax, dword [esp + 0x6c]
mov dword [eax], 1
mov dword [eax + 0xc], 0xffffffff
mov ecx, dword [esp + 0x64]
mov eax, ecx
cdq
sub eax, edx
sar eax, 1
mov dword [esp + 0x40], eax
lea edx, [eax + eax]
cmp edx, ecx
jge 0x412a59
inc eax
mov dword [esp + 0x40], eax
mov eax, 1
mov edi, dword [sym.imp.MSVCRT.dll_malloc]
shl eax, cl
dec eax
mov dword [esp + 0x4c], eax
inc eax
mov dword [esp + 0x64], eax
shl eax, 2
push eax
call edi
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
je 0x412eef
mov ebx, dword [esp + 0x68]
mov eax, dword [ebx + 0x18]
shl eax, 3
cdq
idiv esi
inc eax
lea esi, [eax*4]
push esi
call edi
push esi
mov dword [esp + 0x20], eax
call edi
push esi
mov dword [esp + 0x74], eax
call edi
push esi
mov dword [esp + 0x48], eax
call edi
push esi
mov dword [esp + 0x50], eax
call edi
mov esi, dword [esp + 0x2c]
add esp, 0x14
mov edi, eax
test esi, esi
mov dword [esp + 0x54], edi
je 0x412ea1
mov eax, dword [esp + 0x68]
test eax, eax
je 0x412ea1
mov eax, dword [esp + 0x38]
test eax, eax
je 0x412ea1
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x412ea1
test edi, edi
je 0x412ea1
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x10]
push 0xffffffffffffffff
push ecx
push edx
call fcn.00412f00
mov ecx, dword [esp + 0x54]
lea eax, [esp + 0x28]
push eax
push ecx
push ebx
call fcn.00411810
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
mov esi, dword [esp + 0x34]
add esp, 0x18
mov dword [eax], 0xffffffff
mov dword [ecx], 1
mov edx, dword [esp + 0x1c]
add ecx, 4
mov dword [edi], edx
add eax, 4
mov edx, 1
add edi, 4
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], 0
mov dword [esp + 0x64], edx
mov dword [esp + 0x14], 0
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edi
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 0x18]
cmp eax, ecx
mov dword [esp + 0x2c], 1
lea edi, [eax - 1]
jl 0x412b8d
mov dword [esp + 0x48], 0xffffffff
jmp 0x412ba5
mov ecx, dword [ebx + 0x20]
xor edx, edx
mov dword [esp + 0x48], 8
mov dl, byte [ecx + eax]
inc eax
mov dword [esp + 0x1c], edx
mov dword [ebx + 8], eax
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
shl esi, cl
mov ecx, dword [esp + 0x4c]
xor esi, edx
and esi, ecx
test eax, eax
je 0x412bc8
mov eax, dword [esp + 0x10]
mov eax, dword [eax + esi*4]
jmp 0x412bcb
or eax, 0xffffffff
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x48]
dec ecx
cmp edx, ecx
je 0x412be5
mov dword [esp + 0x2c], 0
jmp 0x412d08
cmp eax, 0xffffffff
jne 0x412c0b
mov edx, dword [esp + 0x68]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push edx
push eax
push ecx
push edi
push esi
push ebp
call fcn.00412f20
add esp, 0x18
mov ebp, eax
jmp 0x412d08
lea edx, [esp + 0x50]
push edx
mov edx, dword [esp + 0x6c]
push edx
mov edx, dword [esp + 0x20]
push edx
push edi
push eax
mov eax, dword [esp + 0x74]
push eax
push ecx
push ebx
call fcn.00412f80
add esp, 0x20
cmp eax, 3
jl 0x412c9f
mov ecx, dword [esp + 0x50]
cmp eax, 2
mov dword [esp + 0x14], eax
mov dword [esp + 0x44], ecx
jle 0x412c95
add eax, 0xfffffffe
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 8]
mov edx, dword [ebx + 0x20]
xor ecx, ecx
mov cl, byte [edx + eax]
lea edi, [eax - 1]
mov edx, ecx
mov ecx, dword [esp + 0x40]
shl esi, cl
mov ecx, dword [esp + 0x4c]
inc eax
mov dword [esp + 0x1c], edx
mov dword [ebx + 8], eax
mov eax, dword [esp + 0x18]
xor esi, edx
mov edx, dword [esp + 0x68]
and esi, ecx
mov ecx, dword [esp + 0x10]
push edx
push eax
push ecx
push edi
push esi
push ebp
call fcn.00412f20
mov ebp, eax
mov eax, dword [esp + 0x44]
add esp, 0x18
dec eax
mov dword [esp + 0x2c], eax
jne 0x412c48
mov dword [esp + 0x2c], 0
jmp 0x412d08
cmp word [0x421da0], 0
je 0x412ce4
cmp eax, 2
jne 0x412ce4
mov edx, dword [esp + 0x68]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x10]
push edx
push eax
push ecx
push edi
push esi
push ebp
call fcn.00412f20
mov edx, dword [esp + 0x68]
add esp, 0x18
mov ebp, eax
mov dword [esp + 0x14], 2
mov dword [esp + 0x44], edx
mov dword [esp + 0x2c], 0
jmp 0x412d55
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
push eax
push ecx
push edx
push edi
push esi
push ebp
call fcn.00412f20
add esp, 0x18
mov ebp, eax
mov dword [esp + 0x2c], 1
mov eax, dword [esp + 0x14]
cmp eax, 1
jne 0x412d53
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x28]
mov dword [eax], ecx
mov ecx, dword [esp + 0x24]
add eax, 4
mov dword [ecx], 0xffffffff
mov dword [edx], 1
mov edx, dword [esp + 0x64]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x28]
inc edx
add ecx, 4
add eax, 4
mov dword [esp + 0x64], edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], eax
jmp 0x412db5
jle 0x412db5
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
mov dword [eax], 0xffffffff
mov eax, dword [esp + 0x44]
mov dword [ecx], eax
mov ecx, dword [esp + 0x28]
mov dword [ecx], edx
mov edx, dword [esp + 0x64]
inc edx
add ecx, 4
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0x20]
add edx, 4
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x24]
add edx, 4
cmp eax, ecx
mov dword [esp + 0x24], edx
jle 0x412da5
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x30]
cmp eax, ecx
jle 0x412db5
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x60]
mov dword [esp + 0x14], eax
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x48]
lea eax, [edx - 1]
mov dword [esp + 0x44], edi
cmp ecx, eax
je 0x412b6e
mov edi, dword [esp + 0x54]
mov eax, dword [esp + 0x64]
mov ebx, dword [esp + 0x38]
mov ebp, dword [esp + 0x3c]
mov dword [edi + eax*4], 0xffffffff
mov ecx, 2
mov dword [ebx + eax*4], 0
mov dword [ebp + eax*4], ecx
inc eax
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x34]
test eax, eax
jge 0x412e18
mov dword [esp + 0x34], 0
cmp dword [esp + 0x30], ecx
jge 0x412e22
mov dword [esp + 0x30], ecx
mov eax, dword [esp + 0x68]
mov esi, dword [sym.imp.MSVCRT.dll_free]
push eax
call esi
mov ecx, dword [esp + 0x1c]
push ecx
call esi
mov edx, dword [esp + 0x18]
push edx
call esi
add esp, 0xc
cmp word [0x44967a], 0
je 0x412e6b
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x64]
push eax
mov eax, dword [esp + 0x70]
push ecx
push ebp
push ebx
push edi
push edx
push eax
call fcn.00413340
add esp, 0x1c
jmp 0x412e85
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x64]
mov eax, dword [esp + 0x6c]
push ecx
push ebp
push ebx
push edi
push edx
push eax
call fcn.004130d0
add esp, 0x18
push ebx
mov edi, eax
call esi
push ebp
call esi
mov ecx, dword [esp + 0x5c]
push ecx
call esi
add esp, 0xc
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov edx, dword [esp + 0x10]
mov ebx, dword [sym.imp.MSVCRT.dll_free]
push edx
call ebx
add esp, 4
test esi, esi
je 0x412ebb
push esi
call ebx
add esp, 4
mov eax, dword [esp + 0x68]
test eax, eax
je 0x412ec9
push eax
call ebx
add esp, 4
mov eax, dword [esp + 0x38]
test eax, eax
je 0x412ed7
push eax
call ebx
add esp, 4
mov eax, dword [esp + 0x3c]
test eax, eax
je 0x412ee5
push eax
call ebx
add esp, 4
test edi, edi
je 0x412eef
push edi
call ebx
add esp, 4
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x4c
ret