Browser DLLHook-GZip字符串解压缩
我正在将一个dll注入firefox(浏览器)并挂接WSARecv。 问题是,数据缓冲区是Gzip压缩的。我已经尝试挂接send()函数并删除“Accept Encoding:gzip,deflate”,但许多Web服务器不理解这一点 所以我试着继续解压缓冲区,改变一些东西,然后再次压缩它。因此,我将zlib.dll和zlib.lib链接到我的dll中,并编写了一个小包装类:Browser DLLHook-GZip字符串解压缩,browser,gzip,hook,Browser,Gzip,Hook,我正在将一个dll注入firefox(浏览器)并挂接WSARecv。 问题是,数据缓冲区是Gzip压缩的。我已经尝试挂接send()函数并删除“Accept Encoding:gzip,deflate”,但许多Web服务器不理解这一点 所以我试着继续解压缓冲区,改变一些东西,然后再次压缩它。因此,我将zlib.dll和zlib.lib链接到我的dll中,并编写了一个小包装类: int CGZip::DecompressString(char* src, int srcLen, char** de
int CGZip::DecompressString(char* src, int srcLen, char** destination, int* destLen)
{
//Define the source, destination, source length, and destination length
char *dest= new char[(unsigned int)destLen];
//Decompress the string in src and place it in dest
int result=uncompress((unsigned char *)dest,(uLongf*)destLen,(const unsigned char *)src,srcLen);
//Return the results of the decompression
*destination = dest;
return(result);
}
但是当我将解压包含到钩住的WSARecv中时,我的dll将不再被加载(没有调用dll\u进程\u附加)。当我删除以下5行时,dll将再次加载
szUncompressed = (char*)malloc((size_t)lpBuffers->len * 100);
CGZip *ziphandler = new CGZip();
ziphandler->DecompressString(lpBuffers->buf, lpBuffers->len, &szUncompressed, &iUncompressedLength);
szUncompressed[iUncompressedLength] = '\0';
你知道为什么DLL不再加载了,或者我如何轻松地解压和压缩数据缓冲区吗
提前感谢:)好的,我解决了它,我只需要在自己的dll之前注入zlib.dll,它就可以工作了:>