Function at 0x4051f0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc4
push ebx
push esi
mov esi, dword [esp + 0xd0]
push edi
test esi, esi
jne 0x405210
pop edi
pop esi
xor al, al
pop ebx
add esp, 0xc4
ret
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
jg 0x40522c
pop edi
pop esi
xor al, al
pop ebx
add esp, 0xc4
ret
lea eax, [esp + 0x14]
push eax
call fcn.00404d00
lea edx, [esp + 0x54]
add esp, 4
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x405241
lea ecx, [esp + 0x50]
push 0x424204
push ecx
call fcn.00407651
add esp, 8
test eax, eax
jne 0x40526d
pop edi
pop esi
xor al, al
pop ebx
add esp, 0xc4
ret
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0x64
je 0x40528a
pop edi
pop esi
xor al, al
pop ebx
add esp, 0xc4
ret
xor esi, esi
mov dl, byte [esp + esi*2 + 0x50]
mov al, byte [esp + esi*2 + 0x51]
lea ecx, [esp + 0x10]
mov byte [esp + 0xc], dl
push ecx
lea edx, [esp + 0x10]
push 0x424200
push edx
mov byte [esp + 0x19], al
mov byte [esp + 0x1a], 0
call fcn.00407b15
mov al, byte [esp + 0x1c]
add esp, 0xc
mov byte [esp + esi + 0x1c], al
inc esi
cmp esi, 0x32
jl 0x40528c
lea ecx, [esp + 0x1c]
push ecx
call fcn.00405130
add esp, 4
xor ecx, ecx
mov eax, ecx
mov esi, 6
cdq
idiv esi
mov bl, byte [esp + ecx + 0x1c]
mov dl, byte [esp + edx + 0x14]
add dl, cl
xor bl, dl
mov byte [esp + ecx + 0x1c], bl
inc ecx
cmp ecx, 0x32
jl 0x4052d5
xor esi, esi
xor eax, eax
xor ecx, ecx
mov cl, byte [esp + eax + 0x1c]
imul ecx, eax
add esi, ecx
inc eax
cmp eax, 0x32
jl 0x4052f9
push 0x424204
push 0
call fcn.00407651
add esp, 8
test eax, eax
jne 0x405329
pop edi
pop esi
xor al, al
pop ebx
add esp, 0xc4
ret
push eax
call fcn.00407646
add esp, 4
cmp esi, eax
je 0x405342
pop edi
pop esi
xor al, al
pop ebx
add esp, 0xc4
ret
lea edx, [esp + 0x1c]
push ebp
push edx
call fcn.00405070
mov ebp, dword [esp + 0xe0]
mov eax, dword [esp + 0x24]
add esp, 4
and eax, 0xff
mov esi, dword [ebp + 4]
or ebx, 0xffffffff
test esi, esi
mov dword [esp + 0x10], eax
je 0x4053bf
mov al, byte [esi - 1]
test al, al
je 0x4053bf
cmp al, 0xff
je 0x4053bf
push 1
mov ecx, ebp
call fcn.004016c0
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x18], ecx
push ecx
mov ecx, ebp
call fcn.00404270
test al, al
je 0x4053bf
mov eax, dword [esp + 0x14]
mov edi, dword [ebp + 4]
mov ecx, eax
push eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, ebp
call fcn.00404250
mov eax, dword [ebp + 8]
cmp eax, 0xffffffff
jae 0x4053cd
mov ebx, eax
test ebx, ebx
jbe 0x4053fd
mov ecx, dword [ebp + 4]
sub eax, ebx
push eax
lea eax, [ecx + ebx]
push eax
push ecx
call fcn.004077e0
mov esi, dword [ebp + 8]
add esp, 0xc
sub esi, ebx
mov ecx, ebp
push 0
push esi
call fcn.00404270
test al, al
je 0x4053fd
mov ecx, dword [ebp + 4]
mov dword [ebp + 8], esi
mov byte [esi + ecx], 0
mov eax, dword [esp + 0x10]
xor edi, edi
test eax, eax
jle 0x40549a
mov ecx, dword [ebp + 8]
mov bl, byte [esp + edi + 0x21]
or edx, 0xffffffff
sub edx, ecx
cmp edx, 1
ja 0x405421
call fcn.00411316
mov esi, dword [ebp + 8]
inc esi
cmp esi, 0xfffffffd
jbe 0x40542f
call fcn.00411316
mov eax, dword [ebp + 4]
test eax, eax
je 0x405455
mov cl, byte [eax - 1]
test cl, cl
je 0x405455
cmp cl, 0xff
je 0x405455
test esi, esi
jne 0x40546c
dec cl
push esi
mov byte [eax - 1], cl
mov ecx, ebp
call fcn.004016c0
jmp 0x40548d
test esi, esi
jne 0x405467
test eax, eax
je 0x40548d
push esi
mov ecx, ebp
call fcn.00404250
jmp 0x40548d
cmp dword [ebp + 0xc], esi
jae 0x405474
mov ecx, ebp
push esi
call fcn.00401a40
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 4]
movsx eax, bl
add ecx, edx
mov ah, al
mov byte [ecx], al
mov eax, dword [ebp + 4]
mov dword [ebp + 8], esi
mov byte [esi + eax], 0
mov eax, dword [esp + 0x10]
inc edi
cmp edi, eax
jl 0x40540b
pop ebp
pop edi
pop esi
mov al, 1
pop ebx
add esp, 0xc4
ret