Function at 0x405350
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 0x40561d
mov edx, dword [eax]
cmp edx, 0x20
push ebx
push edi
lea edi, [esp + 0x14]
jge 0x4053b8
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, 0x479588
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4053c4
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.00404150
mov eax, dword [esp + 0x178]
add esp, 0xc
cmp eax, 3
jne 0x40541f
mov esi, 0x32
lea edx, [esp + 0x14]
push edx
mov eax, edx
push 0x10
push eax
call fcn.00404150
add esp, 0xc
dec esi
jne 0x4053e7
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 0x4054c4
cmp eax, 2
jne 0x4053fc
lea ecx, [esp + 0x14]
push ecx
lea esi, [esp + 0x68]
mov ebx, ebp
call fcn.00403f90
mov ecx, dword [esp + 0x178]
mov edi, dword [ecx + 4]
add esp, 4
xor eax, eax
xor esi, esi
xor edx, edx
jmp 0x405450
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x405463
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x64]
add ecx, edx
and ecx, 0x800000ff
jns 0x40547d
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 0x4054a8
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 0x405450
jmp 0x405570
mov ecx, dword [esp + 0x10]
xor eax, eax
test ebp, ebp
jle 0x4054df
lea ebx, [ebx]
mov dl, byte [esp + eax + 0x14]
xor dl, cl
mov byte [esp + eax + 0x54], dl
inc eax
cmp eax, ebp
jl 0x4054d0
lea eax, [esp + 0x54]
push eax
lea esi, [esp + 0x68]
mov ebx, ebp
call fcn.00403f90
add esp, 4
xor esi, esi
xor ecx, ecx
xor edx, edx
jmp 0x405500
lea eax, [ecx + 1]
and eax, 0x800000ff
jns 0x405511
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x64]
add eax, edx
and eax, 0x800000ff
jns 0x405529
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 0x405552
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 0x405500
dec dword [esp + 0x10]
jns 0x4054c0
push 8
call fcn.0044a5dd
add esp, 4
test eax, eax
pop edi
pop ebx
je 0x405592
push 0x20
lea ecx, [esp + 0x30]
push ecx
mov ecx, eax
call fcn.00449520
mov esi, eax
jmp 0x405594
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.00404dd0
add esp, 0x24
test eax, eax
je 0x405609
test esi, esi
mov eax, dword [esp + 0x188]
mov dword [eax], 1
je 0x4055fb
mov ecx, esi
call fcn.004495a0
push esi
call fcn.0044a5d8
add esp, 4
pop esi
mov eax, 1
pop ebp
add esp, 0x154
ret
test esi, esi
je 0x40561d
mov ecx, esi
call fcn.004495a0
push esi
call fcn.0044a5d8
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.00404dd0
add esp, 0x24
pop esi
pop ebp
add esp, 0x154
ret