10 int main(int argc, char *argv[], char **envp)
16 int (*appMain)(int, char *[], char **);
19 int syscall_handle = -1;
21 for( i = 1; i < argc; i ++ )
23 if(strcmp(argv[i], "--key") == 0) {
24 syscall_handle = atoi(argv[++i]);
28 if(strcmp(argv[i], "--binary") == 0) {
33 if(strcmp(argv[i], "--open") == 0) {
34 if( acess_open(argv[++i], 6) == -1 ) { // Read/Write
35 fprintf(stderr, "Unable to open '%s'\n", argv[i]);
41 if( argv[i][0] != '-' ) break;
45 fprintf(stderr, "Usage: ld-acess <executable> [arguments ...]\n");
55 printf("Exectutable Path: '%s'\n", appPath);
56 printf("Executable argc = %i\n", appArgc);
58 base = Binary_Load(appPath, (uintptr_t*)&appMain);
59 printf("base = %p\n", base);
60 if( !base ) return 127;
62 printf("==============================\n");
63 for(i = 0; i < appArgc; i ++)
64 printf("\"%s\" ", appArgv[i]);
66 __asm__ __volatile__ (
71 : : "r" (envp), "r" (appArgv), "r" (appArgc), "r" (appMain) );
75 void Warning(const char *Format, ...)
79 va_start(args, Format);
80 vprintf(Format, args);
85 void Notice(const char *Format, ...)
89 va_start(args, Format);
90 vprintf(Format, args);