diff --git a/apply_patch.py b/apply_patch.py
new file mode 100644
index 0000000..9897c06
--- /dev/null
+++ b/apply_patch.py
@@ -0,0 +1,52 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+pattern = re.compile(r"<\?php foreach \(\dcurrentNode\['ui_hints'\]\['form_schema'\].*?endforeach;\s*\?>", re.DOTALL)
+
+replacement_text = r"""
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+def replacer(match):
+ return replacement_text
+
+matches = pattern.search(content)
+if matches:
+ content = pattern.sub(replacer, content, count=1)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully!")
+else:
+ print("Pattern not found!")
diff --git a/do_patch.py b/do_patch.py
new file mode 100644
index 0000000..8403272
--- /dev/null
+++ b/do_patch.py
@@ -0,0 +1,63 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+old_block = """
+
+
+
+
+
+
+
+
+
+
+ """
+
+new_block = """
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+if old_block in content:
+ content = content.replace(old_block, new_block)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully")
+else:
+ print("Old block not found!")
\ No newline at end of file
diff --git a/do_patch_base64.py b/do_patch_base64.py
new file mode 100644
index 0000000..0e5974c
--- /dev/null
+++ b/do_patch_base64.py
@@ -0,0 +1,53 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+pattern = re.compile(r"<\?php foreach \(\dcurrentNode\['ui_hints'\]\['form_schema'\] as \$field\): \?>(.*?)<\?php endforeach; \?>", re.DOTALL)
+
+# use a function for replacement so it doesnt parse backslashes
+replacement_text = r"""
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+def replacer(match):
+ return replacement_text
+
+matches = pattern.search(content)
+if matches:
+ content = pattern.sub(replacer, content, count=1)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully!")
+else:
+ print("Pattern not found!")
diff --git a/do_patch_final.py b/do_patch_final.py
new file mode 100644
index 0000000..3e2691e
--- /dev/null
+++ b/do_patch_final.py
@@ -0,0 +1,48 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+pattern = re.compile(r"<\?php foreach \(\dcurrentNode\['ui_hints'\]\['form_schema'\] as \$field\): \?>(.*?)<\?php endforeach; \?>", re.DOTALL)
+
+replacement = r"""
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+if pattern.search(content):
+ content = pattern.sub(lambda m: replacement, content, count=1)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully!")
+else:
+ print("Pattern not found!")
diff --git a/patch_modal.php b/patch_modal.php
new file mode 100644
index 0000000..fda4215
--- /dev/null
+++ b/patch_modal.php
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+HTML;
+
+$new = <<
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+HTML;
+
+$new_content = str_replace($old, $new, $content);
+if ($new_content !== $content) {
+ file_put_contents($file, $new_content);
+ echo "Patched successfully!\n";
+} else {
+ echo "Old block not found!\n";
+}
+
diff --git a/patch_modal.py b/patch_modal.py
new file mode 100644
index 0000000..1cbdd6c
--- /dev/null
+++ b/patch_modal.py
@@ -0,0 +1,63 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+old_block = "
+
+
+
+
+
+
+
+
+
+
+ "
+
+new_block = "
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "
+
+if old_block in content:
+ content = content.replace(old_block, new_block)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully")
+else:
+ print("Old block not found!")
diff --git a/patch_modal2.py b/patch_modal2.py
new file mode 100644
index 0000000..1cbdd6c
--- /dev/null
+++ b/patch_modal2.py
@@ -0,0 +1,63 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+old_block = "
+
+
+
+
+
+
+
+
+
+
+ "
+
+new_block = "
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "
+
+if old_block in content:
+ content = content.replace(old_block, new_block)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully")
+else:
+ print("Old block not found!")
diff --git a/patch_modal3.php b/patch_modal3.php
new file mode 100644
index 0000000..ac3a996
--- /dev/null
+++ b/patch_modal3.php
@@ -0,0 +1,55 @@
+
+
+
+ \" value="0">
+ \" name=\"= $fieldName ?>\" class="form-check-input" value="1" = (!empty($currentValue) || (!isset($currentValue) && !empty($field[\'default\']))) ? \'checked\' : \'\' ?>/>
+
+
+
+
+
+
+
+
+
+
+
+ \" id=\"= $fieldName ?>\" name=\"= $fieldName ?>\" class="form-control" value=\"= htmlspecialchars((string)$valToUse) ?>\">
+
+
+
+ ';
+
+ $content = substr_replace($content, $new_block, $pos_start, $full_end - $pos_start);
+ file_put_contents($file, $content);
+ echo "Patched successfully\n";
+} else {
+ echo "Not found!\n";
+}
+
+?>
\ No newline at end of file
diff --git a/patch_regex.py b/patch_regex.py
new file mode 100644
index 0000000..6fda34a
--- /dev/null
+++ b/patch_regex.py
@@ -0,0 +1,48 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+pattern = re.compile(r"<\?php foreach \(\$currentNode\['ui_hints'\]\['form_schema'\] as \$field\): \?>(.*?)<\?php endforeach; \?>", re.DOTALL)
+
+replacement = r"""
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+if pattern.search(content):
+ content = pattern.sub(replacement, content, count=1)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully!")
+else:
+ print("Pattern not found!")
diff --git a/patch_regex2.py b/patch_regex2.py
new file mode 100644
index 0000000..2f6c5a5
--- /dev/null
+++ b/patch_regex2.py
@@ -0,0 +1,48 @@
+import re
+
+with open('_get_instance_details.php', 'r') as f:
+ content = f.read()
+
+pattern = re.compile(r"<\?php foreach \(\$currentNode\[\'ui_hints\'\]\[\'form_schema\'\] as \$field\): \?>(.*?)<\?php endforeach; \?>", re.DOTALL)
+
+replacement = r"""<\?php foreach ($currentNode['ui_hints']['form_schema'] as $field):
+ $fieldName = $field['name'];
+ $currentValue = $instanceData[$fieldName] ?? null;
+ ?>
+
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "
+
+if pattern.search(content):
+ content = pattern.sub(lambda m: replacement, content, count=1)
+ with open('_get_instance_details.php', 'w') as f:
+ f.write(content)
+ print("Patched successfully!")
+else:
+ print("Pattern not found!")
diff --git a/run_base64.py b/run_base64.py
new file mode 100644
index 0000000..6014992
--- /dev/null
+++ b/run_base64.py
@@ -0,0 +1,87 @@
+import base64
+import os
+
+script_b64 = b"""
+aW1wb3J0IHJlCgp3aXRoIG9wZW4oJ19nZXRfaW5zdGFuY2VfZGV0YWlscy5waHAnLCAncicpIGFz
+IGY6CiAgICBjb250ZW50ID0gZi5yZWFkKCkKCm9sZF9ibG9jayA9ICIiIiAgICAgICAgICAgICAg
+ICAgICAgICAgIDw/cGhwIGZvcmVhY2ggKCRjdXJyZW50Tm9kZVsndWlfaGludHMnXVsnZm9ybV9z
+Y2hlbWEnXSBhcyAkZmllbGQpOiA/PgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNz
+PSJtYi0zIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBmb3I9Ijw/PSAkZmll
+bGRbJ25hbWUnXSA/PiIgY2xhc3M9ImZvcm0tbGFiZWwiPjw/PSAkZmllbGRbJ2xhYmVsJ10gPz48
+L2xhYmVsPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPD9waHAgaWYgKCRmaWVsZFsndHlw
+ZSddID09PSAndGV4dGFyZWEnKTogPz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8
+dGV4dGFyZWEgaWQ9Ijw/PSAkZmllbGRbJ25hbWUnXSA/PiIgbmFtZT0iPD89ICRmaWVsZFsnbmFt
+ZSddID8+IiBjbGFzcz0iZm9ybS1jb250cm9sIj48L3RleHRhcmVhPgogICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgPD9waHAgZWxzZWlmICgkZmllbGRbJ3R5cGUnXSA9PT0gJ3NlbGVjdCcpOiA/
+PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzZWxlY3QgaWQ9Ijw/PSAkZmllbGRb
+J25hbWUnXSA/PiIgbmFtZT0iPD89ICRmaWVsZFsnbmFtZSddID8+IiBjbGFzcz0iZm9ybS1zZWxl
+Y3QiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBmb3JlYWNoICgk
+ZmllbGRbJ29wdGlvbnMnXSBhcyAkb3B0aW9uKTogPz4KICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9Ijw/PSAkb3B0aW9uWyd2YWx1ZSddID8+Ij48
+Pz0gJG9wdGlvblsnbGFiZWwnXSA/Pjwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICA8P3BocCBlbmRmb3JlYWNoOyA/PgogICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgIDwvc2VsZWN0PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPD9waHAgZWxzZTog
+Pz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0iPD89ICRmaWVs
+ZFsndHlwZSddID8+IiBpZD0iPD89ICRmaWVsZFsnbmFtZSddID8+IiBuYW1lPSI8Pz0gJGZpZWxk
+WyduYW1lJ10gPz4iIGNsYXNzPSJmb3JtLWNvbnRyb2wiIHZhbHVlPSI8Pz0gKCRmaWVsZFsnZGVm
+YXVsdCddID8/ICcnKSA9PT0gJ25vdycgPyBkYXRlKCdZLW0tZFxcVEg6aScpIDogJycgPz4iPgog
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgPD9waHAgZW5kaWY7ID8+CiAgICAgICAgICAgICAg
+ICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBlbmRmb3JlYWNo
+OyA/PiIiIgoKbmV3X2Jsb2NrID0gIiIiICAgICAgICAgICAgICAgICAgICAgICAgPD9waHAgZm9y
+ZWFjaCAoJGN1cnJlbnROb2RlWyd1aV9oaW50cyddWydmb3JtX3NjaGVtYSddIGFzICRmaWVsZCk6
+IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZpZWxkTmFtZSA9ICRmaWVsZFsnbmFtZSdd
+OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgJGN1cnJlbnRWYWx1ZSA9ICRpbnN0YW5jZURh
+dGFbJGZpZWxkTmFtZV0gPz8gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAgPz4KICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgIDw/cGhwIGlmICgkZmllbGRbJ3R5cGUnXSA9PT0gJ2NoZWNr
+Ym94Jyk6ID8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iZm9y
+bS1jaGVjayBtYi0zIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0
+IHR5cGU9ImhpZGRlbiIgbmFtZT0iPD89ICRmaWVsZE5hbWUgPz4iIHZhbHVlPSIwIj4KICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9ImNoZWNrYm94IiBpZD0i
+PD89ICRmaWVsZE5hbWUgPz4iIG5hbWU9Ijw/PSAkZmllbGROYW1lID8+IiBjbGFzcz0iZm9ybS1j
+aGVjay1pbnB1dCIgdmFsdWU9IjEiIDw/PSAoIWVtcHR5KCRjdXJyZW50VmFsdWUpIHx8ICghaXNz
+ZXQoJGN1cnJlbnRWYWx1ZSkgJiYgIWVtcHR5KCRmaWVsZFsnZGVmYXVsdCddKSkpID8gJ2NoZWNr
+ZWQnIDogJycgPz4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBm
+b3I9Ijw/PSAkZmllbGROYW1lID8+IiBjbGFzcz0iZm9ybS1jaGVjay1sYWJlbCI+PD89ICRmaWVs
+ZFsnbGFiZWwnXSA/PjwvbGFiZWw+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9k
+aXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBlbHNlOiA/PgogICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9Im1iLTMiPgogICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICA8bGFiZWwgZm9yPSI8Pz0gJGZpZWxkTmFtZSA/PiIgY2xhc3M9
+ImZvcm0tbGFiZWwiPjw/PSAkZmllbGRbJ2xhYmVsJ10gPz48L2xhYmVsPgogICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBpZiAoJGZpZWxkWyd0eXBlJ10gPT09ICd0ZXh0
+YXJlYScpOiA/PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRleHRh
+cmVhIGlkPSI8Pz0gJGZpZWxkTmFtZSA/PiIgbmFtZT0iPD89ICRmaWVsZE5hbWUgPz4iIGNsYXNz
+PSJmb3JtLWNvbnRyb2wiPjw/PSBodG1sc3BlY2lhbGNoYXJzKChzdHJpbmcpKCRjdXJyZW50VmFs
+dWUgPz8gJycpKSA/PjwvdGV4dGFyZWE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgIDw/cGhwIGVsc2VpZiAoJGZpZWxkWyd0eXBlJ10gPT09ICdzZWxlY3QnKTogPz4KICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzZWxlY3QgaWQ9Ijw/PSAkZmllbGRO
+YW1lID8+IiBuYW1lPSI8Pz0gJGZpZWxkTmFtZSA/PiIgY2xhc3M9ImZvcm0tc2VsZWN0Ij4KICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBmb3JlYWNoICgk
+ZmllbGRbJ29wdGlvbnMnXSBhcyAkb3B0aW9uKTogCiAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICRzZWxlY3RlZCA9ICgkY3VycmVudFZhbHVlICE9PSBudWxs
+ICYmIChzdHJpbmcpJGN1cnJlbnRWYWx1ZSA9PT0gKHN0cmluZykkb3B0aW9uWyd2YWx1ZSddKSA/
+ICdzZWxlY3RlZCcgOiAnJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICA/PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8
+b3B0aW9uIHZhbHVlPSI8Pz0gJG9wdGlvblsndmFsdWUnXSA/PiIgPD89ICRzZWxlY3RlZCA/Pj48
+Pz0gJG9wdGlvblsnbGFiZWwnXSA/Pjwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgIDw/cGhwIGVuZGZvcmVhY2g7ID8+CiAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICA8L3NlbGVjdD4KICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgPD9waHAgZWxzZTogPz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgIDw/cGhwIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICRkZWZhdWx0VmFsID0gKCRmaWVsZFsnZGVmYXVsdCddID8/ICcnKSA9PT0gJ25vdycgPyBk
+YXRlKCdZLW0tZFxcVEg6aScpIDogKCRmaWVsZFsnZGVmYXVsdCddID8/ICcnKTsKICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdmFsVG9Vc2UgPSAkY3VycmVudFZh
+bHVlID8/ICRkZWZhdWx0VmFsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgPz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBl
+PSI8Pz0gJGZpZWxkWyd0eXBlJ10gPz4iIGlkPSI8Pz0gJGZpZWxkTmFtZSA/PiIgbmFtZT0iPD89
+ICRmaWVsZE5hbWUgPz4iIGNsYXNzPSJmb3JtLWNvbnRyb2wiIHZhbHVlPSI8Pz0gaHRtbHNwZWNp
+YWxjaGFycygoc3RyaW5nKSR2YWxUb1VzZSkgPz4iPgogICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICA8P3BocCBlbmRpZjsgPz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/cGhwIGVuZGlmOyA/PgogICAg
+ICAgICAgICAgICAgICAgICAgICA8P3BocCBlbmRmb3JlYWNoOyA/PiIiIgoKaWYgb2xkX2Jsb2Nr
+IGluIGNvbnRlbnQ6CiAgICBjb250ZW50ID0gY29udGVudC5yZXBsYWNlKG9sZF9ibG9jaywgbmV3
+X2Jsb2NrKQogICAgd2l0aCBvcGVuKCdfZ2V0X2luc3RhbmNlX2RldGFpbHMucGhwJywgJ3cnKSBh
+cyBmOgogICAgICAgIGYud3JpdGUoY29udGVudCkKICAgIHByaW50KCJQYXRjaGVkIHN1Y2Nlc3Nm
+dWxseSIpCmVsc2U6CiAgICBwcmludCgiT2xkIGJsb2NrIG5vdCBmb3VuZCEiKQ=="""
+
+with open("do_patch.py", "w") as f:
+ f.write(base64.b64decode(script_b64).decode('utf-8'))
diff --git a/run_base64_patch.py b/run_base64_patch.py
new file mode 100644
index 0000000..eb0d6ba
--- /dev/null
+++ b/run_base64_patch.py
@@ -0,0 +1,68 @@
+import base64
+import os
+
+script_b64 = b"""
+aW1wb3J0IHJlCgp3aXRoIG9wZW4oJ19nZXRfaW5zdGFuY2VfZGV0YWlscy5waHAnLCAncicpIGFz
+IGY6CiAgICBjb250ZW50ID0gZi5yZWFkKCkKCnBhdHRlcm4gPSByZS5jb21waWxlKHIiPFw/cGhw
+IGZvcmVhY2ggXChcZGN1cnJlbnROb2RlXFsndWlfaGludHMnXF1cWydmb3JtX3NjaGVtYSdcXSBh
+cyBcJGZpZWxkXCk6IFw/PiguKj8pPFw/cGhwIGVuZGZvcmVhY2g7IFw/PiIsIHJlLkRPVEFMTCkK
+CiMgdXNlIGEgZnVuY3Rpb24gZm9yIHJlcGxhY2VtZW50IHNvIGl0IGRvZXNudCBwYXJzZSBiYWNr
+c2xhc2hlcwpyZXBsYWNlbWVudF90ZXh0ID0gciIiIjw/cGhwIGZvcmVhY2ggKCRjdXJyZW50Tm9k
+ZVsndWlfaGludHMnXVsnZm9ybV9zY2hlbWEnXSBhcyAkZmllbGQpOiAKICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICRmaWVsZE5hbWUgPSAkZmllbGRbJ25hbWUnXTsKICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICRjdXJyZW50VmFsdWUgPSAkaW5zdGFuY2VEYXRhWyRmaWVsZE5hbWVdID8/
+IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgID8+CiAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICA8P3BocCBpZiAoJGZpZWxkWyd0eXBlJ10gPT09ICdjaGVja2JveCcpOiA/PgogICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImZvcm0tY2hlY2sgbWItMyI+CiAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5h
+bWU9Ijw/PSAkZmllbGROYW1lID8+IiB2YWx1ZT0iMCI+CiAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJjaGVja2JveCIgaWQ9Ijw/PSAkZmllbGROYW1lID8+
+IiBuYW1lPSI8Pz0gJGZpZWxkTmFtZSA/PiIgY2xhc3M9ImZvcm0tY2hlY2staW5wdXQiIHZhbHVl
+PSIxIiA8Pz0gKCFlbXB0eSgkY3VycmVudFZhbHVlKSB8fCAoIWlzc2V0KCRjdXJyZW50VmFsdWUp
+ICYmICFlbXB0eSgkZmllbGRbJ2RlZmF1bHQnXSkpKSA/ICdjaGVja2VkJyA6ICcnID8+PgogICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgZm9yPSI8Pz0gJGZpZWxkTmFt
+ZSA/PiIgY2xhc3M9ImZvcm0tY2hlY2stbGFiZWwiPjw/PSAkZmllbGRbJ2xhYmVsJ10gPz48L2xh
+YmVsPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgPD9waHAgZWxzZTogPz4KICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICA8ZGl2IGNsYXNzPSJtYi0zIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgPGxhYmVsIGZvcj0iPD89ICRmaWVsZE5hbWUgPz4iIGNsYXNzPSJmb3JtLWxhYmVsIj48Pz0g
+JGZpZWxkWydsYWJlbCddID8+PC9sYWJlbD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgPD9waHAgaWYgKCRmaWVsZFsndHlwZSddID09PSAndGV4dGFyZWEnKTogPz4KICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZXh0YXJlYSBpZD0iPD89ICRmaWVs
+ZE5hbWUgPz4iIG5hbWU9Ijw/PSAkZmllbGROYW1lID8+IiBjbGFzcz0iZm9ybS1jb250cm9sIj48
+Pz0gaHRtbHNwZWNpYWxjaGFycygoc3RyaW5nKSgkY3VycmVudFZhbHVlID8/ICcnKSkgPz48L3Rl
+eHRhcmVhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBlbHNlaWYg
+KCRmaWVsZFsndHlwZSddID09PSAnc2VsZWN0Jyk6ID8+CiAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICA8c2VsZWN0IGlkPSI8Pz0gJGZpZWxkTmFtZSA/PiIgbmFtZT0iPD89
+ICRmaWVsZE5hbWUgPz4iIGNsYXNzPSJmb3JtLXNlbGVjdCI+CiAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgPD9waHAgZm9yZWFjaCAoJGZpZWxkWydvcHRpb25zJ10g
+YXMgJG9wdGlvbik6IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAkc2VsZWN0ZWQgPSAoJGN1cnJlbnRWYWx1ZSAhPT0gbnVsbCAmJiAoc3RyaW5nKSRjdXJy
+ZW50VmFsdWUgPT09IChzdHJpbmcpJG9wdGlvblsndmFsdWUnXSkgPyAnc2VsZWN0ZWQnIDogJyc7
+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPz4KICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSI8Pz0gJG9w
+dGlvblsndmFsdWUnXSA/PiIgPD89ICRzZWxlY3RlZCA/Pj48Pz0gJG9wdGlvblsnbGFiZWwnXSA/
+Pjwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD9waHAg
+ZW5kZm9yZWFjaDsgPz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwv
+c2VsZWN0PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8P3BocCBlbHNlOiA/
+PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD9waGAgCiAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRlZmF1bHRWYWwgPSAoJGZpZWxk
+WydkZWZhdWx0J10gPz8gJycpID09PSAnbm93JyA/IGRhdGUoJ1ktbS1kXFxUSDppJykgOiAoJGZp
+ZWxkWydkZWZhdWx0J10gPz8gJycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICR2YWxUb1VzZSA9ICRjdXJyZW50VmFsdWUgPz8gJGRlZmF1bHRWYWw7CiAgICAg
+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/PgogICAgICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9Ijw/PSAkZmllbGRbJ3R5cGUnXSA/PiIg
+aWQ9Ijw/PSAkZmllbGROYW1lID8+IiBuYW1lPSI8Pz0gJGZpZWxkTmFtZSA/PiIgY2xhc3M9ImZv
+cm0tY29udHJvbCIgdmFsdWU9Ijw/PSBodG1sc3BlY2lhbGNoYXJzKChzdHJpbmcpJHZhbFRvVXNl
+KSA/PiI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/cGhwIGVuZGlmOyA/
+PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgPD9waHAgZW5kaWY7ID8+CiAgICAgICAgICAgICAgICAgICAgICAgIDw/cGhw
+IGVuZGZvcmVhY2g7ID8+IiIiCgpkZWYgcmVwbGFjZXIobWF0Y2gpOgogICAgcmV0dXJuIHJlcGxh
+Y2VtZW50X3RleHQKCm1hdGNoZXMgPSBwYXR0ZXJuLnNlYXJjaChjb250ZW50KQppZiBtYXRjaGVz
+OgogICAgY29udGVudCA9IHBhdHRlcm4uc3ViKHJlcGxhY2VyLCBjb250ZW50LCBjb3VudD0xKQog
+ICAgd2l0aCBvcGVuKCdfZ2V0X2luc3RhbmNlX2RldGFpbHMucGhwJywgJ3cnKSBhcyBmOgogICAg
+ICAgIGYud3JpdGUoY29udGVudCkKICAgIHByaW50KCJQYXRjaGVkIHN1Y2Nlc3NmdWxseSEiKQpl
+bHNlOgogICAgcHJpbnQoIlBhdHRlcm4gbm90IGZvdW5kISIpCg=="""
+
+with open("do_patch_base64.py", "w") as f:
+ f.write(base64.b64decode(script_b64).decode('utf-8'))