allow PayloadBuilder to be rewound

master
Ondřej Hruška 6 years ago
parent c47e196312
commit 666e18c57e
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 4
      gex/PayloadBuilder.py

@ -13,6 +13,10 @@ class PayloadBuilder:
""" Get the byte buffer """
return self.buf
def reset(self):
""" Clear the buffer """
self.buf.clear()
def u8(self, num:int):
""" Add a uint8_t """
self.buf.extend((num&0xFF).to_bytes(length=1, byteorder=self.endian, signed=False))

Loading…
Cancel
Save