-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced the bash commands with a simple python patcher script.
- Loading branch information
1 parent
3f13681
commit e44b200
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Sming/Arch/Esp8266/Components/esp8266/Tools/patch-phy-bin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
######################################################## | ||
# | ||
# Simple PHY binary patcher | ||
# Author: Slavey Karadzhov <[email protected]> | ||
# | ||
######################################################## | ||
import os | ||
import sys | ||
|
||
def usage(): | ||
print("Usage: \n\t%s <file.bin> [offset]" % sys.argv[0]) | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) not in list(range(2,4)): | ||
usage() | ||
sys.exit(1) | ||
|
||
offset = 107 | ||
if len(sys.argv) > 2: | ||
offset = int(sys.argv[2]) | ||
|
||
with os.fdopen(os.open(sys.argv[1], os.O_RDWR | os.O_CREAT), 'rb+') as f: | ||
f.seek(offset) | ||
f.write(bytearray(b'\xff')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters