binary

beginner:source files vs binary files: what's the purpose of providing both?

here http://www.codeproject.com/KB/database/CsvReader.aspx they are offering both source and binary files. if i am a programmer who needs to use the files, why should they be providing me with both? why not just give me the source and i will compile it? ...

Get function name from function address

As the question states, I have a function address and want to analyze my binary to find its function name. Is there a tool to do that? I have both binary and symbols. ...

Writing binary files C++, way to force something to be at byte 18?

I'm currently trying to write a .bmp file in C++ and for the most part it works, there is however, just one issue. When I start trying to save images with different widths and heights everything goes askew and I'm struggling to solve it, so is there any way to force something to write to a specific byte (adding padding in between it and ...

Convert a binary string representation to a byte array.

How do you convert a string such as "01110100011001010111001101110100" to a byte array then used File.WriteAllBytes such that the exact binary string is the binary of the file. In this case it would be the the text "test". ...

Writing binary file in C++, unsigned char is too small but other data types add padding, is there an alternative?

I'm trying to write a .bmp in C++ but unsigned char can't hold a value high enough for my needs and other data types add padding because of specific byte alignment that makes a mess of things. So is there an alternative data type that can hold a higher value that won't add padding (or a way to make unsigned char hold a higher value)? ...

Serialise and deserialise vector in binary

Hi all, I am having problems trying to serialise a vector (std::vector) into a binary format and then correctly deserialise it and be able to read the data. This is my first time using a binary format (I was using ASCII but that has become too hard to use now) so I am starting simple with just a vector of ints. Whenever I read the dat...

number conversion general methodology ?

Hello experts, This is about how to do number conversion between binary to octal, octal to hexadecimal, binary to hexadecimal.. ( in all these decimal is no where there, either in source or destination ) Whenever decimal is involved either in source or destination i have a general methodology as, if decimal is source, do the mod oper...

reading double from binary file in c

hi, can anyone show how to correctly convert binary represented data into double value in C. for example, i have 8 unsigned char values to be converted to double value (let's name it buffer). so buffer[0]'s 0's bit is LSB, and buffer[7]'s 7's bit is MSB. thanks a lot in advance! ...

x-y = x+¬y+1 problem

I am currently reading a book about "bit fiddling" and the following formula appears: x-y = x+¬y+1 But this doesn't seem to work. Example: x = 0100 y = 0010 x-y = 0010 ¬y = 1101 ¬y+1 = 1110 x+1110 = 10010 But 10010 != 0010... Where did I make a mistake (if any)? (The book is "Hacker's Delight" by Henry S. Warren.) ...

ERlANG - Splitting Lists into sub list

Hi Everyone, So this I just had one problem solved very quickly by a nice guy on my other post. http://stackoverflow.com/questions/3464207/erlang-splitting-lists-into-sub-list Now I am a beginner at Erlang and need a little help with the syntax of another function that does work on the result from my previous post. For example, I now...

Is it possible / logical to use XML as an input/decoder for a binary file reader?

Problem: We have to read from a proprietary binary file at work. It changes every couple of months and it takes a lot of effort from our team to keep our software up to date in order to read the latest changes. So with that in mind, would it be reasonable to create a robust binary parser that takes an xml file as the input or template ...

Correcting Corrupt ZIP file Headers

I have previously been using Chilkat Zip .Net to generate backup files from my application, but after having issues with the Component, moved to Xceed Zip .Net for the same function. If you take one of the Zips generated with the Chilkat and attempt to extract using Xceed, 7Zip, WinZip then it fails. If you take the same file and extra...

Way to get value of this hex number

import binascii f = open('file.ext', 'rb') print binascii.hexlify(f.read(4)) f.close() This prints: 84010100 I know that I must retrieve the hex number 184 out of this data. How can it be done in python? I've used the struct module before, but I don't know if its little endian, big..whatever.. how can I get 184 from this number ...

Decimal Conversion Ranges in the IEEE 754 Specification (Binary Floating-Point Arithmetic)

Table 2 in section 5.6 on the bottom of page 11 of the IEEE 754 specification lists the ranges of decimal values for which decimal to binary floating-point conversion must be performed. The ranges of exponents don't make sense to me. For example, for double-precision, the table says the maximum decimal value eligible to be converted is (...

What type should I use for binary representation of C enum?

As I know C enum is unsigned integer, but this may vary by implementation. What type should I use for the enum in binary representation? *PS 'binary representation' means byte-array. I want to serialize enum values to socket to inter-operate with other programs. ...

Is there any generic binary protocol codec library for python?

There is nice one for java - MINA. Once I've heard that there is something similar for python. But can't remind. EDIT: to be more specific, I would like to have a tool which would help me to create a coded for some binary stream. EDIT2: I'd like to list solutions here (thanks Scott for related topics) Listed in order i'd use it. bit...

.NET Binary File Read Performance

I have a very large set of binary files where several thousand raw frames of video are being sequentially read and processed, and I’m now looking to optimize it as it appears to be more CPU-bound than I/O-bound. The frames are currently being read in this manner, and I suspect this is the biggest culprit: private byte[] frameBuf; Bin...

Can you write to a socket from disk without loading the data in question into memory first?

Using the Socket API in AIR to write a large file to a server, is there a way to do this without reading the file into application memory first? I am using FileStream to store the data in a bytearray and then writing that bytearray to the server through the socket but can I just have something like a file descriptor that references that ...

How to write data in specified format into a binary file with Perl?

Hi all, this might be quite a newbie question, but i need to process a certain text file and dump its content into a binary file and i do not know how - i decided to use perl, but my perl skills are quite low. I probably should have written this in C++, but this seem like a nice and easy task for perl, so why not learn something new? ;)...

How can I compile binary?

I'm a .net developer by heart and usually write web applications. However I've been given the binary of a small project and I need to compile it (I think). It is only two files: mfile.h and mfile.cpp. From looking at the code the .h file is a header file that contains constants and the cpp file is the actual codefile. I created a ne...