Function at 0x4058f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x429bf5
push eax
mov dword fs:[0], esp
sub esp, 0x8c
mov ecx, dword [0x43a0f4]
cmp dword [0x43a0f0], ecx
cmovne ecx, dword [0x43a0f0]
mov dword [0x43a0f4], ecx
mov ecx, dword [0x43a0e8]
mov eax, ecx
push esi
mov esi, dword [0x43a0e4]
sub eax, esi
sar eax, 2
push edi
mov edi, dword [ebp + 0xc]
test eax, eax
jne 0x405954
call fcn.00406390
mov ecx, dword [0x43a0e8]
mov esi, dword [0x43a0e4]
sub ecx, esi
sar ecx, 2
test ecx, ecx
je 0x405c1b
cmp edi, ecx
sbb eax, eax
and eax, edi
mov esi, dword [esi + eax*4]
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x24], esi
test esi, esi
je 0x40597a
mov eax, dword [esi]
push esi
call dword [eax + 4]
push 0
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x18], 0
mov eax, dword [esi]
push ecx
push 0
push 0x57
push esi
mov dword [ebp - 4], 0
call dword [eax + 0x20]
test eax, eax
jne 0x405c0e
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov edx, 0x1c
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040bc8e
mov edi, eax
add esp, 4
mov dword [ebp - 0x14], edi
mov ecx, dword [esi]
lea eax, [ebp - 0x18]
push edi
push eax
push 0
push 0x57
push esi
mov byte [ebp - 4], 1
call dword [ecx + 0x20]
test eax, eax
jne 0x405c01
mov eax, dword [ebp - 0x18]
push dword [ebp - 0x28]
lea ecx, [eax*8]
sub ecx, eax
mov eax, 0x92492493
shl ecx, 2
imul ecx
add edi, ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
push eax
push edi
mov edi, dword [ebp - 0x14]
push edi
call fcn.00402dc0
mov eax, dword [ebp - 0x18]
add esp, 0x10
lea ecx, [eax*8]
sub ecx, eax
lea edi, [edi + ecx*4]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x1c], edi
cmp ecx, edi
je 0x405a94
lea edx, [ecx + 0x1c]
mov eax, ecx
cmp edx, edi
je 0x405a94
mov ecx, dword [ecx]
mov dword [ebp - 0x10], ecx
mov ecx, dword [edx]
cmp dword [ebp - 0x10], ecx
jne 0x405a49
mov ecx, dword [eax + 4]
cmp ecx, dword [edx + 4]
je 0x405a57
mov ecx, dword [edx]
mov eax, edx
mov dword [ebp - 0x10], ecx
add edx, 0x1c
cmp edx, edi
jne 0x405a38
jmp 0x405a94
add edx, 0x1c
cmp edx, edi
je 0x405a8e
nop
mov ecx, dword [eax]
cmp ecx, dword [edx]
jne 0x405a6e
mov ecx, dword [eax + 4]
cmp ecx, dword [edx + 4]
je 0x405a87
movups xmm0, xmmword [edx]
add eax, 0x1c
movups xmmword [eax], xmm0
movq xmm0, qword [edx + 0x10]
movq qword [eax + 0x10], xmm0
mov ecx, dword [edx + 0x18]
mov dword [eax + 0x18], ecx
add edx, 0x1c
cmp edx, edi
jne 0x405a60
lea edi, [eax + 0x1c]
mov dword [ebp - 0x1c], edi
push 0x3f2
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_GetDlgItem]
push 0
push 0
push 0x14b
push eax
mov dword [ebp - 0x20], eax
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x10], 0
cmp eax, edi
je 0x405b5e
mov edi, eax
nop dword [eax]
push dword [edi + 4]
lea eax, [ebp - 0x98]
push dword [edi]
push str._d_x__d
push 0x32
push eax
call fcn.0040ab60
add esp, 0x14
test eax, eax
jle 0x405bfe
lea eax, [ebp - 0x98]
push eax
push 0
push 0x143
push dword [ebp - 0x20]
call dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [0x43a0f4]
mov edx, dword [edi + 4]
mov ecx, dword [edi]
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], edx
cmp eax, dword [0x43a0f8]
je 0x405b30
mov dword [eax], ecx
mov dword [eax + 4], edx
add dword [0x43a0f4], 8
jmp 0x405b3f
lea ecx, [ebp - 0x30]
push ecx
push eax
mov ecx, 0x43a0f0
call fcn.00401850
mov ecx, dword [ebp - 0x10]
inc ecx
mov dword [ebp - 0x10], ecx
lea eax, [ecx*8]
sub eax, ecx
mov ecx, dword [ebp - 0x14]
lea edi, [ecx + eax*4]
cmp edi, dword [ebp - 0x1c]
jne 0x405ad0
mov ecx, 0x43a0d0
call fcn.00401410
mov ecx, 0x43a0d0
mov dword [ebp - 0x34], eax
call fcn.004013e0
mov ecx, dword [0x43a0f0]
mov edi, eax
mov eax, dword [0x43a0f4]
xor edx, edx
mov dword [ebp - 0x24], edi
cmp ecx, eax
je 0x405bed
sub eax, ecx
mov dword [ebp - 0x1c], 0x7fffffff
sar eax, 3
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x405bed
xor esi, esi
mov eax, edi
lea ecx, [ecx + 8]
sub eax, dword [ecx - 4]
cdq
mov edi, eax
mov eax, dword [ebp - 0x34]
sub eax, dword [ecx - 8]
xor edi, edx
sub edi, edx
cdq
xor eax, edx
sub eax, edx
lea edx, [edi + eax]
mov edi, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x10]
cmp edx, edi
cmovge eax, esi
mov esi, eax
mov eax, dword [ebp - 0x10]
inc eax
cmp edx, edi
mov dword [ebp - 0x10], eax
cmovge edx, edi
mov edi, dword [ebp - 0x24]
mov dword [ebp - 0x1c], edx
cmp eax, dword [ebp - 0x2c]
jb 0x405ba3
mov dword [ebp - 0x24], esi
mov esi, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
push 0
push edx
push 0x14e
push dword [ebp - 0x20]
call dword [sym.imp.USER32.dll_SendMessageW]
mov edi, dword [ebp - 0x14]
test edi, edi
je 0x405c0e
push edi
call fcn.0040bc97
add esp, 4
mov eax, dword [esi]
push esi
mov dword [ebp - 4], 0xffffffff
call dword [eax + 8]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret