Describe the bug
This example has a case with no trailing continue or return, so the matcher fails
|
m.switchCase( |
|
m.stringLiteral(m.matcher((s) => /^\d+$/.test(s))), |
|
m.anyList( |
|
m.zeroOrMore(), |
|
m.or(m.continueStatement(), m.returnStatement()), |
|
), |
|
), |
Expected Behaviour
Not sure what the ideal fix is, but I replaced the m.anyList() with m.zeroOrMore() and it seems to work.
Code
function gl() {
var d = "0".split("|");
var e = 0;
while (true) {
switch (d[e++]) {
case "0":
if (true) {
return 123;
} else {
return 456;
}
}
break;
}
}
Logs
Describe the bug
This example has a
casewith no trailing continue or return, so the matcher failswebcrack/packages/webcrack/src/deobfuscate/control-flow-switch.ts
Lines 18 to 24 in 5dd3d93
Expected Behaviour
Not sure what the ideal fix is, but I replaced the
m.anyList()withm.zeroOrMore()and it seems to work.Code
Logs