X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=disassembler%2Fbrcm80211fwconv;h=092c043cfac4e3f06bc985dc282f6eac9df93b0f;hb=bc1c60ad963c92b520949bfa72323ea99ba5fd5b;hp=880abb5d14d11e87cbc9199e231261774546ed49;hpb=7f952f532f4e3fd85f7ea6388cdb755824770ec0;p=b43-tools.git diff --git a/disassembler/brcm80211fwconv b/disassembler/brcm80211fwconv index 880abb5..092c043 100755 --- a/disassembler/brcm80211fwconv +++ b/disassembler/brcm80211fwconv @@ -161,9 +161,14 @@ def mergeSection(hdr_filepath, bin_filepath, mergeIndex, mergefilePath): newBin = [] newSections = [] newOffset = 0 + foundIt = False for section in sections: (offset, length, index) = section if index == mergeIndex: + if foundIt: + print "Confused. Multiple sections with index %d?" % index + return 1 + foundIt = True # We overwrite this section newBin.append(merge_data) newSections.append( (newOffset, len(merge_data), index) ) @@ -176,6 +181,9 @@ def mergeSection(hdr_filepath, bin_filepath, mergeIndex, mergefilePath): return 1 newSections.append( (newOffset, length, index) ) newOffset += length + if not foundIt: + print "Did not find section with index %d" % mergeIndex + return 1 newBin = "".join(newBin) newHdr = generateHeaderData(newSections) try: