mirror of
https://github.com/JonathanSalwan/ROPgadget
synced 2026-06-08 11:25:23 +00:00
update and and xfunc
This commit is contained in:
+5
-19
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user