ixty / mandibule

linux elf injector for x86 x86_64 arm arm64
317 stars 70 forks source link

fake stack argv ptr incorrect #4

Open Hackerl opened 4 years ago

Hackerl commented 4 years ago
    FSTACK_PUSH_LONG(sp, 0);
    for(int i=0; i<ac; i++)
        FSTACK_PUSH_LONG(sp, (unsigned long)av_0 + (ac - i - 1) * sizeof(unsigned long));
    // argc
    FSTACK_PUSH_LONG(sp, ac);

"(unsigned long)av_0 + (ac - i - 1) * sizeof(unsigned long)" not the correct string pointer, each parameter has a different length. The correct pointer should be temporarily saved after the parameter is pushed onto the stack. commit: https://github.com/Hackerl/mandibule/commit/0ba0a46f4443b3307d037aa34bc402d6eb756515