| 
 | 
 
 
发表于 2014-8-23 15:13:07
|
显示全部楼层
 
 
 
- #include <stdio.h>
 
  
- int main( void )
 
 - {
 
 -    int      i,
 
 -             result;
 
 -    float    fp;
 
 -    char     c,
 
 -             s[81];
 
 -    wchar_t  wc,
 
 -             ws[81];
 
  
-    result = scanf_s( "%d %f %c %C %s %S", &i, &fp, &c, 1,
 
 -                      &wc, 1, s, 80, ws, 80 );
 
 -    printf( "The number of fields input is %d\n", result );
 
 -    printf( "The contents are: %d %f %c %C %s %S\n", i, fp, c,
 
 -            wc, s, ws);
 
 -    result = wscanf_s( L"%d %f %hc %lc %S %ls", &i, &fp, &c, 2,
 
 -                       &wc, 1, s, 80, ws, 80 );
 
 -    wprintf( L"The number of fields input is %d\n", result );
 
 -    wprintf( L"The contents are: %d %f %C %c %hs %s\n", i, fp,
 
 -             c, wc, s, ws);
 
 - }
 
  复制代码 
 
这是我之前给你那个网址上的程序,你把它看懂就学会scanf_s了,那个大小值buffer size不是靠背的或是猜的。。。至于完全,你有兴趣的话可以去看一看溢出方面的书,自己写一个shellcode |   
 
 
 
 |