Skip to content

Commit

Permalink
Added new devices, and a new "Tools" folder
Browse files Browse the repository at this point in the history
Added new devices, and a new "Tools" folder, which includes lz4 and check-4-jfif. The lz4 folder also has a automatic .bat file which runs the command for you.
  • Loading branch information
snickerdoodle1215 committed Aug 3, 2024
1 parent 378315e commit 77beed2
Show file tree
Hide file tree
Showing 297 changed files with 5,016 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Tools/check-4-jfif/check-4-jfif_Sbl.bin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

def extract_jpegs_from_aboot_mbn(file_path):
with open(file_path, 'rb') as f:
aboot_data = f.read()

jpeg_headers = b'\xFF\xD8\xFF\xE0'
start = 0
count = 0

while True:
# Find the next occurrence of JPEG header
offset = aboot_data.find(jpeg_headers, start)
if offset == -1:
break

# Found a JPEG header, locate the end of the JPEG image
end_offset = aboot_data.find(b'\xFF\xD9', offset)
if end_offset == -1:
break

# Extract the JPEG data
jpeg_data = aboot_data[offset:end_offset + 2]

# Write the JPEG data to a file
output_filename = f"{count}.jpg"
with open(output_filename, 'wb') as jpeg_file:
jpeg_file.write(jpeg_data)

print(f"Extracted {output_filename}")

# Move start position forward
start = end_offset + 2
count += 1

print(f"Total JPEG images extracted: {count}")

# Usage example
if __name__ == "__main__":
aboot_mbn_file = "Sbl.bin"
if os.path.exists(aboot_mbn_file):
extract_jpegs_from_aboot_mbn(aboot_mbn_file)
else:
print(f"File '{aboot_mbn_file}' not found.")
44 changes: 44 additions & 0 deletions Tools/check-4-jfif/check-4-jfif_aboot.mbn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

def extract_jpegs_from_aboot_mbn(file_path):
with open(file_path, 'rb') as f:
aboot_data = f.read()

jpeg_headers = b'\xFF\xD8\xFF\xE0'
start = 0
count = 0

while True:
# Find the next occurrence of JPEG header
offset = aboot_data.find(jpeg_headers, start)
if offset == -1:
break

# Found a JPEG header, locate the end of the JPEG image
end_offset = aboot_data.find(b'\xFF\xD9', offset)
if end_offset == -1:
break

# Extract the JPEG data
jpeg_data = aboot_data[offset:end_offset + 2]

# Write the JPEG data to a file
output_filename = f"{count}.jpg"
with open(output_filename, 'wb') as jpeg_file:
jpeg_file.write(jpeg_data)

print(f"Extracted {output_filename}")

# Move start position forward
start = end_offset + 2
count += 1

print(f"Total JPEG images extracted: {count}")

# Usage example
if __name__ == "__main__":
aboot_mbn_file = "aboot.mbn"
if os.path.exists(aboot_mbn_file):
extract_jpegs_from_aboot_mbn(aboot_mbn_file)
else:
print(f"File '{aboot_mbn_file}' not found.")
44 changes: 44 additions & 0 deletions Tools/check-4-jfif/check-4-jfif_param.bin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

def extract_jpegs_from_aboot_mbn(file_path):
with open(file_path, 'rb') as f:
aboot_data = f.read()

jpeg_headers = b'\xFF\xD8\xFF\xE0'
start = 0
count = 0

while True:
# Find the next occurrence of JPEG header
offset = aboot_data.find(jpeg_headers, start)
if offset == -1:
break

# Found a JPEG header, locate the end of the JPEG image
end_offset = aboot_data.find(b'\xFF\xD9', offset)
if end_offset == -1:
break

# Extract the JPEG data
jpeg_data = aboot_data[offset:end_offset + 2]

# Write the JPEG data to a file
output_filename = f"{count}.jpg"
with open(output_filename, 'wb') as jpeg_file:
jpeg_file.write(jpeg_data)

print(f"Extracted {output_filename}")

# Move start position forward
start = end_offset + 2
count += 1

print(f"Total JPEG images extracted: {count}")

# Usage example
if __name__ == "__main__":
aboot_mbn_file = "param.bin"
if os.path.exists(aboot_mbn_file):
extract_jpegs_from_aboot_mbn(aboot_mbn_file)
else:
print(f"File '{aboot_mbn_file}' not found.")
44 changes: 44 additions & 0 deletions Tools/check-4-jfif/check-4-jfif_param.lfs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

def extract_jpegs_from_aboot_mbn(file_path):
with open(file_path, 'rb') as f:
aboot_data = f.read()

jpeg_headers = b'\xFF\xD8\xFF\xE0'
start = 0
count = 0

while True:
# Find the next occurrence of JPEG header
offset = aboot_data.find(jpeg_headers, start)
if offset == -1:
break

# Found a JPEG header, locate the end of the JPEG image
end_offset = aboot_data.find(b'\xFF\xD9', offset)
if end_offset == -1:
break

# Extract the JPEG data
jpeg_data = aboot_data[offset:end_offset + 2]

# Write the JPEG data to a file
output_filename = f"{count}.jpg"
with open(output_filename, 'wb') as jpeg_file:
jpeg_file.write(jpeg_data)

print(f"Extracted {output_filename}")

# Move start position forward
start = end_offset + 2
count += 1

print(f"Total JPEG images extracted: {count}")

# Usage example
if __name__ == "__main__":
aboot_mbn_file = "param.lfs"
if os.path.exists(aboot_mbn_file):
extract_jpegs_from_aboot_mbn(aboot_mbn_file)
else:
print(f"File '{aboot_mbn_file}' not found.")
44 changes: 44 additions & 0 deletions Tools/check-4-jfif/check-4-jfif_sboot.bin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

def extract_jpegs_from_aboot_mbn(file_path):
with open(file_path, 'rb') as f:
aboot_data = f.read()

jpeg_headers = b'\xFF\xD8\xFF\xE0'
start = 0
count = 0

while True:
# Find the next occurrence of JPEG header
offset = aboot_data.find(jpeg_headers, start)
if offset == -1:
break

# Found a JPEG header, locate the end of the JPEG image
end_offset = aboot_data.find(b'\xFF\xD9', offset)
if end_offset == -1:
break

# Extract the JPEG data
jpeg_data = aboot_data[offset:end_offset + 2]

# Write the JPEG data to a file
output_filename = f"{count}.jpg"
with open(output_filename, 'wb') as jpeg_file:
jpeg_file.write(jpeg_data)

print(f"Extracted {output_filename}")

# Move start position forward
start = end_offset + 2
count += 1

print(f"Total JPEG images extracted: {count}")

# Usage example
if __name__ == "__main__":
aboot_mbn_file = "sboot.bin"
if os.path.exists(aboot_mbn_file):
extract_jpegs_from_aboot_mbn(aboot_mbn_file)
else:
print(f"File '{aboot_mbn_file}' not found.")
Loading

0 comments on commit 77beed2

Please sign in to comment.