Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by liqilin1567

1 year ago

One of my biggest headaches is stripping specific number of bytes from the head or tail of a binary file. and I couldn't find any built-in tool for that, so I wrote one in C++.

2 comments

liqilin1567

Reply

rkeene2  1 year ago

Last X bytes: dd bs=1 skip=X

First X bytes: dd bs=X count=1

  • liqilin1567  1 year ago

    Thanks, there were few errors after testing.

    1. stripping fist X bytes: dd bs=1 skip=X

    2. stripping last X bytes: truncate -s -X

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities