Function at 0x405020
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x4c
mov esi, dword [esp + 0x70]
push 0x4df40
call fcn.00408e10
add esp, 4
mov dword [esi], 0
xor edi, edi
test eax, eax
je 0x4055d6
mov ebp, eax
mov eax, dword [esp + 0x6c]
imul eax, dword [esp + 0x64]
mov dword [esp + 4], 0
mov dword [esp + 0x10], 1
mov dword [esp + 0x18], eax
inc eax
mov edx, eax
imul edx, dword [esp + 0x68]
mov ecx, 0x79
cmp edx, 0x40
jl 0x4050a0
mov ecx, 0xfffffffe
sub ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x68]
and ecx, esi
mov edx, esi
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, esi
or eax, esi
imul eax, ecx
lea ecx, [edx + eax]
add ecx, 0x39
mov dword [esp + 8], ecx
push ecx
call fcn.00408e10
add esp, 4
mov dword [esp + 0xc], eax
test eax, eax
je 0x405485
mov dword [esp + 0x1c], 0x29
xor edi, edi
mov cl, 0x29
mov ebx, 0x29
mov dword [esp], ebp
jmp 0x4050e0
mov esi, edi
mov ebp, dword [esp]
mov edi, esi
dec ebx
mov dword [esp + 0x1c], ebx
mov ecx, ebx
je 0x40515e
lea esi, [edi + 1]
mov ebp, dword [esp + 8]
cmp esi, ebp
jbe 0x405120
cmp dword [esp + 0x10], 0
je 0x4050d0
mov byte [esp + 0x14], cl
jmp 0x405104
cmp esi, ebp
jbe 0x405130
add ebp, ebp
cmp ebp, 0x81
jae 0x405100
mov ebp, 0x80
jmp 0x405100
mov eax, dword [esp + 0xc]
jmp 0x40514e
push ebp
push dword [esp + 0x10]
call fcn.00408e30
add esp, 8
test eax, eax
je 0x4050d0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
movzx ecx, byte [esp + 0x14]
mov byte [eax + edi], cl
mov dword [esp + 4], esi
mov ebx, dword [esp + 0x1c]
jmp 0x4050d2
mov eax, dword [esp + 0x74]
cmp eax, 0xa
jb 0x40516c
mov eax, 0xa
mov eax, dword [eax*4 + 0x43ca58]
mov ecx, eax
or ecx, 0x1000
mov dword [ebp], 0x404f90
lea edx, [esp + 4]
mov dword [ebp + 4], edx
mov dword [ebp + 8], ecx
mov edx, eax
and edx, 0xfff
add edx, 2
imul edx, edx, 0x5556
shr edx, 0x10
inc edx
mov dword [ebp + 0xc], edx
xor ecx, 0xffffbfff
mov edx, eax
or edx, 0x4000
xor ebx, ebx
test ecx, edx
setne bl
mov dword [ebp + 0x14], ebx
mov ecx, eax
shr ecx, 2
and ecx, 0x3ff
shr eax, 1
and eax, 4
xor ecx, 2
add ecx, eax
imul eax, ecx, 0x5556
shr eax, 0x10
inc eax
mov dword [ebp + 0x10], eax
lea eax, [ebp + 0x29272]
push 0x10000
push 0
push eax
call fcn.00408ea0
add esp, 0xc
mov dword [ebp + 0x24], 0
mov dword [ebp + 0x20], 0
mov dword [ebp + 0x1c], 0
lea eax, [ebp + 0x9272]
lea ecx, [ebp + 0x9273]
mov dword [ebp + 0x3c], 0
mov dword [ebp + 0x40], 0
mov dword [ebp + 0x44], 0
mov dword [ebp + 0x48], 0
mov dword [ebp + 0x58], 0
mov dword [ebp + 0x5c], 0
mov dword [ebp + 0x60], 0
mov dword [ebp + 0x64], 0
mov dword [ebp + 0x68], 0
mov dword [ebp + 0x28], ecx
mov dword [ebp + 0x2c], eax
mov byte [ebp + 0x9272], 0
mov dword [ebp + 0x38], 8
lea eax, [ebp + 0x39272]
mov dword [ebp + 0x30], eax
mov dword [ebp + 0x34], eax
mov dword [ebp + 0x6c], 0
mov dword [ebp + 0x54], 0
mov dword [ebp + 0x50], 0
mov dword [ebp + 0x4c], 0
mov dword [ebp + 0x18], 1
lea esi, [ebp + 0x70]
mov eax, ebp
add eax, 0x8192
push 0x280
push 0
push eax
call fcn.00408ea0
add esp, 0xc
push 0x8121
push 0
push esi
call fcn.00408ea0
add esp, 0xc
lea ebx, [esp + 0x20]
cmp dword [esp + 0x68], 0
jle 0x405361
mov eax, dword [esp + 0x18]
not eax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x68]
lea edi, [eax - 1]
xor esi, esi
jmp 0x405333
mov ecx, eax
not ecx
mov ebx, dword [esp + 0x18]
and ecx, ebx
mov edx, eax
and edx, dword [esp + 0x14]
imul edx, ecx
mov ecx, eax
and ecx, ebx
or eax, ebx
imul eax, ecx
add eax, edx
add eax, dword [esp + 0x60]
mov dword [esp + 0x20], ebx
push 0
push 0
push 0
mov ebx, ebp
push ebp
push eax
mov ebp, dword [esp + 0x14]
push ebp
call fcn.00403810
add esp, 0x18
inc esi
add edi, 0xffffffff
jae 0x405361
mov dword [esp + 0x20], 1
push 0
push 0
push 0
mov eax, ebp
mov ebp, ebx
push ebx
lea ecx, [esp + 0x2c]
push ecx
push eax
call fcn.00403810
add esp, 0x18
mov eax, esi
cmp dword [esp + 0x78], 0
je 0x4052f0
mov eax, edi
jmp 0x4052f0
mov dword [esp + 0x20], 0
push 4
push 0
push 0
push ebx
push 0
push ebp
call fcn.00403810
add esp, 0x18
cmp eax, 1
jne 0x405493
mov ebp, dword [esp + 4]
mov ecx, ebx
lea ebx, [ebp - 0x29]
mov eax, dword [esp + 0x70]
mov dword [eax], ebx
push 0x29
push 0x43ca89
push ecx
call fcn.00408e40
add esp, 0xc
mov eax, dword [esp + 0x64]
mov byte [esp + 0x32], ah
mov byte [esp + 0x33], al
mov eax, dword [esp + 0x68]
mov byte [esp + 0x36], ah
mov byte [esp + 0x37], al
mov eax, dword [esp + 0x6c]
movzx eax, byte [eax + 0x43ca84]
mov byte [esp + 0x39], al
mov eax, ebx
shr eax, 0x18
mov byte [esp + 0x41], al
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x42], al
mov byte [esp + 0x43], bh
mov byte [esp + 0x44], bl
mov ecx, 0xffffffff
mov eax, 0xc
nop
nop
movzx esi, byte [esp + eax + 0x20]
mov edx, ecx
shr edx, 4
and ecx, 0xf
mov edi, esi
not edi
or edi, 0xf
lea ebx, [esi + edi]
add edi, esi
inc edi
and edi, ecx
add ecx, ebx
inc ecx
add edi, edi
sub ecx, edi
xor edx, dword [ecx*4 + 0x43ca18]
mov ecx, edx
shr ecx, 4
shr esi, 4
and edx, 0xf
xor edx, esi
xor ecx, dword [edx*4 + 0x43ca18]
inc eax
cmp eax, 0x1d
jne 0x4053f0
not ecx
bswap ecx
mov dword [esp + 0x3d], ecx
mov ebx, dword [esp + 0xc]
push 0x29
lea eax, [esp + 0x24]
push eax
push ebx
call fcn.00408e40
add esp, 0xc
lea eax, [ebp + 0x10]
mov esi, dword [esp + 8]
cmp eax, esi
mov dword [esp + 0x14], eax
jbe 0x4054c9
cmp dword [esp + 0x10], 0
je 0x4055af
mov edi, dword [esp]
jmp 0x405474
cmp eax, esi
jbe 0x4054a5
add esi, esi
cmp esi, 0x81
jae 0x405470
mov esi, 0x80
jmp 0x405470
push ebp
call fcn.00408e20
add esp, 4
jmp 0x4055d6
push ebp
call fcn.00408e20
add esp, 4
push dword [esp + 0xc]
jmp 0x4055cc
push esi
push ebx
call fcn.00408e30
add esp, 8
test eax, eax
je 0x4055b4
mov ebx, eax
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov ebp, dword [esp + 4]
mov eax, dword [esp + 0x14]
mov dword [ebx + ebp + 0xc], 0x826042ae
mov dword [ebx + ebp + 8], 0x444e4549
mov dword [ebx + ebp + 4], 0
mov dword [ebx + ebp], 0
mov dword [esp + 4], eax
mov ebx, dword [esp + 0x70]
mov edx, dword [ebx]
mov ebp, dword [esp + 0xc]
add edx, 4
je 0x405562
mov eax, 0xffffffff
xor esi, esi
mov dword [esp + 0x18], ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, byte [ebp + esi + 0x25]
mov ebx, eax
and eax, 0xf
mov ebp, edi
not ebp
or ebp, 0xf
lea ecx, [edi + ebp]
add ebp, edi
inc ebp
and ebp, eax
add eax, ecx
inc eax
add ebp, ebp
sub eax, ebp
mov ebp, dword [esp + 0x18]
shr ebx, 4
xor ebx, dword [eax*4 + 0x43ca18]
mov eax, ebx
shr edi, 4
and ebx, 0xf
xor ebx, edi
shr eax, 4
xor eax, dword [ebx*4 + 0x43ca18]
inc esi
cmp edx, esi
jne 0x405510
not eax
mov edi, dword [esp]
mov ebx, dword [esp + 0x70]
jmp 0x405567
xor eax, eax
mov edi, dword [esp]
mov ecx, eax
shr ecx, 0x18
mov edx, dword [esp + 0x14]
mov byte [ebp + edx - 0x10], cl
mov ecx, eax
shr ecx, 0x10
mov edx, dword [esp + 4]
mov esi, dword [esp + 0xc]
mov byte [esi + edx - 0xf], cl
mov ecx, dword [esp + 4]
mov edx, dword [esp + 0xc]
mov byte [edx + ecx - 0xe], ah
mov ecx, dword [esp + 4]
mov edx, dword [esp + 0xc]
mov byte [edx + ecx - 0xd], al
add dword [ebx], 0x39
push edi
call fcn.00408e20
add esp, 4
mov edi, dword [esp + 0xc]
jmp 0x4055d6
mov edi, dword [esp]
jmp 0x4055b8
mov ebx, dword [esp + 0xc]
mov eax, dword [esp + 0x70]
mov dword [eax], 0
push edi
call fcn.00408e20
add esp, 4
push ebx
call fcn.00408e20
add esp, 4
xor edi, edi
mov eax, edi
add esp, 0x4c
pop esi
pop edi
pop ebx
pop ebp
ret