Function at 0x406510
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x58
mov eax, dword [esp + 0xa0]
mov esi, dword [ecx + 0x48]
mov ebx, dword [esi + 4]
mov dword [esp + 0x54], ebx
test eax, eax
je 0x40653e
cmp dword [esi + 0x34], 0
jne 0x40653e
mov dword [ecx + 0x1c], 3
jmp 0x406aa5
mov dword [esp + 0x50], eax
mov dword [esp + 0x4c], edx
movzx edx, word [esp + 0x74]
movzx eax, word [esp + 0x6c]
movzx edx, dx
movzx ebp, word [esp + 0x7c]
mov dword [esp + 0x40], edx
mov edi, eax
mov dword [esp + 0x44], eax
lea edi, [eax + edx]
add edi, ebp
mov eax, dword [esp + 0xac]
xor edx, edx
add edi, eax
setb dl
add edi, ebx
adc edx, 0
add edi, 0x2e
adc edx, 0
cmp edi, 0xffffffff
sbb edx, 0
jb 0x406594
mov dword [ecx + 0x1c], 0xf
jmp 0x406aa5
mov dword [esp + 0x3c], ebp
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], esi
mov edi, dword [esp + 0x8c]
mov edx, eax
mov esi, dword [esp + 0x84]
movzx eax, word [esp + 0x98]
mov dword [esp + 0x12], 0
mov dword [esp + 0x16], 0
mov dword [esp + 0x1e], 0
mov dword [esp + 0x22], 0
mov dword [esp + 0x26], 0
mov dword [esp + 0x2a], 0
mov dword [esp + 0x2e], 0
mov word [esp + 0x32], 0
mov dword [esp + 0xe], 0x2014b50
mov ebx, dword [esp + 0x90]
movzx ecx, word [esp + 0x74]
add ecx, edx
mov dword [esp + 0x48], ecx
xor edx, edx
mov ecx, 0
cmp word [esp + 0x94], 0
je 0x406628
mov cl, 0x14
mov byte [esp + 0x14], cl
mov byte [esp + 0x16], al
mov byte [esp + 0x17], ah
movzx eax, word [esp + 0x94]
mov byte [esp + 0x18], al
mov byte [esp + 0x19], ah
mov dword [esp + 0x1a], 0
mov byte [esp + 0x1e], bl
mov byte [esp + 0x1f], bh
mov ecx, ebx
shr ecx, 0x10
mov byte [esp + 0x20], cl
shr ebx, 0x18
neg edi
mov ecx, 0
sbb ecx, ecx
mov byte [esp + 0x21], bl
or ecx, dword [esp + 0x88]
mov byte [esp + 0x22], cl
mov byte [esp + 0x23], ch
mov ebx, ecx
shr ebx, 0x10
mov byte [esp + 0x24], bl
shr ecx, 0x18
neg esi
mov ebx, 0
sbb ebx, ebx
mov byte [esp + 0x25], cl
or ebx, dword [esp + 0x80]
mov byte [esp + 0x26], bl
mov byte [esp + 0x27], bh
mov ecx, ebx
shr ecx, 0x10
mov byte [esp + 0x28], cl
shr ebx, 0x18
mov byte [esp + 0x29], bl
movzx eax, word [esp + 0x6c]
mov byte [esp + 0x2a], al
mov byte [esp + 0x2b], ah
mov eax, dword [esp + 0x48]
mov byte [esp + 0x2c], al
mov byte [esp + 0x2d], ah
movzx ecx, word [esp + 0x7c]
mov byte [esp + 0x2e], cl
mov byte [esp + 0x2f], ch
mov eax, dword [esp + 0xa4]
mov byte [esp + 0x34], al
mov byte [esp + 0x35], ah
mov ecx, eax
shr ecx, 0x10
mov byte [esp + 0x36], cl
shr eax, 0x18
neg dword [esp + 0x50]
sbb edx, edx
mov byte [esp + 0x37], al
or edx, dword [esp + 0x9c]
mov byte [esp + 0x38], dl
mov byte [esp + 0x39], dh
mov eax, edx
shr eax, 0x10
mov byte [esp + 0x3a], al
shr edx, 0x18
mov byte [esp + 0x3b], dl
mov edi, dword [esp + 8]
lea esi, [edi + 0x2e]
mov ebx, dword [esp]
mov eax, dword [ebx + 8]
cmp eax, esi
jae 0x406786
mov edi, 1
test eax, eax
je 0x406758
mov edi, eax
jmp 0x406758
mov eax, edi
and eax, 2
mov ecx, edi
or edi, 2
imul edi, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add edi, ecx
cmp edi, esi
jb 0x406740
push edi
push dword [ebx + 0xc]
push dword [ebx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
mov ecx, ebx
je 0x406a74
mov dword [ecx], eax
mov dword [ecx + 8], edi
mov ebx, ecx
mov edi, dword [esp + 8]
jmp 0x406788
mov eax, dword [ebx]
mov dword [ebx + 4], esi
mov ecx, dword [ebx + 0xc]
imul edx, ecx, 0x2e
imul ecx, edi
add ecx, eax
lea eax, [esp + 0xe]
push edx
push eax
push ecx
call fcn.004089e0
add esp, 0xc
mov ebp, dword [ebx + 4]
mov eax, dword [ebx + 8]
mov ecx, dword [esp + 0x44]
lea edi, [ecx + ebp]
cmp eax, edi
jae 0x406812
mov esi, 1
test eax, eax
je 0x4067e8
mov esi, eax
jmp 0x4067e8
mov eax, esi
and eax, 2
mov ecx, esi
or esi, 2
imul esi, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add esi, ecx
cmp esi, edi
jb 0x4067d0
push esi
push dword [ebx + 0xc]
push dword [ebx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
mov ecx, ebx
je 0x406a74
mov dword [ecx], eax
mov dword [ecx + 8], esi
mov ebx, ecx
jmp 0x406814
mov esi, eax
mov dword [ebx + 4], edi
cmp word [esp + 0x6c], 0
je 0x406842
mov eax, dword [ebx + 0xc]
imul ebp, eax
add ebp, dword [ebx]
mov ecx, dword [esp + 0x44]
imul ecx, eax
push ecx
push dword [esp + 0x50]
push ebp
call fcn.004089e0
add esp, 0xc
mov edi, dword [ebx + 4]
mov esi, dword [ebx + 8]
mov eax, dword [esp + 0x40]
lea ebp, [edi + eax]
cmp esi, ebp
jae 0x4068a4
mov ebx, 1
test esi, esi
je 0x406878
mov ebx, esi
jmp 0x406878
mov eax, ebx
and eax, 2
mov ecx, ebx
or ebx, 2
imul ebx, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebx, ecx
cmp ebx, ebp
jb 0x406860
push ebx
mov esi, dword [esp + 4]
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, esi
add esp, 0x10
test eax, eax
je 0x406a74
mov dword [ecx], eax
mov dword [ecx + 8], ebx
jmp 0x4068a8
mov ecx, ebx
mov ebx, esi
mov esi, dword [esp + 0xac]
movzx eax, word [esp + 0x74]
mov dword [ecx + 4], ebp
test ax, ax
je 0x4068e1
mov eax, dword [ecx + 0xc]
imul edi, eax
add edi, dword [ecx]
mov ebx, ecx
mov ecx, dword [esp + 0x40]
imul ecx, eax
push ecx
push dword [esp + 0x74]
push edi
call fcn.004089e0
add esp, 0xc
mov ebp, dword [ebx + 4]
mov ebx, dword [ebx + 8]
lea edi, [esi + ebp]
cmp ebx, edi
jae 0x40691e
mov esi, 1
test ebx, ebx
je 0x4068f3
mov esi, ebx
cmp esi, edi
jae 0x406925
mov ebx, dword [esp]
nop
nop
nop
nop
nop
nop
mov eax, esi
and eax, 2
mov ecx, esi
or esi, 2
imul esi, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add esi, ecx
cmp esi, edi
jb 0x406900
jmp 0x406928
mov esi, ebx
mov ebx, dword [esp]
jmp 0x40694c
mov ebx, dword [esp]
push esi
push dword [ebx + 0xc]
push dword [ebx]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
mov ecx, ebx
je 0x406a74
mov dword [ecx], eax
mov dword [ecx + 8], esi
mov ebx, ecx
mov dword [ebx + 4], edi
mov ecx, dword [esp + 0xac]
test ecx, ecx
je 0x40697c
mov eax, dword [ebx + 0xc]
imul ebp, eax
add ebp, dword [ebx]
imul ecx, eax
push ecx
push dword [esp + 0xac]
push ebp
call fcn.004089e0
add esp, 0xc
mov edi, dword [ebx + 4]
mov esi, dword [ebx + 8]
mov ecx, dword [esp + 0x3c]
lea ebx, [edi + ecx]
cmp esi, ebx
jae 0x4069e6
mov ebp, 1
test esi, esi
je 0x4069b8
mov ebp, esi
jmp 0x4069b8
mov eax, ebp
and eax, 2
mov ecx, ebp
or ebp, 2
imul ebp, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebp, ecx
cmp ebp, ebx
jb 0x4069a0
push ebp
mov esi, dword [esp + 4]
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, esi
add esp, 0x10
test eax, eax
je 0x406a74
mov dword [ecx], eax
mov dword [ecx + 8], ebp
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp]
mov dword [eax + 4], ebx
mov ebx, eax
cmp word [esp + 0x7c], 0
je 0x406a0f
mov eax, dword [ebx + 0xc]
imul edi, eax
add edi, dword [ebx]
imul ecx, eax
push ecx
push dword [esp + 0x7c]
push edi
call fcn.004089e0
add esp, 0xc
mov edi, dword [ebx + 0x14]
mov eax, dword [ebx + 0x18]
lea esi, [edi + 1]
cmp eax, esi
jae 0x406aaf
mov ebx, 1
test eax, eax
je 0x406a48
mov ebx, eax
jmp 0x406a48
mov eax, ebx
and eax, 2
mov ecx, ebx
or ebx, 2
imul ebx, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebx, ecx
cmp ebx, esi
jb 0x406a30
push ebx
mov ebp, dword [esp + 4]
push dword [ebp + 0x1c]
push dword [ebp + 0x10]
mov eax, dword [esp + 0x10]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov ecx, ebp
add esp, 0x10
test eax, eax
je 0x406a74
mov dword [ecx + 0x10], eax
mov dword [ecx + 0x18], ebx
mov ebx, ecx
jmp 0x406ab2
mov ebx, dword [esp + 8]
cmp dword [ecx + 8], ebx
mov esi, ecx
mov edi, dword [esp + 4]
jae 0x406a9b
push ebx
push dword [esi + 0xc]
push dword [esi]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x406a9e
mov dword [esi], eax
mov dword [esi + 8], ebx
mov dword [esi + 4], ebx
mov dword [edi + 0x1c], 0x10
xor eax, eax
add esp, 0x58
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebx + 0x10]
mov dword [ebx + 0x14], esi
mov ecx, dword [ebx + 0x1c]
imul edi, ecx
add edi, eax
lea eax, [esp + 0x54]
push ecx
push eax
push edi
call fcn.004089e0
add esp, 0xc
mov eax, 1
jmp 0x406aa7