Function at 0x40ae50
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
add edx, dword [esi - 0x75]
jne 0x40ae6b
mov esi, dword [ebp + 0x10]
push edi
cmp dword [esi], 0
ja 0x40ae72
mov dword [esi], 0x8b0000
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
into
push ds
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x18]
test ah, 2
je 0x40aee2
mov esi, dword [ecx + 0x3bc085a6]
pop esi
mov eax, dword [ebx]
push 0x14
push eax
adc al, 0x50
xor eax, dword [esi - 0x18]
sar byte [ebx - 0x28d20001], 1
mov dword [ecx], ecx
mov dword [eax + 4], edi
mov dword [eax + 8], edi
mov dword [ebp + 0x15], ecx
in al, 0x57
mov dword [eax + 0x10], edi
push edi
mov dword [ebx + 0xc], ecx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
dec edx
push ebx
or al, 0x89
inc edx
adc byte [ebx + 0x488b0c43], cl
adc byte [ebp - 0x57da8a37], al
xor eax, 0x402698
call esi
jae 0x40ae87
jne 0x40aed2
pop edi
pop esi
jg 0x40ae58
in eax, 0x5d
ret 0xc
call esi
jo 0x40aeec
add eax, 0xafc80
pop ebx
mov edx, dword [esi + 0x5d]
ret 0x7f
mov eax, dword [ebx + 0x30]
or edi, 0xffffffff
cmp edi, dword [ebx - 0x35a7ba75]
sbb ecx, dword [edx + 0x888304b]
mov edx, dword [esi]
inc eax
dec edx
loopne 0x40af0b
pop eax
retf 0x8a1b
mov dword [ebx + 0x30], edi
mov ecx, dword [esi]
mov dword [ebp + 0xc], eax
xor byte [ebx + 0xc45890e], cl
test ecx, ecx
jne 0x40af17
invalid
add byte [edi + 0x5e], bl
xor eax, eax
pop ebx
push 0xffffffffffffffc9
pop ebp
ret 0x14
outsb dx, byte [esi]
dec ebx
sub al, 0x84
leave
je 0x40b03f
mov eax, dword [0x3e8b58d2]
push edx
mov dword [ebp + 7], eax
sbb al, 0x7d
clc
call 0xd740a2a3
pop esi
lodsd eax, dword [esi]
dec eax
add dword [ebp - 8], esi
push ebx
pop ebx
xchg ecx, eax
add ebp, esp
in al, dx
add cl, al
leave
aaa
inc ebp
or byte [ebx], bh
sal dword [ebp + edx - 0x75], 0x43
jl 0x40af9c
je 0x40af3d
invalid
ja 0x40aefc
insd dword es:[edi], dx
add byte [eax], al
add byte [ebx + 0x43ed3c48], cl
inc ebx
inc esp
cmp ebx, dword [ebp + 0x438b3702]
push ecx
push ecx
adc byte [eax], bh
lea esp, [ebp - 0x2e]
push edx
push eax
or eax, 0xeae853
add byte [eax], al
mov ecx, dword [ebp - 0xc]
xor edx, edx
adc al, ah
adc byte [0x89289ca], bl
les edx, [eax]
sbb eax, 0x89289ca
je 0x40af74
mov esi, dword [ebx + 0x50]
mov eax, dword [ebx + 0x54]
test eax, 0x444b89f1
adc eax, edx
mov dword [ebx + 0x50], esi
mov dword [ebx + 0x54], eax
mov dword [ebx + 0x3c], edx
mov edx, dword [ebx + 0x3c]
mov eax, dword [ebx + 0x44]
sub eax, edx
cmp edi, eax
ja 0x40afc9
and edi, eax
mov esi, dword [ebx + 0x38]
jge 0x40afcb
cmp byte [esi], ch
jge 0x40afcb
mov ecx, eax
add esp, dword [esi]
mov edx, ecx
jne 0x40af7e
add dh, bl
movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp - 4]
and ecx, 3
mov bl, 0xd0
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebx - 0x53]
cmc
dec ebp
clc
and al, 0xf0
sub ecx, eax
mov ecx, dword [ecx]
or byte [ecx + 0x758b3c34], cl
adc byte [eax], ah
push ebp
cld
test eax, eax
mov dword [ebp + 0x1d], ecx
je 0x40af87
push 0xebffffff
pop esi
jg 0x40b089
adc dword [ecx], eax
add byte [edi + 0x2843c707], dl
add dword [eax], eax
add byte [eax], al
mov eax, dword [ebp - 4]
mov edx, dword [esi - 0x763ed4f4]
push es
je 0x40b02a
mov dword [ebp + 8], 0xcc000000
mov ebx, ecx
cwde
push eax
call sub.KERNEL32.dll_GetLastError
mov eax, dword [ebp + 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
jne 0x40b04a
cmp al, 0x8b
push ss
mov edx, dword [esi]
lea ecx, [ebp + 0xc]
push ecx
push edx
push eax
push ebx
ret 0x33
add byte [eax], al
add byte [ebx + 0x7e3d10c4], al
adc dword [edx + 0x2c458900], esp
cwde
pop es
mov dword [ebx + 0x16], 1
mov edi, dword [ebx]
or al, 0x5f
mov dword [esi], eax
mov eax, dword [ebp + 8]
sbb eax, 0x901e8b5b
ret 0xc
jge 0x40b036
mov eax, dword [esi + 0x15]
mov ecx, dword [esi + 0x14]
adc al, 0xb
rol edi, 0x45
adc byte [edi], dl
add byte [eax], al
mov eax, dword [esi + 0xc]
test eax, eax
je 0x40b137
mov ah, byte [eax + ecx]
test cl, cl
jne 0x40b137
mov ecx, dword [esi + 0x50]
ljmp 0x8b50
mov eax, dword [esi + 0xc]
mov edx, dword [ebp - 0x56]
push ebx
lea ecx, [ebp + 0x10]
adc byte [eax - 0x80], dl
inc esi
add al, 0x51