Files
mtgodot-poc/extension/src/port/EterBase/lzo.h
T
shenleiandClaude Opus 5 fc47582017 port 2A step 2: copy the 40250 header closure into the port mirror
76 closure headers (EterBase, EterLocale, EterPack, EterLib, GameLib, MilesLib,
EffectLib, SphereLib, EterImageLib) copied by the new port_copy.py (CP949->UTF-8,
LF, include-path case only); platform-class headers go to the mirror path too, as
the interface platform/ implements. Six manual `// PORT:` edits (Random, Singleton,
Pool, Stl, Utils, FlyTarget).

- common/D3D8Types.h: D3D8 value types with SDK values/layout, opaque COM interfaces
- common/shim/sdk (d3d8/d3dx8/mss) on every platform, common/shim/win32 off Windows
- Win32Types/Win32Crt: HRESULT, GUID, LARGE_INTEGER, LOGFONT/TEXTMETRIC, _atoi64,
  CRITICAL_SECTION on std::recursive_mutex
- header gate prepends each library's StdAfx.h (40250's precompiled header)

port_gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).
ScriptLib/EterPythonLib/UserInterface wait for 2P (their StdAfx includes Python).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 20:27:57 +09:00

75 lines
1.7 KiB
C++

#ifndef __INC_METIN_II_371GNFBQOCJ_LZO_H__
#define __INC_METIN_II_371GNFBQOCJ_LZO_H__
#include <windows.h>
#include <lzo/lzo1x.h>
#include "Singleton.h"
class CLZObject
{
public:
#pragma pack(4)
typedef struct SHeader
{
DWORD dwFourCC;
DWORD dwEncryptSize; // 암호화된 크기
DWORD dwCompressedSize; // 압축된 데이터 크기
DWORD dwRealSize; // 실제 데이터 크기
} THeader;
#pragma pack()
CLZObject();
~CLZObject();
void Clear();
void BeginCompress(const void * pvIn, UINT uiInLen);
void BeginCompressInBuffer(const void * pvIn, UINT uiInLen, void * pvOut);
bool Compress();
bool BeginDecompress(const void * pvIn);
bool Decompress(DWORD * pdwKey = NULL);
bool Encrypt(DWORD * pdwKey);
bool __Decrypt(DWORD * key, BYTE* data);
const THeader & GetHeader() { return *m_pHeader; }
BYTE * GetBuffer() { return m_pbBuffer; }
DWORD GetSize();
void AllocBuffer(DWORD dwSize);
DWORD GetBufferSize() { return m_dwBufferSize; }
//void CopyBuffer(const char* pbSrc, DWORD dwSrcSize);
private:
void Initialize();
BYTE * m_pbBuffer;
DWORD m_dwBufferSize;
THeader * m_pHeader;
const BYTE * m_pbIn;
bool m_bCompressed;
bool m_bInBuffer;
public:
static DWORD ms_dwFourCC;
};
class CLZO : public CSingleton<CLZO>
{
public:
CLZO();
virtual ~CLZO();
bool CompressMemory(CLZObject & rObj, const void * pIn, UINT uiInLen);
bool CompressEncryptedMemory(CLZObject & rObj, const void * pIn, UINT uiInLen, DWORD * pdwKey);
bool Decompress(CLZObject & rObj, const BYTE * pbBuf, DWORD * pdwKey = NULL);
BYTE * GetWorkMemory();
private:
BYTE * m_pWorkMem;
};
#endif