hex

Converting EBCDIC Char to Hex values (AFP EBCDIC data)

I working with some EBCDIC data that I need to parse and find some Hex values. The problem that I'm having is that it appears that I'm reading the file in with the incorrect encoding. I can see that my record begins with "!" (which is a x5A in EBCDIC) but when doing the conversion to hex it returns as a x21, which is the ASCII value for ...

Regular expression for a non-zero hex value.

Hello, I am looking for a regular expression to determine when any of the values in a 32-bit hex value is non-zero. The data patterns look like 0x00000000 and I want to know when any of the digits is non-zero. For example, if 0x00001000 or 0x10000000 or 0xB000000 would be capture by the regular expression, but not a 0x00000000 patter...

Significance of Hex numbers specified in RFC 3174 (SHA-1)

I'm trying to learn about SHA-1, I was looking at the C implementation that was included in the specification (RFC 31741) and this part confuses me: context->Intermediate_Hash[0] = 0x67452301; context->Intermediate_Hash[1] = 0xEFCDAB89; context->Intermediate_Hash[2] = 0x98BADCFE; context->Intermediate_Hash[3] = 0x10325476; cont...

What exactly is this batch file supposed to do?

What does this do in a .bat file? Is it some sort of assembly language or what? @debug <%0 >nul e100 48 e6 61 be 3f 01 31 db 8a 1c 80 fb ff 74 f4 81 e110 c3 d0 00 b0 b6 e6 43 31 d2 66 b8 dd 34 12 00 66 e120 f7 f3 e6 42 88 e0 e6 42 46 8a 0c 46 ba da 03 ec e130 a8 08 74 fb ec a8 08 75 fb fe c9 74 c9 eb f0 00 e140...

Code golf - hex to (raw) binary conversion

In response to this question asking about hex to (raw) binary conversion, a comment suggested that it could be solved in "5-10 lines of C, or any other language." I'm sure that for (some) scripting languages that could be achieved, and would like to see how. Can we prove that comment true, for C, too? NB: this doesn't mean hex to ASCI...

Is there a Perl module to convert c99 hex floating point notation to regular notation?

Is there a built-in library that I can use to convert c99 style floating point notation, example: 0x1.0p23f, to regular floating point numbers using Perl (and vice versa)? Thanks, ...

Convert hex character to decimal equivelant in MIPs?

How do I take a single ASCII character and convert it to its decimal equivelant in MIPs? Do I simply have to have some conditions to subtract a certain amount from the ascii code to make it its decimal representation? ...

Efficiently convert between Hex, Binary, and Decimal in C/C++

I have 3 base representations for positive integer numbers: Decimal, in unsigned long variable (e.g. unsigned long int NumDec = 200). Hex, in string variable (e.g. string NumHex = "C8") Binary, in string variable (e.g. string NumBin = "11001000") I want to be able to convert between numbers in all 3 representations in the most effici...

What's a good hex editor/viewer for the Mac?

What's a good hex editor/viewer for the Mac? I've used xxd for viewing hexdumps, and I think it can be used in reverse to make edits. But what I really want is a real hex editor. ...

How to set an ints Hex Literal from a string,

Im attempting to load a hex literal from an xml settings file, I can parse the xml just fine and get the required string from the file, but i cant seem to get it to set an int variables value :/ Code: int PlayerBaseAddress = System.Convert.ToInt32(ConfigLoader.GetSetting("PlayerBaseAddress")); // Input string was not in a cor...

Got a Hexademical "Name" Generator for fills?

This is a dumb question, admittedly, please don't hesitate to vote down. :) I was debugging the other day and came across some memory- and register-fills I hadn't seen before on some embedded hardware I'm using. So I started a mental catalog. For example: DEADBEEF, BAADF00D, D15EA5ED, DECEA5ED, BAA5H33P... Something that sticks out w...

Using C++ to edit the registry

I have a limited c++ background and I would like to edit the registry. For example, I want to grab the value of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun and check to see if 0x20 is in it, and then if it is, subtract 0x20 from it's value and write it back (and kill and restart explor...

Why would This Fix the Dual Monitor Issue in Flash?

The Problem: You have dual monitors set up and view a Flash video (Let's say any YouTube video) in full screen mode in one of the monitors. If you work on the other monitor, the video would exit the full screen mode. Therefore, you cannot work while watching video in fullscreen mode. The Solution: A Google search yields this brillia...

Encoding of ... some sort?

Forgive me if this has been asked before, but I assure you I've scoured the internet and have turned up nothing, probably because I don't have the right terminology. I would like to take an integer and convert it to a little-endian(?) hex representation like this: 303 -> 0x2f010000 I can see that the bytes are packed such that the 16'...

How can I convert hex number to integers and strings in Objective C?

Given the example of an array like this: idx = [ 0xe, 0x3, 0x6, 0x8, 0x2 ] I want to get an integer and string representation of each of the specified items in Objective C. I have mocked up a ruby example which works perfectly: 0xe gives 14 when i run 0xe.to_i and "e" when i run to_i(base=16) 0x3 gives 3 when i run 0x3.to_i and gi...

Convert .Net Color Objects to HEX codes and Back

As per the question title, How could I take a hex code and convert it to a .Net Color object, and do it the other way? I googled and keep getting the same way which doesn't work. ColorTranslator.ToHtml(renderedChart.ForeColor) Which returns the name of the color as in 'White' instead of '#ffffff'! Doing it the other way seems to ha...

Altering file inside firmware requires new checksum

I have a firmware-file for a picture frame that I want to alter. The purpose of this altering is to make the device display a custom image during boot. I've managed to switch the existing JPEG-file with my own custom file, but it is not possible to flash the device with this new firmware-file. The device complains about an invalid check...

What is the purpose of hex-encoding for binary data?

I'm a bit curious as to why one would want to use hex encoding over base64. It seems to me that base 64 is more efficient. In particular, why is it that databases seem to always use hex encoding? Is it a historical issue, or am I missing something about hex encoding? ...

Java: Syntax and meaning behind "[B@1ef9157"? Binary/Address?

Hey, I'm trying to figure out what the [B@ prefix means in java. They come out when I attempt to print byte arrays. However, byte arrays of size 32 and size 4 are identical in length. Always "[@B1234567". What is this? Also, they have the property of only printing hex values. I know it can't just be a binary print because random ex...

How can I get a hex dump of a string in PHP?

I'm investigating encodings in PHP5. Is there some way to get a raw hex dump of a string? i.e. a hex representation of each of the bytes (not characters) in a string? ...