Function at 0x40d3a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, ecx
mov eax, edx
push esi
push edi
mov dword [ebp - 4], eax
cmp dword [ebx], 0
mov dword [ebp - 0xc], ebx
je 0x40d3f2
mov ecx, dword [ebp + 8]
xor esi, esi
mov edi, ecx
test ecx, ecx
jle 0x40d3e5
mov ebx, eax
movzx eax, byte [ebx]
lea ecx, [esi*8]
dec edi
lea ebx, [ebx + 1]
movzx edx, byte [eax + 0x497d10]
xor edx, ecx
xor esi, edx
test edi, edi
jg 0x40d3c5
mov ebx, dword [ebp - 0xc]
mov eax, esi
xor edx, edx
div dword [ebx]
mov eax, dword [ebp - 4]
mov edi, edx
jmp 0x40d3f4
xor edi, edi
push edi
push dword [ebp + 8]
mov edx, eax
mov ecx, ebx
call fcn.0040d270
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x40d477
mov eax, dword [ebp + 0xc]
mov esi, dword [ecx + 8]
test eax, eax
jne 0x40d465
mov edx, dword [ecx + 4]
mov eax, dword [ecx]
test edx, edx
je 0x40d421
mov dword [edx], eax
jmp 0x40d424
mov dword [ebx + 8], eax
mov edx, dword [ecx]
test edx, edx
je 0x40d430
mov eax, dword [ecx + 4]
mov dword [edx + 4], eax
mov edx, dword [ebx + 0xc]
test edx, edx
je 0x40d446
cmp dword [edx + edi*8 + 4], ecx
jne 0x40d443
mov eax, dword [ecx]
mov dword [edx + edi*8 + 4], eax
dec dword [edx + edi*8]
push ecx
call fcn.00409d50
add esp, 4
add dword [ebx + 4], 0xffffffff
jne 0x40d46e
mov ecx, ebx
call fcn.0040d170
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ecx + 8], eax
mov eax, dword [ebp - 4]
mov dword [ecx + 0xc], eax
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x40d64c
push 0x14
call fcn.00409a50
mov edx, eax
add esp, 4
mov dword [ebp - 8], edx
test edx, edx
je 0x40d46e
mov eax, dword [ebp - 4]
mov dword [edx + 0xc], eax
mov eax, dword [ebp + 8]
mov dword [edx + 0x10], eax
mov dword [edx + 8], esi
inc dword [ebx + 4]
mov ecx, dword [ebx + 4]
cmp ecx, 0xa
jb 0x40d615
mov edx, dword [ebx]
lea eax, [edx + edx]
cmp ecx, eax
jbe 0x40d612
lea esi, [ecx + ecx]
mov ecx, 0x80
lea eax, [esi*8]
cmp eax, 0x400
cmova esi, ecx
cmp esi, edx
je 0x40d612
mov eax, dword [0x4a1ca8]
test eax, eax
je 0x40d4ea
call eax
lea eax, [esi*8]
push eax
call fcn.00409a50
mov ecx, dword [0x4a1cac]
add esp, 4
mov esi, eax
mov dword [ebp - 0x18], esi
test ecx, ecx
je 0x40d50b
call ecx
test esi, esi
je 0x40d612
push dword [ebx + 0xc]
call fcn.00409d50
add esp, 4
mov dword [ebx + 0xc], esi
push esi
call dword [0x49f968]
shr eax, 3
add esp, 4
mov dword [ebp - 0x14], eax
mov dword [ebx], eax
lea ecx, [eax*8]
push ecx
push 0
push esi
call fcn.00476e60
mov esi, dword [ebx + 8]
add esp, 0xc
mov dword [ebx + 8], 0
test esi, esi
je 0x40d601
mov edx, dword [esi + 0x10]
xor edi, edi
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x10], eax
test edx, edx
jle 0x40d590
mov ebx, eax
nop dword [eax]
movzx eax, byte [ebx]
lea ebx, [ebx + 1]
dec edx
movzx ecx, byte [eax + 0x497d10]
lea eax, [edi*8]
xor ecx, eax
xor edi, ecx
test edx, edx
jg 0x40d570
mov ebx, dword [ebp - 0xc]
mov eax, dword [esi]
xor edx, edx
mov dword [ebp - 0x10], eax
mov eax, edi
div dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
lea edx, [eax + edx*8]
test edx, edx
je 0x40d5db
mov eax, dword [edx]
test eax, eax
je 0x40d5b1
mov ecx, dword [edx + 4]
jmp 0x40d5b3
xor ecx, ecx
inc eax
mov dword [edx + 4], esi
mov dword [edx], eax
test ecx, ecx
je 0x40d5db
mov dword [esi], ecx
mov eax, dword [ecx + 4]
mov dword [esi + 4], eax
mov eax, dword [ecx + 4]
test eax, eax
je 0x40d5d3
mov dword [eax], esi
mov dword [ecx + 4], esi
jmp 0x40d5f4
mov dword [ebx + 8], esi
mov dword [ecx + 4], esi
jmp 0x40d5f4
mov eax, dword [ebx + 8]
mov dword [esi], eax
mov eax, dword [ebx + 8]
test eax, eax
je 0x40d5ea
mov dword [eax + 4], esi
mov dword [esi + 4], 0
mov dword [ebx + 8], esi
mov eax, dword [ebp - 0x10]
mov esi, eax
test eax, eax
jne 0x40d558
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 4]
call fcn.0040d1c0
xor edx, edx
div dword [ebx]
mov edi, edx
mov edx, dword [ebp - 8]
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x40d633
push edx
lea edx, [eax + edi*8]
mov ecx, ebx
call fcn.0040d200
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 8]
mov dword [edx], eax
mov eax, dword [ebx + 8]
test eax, eax
je 0x40d642
mov dword [eax + 4], edx
mov dword [edx + 4], 0
mov dword [ebx + 8], edx
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret