hex

After making a hex mask CTRL+C and CTRL+V is not allowed

Hi, I have a small problem. After making a hex mask, I can not copy/paste with CTRL C/V. If I right click in the textbox I can paste. But I would like to be able to just press CTRL V. If I delete the hex mask, CTRL C/V works fine. Here is a bit of the code: private void maskedTextBox1(Object sender, System.Windows.Forms.KeyPressEvent...

convert an hex string to a NSData

How can I convert a string in hex format to retrieve from it an NSData and after that an UIImage inside of my iPhone app? I've got a string (str) that contains a value like X'FFD8FFE000104A46....01010000010001000'. That string is created from a xml file by the method: - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)st...

How do I convert hex string into signed integer?

I'm getting a hex string that needs to be converted to a signed 8-bit integer. Currently I'm converting using Int16/Int32, which will obviously not give me a negative value for an 8-bit integer. If I get the value 255 in Hex, how do I convert that to -1 in decimal? I assume I want to use an sbyte, but I'm not sure how to get that valu...

Edit library in hex editor while preserving its integrity

I'm attempting to edit a library in hex editor, insert mode. The main point is to rename a few entries in it. If I make it in "Otherwrite" mode, everything works fine, but every time I try to add a few symbols to the end of string in "Insert" mode, the library fails to load. Anything I'm missing here? ...

Convert from HEX color to RGB struct in C

Convert from color HEX code to RGB in pure c using C library only (without C++,templates, etc.) RGB struct may be like this -> typedef struct RGB{ double r; double g; double b; } RGB1; function should return RGB1 ...

C# Replace HEX in binary file

I have a binary file, where are a few values what should be changed. To be more exact, at two part of the file, in the beginning, there are two HEX values 66 73 69 6D 35 2E 36 39 what should be changed to 4D 53 57 49 4E 34 2E 31 How could I do this async, and as fast as possible? I've got to the point where I read the whole file in...

Hex number (not ascii hex value) to string in vb.net

I've tried searching for this, but most people just want to convert hex values into their ascii equivalents. That's not what I am looking todo. I'm looking to see if vb.net has a simple built in function to do this: Private Function NibbleToString(ByVal Nibble As Byte) As String Dim retval As String = String.Empty Select...

Is it acceptable to use RGB colors when designing HTML emails

It is best practice to stick with HEX colors when designing HTML emails - does it matter? ...

Determining delimeter for a structured section in a text file using a hex viewer

I have a text file with structured data. After each text block it says "END" and continues onto the next block. Looking at a hex viewer I see 0A:45:4E:44:0A:20:20:20:20:20:20:20:20:20 which translates into ?END? Notice the 9 spaces. How do I write this as a delimeter in my code? "END\n\n\n \n \n \n \n \n \n" This doe...

How do I convert a hexidecimal color (with alpha) to an int in Jython?

Hi, I need to convert an ARGB hex into an int in Jython for color. I've tried using longs, hex() and a combination of other things and can't seem to get it to work. I get this error "TypeError : 5th arg can't be coerced to int" when I try to convert 0x80ff3333 to an int. I guess there are too many bytes in the hex to convert it. Anyon...

How to convert a char array into string based hex-stream (ostringstream)

Hi, in C++ (on Linux with gcc) I'd like to put a byte array (vector<unsigned char>) to a ostringstream or a string. I know that I can use sprintf but it doesn't seem to be the best way to use char* also. btw: this link did not help Edit: All answer work so far. But I did not meantion, that I'd like to convert the bytes/hex-values int...

How to output hex numbers via XML Serialization in c#?

I've got a few classes and structures that I use XML serialization to save and recall data, but a feature that I'd like to have is to output integers in hex representation. Is there any attribute that I can hang on these structure to make that happen? ...

How do I get the hexadecimal representation of $foo in Perl?

Given the variable $foo containing binary data, how do I get the hexadecimal representation of $foo in Perl? ...

Unknown header on a custom .cab file

Hello everyone! Well, I'm kind of stuck with this. I am hoping one of you can shed some light. I'm working with a cab file, and need to make some changes on it. It's not a standard cab file, though. It pretty much follows the standard for .000 file and the MSCF specification. However, at the very beginning of the file, it has somethin...

When would you use unpack('h*' ...) or pack('h*' ...)?

In Perl, pack and unpack have two templates for converting bytes to/from hex: h    A hex string (low nybble first). H    A hex string (high nybble first). This is best clarified with an example: use 5.010; # so I can use say my $buf = "\x12\x34\x56\x78"; say unpack('H*', $buf); # prints 12345678 say unpack('h*', $buf); # prints...

JFileChooser.showOpenDialog not opening, and no error being thrown?

Okay, so I'm trying to make a hex editor, and I'm trying to make a load JMenuItem, but it's not working. The JFileChooser OpenDialog just doesn't show up, and no errors are being shown. import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.util.Vector; import java....

JScrollPane not showing up?

I have some JScrollPanes on my hex editor and they're not showing up. Any idea why? import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.util.Vector; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; public class HexEditor extends J...

Why does the Basic Java Hex Editor I made freeze on files around 2MB size and up?

Alright, so I'm writing a hex editor in Java and when I load in a file around 2MB or bigger it just freezes. No errors show up though, so I'm not sure whats going on. Can anyone help me? This is the code: import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.util.V...

What does `return 0x1;` mean?

When browsing the source of a project on web I've found some weird to me return statement in main: int main() { /* ... */ return 0x1; } So main is returning 0x1 radix 16, but that's 1 radix 10! Shouldn't main return 0? That is incorrect, right? By the way is it Okay to return 0x0? Thanks in advance. ...

[VB.NET] Any way we can work with hex bytes and chars like in c++?

Well my question is simple and straightforward. Is there any way we can use hex values like in c++? I am going to write binary files, but for that i will have to define certain characters like this for example. \x00\x00\x11\x22\x33\x00\x00 I would first need to convert stuff like this to a byte array, and then write it to a binary te...