mirror of
https://github.com/bkerler/edl.git
synced 2024-11-14 19:14:58 -05:00
Fixed imports and some minor lint issues
This commit is contained in:
parent
4bbb612b91
commit
f89eb79081
10 changed files with 15 additions and 14 deletions
|
@ -3,6 +3,7 @@ import platform
|
|||
import time
|
||||
import json
|
||||
from struct import unpack
|
||||
from binascii import hexlify
|
||||
from Library.utils import *
|
||||
from Library.gpt import gpt
|
||||
from Library.sparse import QCSparse
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
import binascii
|
||||
from binascii import hexlify
|
||||
from Library.utils import *
|
||||
|
||||
|
||||
|
@ -179,7 +179,7 @@ class gpt(metaclass=LogBase):
|
|||
guid2 = struct.unpack("<H", partentry["unique"][0x4:0x6])[0]
|
||||
guid3 = struct.unpack("<H", partentry["unique"][0x6:0x8])[0]
|
||||
guid4 = struct.unpack("<H", partentry["unique"][0x8:0xA])[0]
|
||||
guid5 = binascii.hexlify(partentry["unique"][0xA:0x10]).decode('utf-8')
|
||||
guid5 = hexlify(partentry["unique"][0xA:0x10]).decode('utf-8')
|
||||
pa.unique = "{:08x}-{:04x}-{:04x}-{:04x}-{}".format(guid1, guid2, guid3, guid4, guid5)
|
||||
pa.sector = partentry["first_lba"]
|
||||
pa.sectors = partentry["last_lba"] - partentry["first_lba"] + 1
|
||||
|
|
|
@ -120,7 +120,7 @@ class hdlc:
|
|||
|
||||
def receive_reply(self,timeout=None):
|
||||
replybuf = bytearray()
|
||||
if timeout==None:
|
||||
if timeout is None:
|
||||
timeout=self.timeout
|
||||
tmp = self.cdc.read(MAX_PACKET_LEN, timeout)
|
||||
if tmp == bytearray():
|
||||
|
@ -155,7 +155,7 @@ class hdlc:
|
|||
|
||||
def receive_reply_nocrc(self,timeout=None):
|
||||
replybuf = bytearray()
|
||||
if timeout==None:
|
||||
if timeout is None:
|
||||
timeout=self.timeout
|
||||
tmp = self.cdc.read(MAX_PACKET_LEN, timeout)
|
||||
if tmp == bytearray():
|
||||
|
|
|
@ -6,6 +6,7 @@ import usb.util
|
|||
import time
|
||||
import inspect
|
||||
from Library.utils import *
|
||||
from binascii import hexlify
|
||||
|
||||
USB_DIR_OUT = 0 # to device
|
||||
USB_DIR_IN = 0x80 # to host
|
||||
|
|
|
@ -8,7 +8,6 @@ import shutil
|
|||
import stat
|
||||
import colorama
|
||||
import copy
|
||||
from binascii import hexlify
|
||||
|
||||
try:
|
||||
from capstone import *
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
# Beagle to EDL Loader (c) B.Kerler 2021
|
||||
|
||||
import os,sys
|
||||
import sys
|
||||
from struct import unpack
|
||||
|
||||
def main():
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
from os import walk
|
||||
import hashlib
|
||||
from struct import unpack, pack
|
||||
from struct import unpack
|
||||
from shutil import copyfile
|
||||
try:
|
||||
from Library.utils import elf
|
||||
|
|
2
edl.py
2
edl.py
|
@ -254,7 +254,7 @@ class main(metaclass=LogBase):
|
|||
self.exit()
|
||||
# print((mode, resp))
|
||||
if mode == "sahara":
|
||||
if resp==None:
|
||||
if resp is None:
|
||||
if mode=="sahara":
|
||||
print("Sahara in error state, resetting ...")
|
||||
self.sahara.cmd_reset()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
'''
|
||||
"""
|
||||
Licensed under MIT License, (c) B. Kerler 2018-2019
|
||||
'''
|
||||
"""
|
||||
default_vid_pid = [
|
||||
[0x2c7c, 0x0125, -1], # Quectel EC25
|
||||
[0x1199, 0x9071, -1], # Sierra Wireless
|
||||
|
@ -17,8 +17,6 @@ default_vid_pid = [
|
|||
|
||||
]
|
||||
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
import json
|
||||
import logging
|
||||
|
@ -649,7 +647,7 @@ class qcdiag(metaclass=LogBase):
|
|||
if len(res) > 0:
|
||||
if res[0] == 0x27:
|
||||
res, nvitem = self.read_nvitem(item)
|
||||
if res == False:
|
||||
if not res:
|
||||
print(f"Error while writing nvitem {hex(item)} data, %s" % data)
|
||||
else:
|
||||
if nvitem.data != data:
|
||||
|
|
|
@ -6,4 +6,7 @@ pylzma>=0.5.0
|
|||
pycryptodome
|
||||
lxml>=4.6.1
|
||||
colorama
|
||||
usb
|
||||
capstone
|
||||
keystone-engine
|
||||
|
||||
|
|
Loading…
Reference in a new issue