(转)hook拦截http请求头
By
admin
at 2018-12-09 • 0人收藏 • 2656人看过
转自:aar群聊 抓狂快走(507003933)

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();登录后方可回帖