Giter VIP home page Giter VIP logo

Comments (3)

checkraisefold avatar checkraisefold commented on September 27, 2024

At some point in this repro file, the Base64 decoder also seems to go completely haywire and just decode incorrect data.

from imhex.

paxcut avatar paxcut commented on September 27, 2024

I am having trouble decoding the contents of the file provided in online base64 decoders. If you look in the %APPSLOCALDATA%\imhex\tests\patterns\test_data folder you'll find a file called base64.dat (Im attaching it here just in case it is something I added). If I use the contents of that file in the online decoder it decodes it to some json looking text. Loading that file to the base64 provider produces the same text that can be read in the ascii column.

base64.txt

PLEASE NOTE THE EDITED POST CONTENT

to further verify the information above I used an online base64 encoder and typed some text. The produced base64 code loads in Imhex's base64 provider and shows the same string that was used to encode the input file.
How did you obtain the sample provided? Can you verify if it is valid base64 encoded file? Please provide details to do so but afaik the base64 provider is not misbehaving at all. If you are going to paste base64 data directly into imhex you cant use the clipboard because that copies ascii, not binary values, but it is not clear what exact operations copy data out implies.
Your instructions are also not clear as to what is meant by running pattern language.

I tested running a simple pattern that reads 20 bytes and prints as a string and the decoded bytes are printed correctly. I suspect that your sample is using additional encoding on top of base 64 (like utf-16).afaik base64 provider only supports utf-8 encoding but i need to check that.

from imhex.

checkraisefold avatar checkraisefold commented on September 27, 2024

The sample TXT uses newlines. In both LF and CRLF, ImHex interprets the new lines as base64, or starts a new base64 string, which causes random bytes and garbage to be output.

https://datatracker.ietf.org/doc/html/rfc4648#section-3.1
https://datatracker.ietf.org/doc/html/rfc4648#section-3.3
ImHex should most likely just error if given an input base64 with non-alphabet characters, OR ignore them entirely

from imhex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.