mirror of
https://github.com/PoetryInCode/1337cc.git
synced 2026-08-13 11:24:40 -04:00
Almost complete?
This commit is contained in:
parent
32c728fb91
commit
5327fbce63
26
1337cc.pl
26
1337cc.pl
@ -12,13 +12,13 @@ while (<>) {
|
|||||||
s/\|</k/g;
|
s/\|</k/g;
|
||||||
s/vv/w/g;
|
s/vv/w/g;
|
||||||
|
|
||||||
# Step 3: Perform substitutions on the rest of the line
|
# Find and mark an octal
|
||||||
s/0/o/g;
|
s/\b0([0-7]+)\b/__OCT[$1]OCT__/g;
|
||||||
s/5/s/g;
|
|
||||||
s/7/t/g;
|
# Convert it to binary
|
||||||
s/4/a/g;
|
s/__OCT\[(.*)\]OCT__/"__BIN[" . sprintf("%b", oct($1)) . "]BIN__"/eg;
|
||||||
s/v/u/g;
|
|
||||||
s/3/e/g;
|
tr/0574v3/ostaue/;
|
||||||
|
|
||||||
# We guess wether its an "i" or an "l" based on common english patterns
|
# We guess wether its an "i" or an "l" based on common english patterns
|
||||||
if (/\b1($cons)/) {
|
if (/\b1($cons)/) {
|
||||||
@ -33,8 +33,16 @@ while (<>) {
|
|||||||
s/1/l/;
|
s/1/l/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (/__BIN\[(.*?)\]BIN__/) {
|
||||||
|
tr/li/1/;
|
||||||
|
tr/o/0/;
|
||||||
|
}
|
||||||
|
|
||||||
|
s/__BIN\[([01]+)\]BIN__/0b$1/g;
|
||||||
|
|
||||||
s/1/i/g;
|
s/1/i/g;
|
||||||
|
|
||||||
# Print the modified line
|
open my $cmd, "|-", "gcc -E -" or die "Failed: $!";
|
||||||
print $_;
|
print $cmd $_;
|
||||||
|
close $cmd;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user