Function at 0x407020
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 ebp, dword [esi + 4]
mov dword [esp + 0x54], ebp
test eax, eax
je 0x40704e
cmp dword [esi + 0x34], 0
jne 0x40704e
mov dword [ecx + 0x1c], 3
jmp 0x40759e
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], esi
movzx eax, word [esp + 0x74]
movzx edi, ax
movzx eax, word [esp + 0x6c]
movzx esi, word [esp + 0x7c]
mov dword [esp + 0x40], edi
mov ebx, eax
mov dword [esp + 0x44], eax
add edi, eax
mov ebx, esi
mov dword [esp + 0x3c], esi
add edi, esi
mov esi, dword [esp + 0xac]
xor ebx, ebx
add edi, esi
setb bl
add edi, ebp
adc ebx, 0
add edi, 0x2e
adc ebx, 0
cmp edi, 0xffffffff
sbb ebx, 0
jb 0x4070a9
mov dword [ecx + 0x1c], 0xf
jmp 0x40759e
mov dword [esp + 4], ebp
mov dword [esp], ecx
mov dword [esp + 0x38], edx
mov ebp, dword [esp + 0x8c]
mov edi, dword [esp + 0x84]
movzx eax, word [esp + 0x98]
mov dword [esp + 0xe], 0
mov dword [esp + 0x12], 0
mov dword [esp + 0x1a], 0
mov dword [esp + 0x1e], 0
mov dword [esp + 0x22], 0
mov dword [esp + 0x26], 0
mov dword [esp + 0x2a], 0
mov word [esp + 0x2e], 0
mov dword [esp + 0x16], 0
mov dword [esp + 0xa], 0x2014b50
mov edx, dword [esp + 0x90]
movzx ecx, word [esp + 0x74]
add ecx, esi
mov dword [esp + 0x48], ecx
xor ecx, ecx
mov ebx, 0
cmp word [esp + 0x94], 0
je 0x40713f
mov bl, 0x14
mov byte [esp + 0x10], bl
mov byte [esp + 0x12], al
mov byte [esp + 0x13], ah
movzx eax, word [esp + 0x94]
mov byte [esp + 0x14], al
mov byte [esp + 0x15], ah
mov byte [esp + 0x1a], dl
mov byte [esp + 0x1b], dh
mov ebx, edx
shr ebx, 0x10
mov byte [esp + 0x1c], bl
shr edx, 0x18
neg ebp
mov ebx, 0
sbb ebx, ebx
mov byte [esp + 0x1d], dl
or ebx, dword [esp + 0x88]
mov byte [esp + 0x1e], bl
mov byte [esp + 0x1f], bh
mov edx, ebx
shr edx, 0x10
mov byte [esp + 0x20], dl
shr ebx, 0x18
neg edi
mov edx, 0
sbb edx, edx
mov byte [esp + 0x21], bl
or edx, dword [esp + 0x80]
mov byte [esp + 0x22], dl
mov byte [esp + 0x23], dh
mov ebx, edx
shr ebx, 0x10
mov byte [esp + 0x24], bl
shr edx, 0x18
mov byte [esp + 0x25], dl
movzx eax, word [esp + 0x6c]
mov byte [esp + 0x26], al
mov byte [esp + 0x27], ah
mov eax, dword [esp + 0x48]
mov byte [esp + 0x28], al
mov byte [esp + 0x29], ah
movzx edx, word [esp + 0x7c]
mov byte [esp + 0x2a], dl
mov byte [esp + 0x2b], dh
mov eax, dword [esp + 0xa4]
mov byte [esp + 0x30], al
mov byte [esp + 0x31], ah
mov edx, eax
shr edx, 0x10
mov byte [esp + 0x32], dl
shr eax, 0x18
neg dword [esp + 0x4c]
sbb ecx, ecx
mov byte [esp + 0x33], al
or ecx, dword [esp + 0x9c]
mov byte [esp + 0x34], cl
mov byte [esp + 0x35], ch
mov eax, ecx
shr eax, 0x10
mov byte [esp + 0x36], al
shr ecx, 0x18
mov byte [esp + 0x37], cl
mov ebp, dword [esp + 4]
lea edi, [ebp + 0x2e]
mov esi, dword [esp + 0x50]
mov ebx, dword [esi + 8]
cmp ebx, edi
jae 0x407292
cmp ebx, 1
adc ebx, 0
cmp edi, 2
jb 0x40726c
nop
nop
nop
nop
nop
nop
mov eax, ebx
or eax, 2
mov ecx, ebx
and ecx, 2
imul eax, ecx
xor ecx, 2
and ebx, 0xfffffffd
imul ebx, ecx
add ebx, eax
cmp ebx, edi
jb 0x407250
push ebx
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0xc]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407570
mov dword [esi], eax
mov dword [esi + 8], ebx
mov ebp, dword [esp + 4]
jmp 0x407294
mov eax, dword [esi]
mov dword [esi + 4], edi
mov ecx, dword [esi + 0xc]
mov edi, ecx
not edi
and edi, ebp
mov edx, ebp
not edx
and edx, ecx
imul edx, edi
mov edi, ecx
and edi, ebp
imul ebx, ecx, 0x2e
or ecx, ebp
imul ecx, edi
add ecx, eax
add ecx, edx
lea eax, [esp + 0xa]
push ebx
push eax
push ecx
call fcn.00409630
add esp, 0xc
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x44]
lea edi, [ebx + eax]
cmp ebp, edi
jae 0x40732c
cmp ebp, 1
adc ebp, 0
cmp edi, 2
jb 0x40730c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebp
or eax, 2
mov ecx, ebp
and ecx, 2
imul eax, ecx
xor ecx, 2
and ebp, 0xfffffffd
imul ebp, ecx
add ebp, eax
cmp ebp, edi
jb 0x4072f0
push ebp
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0xc]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407570
mov dword [esi], eax
mov dword [esi + 8], ebp
mov eax, dword [esp + 0x38]
mov dword [esi + 4], edi
cmp word [esp + 0x6c], 0
je 0x407372
mov ecx, dword [esi + 0xc]
mov edi, ecx
not edi
and edi, ebx
mov edx, ebx
not edx
and edx, ecx
imul edx, edi
mov edi, ecx
and edi, ebx
or ebx, ecx
imul ebx, edi
add ebx, dword [esi]
add ebx, edx
mov edx, dword [esp + 0x44]
imul edx, ecx
push edx
push eax
push ebx
call fcn.00409630
add esp, 0xc
mov edi, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x40]
lea ebx, [edi + eax]
cmp ebp, ebx
jae 0x4073cc
cmp ebp, 1
adc ebp, 0
cmp ebx, 2
jb 0x4073ac
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebp
or eax, 2
mov ecx, ebp
and ecx, 2
imul eax, ecx
xor ecx, 2
and ebp, 0xfffffffd
imul ebp, ecx
add ebp, eax
cmp ebp, ebx
jb 0x407390
push ebp
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0xc]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407570
mov dword [esi], eax
mov dword [esi + 8], ebp
movzx eax, word [esp + 0x74]
mov dword [esi + 4], ebx
test ax, ax
je 0x407413
mov eax, dword [esi + 0xc]
mov edx, eax
not edx
and edx, edi
mov ecx, edi
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
and edx, edi
or edi, eax
imul edi, edx
add edi, dword [esi]
add edi, ecx
mov ecx, dword [esp + 0x40]
imul ecx, eax
push ecx
push dword [esp + 0x74]
push edi
call fcn.00409630
add esp, 0xc
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0xac]
lea edi, [ebx + eax]
cmp ebp, edi
jae 0x40746c
cmp ebp, 1
adc ebp, 0
cmp edi, 2
jb 0x40744c
nop
nop
nop
nop
mov eax, ebp
or eax, 2
mov ecx, ebp
and ecx, 2
imul eax, ecx
xor ecx, 2
and ebp, 0xfffffffd
imul ebp, ecx
add ebp, eax
cmp ebp, edi
jb 0x407430
push ebp
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0xc]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407570
mov dword [esi], eax
mov dword [esi + 8], ebp
mov dword [esi + 4], edi
mov eax, dword [esp + 0xac]
test eax, eax
je 0x4074b5
mov edi, eax
mov eax, dword [esi + 0xc]
mov edx, eax
not edx
and edx, ebx
mov ecx, ebx
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
and edx, ebx
or ebx, eax
imul ebx, edx
add ebx, dword [esi]
add ebx, ecx
imul edi, eax
push edi
push dword [esp + 0xac]
push ebx
call fcn.00409630
add esp, 0xc
mov edi, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x3c]
lea ebx, [edi + eax]
cmp ebp, ebx
jae 0x4074d8
mov ecx, dword [esp]
mov edx, esi
push 1
push ebx
call fcn.00409550
add esp, 8
test eax, eax
je 0x407570
mov dword [esi + 4], ebx
cmp word [esp + 0x7c], 0
je 0x407517
mov eax, dword [esi + 0xc]
mov edx, eax
not edx
and edx, edi
mov ecx, edi
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
and edx, edi
or edi, eax
imul edi, edx
add edi, dword [esi]
add edi, ecx
mov ecx, dword [esp + 0x3c]
imul ecx, eax
push ecx
push dword [esp + 0x7c]
push edi
call fcn.00409630
add esp, 0xc
mov edi, dword [esi + 0x14]
lea ebx, [edi + 1]
cmp dword [esi + 0x18], ebx
jae 0x407537
lea edx, [esi + 0x10]
mov ecx, dword [esp]
push 1
push ebx
call fcn.00409550
add esp, 8
test eax, eax
je 0x407570
mov dword [esi + 0x14], ebx
mov eax, dword [esi + 0x1c]
mov edx, eax
not edx
and edx, edi
mov ecx, edi
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
and edx, edi
or edi, eax
imul edi, edx
add edi, dword [esi + 0x10]
add edi, ecx
lea ecx, [esp + 0x54]
push eax
push ecx
push edi
call fcn.00409630
add esp, 0xc
mov eax, 1
jmp 0x4075a0
mov ebx, dword [esp + 4]
cmp dword [esi + 8], ebx
mov edi, dword [esp]
jae 0x407594
push ebx
push dword [esi + 0xc]
push dword [esi]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x407597
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