Function at 0x406214
Capabilities:
Encode data using xor

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x60
mov esi, ecx
mov ebp, edx
mov edi, dword [esp + 0x80]
mov eax, dword [esp + 0x98]
mov edx, dword [eax + 0x34]
mov byte [edx + 0x76], 1
mov eax, dword [edi*4 + 0x77eea0]
mov ebx, dword [edx + 0x80]
mov dword [esp + 0x10], ebx
mov ebx, dword [edx + 0x68]
mov ecx, dword [edx + 0x6c]
mov edx, eax
sar edx, 2
shr edx, 0x1d
add edx, eax
sar edx, 3
mov dword [esp + 0x48], edx
mov eax, dword [esp + 0x84]
lea edx, [eax + eax]
add edx, edx
sub edx, eax
lea eax, [eax + edx*8]
add eax, eax
add eax, eax
cdq
idiv edi
mov edi, dword [esp + 0x90]
test edi, edi
jl 0x406689
mov edx, dword [esp + 0x90]
mov edi, dword [esp + 0x84]
lea edi, [edi + edx - 1]
cmp ecx, edi
jle 0x406689
mov edi, dword [esp + 0x8c]
test edi, edi
jl 0x406689
mov edx, dword [esp + 0x8c]
mov edi, dword [esp + 0x80]
lea edi, [edi + edx - 1]
cmp ebx, edi
jle 0x406689
cmp esi, 0xffffffff
jne 0x4062cd
mov esi, ebp
mov edi, ebp
sar edi, 0x10
and edi, 0xff
mov dword [esp + 0x38], edi
mov edi, ebp
sar edi, 8
and edi, 0xff
mov dword [esp + 0x3c], edi
and ebp, 0xff
mov dword [esp + 0x40], ebp
mov ecx, esi
sar ecx, 0x10
movzx ecx, cl
mov edx, esi
sar edx, 8
movzx edx, dl
mov dword [esp + 0x44], edx
and esi, 0xff
cmp dword [esp + 0x94], 0
je 0x4064bd
mov edx, dword [esp + 0x84]
test edx, edx
jle 0x40667d
sub ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x84]
lea ebp, [edx - 1]
mov dword [esp + 0x28], ebp
mov edi, dword [esp + 0x44]
sub edi, dword [esp + 0x3c]
mov dword [esp + 0x44], edi
sub esi, dword [esp + 0x40]
mov ebp, dword [esp + 0x90]
imul ebp, ebx
add ebp, dword [esp + 0x8c]
mov dword [esp + 4], ebp
xor ebp, ebp
mov dword [esp + 0x34], ebp
xor ebp, ebp
mov dword [esp + 0x30], ebp
xor ebp, ebp
mov dword [esp + 0x2c], ebp
xor ebp, ebp
mov dword [esp + 8], ebp
lea ebp, [edx + edx]
add ebp, ebp
sub ebp, edx
lea edx, [edx + ebp*8]
add edx, edx
add edx, edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ebx
mov ebp, dword [esp + 8]
mov esi, dword [esp + 4]
mov eax, dword [esp + 0x34]
cdq
mov ebx, dword [esp + 0x28]
idiv ebx
add eax, dword [esp + 0x38]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x30]
cdq
idiv ebx
add eax, dword [esp + 0x3c]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x2c]
cdq
idiv ebx
add eax, dword [esp + 0x40]
mov dword [esp + 0x54], eax
lea ebx, [esi + esi]
add ebx, ebx
mov eax, ebp
cdq
mov ecx, dword [esp + 0x18]
idiv ecx
imul eax, dword [esp + 0x48]
mov edx, dword [0x5a34fc]
cmp eax, dword [edx*4 + 0x7d4410]
jge 0x406481
add ebx, dword [esp + 0x10]
mov edx, dword [edx*4 + 0x7d43f0]
add edx, eax
mov dword [esp + 0xc], edx
mov eax, dword [esp + 0x80]
test eax, eax
jle 0x406481
xor eax, eax
mov dword [esp + 8], ebp
mov dword [esp + 4], esi
mov esi, edx
mov edi, eax
sar edi, 2
shr edi, 0x1d
add edi, eax
sar edi, 3
movzx ebp, byte [edi + esi]
mov ecx, eax
cdq
xor ecx, edx
sub ecx, edx
and ecx, 7
xor ecx, edx
sub ecx, edx
neg ecx
add ecx, 7
sar ebp, cl
and ebp, 1
neg ebp
inc ebp
je 0x40646a
mov edx, dword [esp + 0x54]
mov byte [ebx], dl
mov edx, dword [esp + 0x58]
mov byte [ebx + 1], dl
mov edx, dword [esp + 0x5c]
mov byte [ebx + 2], dl
mov byte [ebx + 3], 0xff
add ebx, 4
inc eax
mov edx, dword [esp + 0x80]
cmp eax, edx
jl 0x406424
mov ebp, dword [esp + 8]
mov esi, dword [esp + 4]
mov eax, dword [esp + 0x34]
add eax, dword [esp + 0x20]
mov dword [esp + 0x34], eax
mov edx, dword [esp + 0x30]
add edx, dword [esp + 0x44]
mov dword [esp + 0x30], edx
mov ecx, dword [esp + 0x2c]
add ecx, dword [esp + 0x24]
mov dword [esp + 0x2c], ecx
add esi, dword [esp + 0x14]
add ebp, 0x64
mov ebx, dword [esp + 0x1c]
cmp ebp, ebx
jl 0x4063a5
jmp 0x40667d
mov dword [esp + 0x4c], 0xff000000
mov edx, dword [esp + 0x84]
test edx, edx
jle 0x40667d
sub ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x84]
lea ebp, [edx - 1]
mov dword [esp + 0x28], ebp
mov edi, dword [esp + 0x44]
sub edi, dword [esp + 0x3c]
mov dword [esp + 0x44], edi
sub esi, dword [esp + 0x40]
mov ebp, dword [esp + 0x90]
imul ebp, ebx
add ebp, dword [esp + 0x8c]
mov dword [esp + 0x5c], ebp
xor ebp, ebp
mov dword [esp + 0x34], ebp
xor ebp, ebp
mov dword [esp + 0x58], ebp
xor ebp, ebp
mov dword [esp + 0x54], ebp
xor ebp, ebp
mov dword [esp + 0xc], ebp
lea ebp, [edx + edx]
add ebp, ebp
sub ebp, edx
lea edx, [edx + ebp*8]
add edx, edx
add edx, edx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ebx
mov esi, dword [esp + 0xc]
mov ebp, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
mov edi, dword [esp + 0x5c]
mov dword [esp + 0x58], ecx
mov dword [esp + 0x54], ebp
mov eax, dword [esp + 0x34]
cdq
mov ebx, dword [esp + 0x28]
idiv ebx
add eax, dword [esp + 0x38]
movzx eax, al
mov dword [esp + 0x30], eax
mov eax, ecx
cdq
idiv ebx
add eax, dword [esp + 0x3c]
movzx ecx, al
mov eax, ebp
cdq
idiv ebx
add eax, dword [esp + 0x40]
movzx eax, al
mov edx, dword [esp + 0x30]
shl edx, 0x10
shl ecx, 8
add edx, ecx
lea ebp, [edx + eax - 0x1000000]
mov dword [esp + 0x50], ebp
lea ebx, [edi + edi]
add ebx, ebx
mov eax, esi
cdq
mov ecx, dword [esp + 0x18]
idiv ecx
imul eax, dword [esp + 0x48]
mov edx, dword [0x5a34fc]
cmp eax, dword [edx*4 + 0x7d4410]
mov ebp, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
jge 0x406656
add ebx, dword [esp + 0x10]
mov edx, dword [edx*4 + 0x7d43f0]
add edx, eax
mov dword [esp + 8], edx
mov edx, dword [esp + 0x80]
test edx, edx
jle 0x406656
xor eax, eax
mov dword [esp + 0xc], esi
mov dword [esp + 0x54], ebp
mov dword [esp + 0x58], ecx
mov dword [esp + 0x5c], edi
mov esi, dword [esp + 8]
mov edi, dword [esp + 0x80]
mov edx, eax
sar edx, 2
shr edx, 0x1d
add edx, eax
sar edx, 3
movzx ebp, byte [edx + esi]
mov ecx, eax
cdq
xor ecx, edx
sub ecx, edx
and ecx, 7
xor ecx, edx
sub ecx, edx
neg ecx
add ecx, 7
sar ebp, cl
and ebp, 1
add ebp, ebp
add ebp, ebp
neg ebp
mov edx, dword [esp + ebp + 0x50]
mov dword [ebx], edx
add ebx, 4
inc eax
cmp eax, edi
jl 0x406609
mov esi, dword [esp + 0xc]
mov ebp, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
mov edi, dword [esp + 0x5c]
mov edx, dword [esp + 0x34]
add edx, dword [esp + 0x20]
mov dword [esp + 0x34], edx
add ecx, dword [esp + 0x44]
add ebp, dword [esp + 0x24]
add edi, dword [esp + 0x14]
add esi, 0x64
mov ebx, dword [esp + 0x1c]
cmp esi, ebx
jl 0x406555
mov eax, dword [esp + 0x98]
call fcn.00406698
xor eax, eax
add esp, 0x60
pop ebx
pop ebp
pop esi
pop edi
ret