File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed
Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ apt install -y gdbserver strace
3232 -s halt at entry point
3333 -v show debug information
3434 -n disable address space randomization
35+ -u do not limit memory
3536 ```
3637
37384. Use ` gdbpwn.py` to connect to the target IP.
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ int arg_opt_m = 0;
1212int arg_opt_s = 0 ;
1313int arg_opt_v = 0 ;
1414int arg_opt_n = 0 ;
15+ int arg_opt_u = 0 ;
1516
1617char * * arg_execve_argv = NULL ;
1718char * arg_popen = NULL ;
@@ -62,14 +63,15 @@ int help()
6263 " -s halt at entry point\n"
6364 " -v show debug information\n"
6465 " -n disable address space randomization\n"
66+ " -u do not limit memory\n"
6567 );
6668 exit (EXIT_FAILURE );
6769}
6870
6971int parsing_argv (int argc , char * argv [])
7072{
7173 int opt ;
72- while ((opt = getopt (argc , argv , "e:p:o:hmsvn " )) != -1 ) {
74+ while ((opt = getopt (argc , argv , "e:p:o:hmsvnu " )) != -1 ) {
7375 switch (opt ) {
7476 case 'e' :
7577 arg_opt_e = 1 ;
@@ -97,6 +99,9 @@ int parsing_argv(int argc, char *argv[])
9799 case 'n' :
98100 arg_opt_n = 1 ;
99101 break ;
102+ case 'u' :
103+ arg_opt_u = 1 ;
104+ break ;
100105 default : /* '?' */
101106 help ();
102107 break ;
Original file line number Diff line number Diff line change 55#define COMMAND_PORT 9545
66#define GDBSERVER_PORT 9549
77
8- #define VERSION "1.3.1 "
8+ #define VERSION "1.3.2 "
99
1010#define COMMAND_GDB_REGISTER 0x01
1111#define COMMAND_GDBSERVER_ATTACH 0x02
@@ -54,6 +54,7 @@ extern int arg_opt_m;
5454extern int arg_opt_s ;
5555extern int arg_opt_v ;
5656extern int arg_opt_n ;
57+ extern int arg_opt_u ;
5758extern char * * arg_execve_argv ;
5859extern char * arg_popen ;
5960extern int arg_pid ;
Original file line number Diff line number Diff line change @@ -131,9 +131,12 @@ int start_service(int client_sock)
131131 }
132132 else if (service_pid == 0 )
133133 {
134- limit .rlim_cur = 0x100000000 ;
135- limit .rlim_max = 0x100000000 ;
136- CHECK (setrlimit (RLIMIT_AS , & limit ) != -1 );
134+ if (arg_opt_u == 0 )
135+ {
136+ limit .rlim_cur = 0x100000000 ;
137+ limit .rlim_max = 0x100000000 ;
138+ CHECK (setrlimit (RLIMIT_AS , & limit ) != -1 );
139+ }
137140
138141 CHECK (sigprocmask (SIG_SETMASK , & old_mask , NULL ) != -1 );
139142
You can’t perform that action at this time.
0 commit comments