Implement a memory DLL runner

This commit is contained in:
yuanyuanxiang
2025-04-21 02:39:00 +08:00
parent e9b0be2761
commit ca8ff799ef
6 changed files with 1572 additions and 20 deletions

View File

@@ -506,6 +506,14 @@ BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans
delete[] CompressedBuffer;
throw "Unknown method";
}
else if (ContextObject->CompressMethod == COMPRESS_NONE) {
ContextObject->InDeCompressedBuffer.ClearBuffer();
ContextObject->InDeCompressedBuffer.WriteBuffer(CompressedBuffer, ulOriginalLength);
ContextObject->Decode(CompressedBuffer, ulOriginalLength);
m_NotifyProc(ContextObject);
SAFE_DELETE_ARRAY(CompressedBuffer);
break;
}
bool usingZstd = ContextObject->CompressMethod == COMPRESS_ZSTD, zlibFailed = false;
PBYTE DeCompressedBuffer = new BYTE[ulOriginalLength]; //<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
size_t iRet = usingZstd ?
@@ -570,12 +578,17 @@ VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffe
}
try
{
if (ulOriginalLength > 0)
do
{
if (ulOriginalLength <= 0) return;
if (ContextObject->CompressMethod == COMPRESS_UNKNOWN) {
OutputDebugStringA("[ERROR] UNKNOWN compress method \n");
return;
}
else if (ContextObject->CompressMethod == COMPRESS_NONE) {
ContextObject->WriteBuffer(szBuffer, ulOriginalLength, ulOriginalLength);
break;
}
bool usingZstd = ContextObject->CompressMethod == COMPRESS_ZSTD;
#if USING_LZ4
unsigned long ulCompressedLength = LZ4_compressBound(ulOriginalLength);
@@ -601,7 +614,7 @@ VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffe
ContextObject->WriteBuffer(CompressedBuffer, ulCompressedLength, ulOriginalLength);
delete [] CompressedBuffer;
}
}while (false);
OVERLAPPEDPLUS* OverlappedPlus = new OVERLAPPEDPLUS(IOWrite);
BOOL bOk = PostQueuedCompletionStatus(m_hCompletionPort, 0, (ULONG_PTR)ContextObject, &OverlappedPlus->m_ol);