mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Fix scripting flags handling for cp, mv, inject
This commit is contained in:
parent
c240f3463d
commit
fc5637e86a
@ -300,19 +300,19 @@ bool run_cmd(cmd_id id, u32 flags, char** argv, char* err_str) {
|
|||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "permission fail");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "permission fail");
|
||||||
} else if (id == CMD_ID_CP) {
|
} else if (id == CMD_ID_CP) {
|
||||||
u32 flags_ext = BUILD_PATH;
|
u32 flags_ext = BUILD_PATH;
|
||||||
if (flags && _FLG('h')) flags_ext |= CALC_SHA;
|
if (flags & _FLG('h')) flags_ext |= CALC_SHA;
|
||||||
if (flags && _FLG('n')) flags_ext |= NO_CANCEL;
|
if (flags & _FLG('n')) flags_ext |= NO_CANCEL; // actually use this!
|
||||||
if (flags && _FLG('s')) flags_ext |= SILENT;
|
if (flags & _FLG('s')) flags_ext |= SILENT;
|
||||||
if (flags && _FLG('w')) flags_ext |= OVERWRITE_ALL;
|
if (flags & _FLG('w')) flags_ext |= OVERWRITE_ALL;
|
||||||
else if (flags && _FLG('k')) flags_ext |= SKIP_ALL;
|
else if (flags & _FLG('k')) flags_ext |= SKIP_ALL;
|
||||||
ret = PathMoveCopy(argv[1], argv[0], &flags_ext, false);
|
ret = PathMoveCopy(argv[1], argv[0], &flags_ext, false);
|
||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "copy fail");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "copy fail");
|
||||||
} else if (id == CMD_ID_MV) {
|
} else if (id == CMD_ID_MV) {
|
||||||
u32 flags_ext = BUILD_PATH;
|
u32 flags_ext = BUILD_PATH;
|
||||||
if (flags && _FLG('n')) flags_ext |= NO_CANCEL;
|
if (flags & _FLG('n')) flags_ext |= NO_CANCEL;
|
||||||
if (flags && _FLG('s')) flags_ext |= SILENT;
|
if (flags & _FLG('s')) flags_ext |= SILENT;
|
||||||
if (flags && _FLG('w')) flags_ext |= OVERWRITE_ALL;
|
if (flags & _FLG('w')) flags_ext |= OVERWRITE_ALL;
|
||||||
else if (flags && _FLG('k')) flags_ext |= SKIP_ALL;
|
else if (flags & _FLG('k')) flags_ext |= SKIP_ALL;
|
||||||
ret = PathMoveCopy(argv[1], argv[0], &flags_ext, true);
|
ret = PathMoveCopy(argv[1], argv[0], &flags_ext, true);
|
||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "move fail");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "move fail");
|
||||||
} else if (id == CMD_ID_INJECT) {
|
} else if (id == CMD_ID_INJECT) {
|
||||||
@ -331,9 +331,11 @@ bool run_cmd(cmd_id id, u32 flags, char** argv, char* err_str) {
|
|||||||
ret = false;
|
ret = false;
|
||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "missing dest offset");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "missing dest offset");
|
||||||
} else {
|
} else {
|
||||||
|
u32 flags_ext = 0;
|
||||||
u64 at_dst = 0;
|
u64 at_dst = 0;
|
||||||
*(atstr_dst++) = '\0';
|
*(atstr_dst++) = '\0';
|
||||||
ret = ((sscanf(atstr_dst, "%llX", &at_dst) == 1) && FileInjectFile(argv[1], argv[0], at_dst, at_org, sz_org, NULL));
|
if (flags & _FLG('n')) flags_ext |= NO_CANCEL;
|
||||||
|
ret = ((sscanf(atstr_dst, "%llX", &at_dst) == 1) && FileInjectFile(argv[1], argv[0], at_dst, at_org, sz_org, &flags_ext));
|
||||||
if (err_str) snprintf(err_str, _ERR_STR_LEN, "inject fail");
|
if (err_str) snprintf(err_str, _ERR_STR_LEN, "inject fail");
|
||||||
}
|
}
|
||||||
} else if (id == CMD_ID_RM) {
|
} else if (id == CMD_ID_RM) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user