diff target-utils/tf-breakin/mkembed.c @ 983:7166c8311b0d

tfc139 reworked to support both ARM and Thumb entry
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 10 Dec 2015 08:07:47 +0000
parents 22c6e39e1789
children
line wrap: on
line diff
--- a/target-utils/tf-breakin/mkembed.c	Thu Dec 10 05:35:42 2015 +0000
+++ b/target-utils/tf-breakin/mkembed.c	Thu Dec 10 08:07:47 2015 +0000
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#define	PAYLOAD_SIZE	112
+#define	PAYLOAD_SIZE	116
 u_char payload_buf[PAYLOAD_SIZE];
 
 read_binary(filename)
@@ -46,15 +46,17 @@
 		perror(filename);
 		exit(1);
 	}
-	fprintf(of, "u_char payload[%d] = {\n", PAYLOAD_SIZE);
+	fprintf(of, "u_char shellcode[%d] = {\n", PAYLOAD_SIZE);
 	idx = 0;
-	for (i = 0; i < 14; i++) {
+	for (i = 0; i < 15; i++) {
 		for (j = 0; j < 8; j++) {
 			if (j)
 				putc(' ', of);
 			else
 				putc('\t', of);
 			fprintf(of, "0x%02X,", payload_buf[idx++]);
+			if (idx >= PAYLOAD_SIZE)
+				break;
 		}
 		putc('\n', of);
 	}