summaryrefslogtreecommitdiff
path: root/Userland/sh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/sh.cpp')
-rw-r--r--Userland/sh.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Userland/sh.cpp b/Userland/sh.cpp
index 8df8ae9c58..1ec61c2ed4 100644
--- a/Userland/sh.cpp
+++ b/Userland/sh.cpp
@@ -65,6 +65,18 @@ static int sh_fef(int, const char**)
return 0;
}
+static int sh_wt(int, const char**)
+{
+ const char* rodata_ptr = "foo";
+ printf("Writing to rodata=%p...\n", rodata_ptr);
+ *(char*)rodata_ptr = 0;
+
+ char* text_ptr = (char*)sh_fef;
+ printf("Writing to text=%p...\n", text_ptr);
+ *text_ptr = 0;
+ return 0;
+}
+
static int sh_exit(int, const char**)
{
printf("Good-bye!\n");
@@ -135,6 +147,10 @@ static bool handle_builtin(int argc, const char** argv, int& retval)
retval = sh_fef(argc, argv);
return true;
}
+ if (!strcmp(argv[0], "wt")) {
+ retval = sh_wt(argc, argv);
+ return true;
+ }
if (!strcmp(argv[0], "fork")) {
retval = sh_fork(argc, argv);
return true;