学Shellcode 的练习代码

 #include <stdio.h>
/*
void test()
{
 // sub esp, 44h
 int b;
 int *k=&b;
 k+=22;
 (*k) = 88;
 printf("aaaaaaaaaaaaa %d k = %#0x/n", (*k), k);
/* __asm
 {
  mov DWORD PTR [ebp-4], 'a'
  mov DWORD PTR [ebp+54h], 'a'
 }*/
/* printf("The address of b in test is %#0x/n", &b);
}
void taa()
{
 int *k;
 int *j;
 int *i;
 k = (int*)malloc(sizeof(int));
 j = (int*)malloc(sizeof(int));
 i = (int*)malloc(sizeof(int));
 printf("The address of k in taa is %#0x/n", k);
 printf("The address of j in taa is %#0x/n", j);
 printf("The address of i in taa is %#0x/n", i);
}*/
void ccc(char *a)
{
 char ta[4];
 strcpy(ta, a);
}
void main()
{
 // 12ff7c
/* char c=10;
 printf("The address of main is %#0x/n", main);
 printf("The address of test is %#0x/n", test);
 taa();
 // 12ff24
 test();
*/
 ccc("/x77/x77/x77/x77/x40/x10/x40/x00");
// printf("The address of c in main is %#0x/n", &c);
// printf("The value of c in main is %d/n", c);
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值