diff --git a/source/ram.py b/source/ram.py index cadf771..9f4084f 100644 --- a/source/ram.py +++ b/source/ram.py @@ -51,7 +51,7 @@ def new_file(self): self.files.append(File(fat_map=self.fat.dump)) def calc_offset_to_cluster(self): - cluster = input("Input the cluster that you want the offset to(hex): ") + cluster = input("Input the cluster that you want the offset to(hex): ").upper() offset = Hex.calc_cluster_hex(reserved_area_size=self.reserved_area_size.vl_hex, fats_size=self.fats_size.vl_hex , root_dir_size=self.root_dir_size.vl_hex, cluster=cluster, cluster_size=self.bytes_sector_hex.vl_hex) diff --git a/utils/hex.py b/utils/hex.py index 4006e43..ca9f8b5 100644 --- a/utils/hex.py +++ b/utils/hex.py @@ -51,6 +51,7 @@ def calc_by_bc(self, other): @staticmethod def calc_cluster_hex(reserved_area_size, fats_size, root_dir_size, cluster, cluster_size): cmd = f"echo 'obase=16;ibase=16;{reserved_area_size}+{fats_size}+{root_dir_size}+(({cluster}-2)*{cluster_size})' | bc" + print(f"PG({cluster})= {reserved_area_size}+{fats_size}+{root_dir_size}+(({cluster}-2)*{cluster_size})") out = subprocess.run(cmd, stdout=subprocess.PIPE, shell=True) return out.stdout.decode('utf-8')[:-1]