Function at 0x4077f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.00408180
mov edi, edx
mov ebp, ecx
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.00408240
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x18], edi
je 0x4078bc
test esi, esi
mov ecx, esi
jle 0x407f7a
xor eax, eax
cmp ecx, 1
je 0x407888
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + ebp]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x407870
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x407f7a
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebp
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x407f7a
lea eax, [edi + edi*8]
mov dword [esp + 0x10], eax
mov ebx, eax
shl ebx, 6
test esi, esi
jle 0x40796c
cmp esi, 1
jne 0x407b80
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40790c
lea ecx, [ebx + ebp]
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40790c
mov word [esp + edi*4 + 0xac], cx
mov word [esp + edi*4 + 0xae], ax
inc edi
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.00408240
add esp, 0xc
test edi, edi
sete byte [esp + 7]
je 0x407983
xor eax, eax
nop
nop
movzx ecx, word [esp + eax*4 + 0xac]
movzx edx, cl
inc dword [esp + edx*4 + 0x52c]
shr ecx, 8
mov edx, dword [esp + ecx*4 + 0x92c]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov dword [esp + ecx*4 + 0x92c], edx
inc eax
cmp edi, eax
jne 0x407930
mov eax, dword [esp + 0x92c]
jmp 0x40798c
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.00408240
add esp, 0xc
xor edi, edi
mov byte [esp + 7], 1
xor eax, eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x14], ebp
xor ecx, ecx
mov dword [esp + 0xc], edi
cmp eax, edi
setne cl
inc ecx
mov dword [esp + 0x24], ecx
lea eax, [esp + 0xac]
mov dword [esp], eax
lea eax, [esp + 0x112c]
xor ecx, ecx
xor edx, edx
mov ebx, dword [esp + 0xc]
jmp 0x4079de
mov edx, dword [esp + 0x1c]
mov eax, edx
and eax, 1
xor edx, 1
lea edx, [edx + eax*2]
add ecx, 8
mov eax, ebp
cmp edx, dword [esp + 0x24]
jae 0x407a89
mov esi, dword [esp]
mov dword [esp + 8], esi
mov dword [esp], eax
mov dword [esp + 0x1c], edx
mov eax, edx
shl eax, 0xa
add eax, esp
add eax, 0x52c
mov edx, 3
xor ebp, ebp
nop
mov dword [esp + edx*4 + 0xd20], ebp
add ebp, dword [eax + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], ebp
add ebp, dword [eax + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], ebp
add ebp, dword [eax + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], ebp
add ebp, dword [eax + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x407a00
cmp byte [esp + 7], 0
mov esi, dword [esp]
mov ebp, dword [esp + 8]
jne 0x4079c0
xor eax, eax
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + eax*4]
shr edx, cl
mov ebp, edx
not ebp
or ebp, 0xff
add ebp, edx
mov edx, dword [esp + ebp*4 + 0xd30]
lea edi, [edx + 1]
mov dword [esp + ebp*4 + 0xd30], edi
mov ebp, dword [esp + 8]
mov edi, dword [ebp + eax*4]
mov dword [esi + edx*4], edi
inc eax
cmp ebx, eax
jne 0x407a50
jmp 0x4079c0
cmp dword [esp + 0xc], 0
mov ebx, dword [esp + 0x15c4]
mov edi, dword [esp + 0x10]
je 0x407e50
mov ebp, dword [esp + 0xc]
cmp ebp, 1
jne 0x407ab5
mov eax, dword [esp]
mov word [eax], 1
jmp 0x407d7b
mov esi, dword [esp]
movzx eax, word [esi + 4]
add word [esi], ax
cmp ebp, 3
jl 0x407be5
mov eax, 2
mov ecx, 2
sub ecx, ebp
mov dword [esp + 8], ecx
xor ebx, ebx
mov edx, 1
jmp 0x407b12
movzx esi, word [ecx + eax*4]
inc eax
add word [ecx + edx*4], si
mov ecx, dword [esp + 8]
lea esi, [ecx + edx]
inc esi
inc edx
cmp esi, 1
mov ebp, dword [esp + 0xc]
mov esi, dword [esp]
je 0x407bf4
mov ecx, esi
movzx esi, word [esi + ebx*4]
cmp eax, ebp
jge 0x407b25
movzx ebp, word [ecx + eax*4]
cmp si, bp
jae 0x407b60
mov word [ecx + edx*4], si
mov esi, ebx
mov word [ecx + ebx*4], dx
and ebx, 1
xor esi, 1
lea ebx, [esi + ebx*2]
cmp eax, dword [esp + 0xc]
jge 0x407b6b
cmp ebx, edx
mov ecx, dword [esp]
jge 0x407af0
movzx ebp, word [ecx + ebx*4]
movzx esi, word [ecx + eax*4]
cmp bp, si
jae 0x407af4
jmp 0x407b72
inc eax
mov word [ecx + edx*4], bp
cmp eax, dword [esp + 0xc]
jl 0x407b3e
mov ecx, dword [esp]
movzx ebp, word [ecx + ebx*4]
add word [ecx + edx*4], bp
mov word [ecx + ebx*4], dx
inc ebx
jmp 0x407af9
mov ecx, esi
and ecx, 0x7ffffffe
lea edx, [ebx + ebp]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x407bab
add eax, 2
cmp ecx, eax
je 0x4078dd
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407bc6
mov word [esp + edi*4 + 0xac], si
mov word [esp + edi*4 + 0xae], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x407ba0
mov word [esp + edi*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0xae], si
inc edi
jmp 0x407ba0
lea eax, [ebp - 2]
mov word [esi + ebp*4 - 8], 0
jmp 0x407c81
mov word [esi + ebp*4 - 8], 0
lea edx, [ebp - 3]
mov eax, ebp
and eax, 3
xor eax, 2
mov ecx, edx
je 0x407c2d
mov ecx, edx
nop
nop
nop
nop
mov esi, dword [esp]
movzx esi, word [esi + ecx*4]
mov ebx, dword [esp]
movzx esi, word [ebx + esi*4]
inc esi
mov ebx, dword [esp]
mov word [ebx + ecx*4], si
mov esi, dword [esp]
dec ecx
dec eax
jne 0x407c10
lea eax, [ebp - 2]
cmp edx, 3
jb 0x407c81
inc ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + ecx*4 - 4]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + ecx*4 - 4], dx
movzx edx, word [esi + ecx*4 - 8]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + ecx*4 - 8], dx
movzx edx, word [esi + ecx*4 - 0xc]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + ecx*4 - 0xc], dx
movzx edx, word [esi + ecx*4 - 0x10]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + ecx*4 - 0x10], dx
add ecx, 0xfffffffc
jne 0x407c40
lea ecx, [ebp - 1]
mov esi, 1
xor edx, edx
jmp 0x407ca7
lea esi, [ebx + ebx]
inc edx
test ebx, ebx
mov ebp, dword [esp + 0xc]
mov ebx, dword [esp + 0x15c4]
je 0x407d73
test eax, eax
mov dword [esp + 8], esi
js 0x407ce0
lea ebx, [eax + 1]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp]
movzx edi, word [edi + eax*4]
cmp edx, edi
jne 0x407cf0
inc esi
dec eax
cmp ebx, esi
jne 0x407cc0
mov eax, 0xffffffff
jmp 0x407cf2
xor ebx, ebx
sub esi, ebx
jle 0x407c90
jmp 0x407cfe
mov ebx, esi
mov edi, dword [esp + 0x10]
mov esi, dword [esp + 8]
sub esi, ebx
jle 0x407c90
mov dword [esp + 0x1c], ebx
and esi, 3
je 0x407d29
mov edi, dword [esp]
lea ebx, [edi + ecx*4]
xor ebp, ebp
nop
mov word [ebx], dx
inc ebp
add ebx, 0xfffffffc
cmp esi, ebp
jne 0x407d10
mov edi, dword [esp + 8]
mov esi, edi
sub esi, ebp
sub ecx, ebp
mov ebp, edi
jmp 0x407d2f
mov ebp, dword [esp + 8]
mov esi, ebp
mov ebx, dword [esp + 0x1c]
mov edi, ebx
sub edi, ebp
cmp edi, 0xfffffffc
mov edi, dword [esp + 0x10]
mov ebp, dword [esp]
ja 0x407c90
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp + ecx*4], dx
mov word [ebp + ecx*4 - 4], dx
mov word [ebp + ecx*4 - 8], dx
mov word [ebp + ecx*4 - 0xc], dx
add ecx, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebx
jg 0x407d50
jmp 0x407c90
test ebp, ebp
jle 0x407e50
xor eax, eax
mov edx, dword [esp + 0xc]
mov esi, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi + eax*4]
inc dword [esp + ecx*4 + 0x28]
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, edx
jl 0x407d90
cmp edx, 2
jl 0x407e50
cmp ebx, 0x20
jge 0x407e20
mov eax, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x407ddc
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + ebx*4 + 0x28], eax
dec edx
jne 0x407dd0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x407e18
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + ebx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x407df0
test ebx, ebx
jle 0x4080bd
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x24]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x407e30
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x4080c8
shl edi, 5
mov esi, dword [esp + 0x14]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408240
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408240
add esp, 0xc
test ebx, ebx
mov ebp, dword [esp + 0xc]
mov esi, dword [esp]
jle 0x407f6f
add esi, 0xfffffffe
mov eax, 1
add edi, dword [esp + 0x14]
mov dword [esp], esi
jmp 0x407ebd
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x407f6f
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x407eb0
mov edx, ecx
and edx, 3
je 0x407f20
mov dword [esp + 0xc], ebp
lea ebx, [esi + ebp*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, edi
movzx edi, word [ebx]
mov byte [edi + ebp + 0x8f12], al
mov edi, ebp
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x407ee0
mov ebp, dword [esp + 0xc]
sub ebp, esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp]
cmp ecx, 4
jb 0x407eb0
jmp 0x407f27
mov edx, ecx
cmp ecx, 4
jb 0x407eb0
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi + ebp*4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 8]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 0xc]
add ebp, 0xfffffffc
mov byte [ecx + edi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x407f30
jmp 0x407eb0
mov ecx, dword [esp + 0x15c0]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x530], 0
cmp ebx, 2
jl 0x407fed
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x407f9b
xor eax, eax
mov edx, 2
jmp 0x407fd4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x534], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add edx, 2
cmp ebx, edx
jne 0x407fb0
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x407fed
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
test ecx, ecx
jle 0x4080b2
xor eax, eax
mov edx, dword [esp + 0x18]
lea esi, [edx + edx*8]
mov edx, esi
shl edx, 5
add edx, ebp
shl esi, 6
add esi, ebp
mov dword [esp + 8], esi
jmp 0x40802c
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x4080b2
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408023
mov ecx, dword [esp + ebx*4 + 0x52c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x52c], edi
xor edi, edi
cmp bl, 4
jb 0x40808f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x408060
and ebx, 3
je 0x408010
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x4080a0
jmp 0x408010
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
mov esi, ebx
not esi
and esi, 1
mov ecx, ebx
and ecx, 0xfffffffe
sub ecx, esi
lea esi, [ecx + 1]
jmp 0x4080fa
dec ebp
mov dword [esp + ebx*4 + 0x24], ebp
add dword [esp + ebx*4 + 0x28], 2
dec eax
cmp eax, edx
mov ebx, dword [esp + 0x15c4]
je 0x407e50
dec dword [esp + ebx*4 + 0x28]
test ecx, ecx
jle 0x4080ea
mov ebx, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, dword [esp + ebx*4 + 0x24]
test ebp, ebp
jne 0x4080e0
dec ebx
cmp ebx, 1
jg 0x408110
jmp 0x4080ea