Function at 0x407120
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x50
mov eax, dword [esp + 0xa8]
mov edi, dword [esp + 0x64]
mov ecx, dword [edi + 0x48]
mov dword [esp], ecx
mov ebx, dword [ecx + 4]
mov dword [esp + 0x4c], ebx
test eax, eax
je 0x407158
mov ecx, dword [esp]
cmp dword [ecx + 0x34], 0
jne 0x407158
mov dword [edi + 0x1c], 3
jmp 0x4077b1
movzx ecx, word [esp + 0x74]
movzx esi, word [esp + 0x6c]
movzx ecx, cx
movzx ebp, word [esp + 0x7c]
mov dword [esp + 0x40], ecx
mov edx, esi
mov dword [esp + 0x44], esi
add ecx, esi
add ecx, ebp
mov esi, dword [esp + 0xb4]
xor edx, edx
add ecx, esi
setb dl
add ecx, ebx
adc edx, 0
add ecx, 0x2e
adc edx, 0
cmp ecx, 0xffffffff
sbb edx, 0
jb 0x4071a5
mov dword [edi + 0x1c], 0xf
jmp 0x4077b1
mov dword [esp + 0x3c], ebp
mov dword [esp + 8], ebx
mov ebp, dword [esp + 0x8c]
mov ecx, dword [esp + 0x84]
mov dword [esp + 0x48], ecx
mov dword [esp + 0x12], 0
mov dword [esp + 0x16], 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 dword [esp + 0x2e], 0
mov word [esp + 0x32], 0
mov dword [esp + 0xe], 0x2014b50
movzx edi, word [esp + 0x94]
mov ecx, dword [esp + 0x90]
movzx edx, word [esp + 0x74]
add edx, esi
mov dword [esp + 4], edx
xor ebx, ebx
mov edx, 0
mov esi, edi
test di, di
je 0x407238
mov dl, 0x14
mov byte [esp + 0x14], dl
movzx edx, word [esp + 0x98]
mov byte [esp + 0x16], dl
mov byte [esp + 0x17], dh
mov edx, esi
mov byte [esp + 0x18], dl
mov byte [esp + 0x19], dh
movzx edx, word [esp + 0x9c]
mov byte [esp + 0x1a], dl
mov byte [esp + 0x1b], dh
movzx edx, word [esp + 0xa0]
mov byte [esp + 0x1c], dl
mov byte [esp + 0x1d], dh
mov byte [esp + 0x1e], cl
mov byte [esp + 0x1f], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x20], dl
shr ecx, 0x18
neg ebp
mov edx, 0
sbb edx, edx
mov byte [esp + 0x21], cl
or edx, dword [esp + 0x88]
mov byte [esp + 0x22], dl
mov byte [esp + 0x23], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x24], cl
shr edx, 0x18
neg dword [esp + 0x48]
mov ecx, 0
sbb ecx, ecx
mov byte [esp + 0x25], dl
or ecx, dword [esp + 0x80]
mov byte [esp + 0x26], cl
mov byte [esp + 0x27], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x28], dl
shr ecx, 0x18
mov byte [esp + 0x29], cl
movzx ecx, word [esp + 0x6c]
mov byte [esp + 0x2a], cl
mov byte [esp + 0x2b], ch
mov ecx, dword [esp + 4]
mov byte [esp + 0x2c], cl
mov byte [esp + 0x2d], ch
movzx ecx, word [esp + 0x7c]
mov byte [esp + 0x2e], cl
mov byte [esp + 0x2f], ch
mov edx, dword [esp + 0xac]
mov byte [esp + 0x34], dl
mov byte [esp + 0x35], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x36], cl
shr edx, 0x18
neg eax
sbb ebx, ebx
mov byte [esp + 0x37], dl
or ebx, dword [esp + 0xa4]
mov byte [esp + 0x38], bl
mov byte [esp + 0x39], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x3a], al
shr ebx, 0x18
mov byte [esp + 0x3b], bl
mov ebp, dword [esp + 8]
lea edi, [ebp + 0x2e]
mov eax, dword [esp]
mov ebx, dword [eax + 8]
cmp ebx, edi
jae 0x4073bd
cmp ebx, 1
adc ebx, 0
cmp edi, 2
jb 0x40738c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebx
and eax, 0xfffffffd
mov ecx, ebx
and ecx, 2
or ebx, 2
imul ebx, ecx
xor ecx, 2
imul ecx, eax
add ebx, ecx
cmp ebx, edi
jb 0x407370
push ebx
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407775
mov ecx, dword [esp]
mov dword [esp + 4], eax
mov dword [ecx], eax
mov dword [ecx + 8], ebx
mov ebp, dword [esp + 8]
jmp 0x4073c6
mov eax, dword [esp]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov eax, dword [esp]
mov dword [eax + 4], edi
mov ecx, dword [eax + 0xc]
mov edx, ecx
or edx, 0x2e
mov edi, ecx
and edi, 0x2e
imul edi, edx
mov ebx, ecx
and ebx, 0xffffffd1
mov edx, ecx
not edx
mov esi, ebp
and esi, edx
and edx, 0x2e
imul edx, ebx
add edx, edi
mov edi, ebp
not edi
and edi, ecx
imul edi, esi
mov esi, eax
mov ebx, ecx
or ebx, ebp
and ecx, ebp
imul ecx, ebx
add ecx, dword [esp + 4]
add ecx, edi
lea eax, [esp + 0xe]
push edx
push eax
push ecx
call fcn.00409a30
add esp, 0xc
mov ebp, dword [esi + 4]
mov edi, dword [esi + 8]
mov eax, dword [esp + 0x44]
lea ebx, [eax + ebp]
cmp edi, ebx
jae 0x407485
cmp edi, 1
adc edi, 0
movzx esi, word [esp + 0x74]
cmp ebx, 2
jb 0x40745c
nop
nop
nop
nop
nop
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, ebx
jb 0x407440
push edi
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407775
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], edi
jmp 0x40748a
movzx esi, word [esp + 0x74]
mov eax, dword [esp]
mov dword [eax + 4], ebx
cmp word [esp + 0x6c], 0
je 0x4074ef
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov edx, eax
mov ebx, dword [esp + 0x44]
or edx, ebx
mov ecx, eax
and ecx, ebx
imul ecx, edx
mov edi, ebx
not edi
and edi, eax
mov edx, eax
not edx
and ebx, edx
imul ebx, edi
add ebx, ecx
and edx, ebp
mov ecx, ebp
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, ebp
and eax, ebp
imul eax, edx
add eax, dword [esi]
add eax, ecx
push ebx
push dword [esp + 0x6c]
push eax
call fcn.00409a30
add esp, 0xc
mov ebx, dword [esi + 4]
mov edi, dword [esi + 8]
movzx esi, word [esp + 0x74]
mov eax, dword [esp + 0x40]
lea ebp, [ebx + eax]
cmp edi, ebp
mov ecx, dword [esp + 0xb4]
jae 0x40755a
cmp edi, 1
adc edi, 0
cmp ebp, 2
jb 0x40752c
nop
nop
nop
nop
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, ebp
jb 0x407510
push edi
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407775
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], edi
mov ecx, dword [esp + 0xb4]
mov eax, dword [esp]
mov dword [eax + 4], ebp
test si, si
je 0x4075be
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov edx, eax
mov ebp, dword [esp + 0x40]
or edx, ebp
mov ecx, eax
and ecx, ebp
imul ecx, edx
mov edi, ebp
not edi
and edi, eax
mov edx, eax
not edx
and ebp, edx
imul ebp, edi
add ebp, ecx
and edx, ebx
mov ecx, ebx
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, ebx
and eax, ebx
imul eax, edx
add eax, dword [esi]
add eax, ecx
push ebp
push dword [esp + 0x74]
push eax
call fcn.00409a30
mov ecx, dword [esp + 0xc0]
add esp, 0xc
mov ebp, dword [esi + 4]
mov edi, dword [esi + 8]
lea ebx, [ecx + ebp]
cmp edi, ebx
jae 0x40761a
cmp edi, 1
adc edi, 0
cmp ebx, 2
jb 0x4075ec
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, ebx
jb 0x4075d0
push edi
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x407775
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], edi
mov ecx, dword [esp + 0xb4]
mov eax, dword [esp]
mov dword [eax + 4], ebx
test ecx, ecx
je 0x407677
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov edx, eax
or edx, ecx
mov ebx, ecx
mov ecx, eax
and ecx, ebx
imul ecx, edx
mov edi, ebx
not edi
and edi, eax
mov edx, eax
not edx
and ebx, edx
imul ebx, edi
add ebx, ecx
and edx, ebp
mov ecx, ebp
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, ebp
and eax, ebp
imul eax, edx
add eax, dword [esi]
add eax, ecx
push ebx
push dword [esp + 0xb4]
push eax
call fcn.00409a30
add esp, 0xc
mov ebx, dword [esi + 4]
mov edi, dword [esi + 8]
mov eax, dword [esp + 0x3c]
lea ebp, [ebx + eax]
cmp edi, ebp
jae 0x40769c
mov ecx, dword [esp + 0x64]
mov edx, dword [esp]
push 1
push ebp
call fcn.00409950
add esp, 8
test eax, eax
je 0x407775
mov eax, dword [esp]
mov dword [eax + 4], ebp
cmp word [esp + 0x7c], 0
je 0x4076f6
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov edx, eax
mov ebp, dword [esp + 0x3c]
or edx, ebp
mov ecx, eax
and ecx, ebp
imul ecx, edx
mov edi, ebp
not edi
and edi, eax
mov edx, eax
not edx
and ebp, edx
imul ebp, edi
add ebp, ecx
and edx, ebx
mov ecx, ebx
not ecx
and ecx, eax
imul ecx, edx
mov edx, eax
or edx, ebx
and eax, ebx
imul eax, edx
add eax, dword [esi]
add eax, ecx
push ebp
push dword [esp + 0x7c]
push eax
call fcn.00409a30
add esp, 0xc
mov eax, dword [esp]
mov edi, dword [eax + 0x14]
lea ebx, [edi + 1]
cmp dword [eax + 0x18], ebx
jae 0x40771d
mov eax, dword [esp]
lea edx, [eax + 0x10]
mov ecx, dword [esp + 0x64]
push 1
push ebx
call fcn.00409950
add esp, 8
test eax, eax
je 0x407775
mov esi, dword [esp]
mov dword [esi + 0x14], ebx
mov eax, dword [esi + 0x1c]
mov ecx, eax
or ecx, 1
mov edx, eax
and edx, 1
neg edx
and edx, ecx
mov ecx, eax
not ecx
mov ebx, edi
and ebx, ecx
and ecx, 1
neg ecx
and ecx, eax
and ecx, 0xfffffffe
add ecx, edx
mov edx, edi
not edx
and edx, eax
imul edx, ebx
mov ebx, eax
or ebx, edi
and eax, edi
imul eax, ebx
add eax, dword [esi + 0x10]
add eax, edx
lea edx, [esp + 0x4c]
push ecx
push edx
push eax
call fcn.00409a30
add esp, 0xc
mov eax, 1
jmp 0x4077b3
mov ebx, dword [esp + 8]
mov eax, dword [esp]
cmp dword [eax + 8], ebx
mov edi, dword [esp + 0x64]
jae 0x4077a4
push ebx
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x4077aa
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], ebx
mov eax, dword [esp]
mov dword [eax + 4], ebx
mov dword [edi + 0x1c], 0x10
xor eax, eax
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret