Function at 0x405320
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 0x4055ed
mov edx, dword [eax]
cmp edx, 0x20
push ebx
push edi
lea edi, [esp + 0x14]
jge 0x405388
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, 0x46c588
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x405394
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.00404120
mov eax, dword [esp + 0x178]
add esp, 0xc
cmp eax, 3
jne 0x4053ef
mov esi, 0x32
lea edx, [esp + 0x14]
push edx
mov eax, edx
push 0x10
push eax
call fcn.00404120
add esp, 0xc
dec esi
jne 0x4053b7
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 0x405494
cmp eax, 2
jne 0x4053cc
lea ecx, [esp + 0x14]
push ecx
lea esi, [esp + 0x68]
mov ebx, ebp
call fcn.00403f60
mov ecx, dword [esp + 0x178]
mov edi, dword [ecx + 4]
add esp, 4
xor eax, eax
xor esi, esi
xor edx, edx
jmp 0x405420
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x405433
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x64]
add ecx, edx
and ecx, 0x800000ff
jns 0x40544d
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 0x405478
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 0x405420
jmp 0x405540
mov ecx, dword [esp + 0x10]
xor eax, eax
test ebp, ebp
jle 0x4054af
lea ebx, [ebx]
mov dl, byte [esp + eax + 0x14]
xor dl, cl
mov byte [esp + eax + 0x54], dl
inc eax
cmp eax, ebp
jl 0x4054a0
lea eax, [esp + 0x54]
push eax
lea esi, [esp + 0x68]
mov ebx, ebp
call fcn.00403f60
add esp, 4
xor esi, esi
xor ecx, ecx
xor edx, edx
jmp 0x4054d0
lea eax, [ecx + 1]
and eax, 0x800000ff
jns 0x4054e1
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x64]
add eax, edx
and eax, 0x800000ff
jns 0x4054f9
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 0x405522
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 0x4054d0
dec dword [esp + 0x10]
jns 0x405490
push 8
call fcn.0043f7ed
add esp, 4
test eax, eax
pop edi
pop ebx
je 0x405562
push 0x20
lea ecx, [esp + 0x30]
push ecx
mov ecx, eax
call fcn.0043e880
mov esi, eax
jmp 0x405564
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.00404da0
add esp, 0x24
test eax, eax
je 0x4055d9
test esi, esi
mov eax, dword [esp + 0x188]
mov dword [eax], 1
je 0x4055cb
mov ecx, esi
call fcn.0043e900
push esi
call fcn.0043f7e8
add esp, 4
pop esi
mov eax, 1
pop ebp
add esp, 0x154
ret
test esi, esi
je 0x4055ed
mov ecx, esi
call fcn.0043e900
push esi
call fcn.0043f7e8
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.00404da0
add esp, 0x24
pop esi
pop ebp
add esp, 0x154
ret