0
votes
1answer
62 views

Ruby net/scp, upload file from variable

It seems like net/scp in Ruby (I'm using 1.8.7) only accepts a path and not binary data as "local_file" parameter. In my case, I have the local file stored in a variable. Am I required to ...
1
vote
1answer
215 views

How does pack() and unpack() work in Ruby

In Ruby why we need array Packing? How does directive help to do such packing? I ran some code in my console to see what and how directives looks like in Array packing.But the output is closely same ...
-1
votes
1answer
90 views

Extract zero-terminated strings from binary data, maybe with Ruby's string.unpack?

I perform an UDP request to a server via Ruby. The server's response is mixed content, meaning I get strings, numbers and so on. I know how to interpret the response, but I'm having trouble with ...
0
votes
1answer
323 views

How to POST binary data using Rest Client?

I am trying to read in an audio file of type wav or amr from a HTML form using Rest Client. I have the code to do this in PHP. $filename = $_FILES['f1']['name']; public function getFile($filename) { ...
4
votes
3answers
641 views

How do I start reading at an offset in binary data?

I have a C-like struct like this: SomeStruct << BinData::Record endian :little uint32 :offsetOfName uint32 :offsetOfLastname #... uint32 :lenVars struct :Person, :length => :lenVars ...
1
vote
4answers
503 views

Using Ruby BinData gem to read choices

I am implementing a data structure using Ruby and the BinData gem. I need to implement a Choice value. According to the BinData documentation, a choice can be implemented as: class MyData < ...
7
votes
3answers
655 views

Reverse engineering a statistics data file from my insulin pump controller

This may or may not be a grey area subject, though my intentions are certainly not, so my intention is not to stir up an ethical debate on the topic of reverse engineering. I'm a type 1 diabetic ...
1
vote
2answers
276 views

Binary files corrupted when zipping it with Ruby

I have a service that delivers zipped files over the web. The zip contains executable files for windows platform. I'm using the rubyzip library to compress the file but the process corrupts the ...
2
votes
1answer
164 views

Ruby grep binary files?

I have been using this so far system 'strings binary-file.dmp | grep search_string' Is there something more "Ruby like"?
2
votes
3answers
756 views

Reading Structure Binary Data in Python?

Are there any nice solutions like BinData in Ruby for reading user-defined binary file/stream formats in Python? If not, then what's the preferred way to this in Python outside of just using the ...
0
votes
1answer
664 views

How do I read binary data from a file, and transfer it via Ruby sockets to a client performing bitwise operations?

I'm currently working on a piece of software in Ruby that is meant to read a binary message from a file, and then transmit it over either a TCP or UDP socket to a C program being written by a coworker ...
0
votes
3answers
508 views

Searching Binary Data in Ruby

Using only pure ruby (or justifiably commonplace gems) is there an efficient way to search a large binary document for a specific string of bytes? Deeper context: the mpeg4 container format is a ...
1
vote
1answer
417 views

Unpacking 3-byte/24-bit data chunks with Ruby

I am building a pure-Ruby WAV file read/write library, learning deeper Ruby functionality as I go. It currently works well with 16-bit audio, as I am able to use String.unpack('s*') to pull individual ...
0
votes
2answers
2k views

Create binary data using Ruby?

i was palying with the ruby sockets, so i ended up trying to put an IP packet togather, then i took an ip packet and try to make a new one just like it. now my problem is: if the packet is: 45 00 00 ...