Function at 0x412800
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x506bc0
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push esi
push edi
mov eax, dword [0x564690]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [0x565ae0]
mov eax, ecx
imul eax, ecx
imul eax, ecx
cdq
mov ecx, 0x15
idiv ecx
cmp edx, 5
jne 0x412865
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_OpenThread]
mov ecx, dword [0x565ae0]
mov edx, 7
test eax, eax
cmove ecx, edx
mov dword [0x565ae0], ecx
mov eax, dword [0x5641c0]
mov ecx, 0x5641c0
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
mov edi, dword [ebp + 8]
push 0x5191b4
mov ecx, edi
mov dword [ebp - 4], 0
call fcn.0046a670
mov ecx, eax
call fcn.0046b5e0
or ebx, 0xffffffff
test al, al
je 0x41292e
push 0x5191b4
mov ecx, edi
call fcn.0046a670
mov ecx, eax
call fcn.0041c3f0
sub esp, 0x18
mov edx, esp
mov esi, eax
mov dword [edx + 0x14], 0xf
mov dword [edx + 0x10], 0
mov byte [edx], 0
cmp byte [esi], 0
jne 0x4128d4
xor ecx, ecx
jmp 0x4128e9
mov ecx, esi
lea edi, [ecx + 1]
lea esp, [esp]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4128e0
sub ecx, edi
push ecx
push esi
mov ecx, edx
call fcn.00401430
lea eax, [ebp - 0x18]
push eax
call fcn.0048c4c0
add esp, 0x1c
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.004025b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edx + 0xc]
mov ecx, ebx
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x41292b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x14]
mov edi, dword [esi - 0xc]
test edi, edi
jns 0x41293f
push 0x80070057
call fcn.00402ec0
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x41295c
push edi
lea ecx, [ebp - 0x14]
call fcn.004077f0
mov esi, dword [ebp - 0x14]
lea eax, [edi + 1]
push eax
push esi
call fcn.004e7395
add esp, 8
cmp edi, dword [esi - 8]
jg 0x412935
xor eax, eax
mov dword [esi - 0xc], edi
mov word [esi + edi*2], ax
call fcn.00413200
test al, al
jne 0x412a13
mov edx, dword [0x565ae0]
xor edi, edi
lea esp, [esp]
mov ecx, edi
and ecx, 1
dec ecx
not ecx
and ecx, edx
mov eax, edi
sar eax, 1
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, edx
sar ecx, 1
xor eax, ecx
mov ecx, eax
and ecx, 1
dec ecx
sar eax, 1
not ecx
and ecx, edx
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, edx
sar ecx, 1
xor eax, ecx
mov ecx, eax
and ecx, 1
dec ecx
sar eax, 1
not ecx
and ecx, edx
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, edx
sar ecx, 1
xor eax, ecx
mov ecx, eax
and ecx, 1
dec ecx
sar eax, 1
not ecx
and ecx, edx
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, edx
sar ecx, 1
xor eax, ecx
inc edi
add edx, eax
cmp edi, 0x100
jl 0x412990
mov dword [0x565ae0], edx
cmp dword [esi - 0xc], 0
jge 0x412a1e
or eax, 0xffffffff
jmp 0x412a39
push str.file:__
push esi
call fcn.004e5d72
add esp, 8
test eax, eax
jne 0x412a35
or eax, 0xffffffff
jmp 0x412a39
sub eax, esi
sar eax, 1
test eax, eax
sete byte [ebp - 0xd]
add esi, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x412a5d
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret