[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

控制台赋值工具seti.exe

本帖最后由 happy886rr 于 2016-12-1 11:26 编辑

下载图片存为a.zip解压即是,图为外链,过期失效不再补贴。
备注:图片解压只支持WinRAR软件。

SETI.EXE

摘要:
=============================================================================
强悍的控制台赋值工具,集set之所无、conset之未有。交互简洁,无需开关,标签赋值,展变量艺术。
=============================================================================

用法:
>----------------------------------------------------------------------------
seti [变量名]=(赋值标签)[赋值表达式]
-----------------------------------------------------------------------------
seti a=(ascii)1          &REM 将ascii码1对应的符号赋值给变量a
seti a=(calc)sin(deg30)  &REM 将30°的正弦值赋值给变量a
seti stdout=(color)13    &REM 将颜色值13赋值给控制台输出stdout,即改变输出颜色
seti a=(line3)1.txt      &REM 将1.txt的第三行赋值给变量a
seti a=(crc32)password   &REM 将password的crc32散列值赋值给变量a
seti a=(md5)password     &REM 将password的md5散列值赋值给变量a
seti a=(sha1)password    &REM 将password的sha1散列值赋值给变量a
seti a=(sha256)password  &REM 将password的sha256散列值赋值给变量a
-----------------------------------------------------------------------------

英译:
>----------------------------------------------------------------------------
THE VARIABLE SETTINGS TOOL, COPYRIGHT@2016~2018 BY HAPPY, VERSION 1.0
-----------------------------------------------------------------------------
seti [var]=(label)[value]
-----------------------------------------------------------------------------
     (ascii) :Assigns an ascii value to the var
     (calc)  :Calculates the value of an expression and assigns it to the var
     (color) :Sets the console font color
     (line)  :Assigns a file binary stream to the var
     (crc32) :Calculates crc32 value of the string and assigns it to the var
     (md5)   :Calculates md5 value of the string and assigns it to the var
     (sha1)  :Calculates sha1 value of the string and assigns it to the var
     (sha256):Calculates sha256 value of the string and assigns it to the var
-----------------------------------------------------------------------------

COLOR标签颜色列表:
>----------------------------------------------------------------------------
FOREGROUND_BLUE                字体颜色:蓝          1
FOREGROUND_GREEN        字体颜色:绿          2
FOREGROUND_RED                字体颜色:红          4
FOREGROUND_INTENSITY        前景颜色:高亮    8
BACKGROUND_BLUE                背景颜色:蓝         16
BACKGROUND_GREEN        背景颜色:绿         32
BACKGROUND_RED                背景颜色:红     64
BACKGROUND_INTENSITY        背景色高亮显示        128
set /a V=1|2|8|32       &REM 叠加颜色值
seti STDOUT=(color)%V%  &REM 赋值颜色值
-----------------------------------------------------------------------------


支持的数学函数列表:
>----------------------------------------------------------------------------
常数类
        pi    3.141592653589
        e     2.718281828489
-----------------------------------------------------------------------------
通用类
        round 四舍五入
        floor 整取
        ceil  向上舍入
        deg   角度转弧度
        sqrt  开方
        fac   阶乘
        lg    常用对数,以10为底
        ln    自然对数
        //    整除
        %     取余数
        ^     次方
-----------------------------------------------------------------------------
三角函数类
        sin、cos、tan   
        arcsin、arccos、arctan
-----------------------------------------------------------------------------
双曲函数类
        sinh、cosh、tanh
        arcsinh、arccosh、arctanh
-----------------------------------------------------------------------------

ASCII码表:
>----------------------------------------------------------------------------
十进制  16进制  描述
-----------------------------------------------------------------------------
0       00      null
1       01      start of header
2       02      start of text
3       03      end of text
4       04      end of transmission
5       05      enquiry
6       06      acknowledge
7       07      bell
8       08      backspace
9       09      horizontal tab
10      0A      line feed
11      0B      vertical tab
12      0C      form feed
13      0D      carriage return
14      0E      shift out
15      0F      shift in
16      10      data link escape
17      11      no assignment,usually XON
18      12      
19      13      no assignment,usually XOFF
20      14      
21      15      negative acknowledge
22      16      synchronous idle
23      17      end of transmission block
24      18      cancel
25      19      end of medium
26      1A      substitute
27      1B      escape
28      1C      file seperator
29      1D      group seperator
30      1E      record seperator
31      1F      unit seperator
32      20      space
33      21      !
34      22      "
35      23      #
36      24      $
37      25      %
38      26      &
39      27      '
40      28      (
41      29      )
42      2A      *
43      2B      +
44      2C      ,
45      2D      -
46      2E      .
47      2F      /
48      30      0
49      31      1
50      32      2
51      33      3
52      34      4
53      35      5
54      36      6
55      37      7
56      38      8
57      39      9
58      3A      :
59      3B      ;
60      3C      <
61      3D      =
62      3E      >
63      3F      ?
64      40      @
65      41      A
66      42      B
67      43      C
68      44      D
69      45      E
70      46      F
71      47      G
72      48      H
73      49      I
74      4A      J
75      4B      K
76      4C      L
77      4D      M
78      4E      N
79      4F      O
80      50      P
81      51      Q
82      52      R
83      53      S
84      54      T
85      55      U
86      56      V
87      57      W
88      58      X
89      59      Y
90      5A      Z
91      5B      [
92      5C      \
93      5D      ]
94      5E      ^
95      5F      _
96      60      `
97      61      a
98      62      b
99      63      c
100     64      d
101     65      e
102     66      f
103     67      g
104     68      h
105     69      i
106     6A      j
107     6B      k
108     6C      l
109     6D      m
110     6E      n
111     6F      o
112     70      p
113     71      q
114     72      r
115     73      s
116     74      t
117     75      u
118     76      v
119     77      w
120     78      x
121     79      y
122     7A      z
123     7B      {
124     7C      |
125     7D      }
126     7E      ~
127     7F      delete
-----------------------------------------------------------------------------
                                                             12/01/2016

核心源码:
部分代码参考众多网页、博客以及外文网站、以及无法确认原始出处,参考部分版权均归原作者所有,其余版权归本人所有。
  1. /*
  2. THE VARIABLE SETTINGS TOOL, VERSION 1.0
  3. SETI.EXE
  4. COPYRIGHT@2016~2018 BY HAPPY
  5. */
  6. #include <stdio.h>
  7. #include <windows.h>
  8. #include <ctype.h>
  9. #include <math.h>
  10. #include <tchar.h>
  11. #include <tlhelp32.h>
  12. //变量表尺寸
  13. #define VAR_NAME_SIZE 1024
  14. #define VAR_VALU_SIZE 4096
  15. //可解释标签数量                        
  16. #define LABEL_NUM 8
  17. //添加标签小写定义,解释时不区分大小写。
  18. static const char* LABEL_WORDS[]={"(ascii)", "(calc)", "(color)", "(line", "(crc32)", "(md5)", "(sha1)", "(sha256)"};
  19. //SetEnvironmentVariable函数
  20. typedef BOOL (WINAPI *PFN_SetEnvironmentVariable)(LPCTSTR, LPCTSTR);
  21. //存储结构体
  22. typedef struct{
  23. DWORD funPTR;
  24. char NAME[VAR_NAME_SIZE];
  25. char VALU[VAR_VALU_SIZE];
  26. }VAR_TABLE;
  27. /*************辅助函数群*************/
  28. //帮助信息
  29. void HelpInfomation(int ExitCode)
  30. {
  31. fputs(
  32. "VARIABLE SETTINGS TOOL, COPYRIGHT@2016~2018 BY HAPPY, VERSION 1.0\n"
  33. "-----------------------------------------------------------------------------\n"
  34. "seti [var]=(label)[value]\n"
  35. "-----------------------------------------------------------------------------\n"
  36. "     (ascii)   Assigns an ascii value to the variable\n"
  37. "     (calc)    Calculates the string's value and assigns it to the variable\n"
  38. "     (color)   Sets the console stdout color\n"
  39. "     (line[N]) Assigns a file's Nth line to the variable\n"
  40. "     (crc32)   Assigns string's crc32 value to the variable\n"
  41. "     (md5)     Assigns string's md5 value to the variable\n"
  42. "     (sha1)    Assigns string's sha1 value to the variable\n"
  43. "     (sha256)  Assigns string's sha256 value to the variable\n"
  44. "-----------------------------------------------------------------------------\n"
  45. "12/01/2016\n"
  46. ,stdout
  47. );
  48. exit(ExitCode);
  49. }
  50. //关键词解析函数
  51. int Identify_KeyWords(const char* Line)
  52. {
  53. int i, L, SN;
  54. for(SN=0; SN<LABEL_NUM; SN++){
  55. L=strlen(LABEL_WORDS[SN]);
  56. for(i=0; i < L; i++){
  57. if(
  58. Line[i]   !=LABEL_WORDS[SN][i] &&
  59. Line[i]+32!=LABEL_WORDS[SN][i]
  60. ){break;}
  61. }
  62. if(i==L){return SN;}
  63. }
  64. return 255;
  65. }
  66. //字体颜色: 1,2,4,8前景;16,32,64,128后景;
  67. int FontColor(unsigned short A)
  68. {
  69. HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE);
  70. CONSOLE_SCREEN_BUFFER_INFO csbi;
  71. GetConsoleScreenBufferInfo(handle_out, &csbi);
  72. SetConsoleTextAttribute(handle_out, A);
  73. return 0;
  74. }
  75. //读文件流
  76. char* FileStream(char* file, int lineNUM)
  77. {
  78. FILE* fp;
  79. if( (fp=fopen(file, "rb"))==NULL ){
  80. fputs("Read file error.", stdout);
  81. exit(1);
  82. }
  83. int i=0;
  84. char* L=(char*)calloc(1025, sizeof(char));
  85. while(!feof(fp)){
  86. memset(L, 0,  1024*sizeof(char));
  87. fgets(L, 1024, fp);
  88. i++;
  89. if(i==lineNUM){break;}
  90. }
  91. fclose(fp);
  92. return L;
  93. }
  94. //子串替换
  95. char *tmp_ExpressionA;
  96. void Strrpl(char* str,char* x, char* y){
  97. char *n=NULL;
  98. tmp_ExpressionA=(char*)calloc(4096, sizeof(char));
  99. int i=0;
  100. while((n =strstr(str,x)) !=0){
  101. if(n-str !=0){
  102. memcpy(&tmp_ExpressionA[i], str, n-str);
  103. }
  104. memcpy(&tmp_ExpressionA[i+n-str], y, strlen(y));
  105. i+=n-str+strlen(y);
  106. strcpy(str, n+strlen(x));
  107. }
  108. strcat(tmp_ExpressionA, str);
  109. strcpy(str, tmp_ExpressionA);
  110. }
  111. //表达式计算
  112. #include "Lib\DataCalc\calcuexp.c"
  113. char* CalculateExpression(char* str)
  114. {
  115. Strrpl(str,"pi","3.141592653589");
  116. Strrpl(str,"arcsinh","*A");
  117. Strrpl(str,"arccosh","*B");
  118. Strrpl(str,"arctanh","*C");
  119. Strrpl(str,"arcsin","*D");
  120. Strrpl(str,"arccos","*E");
  121. Strrpl(str,"arctan","*F");
  122. Strrpl(str,"round","*G");
  123. Strrpl(str,"floor","*H");
  124. Strrpl(str,"ceil","*I");
  125. Strrpl(str,"sqrt","*J");
  126. Strrpl(str,"deg","*K");
  127. Strrpl(str,"sinh","*L");
  128. Strrpl(str,"cosh","*M");
  129. Strrpl(str,"tanh","*N");
  130. Strrpl(str,"lg","*O");
  131. Strrpl(str,"ln","*P");
  132. Strrpl(str,"sin","*Q");
  133. Strrpl(str,"cos","*R");
  134. Strrpl(str,"tan","*S");
  135. Strrpl(str,"//","T");
  136. Strrpl(str,"fac","Z");
  137. Strrpl(str,"e","2.718281828489");
  138. double ans;
  139. const char *cur_pos = str;
  140. char *result=(char*)calloc(64, sizeof(char));
  141. status_t ret = do_calculate(&cur_pos, &ans);
  142. if(ret ==0){
  143. if (ans > 1e8 || IS_DOUBLE_ZERO(ans - (int)ans)){
  144. sprintf(result, "%.12g\0", ans);
  145. }else{
  146. sprintf(result, "%.12f\0", ans);
  147. }
  148. return result;
  149. }
  150. fputs("Error calculate\n", stdout);
  151. exit(1);
  152. }
  153. ////////////////////////////////////////////crc32
  154. #include "Lib/DataCalc/Crc32Calc.h"
  155. #include "Lib/DataCalc/Crc32Calc.c"
  156. Crc32Calc c1;
  157. char* crc32(char* Buf){
  158. int x, y, z;
  159. char* result=(char*)calloc(64, sizeof(char));;
  160. Crc32Calc_init(&c1);
  161. Crc32Calc_reset(&c1);
  162. Crc32Calc_calculate(&c1,Buf, strlen(Buf));
  163. sprintf(result, "%x\0", c1.Value );
  164. Crc32Calc_uninit(&c1);
  165. return result;
  166. }
  167. ////////////////////////////////////////////md5
  168. #include "Lib/DataCalc/Md5Calc.h"
  169. #include "Lib/DataCalc/Md5Calc.c"
  170. char Buf[256]={0};
  171. Md5Calc m5;
  172. char* md5(char* TestStr){
  173. void* op;
  174. char* result=(char*)calloc(128, sizeof(char));
  175. SZ_T w,x,y,z,e;
  176. SZ_T f = 0;
  177. Md5Calc_init(&m5);
  178. Md5Calc_reset(&m5);
  179. Md5Calc_calculate( &m5, TestStr, strlen( TestStr));
  180. sprintf(result, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\0" ,( SZ_UCHAR )( m5.Value[0]),( SZ_UCHAR )( m5.Value[1]),( SZ_UCHAR )( m5.Value[2]),( SZ_UCHAR )( m5.Value[3]),( SZ_UCHAR )( m5.Value[4]),( SZ_UCHAR )( m5.Value[5]),( SZ_UCHAR )( m5.Value[6]),( SZ_UCHAR )( m5.Value[7]),( SZ_UCHAR )( m5.Value[8]),( SZ_UCHAR )( m5.Value[9]),( SZ_UCHAR )( m5.Value[10]),( SZ_UCHAR )( m5.Value[11]),( SZ_UCHAR )( m5.Value[12]),( SZ_UCHAR )( m5.Value[13]),( SZ_UCHAR )( m5.Value[14]),( SZ_UCHAR )( m5.Value[15]) );
  181. Md5Calc_uninit( &m5 );
  182. return result;
  183. }
  184. ////////////////////////////////////////////sha1
  185. #include "Lib/DataCalc/Sha1Calc.h"
  186. #include "Lib/DataCalc/Sha1Calc.c"
  187. char *abuf;
  188. Sha1Calc s1;
  189. char* sha1(char* TestStr){
  190. abuf=(char*)calloc(1000000,sizeof(char));
  191. char* result=(char*)calloc(128, sizeof(char));
  192. void* op;
  193. SZ_T w,x,y,z,e;
  194. SZ_T f=0;
  195. for(x=0; x<1000000; x++){abuf[x]='a';}
  196. Sha1Calc_reset(&s1);
  197. Sha1Calc_calculate(&s1,TestStr,strlen(TestStr));
  198. sprintf(result, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\0", (SZ_UCHAR)(s1.Value[0]), (SZ_UCHAR)(s1.Value[1]), (SZ_UCHAR)(s1.Value[2]), (SZ_UCHAR)(s1.Value[3]), (SZ_UCHAR)(s1.Value[4]), (SZ_UCHAR)(s1.Value[5]), (SZ_UCHAR)(s1.Value[6]), (SZ_UCHAR)(s1.Value[7]), (SZ_UCHAR)(s1.Value[8]), (SZ_UCHAR)(s1.Value[9]), (SZ_UCHAR)(s1.Value[10]), (SZ_UCHAR)(s1.Value[11]), (SZ_UCHAR)(s1.Value[12]), (SZ_UCHAR)(s1.Value[13]), (SZ_UCHAR)(s1.Value[14]), (SZ_UCHAR)(s1.Value[15]), (SZ_UCHAR)(s1.Value[16]), (SZ_UCHAR)(s1.Value[17]), (SZ_UCHAR)(s1.Value[18]), (SZ_UCHAR)(s1.Value[19]) );
  199. Sha1Calc_uninit(&s1);
  200. return result;
  201. }
  202. ////////////////////////////////////////////sha256
  203. #include "Lib/DataCalc/Sha256Calc.h"
  204. #include "Lib/DataCalc/Sha256Calc.c"
  205. Sha256Calc s2;
  206. char* sha256(char* TestStr){
  207. char* result=(char*)calloc(128, sizeof(char));
  208. void* op;
  209. SZ_T w,x,y,z,e;
  210. SZ_T f=0;
  211. abuf=(char*)calloc(1000000, sizeof(char));
  212. Sha256Calc_reset(&s2);
  213. Sha256Calc_calculate(&s2,TestStr,strlen(TestStr));
  214. sprintf(result, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\0", (SZ_UCHAR)(s2.Value[0]), (SZ_UCHAR)(s2.Value[1]), (SZ_UCHAR)(s2.Value[2]), (SZ_UCHAR)(s2.Value[3]), (SZ_UCHAR)(s2.Value[4]), (SZ_UCHAR)(s2.Value[5]), (SZ_UCHAR)(s2.Value[6]), (SZ_UCHAR)(s2.Value[7]), (SZ_UCHAR)(s2.Value[8]), (SZ_UCHAR)(s2.Value[9]), (SZ_UCHAR)(s2.Value[10]), (SZ_UCHAR)(s2.Value[11]), (SZ_UCHAR)(s2.Value[12]), (SZ_UCHAR)(s2.Value[13]), (SZ_UCHAR)(s2.Value[14]), (SZ_UCHAR)(s2.Value[15]), (SZ_UCHAR)(s2.Value[16]), (SZ_UCHAR)(s2.Value[17]), (SZ_UCHAR)(s2.Value[18]), (SZ_UCHAR)(s2.Value[19]), (SZ_UCHAR)(s2.Value[20]), (SZ_UCHAR)(s2.Value[21]), (SZ_UCHAR)(s2.Value[22]), (SZ_UCHAR)(s2.Value[23]), (SZ_UCHAR)(s2.Value[24]), (SZ_UCHAR)(s2.Value[25]), (SZ_UCHAR)(s2.Value[26]), (SZ_UCHAR)(s2.Value[27]), (SZ_UCHAR)(s2.Value[28]), (SZ_UCHAR)(s2.Value[29]), (SZ_UCHAR)(s2.Value[30]), (SZ_UCHAR)(s2.Value[31]) );
  215. Sha256Calc_uninit(&s2);
  216. free(abuf);
  217. return result;
  218. }
  219. //获取当前PID
  220. DWORD GetCurrentPID()
  221. {
  222. DWORD pid=GetCurrentProcessId();
  223. DWORD ppid = (DWORD)(-1);
  224. HANDLE hProcessSnap;
  225. PROCESSENTRY32 pe32;
  226. hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
  227. if(hProcessSnap ==INVALID_HANDLE_VALUE){fputs("Get PID error.", stdout);exit(1);}
  228. pe32.dwSize = sizeof( PROCESSENTRY32 );
  229. BOOL bResult = Process32First( hProcessSnap, &pe32 );
  230. if(bResult ==FALSE){fputs("Get PID error.", stdout);exit(1);}
  231. do{
  232. if (pid == pe32.th32ProcessID)
  233. {
  234. ppid = pe32.th32ParentProcessID;
  235. break;
  236. }
  237. } while( Process32Next( hProcessSnap, &pe32 ) );
  238. CloseHandle( hProcessSnap );
  239. return( ppid );
  240. }
  241. //提升DEBUG权限
  242. BOOL EnableDebugPrivilege(BOOL bEnable)
  243. {
  244. HANDLE hToken;
  245. BOOL R=FALSE;
  246. if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)){   
  247. TOKEN_PRIVILEGES tp;  
  248. tp.PrivilegeCount =1;  
  249. LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tp.Privileges[0].Luid);  
  250. tp.Privileges[0].Attributes = bEnable ? SE_PRIVILEGE_ENABLED : 0;  
  251. AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(tp), NULL, NULL);  
  252. R =(GetLastError()==ERROR_SUCCESS);  
  253. CloseHandle(hToken);   
  254. }   
  255. return R;   
  256. }
  257. /*************业务函数群*************/
  258. //SetEnvironmentVariable函数入口
  259. DWORD WINAPI threadProc(LPVOID lpParam)
  260. {
  261. VAR_TABLE *pRP=(VAR_TABLE*)lpParam;
  262. PFN_SetEnvironmentVariable pfnSetEnvironmentVariable =(PFN_SetEnvironmentVariable)pRP->funPTR;
  263. pfnSetEnvironmentVariable(pRP->NAME, pRP->VALU);
  264. return 0;
  265. }
  266. //线程注入函数
  267. int Inject(const char* vNAME, const char* vValu)
  268. {
  269. EnableDebugPrivilege(TRUE);
  270. DWORD DW_PID =GetCurrentPID();
  271. if(DW_PID ==(DWORD)(-1)){fputs("Inject error.", stdout);exit(1);}
  272. HANDLE hProcess=OpenProcess(PROCESS_ALL_ACCESS, FALSE, DW_PID);
  273. if(hProcess ==NULL){fputs("Inject error.", stdout);exit(1);}
  274. DWORD DW_MEM_SIZE=4096;
  275. LPVOID pRemoteThread =VirtualAllocEx(hProcess, 0, DW_MEM_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE) ;
  276. if(pRemoteThread ==NULL){fputs("Inject error.", stdout);exit(1);}
  277. BOOL bResult =WriteProcessMemory(hProcess, pRemoteThread, threadProc, DW_MEM_SIZE, NULL);
  278. if(bResult ==FALSE){fputs("Inject error.", stdout);exit(1);}
  279. VAR_TABLE var={0};
  280. HMODULE hKernel32 =LoadLibrary("Kernel32.dll");
  281. //获取SetEnvironmentVariableA函数入口地址
  282. var.funPTR=(DWORD)GetProcAddress(hKernel32, "SetEnvironmentVariableA");
  283. //赋值变量表
  284. strcpy(var.NAME, (char*)vNAME);
  285. strcpy(var.VALU, (char*)vValu);
  286. DW_MEM_SIZE=sizeof(var);
  287. LPVOID pRemoteParam =VirtualAllocEx(hProcess, 0, DW_MEM_SIZE, MEM_COMMIT, PAGE_READWRITE);
  288. if(pRemoteParam ==NULL){fputs("Inject error.", stdout);exit(1);}
  289. bResult=WriteProcessMemory(hProcess, pRemoteParam, &var.funPTR, DW_MEM_SIZE, NULL);
  290. if(bResult ==FALSE){fputs("Inject error.", stdout);exit(1);}
  291. HANDLE hRemoteThread=CreateRemoteThread(hProcess, NULL, 0, pRemoteThread, pRemoteParam, 0, NULL);
  292. if(hRemoteThread ==FALSE){fputs("Inject error.", stdout);exit(1);}
  293. CloseHandle(hRemoteThread);
  294. CloseHandle(hProcess);
  295. return 0;
  296. }
  297. /*************主函数入口*************/
  298. int main(int argc, char** argv)
  299. {
  300. //参数不足则退出 并抛出说明
  301. if(argc==1){HelpInfomation(1);}
  302. //取得缓存区命令行
  303. LPSTR Line=GetCommandLineA()+strlen(argv[0]);
  304. //过滤行TAB缩进或前空格
  305. while(*Line=='\t'|| *Line==' '){Line++;}
  306. //根据等号切分出变量名和变量赋值表达式
  307. char* vNAME=strtok(Line, "=");
  308. char* vValu=strtok(NULL, "=");
  309. if(vValu==NULL){HelpInfomation(1);}
  310. //过滤赋值表达式TAB缩进或前空格
  311. while(*vValu=='\t'|| *vValu==' '){vValu++;}
  312. //如赋值表达式为空则抛出使用说明
  313. if(vValu==NULL){HelpInfomation(1);}
  314. //设置行号
  315. int lineNUM=0;
  316. //解析标签
  317. int SN=Identify_KeyWords(vValu);
  318. switch(SN){
  319. case 0:
  320. vValu[0]=atoi(vValu+strlen(LABEL_WORDS[SN]))%128;
  321. vValu[1]=0x00;
  322. Inject(vNAME, vValu);
  323. break;
  324. case 1:
  325. vValu=CalculateExpression(vValu+strlen(LABEL_WORDS[SN]));
  326. Inject(vNAME, CalculateExpression(vValu));
  327. break;
  328. case 2:
  329. FontColor(atoi(vValu+strlen(LABEL_WORDS[SN])));
  330. break;
  331. case 3:
  332. vValu=vValu+strlen(LABEL_WORDS[SN]);
  333. lineNUM=atoi(vValu);
  334. strtok(vValu, ")");
  335. Inject(vNAME, FileStream(strtok(NULL, ")"), lineNUM));
  336. break;
  337. case 4:
  338. vValu=vValu+strlen(LABEL_WORDS[SN]);
  339. Inject(vNAME, crc32(vValu));
  340. break;
  341. case 5:
  342. vValu=vValu+strlen(LABEL_WORDS[SN]);
  343. Inject(vNAME, md5(vValu));
  344. break;
  345. case 6:
  346. vValu=vValu+strlen(LABEL_WORDS[SN]);
  347. Inject(vNAME, sha1(vValu));
  348. break;
  349. case 7:
  350. vValu=vValu+strlen(LABEL_WORDS[SN]);
  351. vValu=sha256(vValu);
  352. Inject(vNAME, vValu);
  353. break;
  354. default:
  355. fputs("Error label\n", stdout);
  356. return 1;
  357. }
  358. return 0;
  359. }
复制代码
批处理演示
  1. @echo off&setlocal enabledelayedexpansion&title seti演示脚本
  2. set REM=echo
  3. !REM!;
  4. !REM! 将第1行赋值给变量L
  5. seti L=(line1)%~f0&echo;!L!
  6. !REM! 将STDOUT颜色赋值为15,即&seti STDOUT=(color)12&!REM!;改变输出缓存区&seti STDOUT=(color)15&!REM!;字体颜色
  7. !REM!;
  8. !REM! 将ASCII值07赋值给变量bell
  9. seti bell=(ascii)07
  10. !REM!;
  11. !REM! 计算数学表达式的值并赋值给变量result
  12. seti result=(calc)5*(arctan(cos(sin(ln(lg(2.71828))))))&echo;!result!
  13. !REM!;
  14. !REM! 对函数式的支持
  15. set/a "x=1, y=2, z=3"
  16. seti fun(%x%, %y%, %z%)=(calc)5*(arctan(cos(sin(ln(lg(%z%))))))+%x%+%y%&echo;!fun(1, 2, 3)!
  17. !REM!;
  18. !REM! 对超长算式的支持
  19. seti result=(calc)5tan5lnlge+6pi*tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge+lnpi+6pi*tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge/lnpi+6pi-tanpi+arcsin0.75+sin0.75+lge+lnpi//2+5tan5lnlge+6pi*tanpi+arcsin0.75*tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge+lnpi+6pi*tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75+lge/lnpi+6pi-tanpi+arcsin0.75+sin0.75+lge+lnpi//2+5tan5lnlge+6pi*tanpi+arcsin0.75*tanpi+arcsin0.75+lge+lnpi+6pi-tanpi+arcsin0.75&echo;!result!
  20. !REM!;
  21. REM hash赋值,支持crc32、md5、sh1、sha256等四种散列值
  22. !REM! 对password做md5加密,并赋值给变量m
  23. seti m=(md5)password&echo;!m!
  24. !REM!;
  25. pause
复制代码

还不如干脆别用bat好了

TOP

回复 2# Nsqs

感谢回复,因是批处理论坛,所以发帖内容多数均涉及到批处理。

TOP

来迟了,编译失败,求exe

TOP

本帖最后由 happy886rr 于 2017-1-7 19:33 编辑

回复 4# CrLf
大师,已经发送离线文件至你Geek群里的QQ ,请及时接收
1

评分人数

    • CrLf: 感谢分享技术 + 1

TOP

回复 5# happy886rr


    在github整个地方放多好。

TOP

回复 6# freesoft00
稍后会弄的,主要是写的第三方太多,一时半会整理github又需要太多时间。我还有很多第三方要写, 等都写完,就整理成册,并配置专门的pdf教程。
1

评分人数

TOP

seti 上次一个EXE 呀

TOP

回复 8# 小勇12
seti已经过时了,请使用我的新工具ICMD,地址http://www.bathome.net/viewthrea ... &highlight=ICMD

TOP

回复 9# happy886rr


    你github账号多少啊,关注一下
踏实一些点.不要着急.你想要的时间都会给你.2

TOP

返回列表