gchq / gchq/CyberChef

Operation request: struct.unpack as in Python

Open
#1,333 3 comments 0 reactions 0 assignees View on GitHub
operation
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

## Summary

hi,

Is there a way with CyberChef to do like in Python with `struct.unpack` ?

I have a 16 characters string (128 bits) that breaks down as follows : `yymmDDddHHMMSSss`.
`yy` is the year, `mm` is the month, `DD` is the day of the week, `dd` is the day, `HH` is the hour, `MM` is the minutes, `SS` is the seconds and `ss` is the milliseconds (yes, it's a Windows SystemTime reg_binary value in registry ;-)).

with this string placed in the `data` variable, I convert/format the date as follows with Python :
`print(datetime.datetime(*struct.unpack('HHxHHHHH', binascii.unhexelify(data))))`

if it is possible, how to do the conversion with CyberChef ?

regards, lacsaP.

Contributor guide

Open the contributing guide

Research direction

No implementation file or test is named. Start by locating CyberChef’s existing operations for binary parsing and date/time formatting, then compare their input and endianness conventions with the requested Windows SystemTime layout. Done means the 128-bit value can be converted to the requested date fields, with tests covering the supported interpretation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.