Function at 0x40d380
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
push ebx
mov eax, 0x9e3779b9
push ebp
push esi
push edi
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov ebx, eax
mov edi, eax
mov edx, eax
mov ecx, eax
mov esi, eax
mov dword [esp + 0x1c], 4
jmp 0x40d3b0
mov eax, dword [esp + 0x18]
lea esp, [esp]
mov ebp, ecx
shl ebp, 0xb
xor esi, ebp
add edi, esi
add ecx, edx
mov ebp, edx
ror ebp, 2
xor ecx, ebp
add eax, ecx
add edx, edi
mov ebp, edi
shl ebp, 8
xor edx, ebp
mov ebp, eax
add edi, eax
add ebx, edx
ror ebp, 0x10
xor edi, ebp
add dword [esp + 0x14], edi
add eax, ebx
mov ebp, ebx
shl ebp, 0xa
xor eax, ebp
mov ebp, dword [esp + 0x10]
add ebp, eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ebp
mov ebp, eax
add ebx, eax
ror ebp, 4
xor ebx, ebp
mov ebp, dword [esp + 0x10]
add eax, ebp
shl ebp, 8
xor eax, ebp
mov ebp, dword [esp + 0x10]
add esi, ebx
add ecx, eax
mov dword [esp + 0x14], eax
mov eax, esi
ror eax, 9
add ebp, esi
xor eax, ebp
mov dword [esp + 0x10], eax
add edx, eax
mov eax, dword [esp + 0x1c]
add esi, ecx
dec eax
mov dword [esp + 0x1c], eax
jne 0x40d3a8
mov eax, 0xc
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], eax
jmp 0x40d450
mov ebx, dword [esp + 0x1c]
lea ebx, [ebx]
cmp byte [esp + 0x2c], 0
je 0x40d497
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x38]
add esi, dword [eax + ebx - 0xc]
add ecx, dword [eax + ebx - 8]
add edx, dword [eax + ebx - 4]
add edi, dword [eax + ebx]
mov ebp, dword [eax + ebx + 4]
add dword [esp + 0x18], ebp
mov ebp, dword [eax + ebx + 8]
add dword [esp + 0x1c], ebp
mov ebp, dword [eax + ebx + 0xc]
mov eax, dword [eax + ebx + 0x10]
mov ebx, dword [esp + 0x10]
add dword [esp + 0x14], ebp
add ebx, eax
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x1c]
mov eax, ecx
shl eax, 0xb
xor esi, eax
add edi, esi
add ecx, edx
mov eax, edx
ror eax, 2
xor ecx, eax
mov eax, dword [esp + 0x18]
add eax, ecx
add edx, edi
mov ebp, edi
shl ebp, 8
xor edx, ebp
add ebx, edx
mov ebp, eax
ror ebp, 0x10
add edi, eax
xor edi, ebp
mov ebp, dword [esp + 0x14]
add ebp, edi
add eax, ebx
mov dword [esp + 0x14], ebp
mov ebp, ebx
shl ebp, 0xa
xor eax, ebp
add dword [esp + 0x10], eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x14]
add ebx, eax
mov ebp, eax
ror ebp, 4
xor ebx, ebp
add esi, ebx
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x10]
add eax, ebx
mov ebp, ebx
shl ebp, 8
xor eax, ebp
add ecx, eax
add ebx, esi
mov dword [esp + 0x14], eax
mov eax, esi
ror eax, 9
xor eax, ebx
mov ebx, dword [esp + 0x28]
mov ebp, dword [ebx + 0x3c]
add edx, eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x20]
add esi, ecx
mov dword [eax + ebp - 0xc], esi
mov ebp, dword [ebx + 0x3c]
mov dword [eax + ebp - 8], ecx
mov ebp, dword [ebx + 0x3c]
mov dword [eax + ebp - 4], edx
mov ebp, dword [ebx + 0x3c]
mov dword [eax + ebp], edi
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x18]
mov dword [eax + ebx + 4], ebp
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x1c]
mov dword [eax + ebx + 8], ebp
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x14]
mov dword [eax + ebx + 0xc], ebp
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x10]
mov dword [eax + ebx + 0x10], ebp
add eax, 0x20
cmp eax, 0x40c
mov dword [esp + 0x20], eax
jl 0x40d446
mov al, byte [esp + 0x2c]
test al, al
je 0x40d6ef
mov eax, 0xc
mov dword [esp + 0x20], eax
jmp 0x40d5a0
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
add ecx, dword [ebx + eax - 8]
add edx, dword [ebx + eax - 4]
mov ebp, dword [ebx + eax - 0xc]
add ebp, esi
mov dword [esp + 0x2c], ebx
mov esi, ecx
shl esi, 0xb
xor esi, ebp
mov ebp, dword [ebx + eax]
mov ebx, dword [ebx + eax + 4]
add ebp, esi
add edi, ebp
add ecx, edx
mov ebp, edx
ror ebp, 2
xor ecx, ebp
mov ebp, dword [esp + 0x18]
add ebx, ecx
add ebp, ebx
mov dword [esp + 0x18], ebp
mov ebp, dword [esp + 0x1c]
add edx, edi
mov ebx, edi
shl ebx, 8
xor edx, ebx
mov ebx, dword [esp + 0x2c]
mov ebx, dword [ebx + eax + 8]
add ebx, edx
add ebp, ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x1c], ebp
mov ebp, ebx
add ebx, edi
ror ebp, 0x10
xor ebp, ebx
mov ebx, dword [esp + 0x2c]
mov ebx, dword [ebx + eax + 0xc]
mov edi, ebp
mov ebp, dword [esp + 0x14]
add ebx, edi
add ebp, ebx
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x14], ebp
mov ebp, dword [esp + 0x18]
add ebp, ebx
shl ebx, 0xa
xor ebx, ebp
mov ebp, dword [esp + 0x2c]
mov eax, dword [eax + ebp + 0x10]
mov ebp, dword [esp + 0x1c]
add eax, ebx
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x10]
add ebx, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ebx
add ebp, eax
mov ebx, eax
ror ebx, 4
xor ebx, ebp
add esi, ebx
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x10]
add eax, ebx
mov ebp, ebx
shl ebp, 8
xor eax, ebp
add ecx, eax
mov dword [esp + 0x14], eax
mov eax, esi
add ebx, esi
ror eax, 9
xor eax, ebx
mov ebx, dword [esp + 0x28]
add edx, eax
mov dword [esp + 0x10], eax
add esi, ecx
mov ebp, dword [ebx + 0x3c]
mov eax, dword [esp + 0x20]
mov dword [eax + ebp - 0xc], esi
mov ebp, dword [ebx + 0x3c]
mov dword [eax + ebp - 8], ecx
mov ebp, dword [ebx + 0x3c]
mov dword [eax + ebp - 4], edx
mov ebp, dword [ebx + 0x3c]
mov dword [eax + ebp], edi
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x18]
mov dword [eax + ebx + 4], ebp
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x1c]
mov dword [eax + ebx + 8], ebp
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x14]
mov dword [eax + ebx + 0xc], ebp
mov ebx, dword [esp + 0x28]
mov ebx, dword [ebx + 0x3c]
mov ebp, dword [esp + 0x10]
mov dword [eax + ebx + 0x10], ebp
add eax, 0x20
cmp eax, 0x40c
mov dword [esp + 0x20], eax
jl 0x40d5a0
mov eax, dword [esp + 0x28]
call fcn.0040d2c0
pop edi
pop esi
pop ebp
mov dword [eax + 0x34], 0x100
pop ebx
add esp, 0x14
ret 8