Skip to content

Commit 4b36f25

Browse files
Azi Hassanazihassan
authored andcommitted
[main] Update challenge name parsing to support special characters in accordance with player 3062cec8
1 parent 22a2cef commit 4b36f25

File tree

2 files changed

+8549
-0
lines changed

2 files changed

+8549
-0
lines changed

source/parsers.d

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ struct ThrottlingAlgorithm
695695
//$EK=function(p){var y=p[G[59]](G[11]),...return y[G[54]](G[11])};
696696
ctRegex!(`(.{3})=function\(\w+\)\{var \w+=\w\[.+\]\(.+\),(.|\s)+?return .+\(.+\)\};`),
697697
ctRegex!(`var \w{3}=\[(\w{3})\]`),
698+
ctRegex!(`var .{3}=\[(.{3})\]`),
698699
];
699700
foreach(regex; regexes)
700701
{
@@ -913,3 +914,16 @@ unittest
913914

914915
assert(expected == actual, expected ~ " != " ~ actual);
915916
}
917+
918+
unittest
919+
{
920+
writeln("Should parse challenge in base.js 3062cec8.js".formatTitle());
921+
scope(success) writeln("OK\n".formatSuccess());
922+
auto algorithm = ThrottlingAlgorithm("tests/3062cec8.js".readText(), new StdoutLogger());
923+
assert(algorithm.findChallengeName() == "EuO", algorithm.findChallengeName() ~ " != EuO");
924+
925+
string expected = "aXtqvScqyMQNhg";
926+
string actual = algorithm.solve("POgLT81CGkQw4dNl");
927+
928+
assert(expected == actual, expected ~ " != " ~ actual);
929+
}

0 commit comments

Comments
 (0)