Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a sandbox / fprintf crash

  • Loading branch information...
commit 675accfe3568f235c75295be7a891b40823d2ac9 1 parent 872b63b
Geoff Norton authored committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 food/food.c
View
17 food/food.c
@@ -103,7 +103,24 @@ void *stubify(void *addy, const char *id, bool needs_mprotect) {
return ret;
}
+/*
+ * Flash appears to try to fprintf to some FILE* handle in the sandbox
+ * which dies in flockfile, but I havn't been able to track down exactly
+ * where yet, and extending the sandbox doesn't seem to fix it? wtf.
+ * Lets do this lameness for now so youtube doesn't crash and muchmusic works
+ */
+int hook_fprintf(FILE *stream, const char *format, ...) {
+ fprintf(stderr, "DEBUG_HOOK: ");
+ va_list v;
+ va_start(v, format);
+ vfprintf(stderr, format, v);
+ va_end(v);
+
+ return 0;
+}
+
static void *getsym(char *id) {
+ if(!strcmp(id, "fprintf")) id = "hook_fprintf";
if(!strcmp(id, "__errno")) id = "__error";
if(!strcmp(id, "mmap")) id = "rmmap";
if(!strcmp(id, "mprotect")) id = "rmprotect";

0 comments on commit 675accf

Please sign in to comment.
Something went wrong with that request. Please try again.