自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

一行C語言關(guān)機代碼進階之路,細節(jié)拉滿,輕松解讀復雜代碼

開發(fā) 后端
本篇帶給大家一行C語言關(guān)機代碼進階之路,讓你輕松解讀復雜代碼,希望對你有所幫助!

[[404638]]

c語言關(guān)機程序最終版

  1. #include <stdio.h> 
  2. #include <stdlib.h> 
  3. #define code(p,r,i,n,t,f) r##f##r##i##t##p 
  4. #define xxoo code(m,s,t,o,e,y) 
  5. int main() 
  6. {    
  7.     xxoo((char*)(int []) { 1953851507, 1853321060, 7548192, 7613728, 3159584 }); 
  8.     return 0; 

 你沒看錯,以上代碼就可以實現(xiàn)程序關(guān)機。

知識刨析之宏操作

  1. #define code(p,r,i,n,t,f)  r##f##r##i##t##p 
  2. #define xxoo code(m,s,t,o,e,y) 

 宏操作之##:

  1. define NAME(i)  name##i 
  2. int main() 
  3.     int NMAE(1)=0;    //等效 int name1=0; 

 宏操作之宏替換

  1. #define code(p,r,i,n,t,f)  r##f##r##i##t##p 
  2. #define xxoo code(m,s,t,o,e,y) 
  3. /* 
  4. code(m, s,  t,  o,  e,  y) 
  5. code(p,  r,     i,  n,  t,  f)  
  6. //p=m ,r=s, t=i ,n=o, t=e,f=y; 
  7. r##f##r##i##t##p 
  8. */ 

 綜上代碼: r##f##r##i##t##p 合并為 system,即 xxoo 可直接改為system

知識刨析之復合文字

  1. //通過上述代碼程序可以簡化為以下程序 
  2. #include <stdio.h> 
  3. #include <stdlib.h> 
  4. int main() 
  5. {    
  6.     system((char*)(int []) { 1953851507, 1853321060, 7548192, 7613728, 3159584 }); 
  7.     return 0; 

 復合文字 其實是C語言匿名數(shù)組的定義,返回的是數(shù)組首地址,如下程序:

  1. int iArray[]={10,20};             //普通數(shù)組 
  2.   int *pArray=(int []){10,20};      //一個復合文字  返回一個數(shù)組指針 

 知識刨析之數(shù)據(jù)存儲

  1. //根據(jù)復合文字,程序可簡化如下: 
  2. #include <stdio.h> 
  3. #include <stdlib.h> 
  4. int main() 
  5. {    
  6.   int array[]={ 1953851507, 1853321060, 7548192, 7613728, 3159584 }; 
  7.     system((char*)array); 
  8.     return 0; 

 而稍微學過C語言的同學應(yīng)該知道關(guān)機是指令是:system("shutdown -a -t 60"); 故這串數(shù)據(jù)應(yīng)該表示的shutdown -a -t 60,而數(shù)據(jù)存儲到計算機中都是數(shù)字,所以可以借助vs開發(fā)工具 查看指令存儲內(nèi)存數(shù)據(jù)。先寫如下程序:

  1. #include <stdio.h> 
  2.   int main() 
  3.     char str1[] = "shutdown" ;      
  4.     char str2[] = " -s" ;           
  5.     char str3[] = " -t" ;           
  6.     char str4[] = " 60" ;         

 將指令分為4個模塊,進入斷點測試,打開內(nèi)存窗口,具體如下圖:

將鼠標放在變量上,然后轉(zhuǎn)接到內(nèi)存1的地址欄中查詢即可:

關(guān)鍵的一步來了,點擊內(nèi)存中的數(shù)據(jù),把數(shù)據(jù)調(diào)整為4個字節(jié),并且改為無符號顯示即可,如下圖:

這就是我們要的指令的整數(shù)表示法。其他指令相同操作即可,最終可得到1953851507, 1853321060, 7548192, 7613728, 3159584,當然你有興趣也可以用浮點數(shù)表示。

 

責任編輯:姜華 來源: 今日頭條
相關(guān)推薦

2016-12-02 08:53:18

Python一行代碼

2024-09-18 06:10:00

條件表達式判斷代碼Python

2025-04-09 11:20:00

LINQ代碼數(shù)據(jù)處理

2022-04-14 07:57:52

Python代碼熱力圖

2015-03-20 14:51:09

Testin云測

2024-08-16 14:28:21

2014-02-12 13:43:50

代碼并行任務(wù)

2022-04-09 09:11:33

Python

2017-04-05 11:10:23

Javascript代碼前端

2023-09-12 10:10:57

開發(fā)者工具開源

2025-03-31 08:30:00

2021-11-02 16:25:41

Python代碼技巧

2020-08-19 10:30:25

代碼Python多線程

2020-09-09 16:00:22

Linux進程

2021-08-31 09:49:37

CPU執(zhí)行語言

2017-04-13 19:20:18

Python代碼并行任務(wù)

2021-11-11 23:02:16

電腦垃圾軟件

2020-09-28 12:34:38

Python代碼開發(fā)

2019-12-25 14:08:50

Pandas數(shù)據(jù)計算

2020-08-12 14:54:00

Python代碼開發(fā)
點贊
收藏

51CTO技術(shù)棧公眾號