Function at 0x10040540
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10064028
mov eax, dword fs:[0]
push eax
sub esp, 0x78
push ebx
push esi
push edi
mov eax, dword [0x10077604]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov ebx, dword [ebp + 8]
mov eax, dword [esi]
mov dword [0x10078540], eax
test ebx, ebx
jne 0x1004058e
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 0xc]
cmp eax, 1
jne 0x100405a9
cmp ebx, dword [esi + 4]
jne 0x100407c0
call fcn.1003f7d0
jmp 0x100407c0
and eax, 0xf0000
cmp eax, 0x10000
je 0x100407ab
cmp eax, 0x40000
je 0x100405dc
cmp eax, 0x80000
jne 0x100407c0
push 0
push dword [esi]
call fcn.10012b40
add esp, 8
jmp 0x100407c0
push 0
push dword [esi]
call fcn.10012b40
mov eax, dword [esi + 0x28]
add esp, 8
sub eax, dword [esi + 0x24]
xor edi, edi
sar eax, 3
test eax, eax
je 0x10040624
mov eax, dword [esi + 0x24]
mov eax, dword [eax + edi*8 + 4]
test eax, eax
je 0x10040616
mov eax, dword [eax]
test eax, eax
je 0x10040616
push pe_nt_image_headers32
push eax
call fcn.10012b70
add esp, 8
mov eax, dword [esi + 0x28]
inc edi
sub eax, dword [esi + 0x24]
sar eax, 3
cmp edi, eax
jb 0x100405f7
mov eax, dword [esi + 0x24]
mov ecx, dword [esi + 0x28]
cmp eax, ecx
je 0x100407c0
mov edi, dword [eax + 4]
mov edx, dword [eax]
mov dword [ebp - 0x18], edx
test edi, edi
je 0x10040642
cmp dword [edi], ebx
je 0x1004064e
add eax, 8
cmp eax, ecx
jne 0x10040632
jmp 0x100407c0
mov eax, dword [edi + 0x50]
test eax, eax
je 0x100407c0
cmp dword [edi + 0x54], 0
je 0x100407c0
push dword [eax]
call fcn.10007f40
mov ebx, eax
add esp, 4
mov dword [ebp + 8], ebx
test ebx, ebx
je 0x100407c0
push edi
mov ecx, esi
call fcn.1003f8b0
cmp dword [esi + 0x18], eax
jne 0x100407c0
mov eax, dword [edi + 0x54]
push 0x4000
mov eax, dword [eax]
add eax, dword [ebx]
mov dword [esi + 0x14], eax
push dword [edi]
call fcn.10012b70
push 0xffffffffffffffff
call fcn.1001d470
mov byte [ebp - 0x18], 0x17
mov al, 0x52
xor al, byte [ebp - 0x18]
mov ah, 0x76
mov byte [ebp - 0x17], al
add esp, 0xc
mov al, byte [ebp - 0x18]
mov cl, 0x6f
xor ah, al
mov byte [ebp - 0xf], 0
mov dl, 0x74
mov byte [ebp - 0x13], ah
mov ch, 0x79
mov byte [ebp - 0xf], 0
mov dh, 0x70
xor cl, al
xor ch, al
mov byte [ebp - 0x16], cl
mov bl, 0x7f
mov byte [ebp - 0x12], ch
mov bh, 0x72
lea ecx, [ebp - 0x30]
xor dl, al
xor bl, al
xor dh, al
mov byte [ebp - 0x15], dl
xor bh, al
mov byte [ebp - 0x14], bl
lea eax, [ebp - 0x17]
mov byte [ebp - 0x11], dh
push eax
mov byte [ebp - 0x10], bh
call fcn.100017e0
push 0x64
push 4
lea eax, [ebp - 0x30]
mov dword [ebp - 4], 0
push eax
push dword [edi + 0x54]
lea eax, [ebp - 0x60]
push dword [ebp + 8]
push eax
call fcn.10009920
add esp, 0xc
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 4], 1
jb 0x1004072c
mov eax, dword [eax]
movaps xmm0, xmmword [0x10069f30]
xor ecx, ecx
movups xmmword [ebp - 0x84], xmm0
push eax
movaps xmm0, xmmword [0x10069f20]
movups xmmword [ebp - 0x74], xmm0
mov byte [ebp - 0x64], 0
nop dword [eax]
mov al, byte [ebp - 0x84]
xor byte [ebp + ecx - 0x83], al
inc ecx
cmp ecx, 0x1f
jb 0x10040750
sub esp, 0x18
mov byte [ebp - 0x64], 0
lea eax, [ebp - 0x83]
mov ecx, esp
push eax
call fcn.100017e0
lea eax, [ebp - 0x48]
push eax
call fcn.100322e0
add esp, 0x20
push eax
mov byte [ebp - 4], 2
call fcn.1001d4a0
add esp, 0x10
lea ecx, [ebp - 0x48]
call fcn.10001840
lea ecx, [ebp - 0x60]
call fcn.10001840
lea ecx, [ebp - 0x30]
call fcn.10001840
jmp 0x100407c0
push ebx
call fcn.1003f820
test eax, eax
je 0x100407c0
push eax
mov ecx, esi
call fcn.1003f8b0
mov dword [esi + 0x18], eax
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8