Browse Source

modified: README.md

modified:   patch.py
	modified:   upgrade.py
pull/7/head
zyb 2 years ago
parent
commit
1861785032
  1. 2
      README.md
  2. 1
      patch.py
  3. 7
      upgrade.py

2
README.md

@ -5,7 +5,7 @@
![](install.png)
![](routeros.png)
### Uses keygen to generate license key (keygen.exe in iso).
### Uses keygen to generate license key (keygen in iso or img).
![](keygen.png)
### all patches are applied automatically with [github workflow](https://github.com/elseif/MikroTikPatch/blob/main/.github/workflows/mikrotik_patch.yml).

1
patch.py

@ -98,7 +98,6 @@ def patch_system_npk(key_dict,input_file,output_file=None):
npk.save(output_file or input_file)
if __name__ == '__main__':
import argparse,os
parser = argparse.ArgumentParser(description='MikroTik patcher')
subparsers = parser.add_subparsers(dest="command")

7
upgrade.py

@ -1,6 +1,7 @@
from mitmproxy import http
import os
class MwrAddon:
class UpgradeAddon:
def request(self,flow: http.HTTPFlow) -> None:
if len(flow.request.path_components)==3 and flow.request.path_components[0] == 'routeros':
version = flow.request.path_components[1]
@ -26,7 +27,7 @@ class MwrAddon:
)
else:
flow.response = http.Response.make(status_code=404)
addons = [MwrAddon()]
async def start_listen(port):
from mitmproxy.tools.dump import DumpMaster
from mitmproxy import options
@ -34,7 +35,7 @@ async def start_listen(port):
print(f'listening at *:{port}')
print(f'open http://127.0.0.1:{port}')
master = DumpMaster(opts)
master.addons.add(*addons)
master.addons.add([UpgradeAddon()])
try:
await master.run()
except KeyboardInterrupt:

Loading…
Cancel
Save