Function at 0x404f20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ebx, edx
push edi
mov edi, ecx
mov dword [ebp - 0xc], ebx
cmp dword [edi + 0x240], 0x200
lea edx, [edi + 0x240]
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x10], edx
mov dword [ebp - 8], esi
mov dword [ebp - 4], ecx
jae 0x404f77
test esi, esi
je 0x404f77
mov eax, dword [edx]
dec esi
mov dword [ebp - 8], esi
mov al, byte [edi + eax]
xor al, byte [ebx]
inc ebx
mov byte [ecx], al
inc ecx
inc dword [edx]
cmp dword [edx], 0x200
mov dword [ebp - 4], ecx
mov dword [ebp - 0xc], ebx
jb 0x404f54
cmp byte [0x425446], 0
je 0x404fe5
mov eax, dword [edi + 0x230]
not eax
cmp eax, 8
jbe 0x404fe5
lea ecx, [ecx]
test esi, esi
je 0x404fe5
push 8
cmp esi, 0x200
jb 0x405118
push ecx
mov edx, ebx
lea ecx, [edi + 0x200]
call fcn.004051f0
add dword [edi + 0x230], 8
add ebx, 0x200
mov eax, dword [edi + 0x230]
sub esi, 0x200
mov ecx, dword [ebp - 4]
not eax
add ecx, 0x200
mov dword [ebp - 0xc], ebx
add esp, 8
mov dword [ebp - 4], ecx
mov dword [ebp - 8], esi
cmp eax, 8
ja 0x404f90
cmp byte [0x425445], 0
je 0x405059
mov eax, dword [edi + 0x230]
not eax
cmp eax, 4
jbe 0x405059
jmp 0x405000
test esi, esi
je 0x4051e8
push 8
cmp esi, 0x100
jb 0x40515f
push ecx
mov edx, ebx
lea ecx, [edi + 0x200]
call fcn.00405dc0
add dword [edi + 0x230], 4
add ebx, 0x100
mov eax, dword [edi + 0x230]
sub esi, 0x100
mov ecx, dword [ebp - 4]
not eax
add ecx, 0x100
mov dword [ebp - 0xc], ebx
add esp, 8
mov dword [ebp - 4], ecx
mov dword [ebp - 8], esi
cmp eax, 4
ja 0x405000
test esi, esi
je 0x4051e8
push 8
lea edx, [edi + 0x200]
lea ecx, [edi + 0x1c0]
call fcn.004048a0
add esp, 4
add dword [edi + 0x230], 1
jne 0x405086
inc dword [edi + 0x234]
cmp esi, 0x40
jbe 0x4051b5
mov ecx, dword [ebp - 4]
lea eax, [ebx + 3]
sub ebx, ecx
mov dword [ebp - 0x18], eax
lea eax, [edi + 0x1c1]
mov dword [ebp - 0x1c], ebx
mov edi, dword [ebp - 0x18]
mov ebx, 0x10
mov esi, dword [ebp - 0x1c]
lea edx, [ecx + 1]
mov dword [ebp - 0x14], eax
mov ecx, eax
movzx eax, byte [ecx - 1]
lea ecx, [ecx + 4]
xor al, byte [edi - 3]
lea edi, [edi + 4]
mov byte [edx - 1], al
lea edx, [edx + 4]
movzx eax, byte [esi + edx - 4]
xor al, byte [ecx - 4]
mov byte [edx - 4], al
movzx eax, byte [ecx - 3]
xor al, byte [edi - 5]
mov byte [edx - 3], al
movzx eax, byte [ecx - 2]
xor al, byte [edi - 4]
mov byte [edx - 2], al
sub ebx, 1
jne 0x4050b6
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
add ebx, 0x40
mov esi, dword [ebp - 8]
add ecx, 0x40
mov edi, dword [ebp - 0x20]
sub esi, 0x40
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], ecx
mov dword [ebp - 8], esi
jne 0x404f77
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
xor edx, edx
lea ecx, [edi + 0x200]
call fcn.004051f0
add dword [edi + 0x230], 8
add esp, 8
test esi, esi
je 0x4051e3
mov edx, dword [ebp - 4]
sub edi, ebx
sub edx, ebx
mov ecx, esi
mov al, byte [edi + ebx]
lea ebx, [ebx + 1]
xor al, byte [ebx - 1]
mov byte [edx + ebx - 1], al
sub ecx, 1
jne 0x405141
mov eax, dword [ebp - 0x10]
mov dword [eax], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [edi + 0x100]
xor edx, edx
mov dword [ebp - 0x20], ecx
push ecx
lea ecx, [edi + 0x200]
call fcn.00405dc0
add dword [edi + 0x230], 4
add esp, 8
xor edi, edi
test esi, esi
je 0x4051a3
mov edx, dword [ebp - 4]
sub ebx, edx
jmp 0x405190
mov eax, dword [ebp - 0x20]
lea ecx, [edi + edx]
mov al, byte [eax + edi]
inc edi
xor al, byte [ebx + ecx]
mov byte [ecx], al
cmp edi, esi
jb 0x405190
mov eax, dword [ebp - 0x10]
add esi, 0x100
mov dword [eax], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov dword [ebp - 0xc], eax
test esi, esi
je 0x4051dd
mov edx, dword [ebp - 4]
sub ebx, edx
lea ecx, [eax + edx]
mov al, byte [edi + eax + 0x1c0]
xor al, byte [ebx + ecx]
mov byte [ecx], al
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0xc], eax
cmp eax, esi
jb 0x4051c3
add esi, 0x1c0
mov eax, dword [ebp - 0x10]
mov dword [eax], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret