Function at 0x405370
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x2c]
sub esp, 0x154
mov dword [eax], 0
mov eax, dword [esp + 0x174]
test eax, eax
push ebp
mov ebp, dword [esp + 0x164]
push esi
je 0x40563d
mov edx, dword [eax]
cmp edx, 0x20
push ebx
push edi
lea edi, [esp + 0x14]
jge 0x4053d8
mov esi, dword [eax + 4]
mov ecx, edx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x20
sub ecx, edx
lea edi, [esp + edx + 0x14]
mov edx, ecx
shr ecx, 2
mov esi, 0x465588
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4053e4
mov eax, dword [eax + 4]
mov ecx, 8
mov esi, eax
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x14]
push eax
mov ecx, eax
push 0x20
push ecx
call fcn.00404170
mov eax, dword [esp + 0x178]
add esp, 0xc
cmp eax, 3
jne 0x40543f
mov esi, 0x32
lea edx, [esp + 0x14]
push edx
mov eax, edx
push 0x10
push eax
call fcn.00404170
add esp, 0xc
dec esi
jne 0x405407
mov edx, dword [esp + 0x174]
mov esi, dword [edx + 4]
mov ecx, 8
lea edi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x13
mov dword [esp + 0x10], ecx
jmp 0x4054e4
cmp eax, 2
jne 0x40541c
lea ecx, [esp + 0x14]
push ecx
lea esi, [esp + 0x68]
mov ebx, ebp
call fcn.00403fb0
mov ecx, dword [esp + 0x178]
mov edi, dword [ecx + 4]
add esp, 4
xor eax, eax
xor esi, esi
xor edx, edx
jmp 0x405470
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x405483
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x64]
add ecx, edx
and ecx, 0x800000ff
jns 0x40549d
dec ecx
or ecx, 0xffffff00
inc ecx
mov bl, byte [esp + esi + 0x64]
movzx edx, cl
mov cl, byte [esp + edx + 0x64]
mov byte [esp + esi + 0x64], cl
mov byte [esp + edx + 0x64], bl
movzx ecx, cl
movzx ebx, bl
add ecx, ebx
and ecx, 0x800000ff
jns 0x4054c8
dec ecx
or ecx, 0xffffff00
inc ecx
mov bl, byte [edi + eax]
mov cl, byte [esp + ecx + 0x64]
xor cl, bl
mov byte [esp + eax + 0x34], cl
inc eax
cmp eax, 0x20
jl 0x405470
jmp 0x405590
mov ecx, dword [esp + 0x10]
xor eax, eax
test ebp, ebp
jle 0x4054ff
lea ebx, [ebx]
mov dl, byte [esp + eax + 0x14]
xor dl, cl
mov byte [esp + eax + 0x54], dl
inc eax
cmp eax, ebp
jl 0x4054f0
lea eax, [esp + 0x54]
push eax
lea esi, [esp + 0x68]
mov ebx, ebp
call fcn.00403fb0
add esp, 4
xor esi, esi
xor ecx, ecx
xor edx, edx
jmp 0x405520
lea eax, [ecx + 1]
and eax, 0x800000ff
jns 0x405531
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x64]
add eax, edx
and eax, 0x800000ff
jns 0x405549
dec eax
or eax, 0xffffff00
inc eax
mov bl, byte [esp + ecx + 0x64]
movzx edx, al
mov al, byte [esp + edx + 0x64]
mov byte [esp + ecx + 0x64], al
movzx eax, al
movzx edi, bl
add eax, edi
and eax, 0x800000ff
mov byte [esp + edx + 0x64], bl
jns 0x405572
dec eax
or eax, 0xffffff00
inc eax
mov bl, byte [esp + esi + 0x34]
mov al, byte [esp + eax + 0x64]
xor bl, al
mov byte [esp + esi + 0x34], bl
inc esi
cmp esi, 0x20
jl 0x405520
dec dword [esp + 0x10]
jns 0x4054e0
push 8
call fcn.0043a99d
add esp, 4
test eax, eax
pop edi
pop ebx
je 0x4055b2
push 0x20
lea ecx, [esp + 0x30]
push ecx
mov ecx, eax
call fcn.00439a40
mov esi, eax
jmp 0x4055b4
xor esi, esi
mov edx, dword [esp + 0x184]
mov eax, dword [esp + 0x178]
mov ecx, dword [esp + 0x174]
push edx
mov edx, dword [esp + 0x174]
push esi
push eax
mov eax, dword [esp + 0x178]
push ecx
mov ecx, dword [esp + 0x174]
push edx
mov edx, dword [esp + 0x174]
push eax
push ebp
push ecx
push edx
call fcn.00404df0
add esp, 0x24
test eax, eax
je 0x405629
test esi, esi
mov eax, dword [esp + 0x188]
mov dword [eax], 1
je 0x40561b
mov ecx, esi
call fcn.00439ac0
push esi
call fcn.0043a998
add esp, 4
pop esi
mov eax, 1
pop ebp
add esp, 0x154
ret
test esi, esi
je 0x40563d
mov ecx, esi
call fcn.00439ac0
push esi
call fcn.0043a998
add esp, 4
mov ecx, dword [esp + 0x184]
mov edx, dword [esp + 0x180]
mov eax, dword [esp + 0x178]
push ecx
mov ecx, dword [esp + 0x178]
push edx
mov edx, dword [esp + 0x178]
push eax
mov eax, dword [esp + 0x178]
push ecx
mov ecx, dword [esp + 0x174]
push edx
mov edx, dword [esp + 0x174]
push eax
push ebp
push ecx
push edx
call fcn.00404df0
add esp, 0x24
pop esi
pop ebp
add esp, 0x154
ret