Open postmodern opened 1 year ago
An idea, String#unpack_uint8
could be optimized to just return getbyte(0)
.
Did a Mastodon poll about _ne
vs. _net
suffix, and appears most people say to just use _be
when referring to network-byte-order types. So maybe hold off on the _ne
/_net
aliases until someone eventually requests them?
https://infosec.exchange/@postmodern/110459088606261323
String
should have core-exts that can unpack the String as a singleuint*
,int*
, orfloat*
type. These methods should callunpack1
with a single C type argument (ex::uint32
) and**kwargs
.String#unpack_uint8
String#unpack_uint16
String#unpack_uint32
String#unpack_uint64
String#unpack_int8
String#unpack_int16
String#unpack_int32
String#unpack_int64
String#unpack_float32
String#unpack_float64
String#unpack_pointer
String#unpack_cstring
The following methods should not accept
**kwargs
as they use little-endian or big-endian types:String#unpack_uint16_le
String#unpack_uint32_le
String#unpack_uint64_le
String#unpack_int8_le
String#unpack_int16_le
String#unpack_int32_le
String#unpack_int64_le
String#unpack_float32_le
String#unpack_float64_le
String#unpack_uint16_be
String#unpack_uint32_be
String#unpack_uint64_be
String#unpack_int8_be
String#unpack_int16_be
String#unpack_int32_be
String#unpack_int64_be
String#unpack_float32_be
String#unpack_float64_be
Alias
*_be
methods as*_ne
or*_net
?The documentation and specs can be copy/pasted from
String#unpack1
.This will give
ronin-support
parity with pwnlib.util.packing.