Function at 0x40f20c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff8
push ebx
push esi
mov esi, eax
push edi
xor eax, eax
mov dword [ebp - 4], ecx
mov dword [esi + 4], eax
mov dword [esi], eax
cmp dword [ebp - 4], 0x8000
mov ebx, edx
jge 0x40f231
mov edx, dword [ebp - 4]
jmp 0x40f236
mov edx, 0x8000
push edx
push ebx
push dword [esi + 8]
call fcn.0041ce90
add esp, 0xc
mov byte [ebp - 5], 0
mov eax, 1
cmp eax, dword [ebp - 4]
jge 0x40f25d
mov cl, byte [ebx + eax]
xor byte [ebp - 5], cl
inc eax
cmp eax, dword [ebp - 4]
jl 0x40f251
mov edx, 8
mov eax, esi
call fcn.0040e45c
mov ecx, dword [ebp + 8]
xor eax, eax
mov dword [ecx + 0x10], eax
mov dl, byte [ebx]
cmp dl, byte [ebp - 5]
jne 0x40f464
mov ecx, dword [ebp - 4]
mov edx, ebx
mov eax, esi
call fcn.0040f888
mov ebx, eax
test ebx, ebx
je 0x40f2cd
mov edx, 1
mov eax, dword [ebp + 8]
call fcn.0040f4b4
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x10]
inc dword [ecx + 0x10]
shl eax, 3
mov edx, dword [ebp + 8]
mov ecx, dword [edx]
lea eax, [eax + eax*4]
add ecx, eax
mov eax, ecx
mov dword [eax], 0x36
mov dword [eax + 0xc], ebx
lea edx, [eax + 0xc]
lea ecx, [eax + 0x1c]
mov dword [eax + 0x14], edx
mov dword [eax + 0x24], ecx
xor eax, eax
mov dword [ebp - 4], eax
mov eax, esi
call fcn.0040e470
mov ebx, eax
mov edx, 1
mov eax, esi
call fcn.0040e45c
test bh, 0x80
je 0x40f459
mov eax, esi
call fcn.0040f61c
mov edi, eax
inc edi
xor ebx, ebx
jmp 0x40f329
mov eax, dword [ebp + 8]
mov edx, 1
add eax, 0x20
call fcn.00405494
mov eax, esi
call fcn.0040e470
shr eax, 8
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
mov byte [ecx + ebx], al
mov edx, 8
mov eax, esi
call fcn.0040e45c
inc ebx
mov ecx, dword [esi]
cmp ecx, dword [ebp - 4]
jge 0x40f459
cmp edi, ebx
jg 0x40f2f9
jmp 0x40f459
mov edx, 1
mov eax, dword [ebp + 8]
call fcn.0040f4b4
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [eax + 0x10]
mov ebx, dword [ecx]
shl edx, 3
mov eax, esi
lea edx, [edx + edx*4]
add ebx, edx
call fcn.0040e470
test ah, 0x80
jne 0x40f37c
shr eax, 0xc
mov dword [ebx], eax
mov edx, 4
mov eax, esi
call fcn.0040e45c
jmp 0x40f390
shr eax, 0xa
sub eax, 0x18
mov dword [ebx], eax
mov edx, 6
mov eax, esi
call fcn.0040e45c
mov edx, dword [ebx]
test byte [edx + 0x426864], 4
je 0x40f3bc
mov eax, esi
call fcn.0040e470
shr eax, 0xf
setne dl
and edx, 1
mov byte [ebx + 4], dl
mov edx, 1
mov eax, esi
call fcn.0040e45c
jmp 0x40f3c0
mov byte [ebx + 4], 0
mov ecx, 3
lea edx, [ebx + 0x1c]
mov dword [ebx + 0x18], ecx
mov dword [ebx + 8], ecx
mov eax, dword [ebx]
movzx edi, byte [eax + 0x426864]
lea eax, [ebx + 0xc]
and edi, 3
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x24], edx
test edi, edi
jle 0x40f453
lea edx, [ebx + 8]
mov cl, byte [ebx + 4]
mov eax, esi
call fcn.0040f510
cmp edi, 2
jne 0x40f408
lea edx, [ebx + 0x18]
mov cl, byte [ebx + 4]
mov eax, esi
call fcn.0040f510
jmp 0x40f453
cmp dword [ebx + 8], 1
jne 0x40f453
mov eax, dword [ebx]
test byte [eax + 0x426864], 0x18
je 0x40f453
mov eax, dword [ebx + 0xc]
cmp eax, 0x100
jl 0x40f42a
sub eax, 0x100
jmp 0x40f450
cmp eax, 0x88
jl 0x40f438
sub eax, 0x108
jmp 0x40f44a
cmp eax, 0x10
jl 0x40f442
sub eax, 8
jmp 0x40f44a
cmp eax, 8
jl 0x40f44a
sub eax, 0x10
mov edx, dword [ebp + 8]
add eax, dword [edx + 0x10]
mov dword [ebx + 0xc], eax
mov ecx, dword [ebp + 8]
inc dword [ecx + 0x10]
mov eax, dword [esi]
cmp eax, dword [ebp - 4]
jl 0x40f33d
mov edx, 1
mov eax, dword [ebp + 8]
call fcn.0040f4b4
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x10]
inc dword [edx + 0x10]
shl eax, 3
mov edx, dword [ebp + 8]
mov ecx, dword [edx]
lea eax, [eax + eax*4]
add ecx, eax
mov eax, ecx
mov dword [eax], 0x16
lea edx, [eax + 0xc]
mov dword [eax + 0x14], edx
lea ecx, [eax + 0x1c]
mov dword [eax + 0x24], ecx
cmp dword [ebp - 4], 0
je 0x40f4ab
mov edx, dword [ebp + 8]
mov eax, esi
call fcn.0040f740
pop edi
pop esi
pop ebx
pop ecx
pop ecx
pop ebp
ret 4