
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Do you ever find yourself writing code like this?
io = File.open(...)
len = io.read(2).unpack("v")
name = io.read(len)
width, height = io.read(8).unpack("VV")
puts "Rectangle #{name} is #{width} x #{height}"
It’s ugly, violates DRY and doesn't feel like Ruby.
There is a better way. Here’s how you’d write the above using BinData.
class Rectangle < BinData::Record
endian :little
uint16 :len
string :name, :read_length => :len
uint32 :width
uint32 :height
end
io = File.open(...)
r = Rectangle.read(io)
puts "Rectangle #{r.name} is #{r.width} x #{r.height}"
BinData provides a declarative way to read and write structured binary data.
This means the programmer specifies what the format of the binary
data is, and BinData works out how to read and write data in this
format. It is an easier (and more readable) alternative to
ruby's #pack
and #unpack
methods.
BinData makes it easy to create new data types. It supports all the common primitive datatypes that are found in structured binary data formats. Support for dependent and variable length fields is built in.
$ gem install bindata
If you have any queries / bug reports / suggestions, please contact me (Dion Mendel) via email at bindata@dmau.org
FAQs
Unknown package
We found that bindata demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.