-1
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
// Make some stack information
char a[100], b[100], c[100], d[100];
// Call the exploitable function
exploitable(argv[1]);
// Return everything is OK
return(0);
}
int exploitable(char *arg)
{
// Make some stack space
char buffer[10];
// Now copy the buffer
strcpy(buffer, arg);
printf("The buffer says .. [%s/%p].\n", buffer, &buffer);
// Return everything fun
return(0);
}
私は大きな値で悪用可能なものを呼び出す必要があります。また、メインプログラムで正常に戻るはずです。どんな推測も感謝です。Cプログラムのバッファオーバーフローと成功の実行方法
現在、アドレス空間のランダム化の存在を考えると、これはほとんど不可能です。スタックフレームのアドレスを推測するために複数回実行することができない限り。 –
あなたは何を達成しようとしていますか?スタック内のメモリを上書きするには? –