Function at 0x404976
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 8]
mov edx, dword [esp + 4]
push esi
push edi
lea esi, [eax - 0x3d9f]
xor edx, 0x4036
lea edi, [eax - 0x6a]
mov ecx, esi
mov eax, dword [esp + 0x14]
xor ecx, 0x35b7
add eax, 0x1b
mov dword [esp + 0x10], edi
cmp eax, ecx
je 0x404bf7
mov eax, edi
xor eax, 0x492
cmp edx, eax
jge 0x404bf7
xor edx, 0x3ab3
push ebx
push ebp
cmp esi, edx
jg 0x404b9a
mov ecx, dword [0x4ae154]
mov esi, dword [esp + 0x24]
mov eax, dword [ecx + 0xd8]
cmp eax, dword [esi + 0xac]
ja 0x4049ed
mov dword [esi + 0xb4], section..data
jmp 0x4049fc
mov eax, dword [esi + 0xf4]
add eax, dword [esi + 0x20]
add dword [ecx + 0x90], eax
xor ebx, ebx
mov ebp, ebx
mov eax, dword [esi + 0xb4]
mov ecx, dword [eax + ebp]
add ebp, 4
mov eax, dword [esi + 0x20]
inc eax
imul eax, dword [esi + 0x118]
mov dword [esi + 0x118], eax
mov edx, dword [0x529170]
imul edx, ecx
mov ecx, dword [0x4ae154]
mov eax, dword [ecx + 0x118]
sub eax, 0x160c63
imul eax, dword [ecx + 0xc4]
mov dword [ecx + 0xc4], eax
mov ecx, dword [esi + 0x84]
mov eax, dword [esi + 0xb8]
mov byte [ecx + eax], dl
inc dword [esi + 0x84]
mov ecx, dword [0x4ae154]
mov eax, dword [ecx + 0x1c]
sub eax, 0x12
xor dword [0x5291b4], eax
mov eax, dword [ecx + 0x44]
xor eax, dword [0x529204]
xor eax, 0x13ffd7
or dword [esi + 0x5c], eax
mov eax, dword [0x52919c]
xor eax, 0x48
or dword [esi + 0x7c], eax
mov ecx, dword [0x4ae154]
mov eax, dword [0x5291e4]
add eax, 0x194c18
or dword [ecx + 8], eax
mov eax, 0xfff09a7f
sub eax, dword [esi + 0x68]
add dword [esi + 0x124], eax
mov ecx, dword [0x4ae154]
mov eax, dword [esi + 0x110]
xor eax, 0x30
add dword [ecx + 0xd8], eax
cmp ebp, 0x28470
jl 0x404a00
mov dword [esi + 0x100], 0x5290f0
mov eax, dword [0x5291fc]
sub dword [esi + 0x44], eax
mov eax, dword [0x4ae154]
push 0x12
mov eax, dword [eax + 0x98]
add eax, 0x190e11
xor dword [esi + 0x1c], eax
mov eax, dword [0x4ae154]
mov ecx, dword [eax + 0x20]
xor ecx, dword [esi + 0x1c]
pop eax
sub eax, ecx
mov ecx, dword [esi + 0xcc]
add dword [esi + 0xdc], eax
mov eax, dword [0x5291d0]
inc eax
imul eax, dword [esi + 0x124]
mov dword [esi + 0x124], eax
mov eax, dword [esi + 0xa4]
xor dword [ecx + ebx], eax
add ebx, 4
mov eax, dword [esi + 0x1c]
xor eax, dword [esi + 0x7c]
xor eax, 0x18c92d
or dword [esi + 0x90], eax
mov eax, dword [0x52916c]
add eax, 0xffe736c2
imul eax, dword [esi + 0x1c]
mov dword [esi + 0x1c], eax
mov eax, dword [0x5291c0]
add dword [0x529194], eax
cmp ebx, 0x7c98c
jl 0x404ad3
mov eax, dword [esi + 0xcc]
mov dword [esi + 0xb0], eax
mov eax, dword [0x4ae154]
push dword [eax + 0x134]
mov eax, dword [eax + 0x11c]
add eax, dword [esi + 0xb8]
push eax
push dword [esi + 0x100]
call dword [0x5291a0]
mov dword [esi + 0xf0], eax
jmp 0x404bf5
mov ebp, dword [esp + 0x24]
mov eax, dword [ebp + 0x24]
mov ebx, dword [ebp + 0xe8]
neg eax
cmp ebx, eax
jne 0x404bf5
mov eax, dword [esp + 0x20]
or esi, 0x3d50
add eax, 0xffffca0d
add eax, edi
mov edi, eax
mov eax, dword [0x4ae154]
push esi
mov eax, dword [eax + 0x9c]
or eax, 0x3a9d
imul eax, eax, 0x3a61
push eax
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
push edi
call dword [sym.imp.KERNEL32.dll_CreateActCtxA]
mov ecx, dword [ebp + 0x24]
add ebx, 2
neg ecx
cmp ebx, ecx
je 0x404bc0
mov edi, dword [esp + 0x18]
pop ebp
pop ebx
xor edi, 0x653
mov eax, edi
pop edi
pop esi
ret