Skip to content

Reconstruct bytes from a Java signed array

Extract a Java byte array, convert negative values to unsigned bytes, rebuild the binary, and display its hexadecimal signature.

Install in Serialize

What it can do

  • Extract array contents
  • Convert signed Java bytes to 0–255 values
  • Rebuild raw bytes
  • Recognize the Java class signature

How the recipe works

Regular expression

Select values inside the braces.

Find / Replace

Pair every negative value with 256 for modular conversion.

Find / Replace

Move each value to its own record.

Fork

Evaluate records independently.

Sum

Add the signed value to 256.

Merge

Rejoin the unsigned decimals.

From Charcode

Convert decimal character codes to bytes.

To Hex

Render the result as spaced hexadecimal.

Demonstration

Sample input

byte[] magic = {-54,-2,-70,-66};

Expected result

ca fe ba be

When to use it

  • Java reverse-engineering labs
  • Binary-format education
  • Recovering embedded byte arrays

Adapt it

Remove the final To Hex step when you want to save or inspect the reconstructed binary directly.

Source and verification

Adapted from mattnotmax CyberChef recipes. The explanation and sample are written for Serialize, use synthetic or documentation-safe data, and are checked against the current operation catalogue. The workflow runs locally without an external API call.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close