Skip to content

add shToElf handler#567

Merged
p2r3 merged 3 commits intop2r3:masterfrom
neko782:elf
Mar 25, 2026
Merged

add shToElf handler#567
p2r3 merged 3 commits intop2r3:masterfrom
neko782:elf

Conversation

@neko782
Copy link
Copy Markdown
Contributor

@neko782 neko782 commented Mar 20, 2026

a pretty crude method but works and im proud of it

@ConnorTippets
Copy link
Copy Markdown
Contributor

the xkcd reference is Krazy

@neko782
Copy link
Copy Markdown
Contributor Author

neko782 commented Mar 21, 2026

a number had to be chosen (with a very secure rng) :p

Comment on lines +8 to +9
// https://xkcd.com/221
int cmd_size = 1273991571;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there really no reason behind this number? Could this at least be a product of powers of two or something? Or really just some clean-ish number, or something chosen through some reason, rather than literally random?

I propose 1073741824 (or 1024^3), it's exactly 1 GiB and close to this value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there really no reason behind this number? Could this at least be a product of powers of two or something? Or really just some clean-ish number, or something chosen through some reason, rather than literally random?

the number is patched out by the js code with the real cmd size (important that its exact! we need to seek to the place in the binary where the shell script is located), i had to pick a number that i know wouldnt appear in the binary

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's... disgusting. Sure!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its super gross

@p2r3 p2r3 merged commit 6998584 into p2r3:master Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants