- Code: Select all
def SetBit(self,index):
dwordidx = index >> 5 # (Equivalent to index / 32 ) Maximum 32 bits per dword
if dwordidx >= len(self.data): # append another dword if neccesary
self.data.append(0x00000000)
self.data[dwordidx] |= ( 1 << (index & 31)) # (index & 31) gives the bit index within this dword
it's having trouble etting a bit DWord higher than 32 which responderundothirdperson and others are.