Function at 0x407790
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b8
call fcn.004081e0
mov edi, edx
mov dword [esp + 0xc], ecx
mov ebx, dword [esp + 0x15d0]
mov esi, dword [esp + 0x15cc]
lea eax, [esp + 0x34]
push 0x84
push 0
push eax
call fcn.00408490
add esp, 0xc
cmp dword [esp + 0x15d4], 0
mov dword [esp + 0x14], edi
je 0x40785e
test esi, esi
mov ecx, esi
jle 0x407ffb
xor eax, eax
cmp ecx, 1
je 0x407828
mov ecx, dword [esp + 0x15cc]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0xc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x34]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x34]
add eax, 2
cmp ecx, eax
jne 0x407810
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x407ffb
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15cc]
inc dword [esp + eax*4 + 0x34]
jmp 0x407ffb
lea eax, [edi + edi*8]
mov dword [esp + 0x28], eax
shl eax, 6
mov dword [esp + 0x10], eax
test esi, esi
jle 0x40795b
cmp esi, 1
jne 0x407bce
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x4078b7
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4078b7
mov word [esp + edi*4 + 0x4b8], cx
mov word [esp + edi*4 + 0x4ba], ax
inc edi
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408490
add esp, 0xc
test edi, edi
sete byte [esp + 3]
je 0x407972
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x40792f
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
movzx edx, word [esp + eax*4 + 0x4bc]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
add eax, 2
cmp ecx, eax
jne 0x4078f0
mov ecx, edi
test cl, 1
je 0x407952
movzx eax, word [esp + eax*4 + 0x4b8]
movzx ecx, al
inc dword [esp + ecx*4 + 0x938]
shr eax, 8
inc dword [esp + eax*4 + 0xd38]
mov eax, dword [esp + 0xd38]
jmp 0x40797b
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408490
add esp, 0xc
xor edi, edi
mov byte [esp + 3], 1
xor eax, eax
xor ecx, ecx
cmp eax, edi
setne cl
inc ecx
mov dword [esp + 0x30], ecx
lea eax, [edi - 1]
mov dword [esp + 0x18], eax
mov dword [esp + 4], edi
mov edx, edi
and edx, 0xfffffffe
lea ebp, [esp + 0x4b8]
lea eax, [esp + 0x1138]
xor ecx, ecx
lea esi, [esp + 0x938]
xor edi, edi
mov dword [esp + 0x20], edx
jmp 0x4079d8
inc edi
add ecx, 8
add esi, 0x400
mov eax, dword [esp + 8]
cmp edi, dword [esp + 0x30]
je 0x407afd
mov dword [esp + 0x24], edi
mov dword [esp + 8], ebp
mov ebp, eax
mov eax, 3
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [esi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [esi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [esi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb8], edx
add edx, dword [esi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x4079f0
cmp byte [esp + 3], 0
mov edi, dword [esp + 0x24]
jne 0x4079c0
cmp dword [esp + 0x18], 0
je 0x407aa0
xor eax, eax
mov edi, dword [esp + 8]
nop
nop
nop
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov edi, ebp
mov ebp, dword [esp + edx*4 + 0xb8]
lea ebx, [ebp + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov edx, dword [esp + 8]
mov edx, dword [edx + eax*4]
mov dword [edi + ebp*4], edx
mov edx, dword [esp + 8]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb8]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb8], ebp
mov ebp, edi
mov edi, dword [esp + 8]
mov edx, dword [edi + eax*4 + 4]
mov dword [ebp + ebx*4], edx
mov edx, dword [esp + 0x20]
add eax, 2
cmp edx, eax
jne 0x407a40
jmp 0x407aa2
xor eax, eax
test byte [esp + 4], 1
mov ebx, dword [esp + 0x15d0]
mov edi, dword [esp + 0x24]
je 0x4079c0
mov edx, dword [esp + 8]
movzx edx, word [edx + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb8]
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], ebp
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb8], ebp
mov ebp, dword [esp + 0x1c]
mov ebx, dword [esp + 8]
mov eax, dword [ebx + eax*4]
mov ebx, dword [esp + 0x2c]
mov dword [ebp + ebx*4], eax
mov ebx, dword [esp + 0x15d0]
jmp 0x4079c0
cmp dword [esp + 4], 0
je 0x407f12
mov ecx, dword [esp + 4]
cmp ecx, 1
jne 0x407b1c
mov word [ebp], 1
jmp 0x407df5
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp ecx, 3
mov ebx, ecx
jl 0x407c35
mov eax, 2
mov ecx, 2
sub ecx, ebx
xor edx, edx
mov esi, 1
jmp 0x407b6d
movzx edi, word [ebp + eax*4]
inc eax
add word [ebp + esi*4], di
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
mov ebx, dword [esp + 4]
je 0x407c4f
movzx edi, word [ebp + edx*4]
cmp eax, ebx
jge 0x407b80
movzx ebx, word [ebp + eax*4]
cmp di, bx
jae 0x407bb0
mov word [ebp + esi*4], di
mov word [ebp + edx*4], si
inc edx
cmp eax, dword [esp + 4]
jge 0x407bbc
cmp edx, esi
jge 0x407b50
movzx ebx, word [ebp + edx*4]
movzx edi, word [ebp + eax*4]
cmp bx, di
jae 0x407b55
jmp 0x407bc1
mov word [ebp + esi*4], bx
inc eax
cmp eax, dword [esp + 4]
jl 0x407b91
movzx ebx, word [ebp + edx*4]
add word [ebp + esi*4], bx
mov word [ebp + edx*4], si
inc edx
jmp 0x407b5b
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x407bfb
add eax, 2
cmp ecx, eax
je 0x407881
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407c16
mov word [esp + edi*4 + 0x4b8], si
mov word [esp + edi*4 + 0x4ba], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x407bf0
mov word [esp + edi*4 + 0x4b8], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4ba], si
inc edi
jmp 0x407bf0
mov eax, ebx
xor eax, 2
mov ecx, ebx
and ecx, 0xfffffffd
add ecx, ecx
sub ecx, eax
mov word [ebp + ecx*4], 0
jmp 0x407ce5
mov eax, ebx
xor eax, 2
mov ecx, ebx
and ecx, 0xfffffffd
add ecx, ecx
sub ecx, eax
mov word [ebp + ecx*4], 0
lea edx, [ebx - 3]
mov esi, ebx
and esi, 3
xor esi, 2
mov eax, edx
je 0x407c94
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + eax*4]
movzx edi, word [ebp + edi*4]
inc edi
mov word [ebp + eax*4], di
dec eax
dec esi
jne 0x407c80
cmp edx, 3
jb 0x407ce5
inc eax
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + eax*4 - 4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 4], dx
movzx edx, word [ebp + eax*4 - 8]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 8], dx
movzx edx, word [ebp + eax*4 - 0xc]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 0xc], dx
movzx edx, word [ebp + eax*4 - 0x10]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x407ca0
mov edi, 1
xor edx, edx
mov eax, dword [esp + 0x18]
mov dword [esp + 0x1c], ebp
jmp 0x407d2d
mov edi, esi
and edi, 2
mov ebx, esi
or esi, 2
imul esi, edi
xor edi, 2
and ebx, 0xfffffffd
imul ebx, edi
add esi, ebx
mov edi, edx
and edi, 1
xor edx, 1
lea edx, [edx + edi*2]
mov edi, esi
test esi, esi
jle 0x407de3
test ecx, ecx
mov dword [esp + 8], edi
js 0x407d60
lea esi, [ecx + 1]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + ecx*4]
cmp edx, edi
jne 0x407d70
inc ebx
dec ecx
cmp esi, ebx
jne 0x407d40
mov ecx, 0xffffffff
jmp 0x407d72
xor esi, esi
jmp 0x407d76
mov esi, ebx
mov edi, dword [esp + 8]
mov ebx, edi
sub ebx, esi
jle 0x407d00
and ebx, 3
je 0x407daa
lea ebp, [ebp + eax*4]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], dx
inc edi
add ebp, 0xfffffffc
cmp ebx, edi
jne 0x407d90
mov ebx, dword [esp + 8]
sub ebx, edi
sub eax, edi
mov ebp, dword [esp + 0x1c]
jmp 0x407dac
mov ebx, edi
mov edi, esi
sub edi, dword [esp + 8]
cmp edi, 0xfffffffc
ja 0x407d00
nop
nop
nop
nop
nop
mov word [ebp + eax*4], dx
mov word [ebp + eax*4 - 4], dx
mov word [ebp + eax*4 - 8], dx
mov word [ebp + eax*4 - 0xc], dx
add eax, 0xfffffffc
add ebx, 0xfffffffc
cmp ebx, esi
jg 0x407dc0
jmp 0x407d00
cmp dword [esp + 4], 0
mov ebx, dword [esp + 0x15d0]
jle 0x407f12
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x18], 3
jb 0x407e3b
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x34]
add ecx, 4
cmp edx, ecx
jne 0x407e10
test eax, eax
je 0x407e5d
lea ecx, [ecx*4]
add ecx, ebp
xor edx, edx
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x34]
inc edx
cmp eax, edx
jne 0x407e50
cmp dword [esp + 4], 2
jl 0x407f12
lea eax, [ebx + 1]
cmp eax, 0x21
jge 0x407ecc
mov ecx, dword [esp + ebx*4 + 0x34]
mov edx, ebx
neg edx
and edx, 3
je 0x407e8c
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + ebx*4 + 0x34], ecx
inc eax
dec edx
jne 0x407e80
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x407ec8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + ebx*4 + 0x34], ecx
add ecx, dword [esp + eax*4 + 0x38]
mov dword [esp + ebx*4 + 0x34], ecx
add ecx, dword [esp + eax*4 + 0x3c]
mov dword [esp + ebx*4 + 0x34], ecx
add ecx, dword [esp + eax*4 + 0x40]
mov dword [esp + ebx*4 + 0x34], ecx
add eax, 4
cmp eax, 0x21
jne 0x407ea0
test ebx, ebx
jle 0x407f02
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x30]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x407ee0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408147
jmp 0x407f12
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x408147
mov edi, dword [esp + 0x28]
shl edi, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408490
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, esi
add eax, 0x8852
mov esi, edi
push 0x240
push 0
push eax
call fcn.00408490
add esp, 0xc
test ebx, ebx
jle 0x407ff4
mov eax, 1
add esi, dword [esp + 0xc]
jmp 0x407f81
mov edi, dword [esp + 4]
mov dword [esp + 4], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x407ff4
mov edx, dword [esp + eax*4 + 0x34]
test edx, edx
jle 0x407f70
test dl, 1
jne 0x407fa0
mov ecx, edx
jmp 0x407fbc
mov edi, dword [esp + 4]
movzx ecx, word [ebp + edi*4 - 2]
dec edi
mov dword [esp + 4], edi
mov byte [ecx + esi + 0x8f12], al
mov ecx, edx
not ecx
lea ecx, [ecx + edx*2]
cmp edx, 1
mov edi, dword [esp + 4]
je 0x407f74
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + edi*4 - 2]
mov byte [edx + esi + 0x8f12], al
movzx edx, word [ebp + edi*4 - 6]
add edi, 0xfffffffe
mov byte [edx + esi + 0x8f12], al
add ecx, 0xfffffffe
test ecx, ecx
jg 0x407fd0
jmp 0x407f74
mov ecx, dword [esp + 0x15cc]
mov dword [esp + 0x93c], 0
cmp ebx, 2
jl 0x40806d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40801c
xor eax, eax
mov edx, 2
jmp 0x408054
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add eax, dword [esp + edx*4 + 0x3c]
add eax, eax
mov dword [esp + edx*4 + 0x944], eax
add edx, 2
cmp ebx, edx
jne 0x408030
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15cc]
je 0x40806d
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
test ecx, ecx
jle 0x40813c
xor eax, eax
mov edx, dword [esp + 0x14]
lea esi, [edx + edx*8]
mov edi, esi
shl edi, 5
mov edx, dword [esp + 0xc]
add edi, edx
mov dword [esp + 8], edi
shl esi, 6
add esi, edx
mov dword [esp + 0x20], esi
jmp 0x4080bc
mov ecx, dword [esp + 0x20]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15cc]
inc eax
cmp eax, ecx
je 0x40813c
mov edx, dword [esp + 8]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x4080b3
mov edx, dword [esp + ebx*4 + 0x938]
lea ecx, [edx + 1]
mov dword [esp + ebx*4 + 0x938], ecx
xor edi, edi
cmp ebx, 1
je 0x408120
mov ebp, ebx
and ebp, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
mov edi, edx
xor edi, 0x7ffffffe
mov esi, edx
or esi, 1
and esi, edi
mov edi, edx
shr edi, 1
shl ecx, 2
add esi, esi
or esi, ecx
mov ecx, edi
xor ecx, 0xfffffffe
or edi, 1
and edi, ecx
or edi, esi
shr edx, 2
mov ecx, edi
add ebp, 0xfffffffe
jne 0x4080f0
test bl, 1
je 0x4080a0
add edi, edi
mov ecx, edx
xor ecx, 0xfffffffe
or edx, 1
and edx, ecx
or edi, edx
jmp 0x4080a0
add esp, 0x15b8
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x34]
mov ecx, ebx
nop
nop
nop
cmp ecx, 2
jl 0x408176
mov esi, dword [esp + ecx*4 + 0x30]
dec ecx
test esi, esi
je 0x408150
dec esi
mov dword [esp + ecx*4 + 0x34], esi
mov esi, dword [esp + ecx*4 + 0x38]
mov edi, esi
and edi, 2
xor esi, 2
lea esi, [esi + edi*2]
mov dword [esp + ecx*4 + 0x38], esi
dec eax
cmp eax, edx
jne 0x408147
jmp 0x407f12