1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-22 20:06:43 +00:00

[script] Fix <= and >=

This commit is contained in:
suchmememanyskill 2021-01-10 23:19:51 +01:00
parent 5057bb2863
commit d27832effb
2 changed files with 20 additions and 3 deletions

View file

@ -343,6 +343,7 @@ scriptFunction(funcMkdir){
return varInt((f_mkdir(vars[0].stringType))); return varInt((f_mkdir(vars[0].stringType)));
} }
// Args: Str
scriptFunction(funcReadDir){ scriptFunction(funcReadDir){
int res = 0; int res = 0;
Vector_t files = ReadFolder(vars[0].stringType, &res); Vector_t files = ReadFolder(vars[0].stringType, &res);
@ -369,26 +370,32 @@ scriptFunction(funcReadDir){
return newVar(StringArrayType, 1, .vectorType = fileNames); return newVar(StringArrayType, 1, .vectorType = fileNames);
} }
// Args: Str, Str
scriptFunction(funcCopyDir){ scriptFunction(funcCopyDir){
return varInt((FolderCopy(vars[0].stringType, vars[1].stringType).err)); return varInt((FolderCopy(vars[0].stringType, vars[1].stringType).err));
} }
// Args: Str
scriptFunction(funcDelDir){ scriptFunction(funcDelDir){
return varInt((FolderDelete(vars[0].stringType).err)); return varInt((FolderDelete(vars[0].stringType).err));
} }
// Args: Str
scriptFunction(funcDelFile){ scriptFunction(funcDelFile){
return varInt((f_unlink(vars[0].stringType))); return varInt((f_unlink(vars[0].stringType)));
} }
// Args: Str, Str
scriptFunction(funcMmcDump){ scriptFunction(funcMmcDump){
return varInt((DumpOrWriteEmmcPart(vars[0].stringType, vars[1].stringType, 0, 1).err)); return varInt((DumpOrWriteEmmcPart(vars[0].stringType, vars[1].stringType, 0, 1).err));
} }
// Args: Str, Str, Int
scriptFunction(funcMmcRestore){ scriptFunction(funcMmcRestore){
return varInt((DumpOrWriteEmmcPart(vars[0].stringType, vars[1].stringType, 1, vars[2].integerType).err)); return varInt((DumpOrWriteEmmcPart(vars[0].stringType, vars[1].stringType, 1, vars[2].integerType).err));
} }
// Args: Str
scriptFunction(funcGetNcaType){ scriptFunction(funcGetNcaType){
if (!TConf.keysDumped) if (!TConf.keysDumped)
return ErrVar(ERRFATALFUNCFAIL); return ErrVar(ERRFATALFUNCFAIL);
@ -396,6 +403,7 @@ scriptFunction(funcGetNcaType){
return varInt((GetNcaType(vars[0].stringType))); return varInt((GetNcaType(vars[0].stringType)));
} }
// Args: Str
scriptFunction(funcSignSave){ scriptFunction(funcSignSave){
if (!TConf.keysDumped) if (!TConf.keysDumped)
return ErrVar(ERRFATALFUNCFAIL); return ErrVar(ERRFATALFUNCFAIL);
@ -409,6 +417,7 @@ scriptFunction(funcGetMs){
extern int launch_payload(char *path); extern int launch_payload(char *path);
// Args: Str
scriptFunction(funcLaunchPayload){ scriptFunction(funcLaunchPayload){
return varInt(launch_payload(vars[0].stringType)); return varInt(launch_payload(vars[0].stringType));
} }

View file

@ -251,16 +251,24 @@ Vector_t runLexer(const char* in, u32 len) {
vecAddElement(&vec, makeLexarToken(BitShiftRight, 0)); vecAddElement(&vec, makeLexarToken(BitShiftRight, 0));
in++; in++;
} }
else else {
int a = (in[1] == '=') ? 1 : 0;
vecAddElement(&vec, makeLexarToken(Bigger, 0)); vecAddElement(&vec, makeLexarToken(Bigger, 0));
in += a;
}
} }
ELIFC('<'){ ELIFC('<'){
if (in[1] == '<'){ if (in[1] == '<'){
vecAddElement(&vec, makeLexarToken(BitShiftLeft, 0)); vecAddElement(&vec, makeLexarToken(BitShiftLeft, 0));
in++; in++;
} }
else else {
vecAddElement(&vec, makeLexarToken(Smaller, 0)); int a = (in[1] == '=') ? 1 : 0;
vecAddElement(&vec, makeLexarToken(Smaller + a, 0));
in += a;
}
} }
else { else {
int val = 0; int val = 0;