(转)hook拦截http请求头

By admin at 2018-12-09 • 0人收藏 • 2564人看过

转自:aar群聊 抓狂快走(507003933)

image.png

import raw.apiHook

var host;
hookHttpOpenRequest = function(hConnect,lpszVerb,lpszObjectName,lpszVersion,lpszReferrer,lplpszAcceptTypes,dwFlags,dwContext){
  //console.log(host ++ string.fromUnicode(lpszObjectName,0,true))
  
  if(string.find(string.fromUnicode(lpszObjectName,0,true),'@bkn')){
  	console.log(string.fromUnicode(lpszObjectName,0,true))
  }
  

    return owner.callApi( hConnect,(lpszVerb),(lpszObjectName),(lpszVersion),(lpszReferrer),lplpszAcceptTypes,dwFlags,dwContext )
}
 
hookInternetConnect = function(hInet,serverName, serverPort, userName, password, service, flags, context){
    host = string.fromUnicode(serverName,0,true)
    return owner.callApi(hInet,(serverName), serverPort, userName, password, service, flags, context); 
}
 
hook = raw.apiHook("Wininet.dll", "HttpOpenRequestW", "pointer(pointer hConnect,pointer lpszVerb,pointer lpszObjectName,pointer lpszVersion,pointer lpszReferrer,pointer lplpszAcceptTypes,INT dwFlags,INT dwContext)", hookHttpOpenRequest).install()
hook2 = raw.apiHook("Wininet.dll", "InternetConnectW","pointer(pointer hInet,pointer serverName,INT serverPort,pointer userName,pointer password,INT service,INT flags,INT context)",hookInternetConnect).install();


登录后方可回帖

登 录
信息栏
 私人小站

本站域名

ChengXu.XYZ

投诉联系:  popdes@126.com



快速上位机开发学习,本站主要记录了学习过程中遇到的问题和解决办法及上位机代码分享

这里主要专注于学习交流和经验分享.
纯私人站,当笔记本用的,学到哪写到哪.
如果侵权,联系 Popdes@126.com

友情链接
Aardio官方
Aardio资源网


才仁机械


网站地图SiteMap

Loading...