update and and xfunc

This commit is contained in:
Jonathan Salwan
2011-10-20 13:43:39 +02:00
parent d01c458993
commit f97eb0f127
16 changed files with 123 additions and 71 deletions
+5 -19
View File
@@ -37,9 +37,7 @@ t_makecode *add_element(t_makecode *old_element, char *instruction, Elf32_Addr a
{
t_makecode *new_element;
new_element = malloc(sizeof(t_makecode));
if (new_element == NULL)
exit(EXIT_FAILURE);
new_element = xmalloc(sizeof(t_makecode));
new_element->addr = addr;
new_element->instruction = instruction;
new_element->next = old_element;
@@ -100,13 +98,7 @@ static char *get_first_reg(char *gadget)
{
char *p;
p = malloc(4 * sizeof(char));
if (!p)
{
fprintf(stderr, "Error malloc\n");
exit(EXIT_FAILURE);
}
p = xmalloc(4 * sizeof(char));
while (*gadget != '(' && *gadget != '\0')
gadget++;
@@ -120,13 +112,7 @@ static char *get_second_reg(char *gadget)
{
char *p;
p = malloc(4 * sizeof(char));
if (!p)
{
fprintf(stderr, "Error malloc\n");
exit(EXIT_FAILURE);
}
p = xmalloc(4 * sizeof(char));
while (*gadget != '(' && *gadget != '\0')
gadget++;
@@ -218,7 +204,7 @@ static void makepartie1_local(t_makecode *list_ins)
xor_gadget = get_gadget_since_addr(addr_xor_gadget);
fprintf(stdout, "\t%sPayload%s\n", YELLOW, ENDC);
fprintf(stdout, "\t\t%s# execve /bin/sh generated by RopGadget v3.2%s\n", BLUE, ENDC);
fprintf(stdout, "\t\t%s# execve /bin/sh generated by RopGadget v3.3%s\n", BLUE, ENDC);
/*****************\/bin*********************/
fprintf(stdout, "\t\t%sp += pack(\"<I\", 0x%.8x) # %s%s\n", BLUE, addr_pop_stack_gadget, pop_stack_gadget, ENDC);
@@ -298,7 +284,7 @@ static void makepartie1_remote(t_makecode *list_ins)
xor_gadget = get_gadget_since_addr(addr_xor_gadget);
fprintf(stdout, "\t%sPayload%s\n", YELLOW, ENDC);
fprintf(stdout, "\t\t%s# execve /bin/sh bindport %s generated by RopGadget v3.2%s\n", BLUE, bind_mode.port, ENDC);
fprintf(stdout, "\t\t%s# execve /bin/sh bindport %s generated by RopGadget v3.3%s\n", BLUE, bind_mode.port, ENDC);
/*****************\//us*********************/
fprintf(stdout, "\t\t%sp += pack(\"<I\", 0x%.8x) # %s%s\n", BLUE, addr_pop_stack_gadget, pop_stack_gadget, ENDC);