Function at 0x440640
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
test ebx, ebx
je 0x4408e1
mov esi, dword [ebp + 8]
test esi, esi
je 0x440667
cmp dword [esi + 0x200], 0
jne 0x440676
mov eax, 0xffff
add word [ebx + 0x28], ax
jne 0x4408e1
mov edi, dword [ebx + 8]
mov dword [esp + 0x14], edi
test edi, edi
je 0x44079e
mov ecx, dword [edi + 0x14]
mov dword [esp + 0x1c], ecx
test esi, esi
je 0x44069d
cmp dword [esi + 0x200], 0
jne 0x44073d
mov ecx, dword [edi]
mov eax, ecx
test ecx, ecx
jne 0x4406ab
mov dword [esp + 0x10], ecx
jmp 0x4406c1
cmp byte [ecx], 0
je 0x4406b6
inc eax
cmp byte [eax], 0
jne 0x4406b0
sub eax, ecx
and eax, 0x3fffffff
mov dword [esp + 0x10], eax
mov ebx, dword [edi + 0x18]
add ebx, 0x18
cmp dword [ebx], 0
mov dword [esp + 0x18], ebx
je 0x44070d
mov edx, dword [esp + 0x10]
xor eax, eax
cmp edx, eax
jle 0x440703
lea ebx, [ebx]
movzx edi, byte [ecx]
movzx edi, byte [edi + 0x4e3098]
lea ebx, [eax*8]
xor edi, ebx
dec edx
xor eax, edi
inc ecx
test edx, edx
jg 0x4406e0
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
xor edx, edx
div dword [ebx]
mov dword [esp + 0x14], edx
jmp 0x440715
mov dword [esp + 0x14], 0
mov edx, dword [esp + 0x10]
mov eax, dword [edi]
push edx
mov edx, dword [esp + 0x18]
push eax
mov eax, ebx
call fcn.0040c9c0
add esp, 8
test eax, eax
je 0x44073a
mov edx, dword [esp + 0x14]
mov ecx, ebx
call fcn.0040ca60
mov ebx, dword [ebp + 0xc]
test esi, esi
je 0x44074a
cmp dword [esi + 0x200], 0
jne 0x44075e
mov eax, dword [edi + 0x28]
test eax, eax
je 0x44075e
dec dword [eax]
jne 0x44075e
push eax
call fcn.00408fe0
add esp, 4
mov eax, dword [edi + 0x24]
push eax
push esi
call fcn.004372f0
mov eax, dword [edi + 0x10]
add esp, 8
mov ecx, esi
call fcn.00409080
test byte [edi + 0x38], 0x10
je 0x440785
mov eax, dword [edi + 0x20]
mov ecx, esi
call fcn.00409080
mov eax, edi
mov ecx, esi
call fcn.00409080
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x14], edi
test edi, edi
jne 0x440685
push ebx
call fcn.0044ded0
add esp, 4
push ebx
mov edi, esi
call fcn.004405c0
mov eax, dword [ebx]
add esp, 4
mov ecx, esi
call fcn.00409080
mov eax, dword [ebx + 0x14]
mov ecx, esi
call fcn.00409080
mov edi, dword [ebx + 0xc]
test edi, edi
je 0x4407df
push edi
push esi
call fcn.004575a0
add esp, 8
mov eax, edi
mov ecx, esi
call fcn.00409080
mov ecx, dword [ebx + 0x18]
push ecx
push esi
call fcn.00437e90
add esp, 8
test esi, esi
je 0x4407f9
cmp dword [esi + 0x200], 0
jne 0x440805
push 0
mov edi, ebx
call fcn.00466450
add esp, 4
cmp dword [ebx + 0x38], 0
je 0x4408d8
xor edi, edi
cmp dword [ebx + 0x34], edi
jle 0x44082e
cmp edi, 1
je 0x440828
mov edx, dword [ebx + 0x38]
mov eax, dword [edx + edi*4]
mov ecx, esi
call fcn.00409080
inc edi
cmp edi, dword [ebx + 0x34]
jl 0x440816
mov eax, dword [ebx + 0x38]
test eax, eax
je 0x4408d8
test esi, esi
je 0x4408cf
cmp dword [esi + 0x200], 0
je 0x44089b
cmp eax, dword [esi + 0x10c]
jb 0x440879
cmp eax, dword [esi + 0x110]
jae 0x440879
movzx eax, word [esi + 0xf0]
mov ecx, dword [esi + 0x200]
add dword [ecx], eax
mov eax, ebx
mov ecx, esi
call fcn.00409080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
call dword [0x4f8be0]
mov ecx, dword [esi + 0x200]
add dword [ecx], eax
add esp, 4
mov eax, ebx
mov ecx, esi
call fcn.00409080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, dword [esi + 0x10c]
jb 0x4408cf
cmp eax, dword [esi + 0x110]
jae 0x4408cf
mov ecx, dword [esi + 0x108]
mov dword [eax], ecx
dec dword [esi + 0xf4]
mov dword [esi + 0x108], eax
mov eax, ebx
mov ecx, esi
call fcn.00409080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
call fcn.00408fe0
add esp, 4
mov eax, ebx
mov ecx, esi
call fcn.00409080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret