├── PETOOLS
├── PETOOLS
│ ├── Debug
│ │ ├── PETOOLS.vcxproj.FileListAbsolute.txt
│ │ ├── vc142.idb
│ │ ├── PETOOLS.res
│ │ ├── PETOOLS.tlog
│ │ │ └── PETOOLS.lastbuildstate
│ │ └── PETOOLS.exe.recipe
│ ├── stdafx.h
│ ├── AddPatch.h
│ ├── GlobeVar.h
│ ├── MFCEdit.cpp
│ ├── PETOOLS.cpp
│ ├── PETOOLS.h
│ ├── PETOOLS.rc
│ ├── ReadMe.txt
│ ├── resource.h
│ ├── stdafx.cpp
│ ├── targetver.h
│ ├── AddPatch.cpp
│ ├── DialogFirst.h
│ ├── DisaDialog.h
│ ├── MFCStatic.cpp
│ ├── MFCStatus.cpp
│ ├── MyListCtrl.h
│ ├── PETOOLSDlg.h
│ ├── PosCalcDlg.h
│ ├── SectionsDlg.h
│ ├── AddSectionDlg.h
│ ├── DialogFirst.cpp
│ ├── DisaDialog.cpp
│ ├── MyListCtrl.cpp
│ ├── PosCalcDlg.cpp
│ ├── ProBarThread.cpp
│ ├── ProBarThread.h
│ ├── ProgressDialog.h
│ ├── SectionsDlg.cpp
│ ├── res
│ │ ├── PETOOLS.ico
│ │ └── PETOOLS.rc2
│ ├── AddSectionDlg.cpp
│ ├── DataDirectoryDlg.h
│ ├── ProgressDialog.cpp
│ ├── DataDirectoryDlg.cpp
│ ├── MyResource.h
│ ├── PETOOLS.vcxproj.user
│ ├── MFCEdit.h
│ ├── Release
│ │ └── PETOOLS.exe.recipe
│ ├── MFCStatus.h
│ ├── MFCStatic.h
│ ├── GlobeVar.cpp
│ ├── PETOOLS.vcxproj.filters
│ ├── PETOOLS.vcxproj
│ └── PETOOLSDlg.cpp
├── PETOOLS.suo
├── Debug
│ ├── 16Edit.ini
│ ├── 加壳示例.rar
│ ├── 16Edit.dll
│ ├── PELib.dll
│ ├── PEMake.exe
│ ├── PETOOLS.exe
│ ├── configure.ini
│ ├── dbghelp.lib
│ ├── shellcode
│ │ ├── 1.bin
│ │ ├── 2.bin
│ │ ├── cc.bin
│ │ └── patch.exe
│ └── otherconfigure.ini
├── Release
│ ├── 16Edit.ini
│ ├── 加壳示例.rar
│ ├── 16Edit.dll
│ ├── PELib.dll
│ ├── PEMake.exe
│ ├── PETOOLS.exe
│ ├── dbghelp.lib
│ ├── configure.ini
│ ├── shellcode
│ │ ├── 1.bin
│ │ ├── 2.bin
│ │ ├── cc.bin
│ │ └── patch.exe
│ └── otherconfigure.ini
├── VSCleaner.exe
├── vscleaner.ini
├── CommonLib
│ ├── MiniDump.h
│ ├── CodedConvert.h
│ ├── MiniDump.cpp
│ ├── disasm
│ │ ├── disasm.h
│ │ ├── asmserv.cpp
│ │ ├── assembl.cpp
│ │ └── disasm.cpp
│ ├── 16Edit
│ │ ├── 16Edit.dll
│ │ ├── 16Edit.lib
│ │ ├── 16EditDll.h
│ │ └── APIs.tXt
│ ├── MemoryPool
│ │ ├── MemMgr.h
│ │ ├── bin
│ │ │ └── MemMgr.lib
│ │ └── bind
│ │ │ └── MemMgr.lib
│ ├── PELib
│ │ ├── PE
│ │ │ ├── PEMake.h
│ │ │ └── PEStruct.h
│ │ ├── bin
│ │ │ └── PELib.lib
│ │ └── bind
│ │ │ └── PELib.lib
│ ├── pack
│ │ ├── ByteBuffer.h
│ │ ├── TXCommPack.cpp
│ │ └── TXCommPack.h
│ ├── Ini.h
│ ├── Lock.h
│ ├── Ini.cpp
│ ├── LogLib
│ │ ├── DebugLog.h
│ │ ├── DebugLog.cpp
│ │ └── log4z.h
│ ├── Hex.h
│ ├── typedef.h
│ ├── zlib
│ │ └── zconf.h
│ └── xml
│ │ └── Markup.h
└── PETOOLS.sln
├── README.md
├── LICENSE
└── .gitignore
/PETOOLS/PETOOLS/Debug/PETOOLS.vcxproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS.suo
--------------------------------------------------------------------------------
/PETOOLS/Debug/16Edit.ini:
--------------------------------------------------------------------------------
1 | [Options]
2 | WinPos=010000000C020000FD0000007E020000900100001D
3 |
--------------------------------------------------------------------------------
/PETOOLS/Debug/加壳示例.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/加壳示例.rar
--------------------------------------------------------------------------------
/PETOOLS/Release/16Edit.ini:
--------------------------------------------------------------------------------
1 | [Options]
2 | WinPos=010000000C020000FD0000007E020000900100001D
3 |
--------------------------------------------------------------------------------
/PETOOLS/VSCleaner.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/VSCleaner.exe
--------------------------------------------------------------------------------
/PETOOLS/vscleaner.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/vscleaner.ini
--------------------------------------------------------------------------------
/PETOOLS/Debug/16Edit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/16Edit.dll
--------------------------------------------------------------------------------
/PETOOLS/Debug/PELib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/PELib.dll
--------------------------------------------------------------------------------
/PETOOLS/Debug/PEMake.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/PEMake.exe
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/stdafx.h
--------------------------------------------------------------------------------
/PETOOLS/Release/加壳示例.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/加壳示例.rar
--------------------------------------------------------------------------------
/PETOOLS/Debug/PETOOLS.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/PETOOLS.exe
--------------------------------------------------------------------------------
/PETOOLS/Debug/configure.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/configure.ini
--------------------------------------------------------------------------------
/PETOOLS/Debug/dbghelp.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/dbghelp.lib
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/AddPatch.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/AddPatch.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/GlobeVar.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/GlobeVar.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MFCEdit.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/MFCEdit.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLS.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/PETOOLS.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLS.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/PETOOLS.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLS.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/PETOOLS.rc
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/ReadMe.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/ReadMe.txt
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/resource.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/stdafx.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/targetver.h
--------------------------------------------------------------------------------
/PETOOLS/Release/16Edit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/16Edit.dll
--------------------------------------------------------------------------------
/PETOOLS/Release/PELib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/PELib.dll
--------------------------------------------------------------------------------
/PETOOLS/Release/PEMake.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/PEMake.exe
--------------------------------------------------------------------------------
/PETOOLS/Release/PETOOLS.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/PETOOLS.exe
--------------------------------------------------------------------------------
/PETOOLS/Release/dbghelp.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/dbghelp.lib
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/MiniDump.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/MiniDump.h
--------------------------------------------------------------------------------
/PETOOLS/Debug/shellcode/1.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/shellcode/1.bin
--------------------------------------------------------------------------------
/PETOOLS/Debug/shellcode/2.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/shellcode/2.bin
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/AddPatch.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/AddPatch.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/DialogFirst.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/DialogFirst.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/DisaDialog.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/DisaDialog.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MFCStatic.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/MFCStatic.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MFCStatus.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/MFCStatus.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MyListCtrl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/MyListCtrl.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLSDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/PETOOLSDlg.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PosCalcDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/PosCalcDlg.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/SectionsDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/SectionsDlg.h
--------------------------------------------------------------------------------
/PETOOLS/Release/configure.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/configure.ini
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/CodedConvert.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/CodedConvert.h
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/MiniDump.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/MiniDump.cpp
--------------------------------------------------------------------------------
/PETOOLS/Debug/otherconfigure.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/otherconfigure.ini
--------------------------------------------------------------------------------
/PETOOLS/Debug/shellcode/cc.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/shellcode/cc.bin
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/AddSectionDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/AddSectionDlg.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/Debug/vc142.idb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/Debug/vc142.idb
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/DialogFirst.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/DialogFirst.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/DisaDialog.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/DisaDialog.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MyListCtrl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/MyListCtrl.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PosCalcDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/PosCalcDlg.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/ProBarThread.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/ProBarThread.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/ProBarThread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/ProBarThread.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/ProgressDialog.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/ProgressDialog.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/SectionsDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/SectionsDlg.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/res/PETOOLS.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/res/PETOOLS.ico
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/res/PETOOLS.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/res/PETOOLS.rc2
--------------------------------------------------------------------------------
/PETOOLS/Release/shellcode/1.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/shellcode/1.bin
--------------------------------------------------------------------------------
/PETOOLS/Release/shellcode/2.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/shellcode/2.bin
--------------------------------------------------------------------------------
/PETOOLS/Release/shellcode/cc.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/shellcode/cc.bin
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/disasm/disasm.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/disasm/disasm.h
--------------------------------------------------------------------------------
/PETOOLS/Debug/shellcode/patch.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Debug/shellcode/patch.exe
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/AddSectionDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/AddSectionDlg.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/DataDirectoryDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/DataDirectoryDlg.h
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/Debug/PETOOLS.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/Debug/PETOOLS.res
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/ProgressDialog.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/ProgressDialog.cpp
--------------------------------------------------------------------------------
/PETOOLS/Release/otherconfigure.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/otherconfigure.ini
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/16Edit/16Edit.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/16Edit/16Edit.dll
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/16Edit/16Edit.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/16Edit/16Edit.lib
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/MemoryPool/MemMgr.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/MemoryPool/MemMgr.h
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/PELib/PE/PEMake.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/PELib/PE/PEMake.h
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/PELib/PE/PEStruct.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/PELib/PE/PEStruct.h
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/PELib/bin/PELib.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/PELib/bin/PELib.lib
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/disasm/asmserv.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/disasm/asmserv.cpp
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/disasm/assembl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/disasm/assembl.cpp
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/disasm/disasm.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/disasm/disasm.cpp
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/pack/ByteBuffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/pack/ByteBuffer.h
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/pack/TXCommPack.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/pack/TXCommPack.cpp
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/DataDirectoryDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/PETOOLS/DataDirectoryDlg.cpp
--------------------------------------------------------------------------------
/PETOOLS/Release/shellcode/patch.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/Release/shellcode/patch.exe
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/PELib/bind/PELib.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/PELib/bind/PELib.lib
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/MemoryPool/bin/MemMgr.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/MemoryPool/bin/MemMgr.lib
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/MemoryPool/bind/MemMgr.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SurrealSky/PETOOLS/HEAD/PETOOLS/CommonLib/MemoryPool/bind/MemMgr.lib
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MyResource.h:
--------------------------------------------------------------------------------
1 | #define PB_SETVALUE WM_USER+1
2 | #define WM_UPDATEUI WM_USER+2
3 | #define MSG_SAVE WM_USER+3
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PETOOLS
2 | - https://github.com/SurrealSky/PETOOLS
3 | - mail:securitysky@sina.com
4 |
5 | ## 介绍
6 |
7 | * PETOOLS是一款Windows下PE文件分析工具,软件加壳工具。
8 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLS.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | PETOOLS.rc
5 |
6 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/Debug/PETOOLS.tlog/PETOOLS.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:VCServicingVersionCrtHeaders=14.29.30136:TargetPlatformVersion=10.0.19041.0:
2 | Debug|Win32|D:\work\program\PETOOLS\PETOOLS\|
3 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/Debug/PETOOLS.exe.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\work\program\PETOOLS\PETOOLS\Debug\PETOOLS.exe
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MFCEdit.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // MFCEdit
5 |
6 | class MFCEdit : public CMFCEditBrowseCtrl
7 | {
8 | DECLARE_DYNAMIC(MFCEdit)
9 |
10 | public:
11 | MFCEdit();
12 | virtual ~MFCEdit();
13 |
14 | protected:
15 | DECLARE_MESSAGE_MAP()
16 |
17 | public:
18 | virtual void PreSubclassWindow();
19 | };
20 |
21 |
22 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/Release/PETOOLS.exe.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\work\program\PETOOLS\PETOOLS\Release\PETOOLS.exe
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/Ini.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | class Ini
5 | {
6 | public:
7 | Ini(void);
8 | ~Ini(void);
9 | public:
10 | int GetIntKey(IN TCHAR *File,IN TCHAR *section,IN TCHAR *key);
11 | void GetStrKey(IN TCHAR *File,IN TCHAR *section,IN TCHAR *key,OUT TCHAR *pOutBuffer);
12 | TCHAR *GetPath(void);
13 | private:
14 | TCHAR PATH[MAX_PATH];
15 | };
16 |
17 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MFCStatus.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // MFCStatus
5 |
6 | class MFCStatus : public CStatusBarCtrl
7 | {
8 | DECLARE_DYNAMIC(MFCStatus)
9 |
10 | public:
11 | MFCStatus();
12 | virtual ~MFCStatus();
13 | CProgressCtrl m_progres;
14 | public:
15 | void SetUI();
16 | void SetProcessBar(UINT pos){this->m_progres.SetPos(pos);};
17 | protected:
18 | DECLARE_MESSAGE_MAP()
19 | };
20 |
21 |
22 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/MFCStatic.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // MFCStatic
5 |
6 | class MFCStatic : public CStatic
7 | {
8 | DECLARE_DYNAMIC(MFCStatic)
9 |
10 | public:
11 | MFCStatic();
12 | virtual ~MFCStatic();
13 | protected:
14 | DECLARE_MESSAGE_MAP()
15 | public:
16 | TCHAR Title[MAX_PATH];
17 | public:
18 | afx_msg void OnMouseMove(UINT nFlags, CPoint point);
19 | afx_msg void OnMouseLeave();
20 | virtual void PreSubclassWindow();
21 | };
22 |
23 |
24 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/Lock.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | class CLock
4 | {
5 | public:
6 | CLock()
7 | {
8 | InitializeCriticalSection(&m_cs);
9 | }
10 |
11 | ~CLock()
12 | {
13 | DeleteCriticalSection(&m_cs);
14 | }
15 |
16 | void Lock()
17 | {
18 | EnterCriticalSection(&m_cs);
19 | }
20 |
21 | void Unlock()
22 | {
23 | LeaveCriticalSection(&m_cs);
24 | }
25 | private:
26 | CRITICAL_SECTION m_cs;
27 | };
28 |
29 | class AutoLock
30 | {
31 | public:
32 | AutoLock()
33 | {
34 | m_lock.Lock();
35 | }
36 | ~AutoLock()
37 | {
38 | m_lock.Unlock();
39 | }
40 | private:
41 | CLock m_lock;
42 | private:
43 | AutoLock(const AutoLock& lock);
44 | AutoLock& operator=(const AutoLock& lock);
45 | };
46 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/GlobeVar.cpp:
--------------------------------------------------------------------------------
1 | #include"GlobeVar.h"
2 |
3 | const char *UNUSE="N/A";
4 |
5 | void Create16EditWindow(unsigned char *buffer,unsigned int size,unsigned int startoff,unsigned int endoff)
6 | {
7 | HE_SETTINGS s;
8 | memset(&s, 0, sizeof(s));
9 | s.dwMask = HE_SET_MEMORYBLOCKINPUT | HE_SET_SETSELECTION;
10 | //s.szFilePath = "D://flash.exe";
11 | s.diMem.bReadOnly = TRUE;
12 | s.diMem.pDataBuff = buffer;
13 | s.diMem.dwSize = size;
14 | s.dwSelStartOff = startoff;
15 | s.dwSelEndOff = endoff;
16 |
17 | if (!HESpecifySettings(&s))
18 | {
19 | MessageBox(0,"16EditLoader", "File access error !", MB_ICONERROR);
20 | return;
21 | }
22 | //
23 | // enter window loop (with current thread)
24 | //
25 | HEEnterWindowLoop();
26 | }
27 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/Ini.cpp:
--------------------------------------------------------------------------------
1 | #include "Ini.h"
2 | #include
3 |
4 | Ini::Ini(void)
5 | {
6 | ZeroMemory(this->PATH,sizeof(this->PATH));
7 | }
8 |
9 | TCHAR* Ini::GetPath(void)
10 | {
11 | return this->PATH;
12 | }
13 |
14 | int Ini::GetIntKey(IN TCHAR *File,IN TCHAR *section,IN TCHAR *key)
15 | {
16 | ::GetModuleFileName(NULL,this->GetPath(),MAX_PATH);
17 | *(strrchr(this->GetPath(),'\\')+1)=0x00;
18 | strcat(this->GetPath(),File);
19 | return ::GetPrivateProfileInt(section,key,0,this->GetPath());
20 |
21 | }
22 |
23 | void Ini::GetStrKey(IN TCHAR *File,IN TCHAR *section,IN TCHAR *key,OUT TCHAR *pOutBuffer)
24 | {
25 | ::GetModuleFileName(NULL,this->GetPath(),MAX_PATH);
26 | *(strrchr(this->GetPath(),'\\')+1)=0x00;
27 | strcat(this->GetPath(),File);
28 | GetPrivateProfileString(section,key,0,pOutBuffer,MAX_PATH,this->GetPath());
29 | }
30 |
31 | Ini::~Ini(void)
32 | {
33 | }
34 |
35 |
36 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/LogLib/DebugLog.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | namespace SurrealDebugLog
10 | {
11 | //
12 | //NOTICE
13 | //
14 | template
15 | std::string string_format(const std::string& format, Args ... args)
16 | {
17 | size_t size = snprintf(nullptr, 0, format.c_str(), args ...) + 1; // Extra space for '\0'
18 | std::unique_ptr buf(new char[size]);
19 | snprintf(buf.get(), size, format.c_str(), args ...);
20 | return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside
21 | }
22 |
23 | //#define Dbg
24 |
25 | void DebugLog(const std::string &OutputString);
26 |
27 | void DebugLog(const std::string& lpTag, const std::string OutputString);
28 |
29 | void DebugLogHex(const std::string &lpTag, std::string &OutputString, SurrealTypes::STu32 lpOutputStringLen);
30 |
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/pack/TXCommPack.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | #define BUFFER_SIZE 0x200
5 | #pragma pack(1)
6 | class CTXCommPack
7 | {
8 | public:
9 | CTXCommPack(void);
10 | CTXCommPack(size_t);
11 | virtual ~CTXCommPack(void);
12 | public:
13 | void AddByte(STu8);
14 | void PreAddByte(STu8);
15 | void AddWord(STu16);
16 | void PreAddWord(STu16);
17 | void AddDWord(STu32);
18 | void PreAddDWord(const STu32);
19 | void AddDDWord(const STu64);
20 | void PreAddDDWord(const STu64);
21 | void AddBuf(const STu8 *,const STu32);
22 | void PreAddBuf(const STu8 *, const STu32);
23 | void AddBufLenWord();
24 | void AddBufLenDWord();
25 | void AddFieldCode(STu16);
26 | void ChangeByte(const STu32,const STu8);
27 | void ChangeWord(const STu32,const STu16);
28 | void ChangeDWord(const STu32,const STu32);
29 | void ChangeDDWord(const STu32, const STu64);
30 | void ChangeBuffer(const STu32,const STu8*,const STu32);
31 | void GetBufferOut();
32 | public:
33 | ByteBuffer buffer;
34 | };
35 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/Hex.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | namespace SurrealHex
5 | {
6 | class HexConvert
7 | {
8 | public:
9 | HexConvert() {};
10 | ~HexConvert() {};
11 | public:
12 | std::string HexToStr(STu8 *pbSrc, STu32 nLen)
13 | {
14 | std::string str;
15 | char ddl, ddh;
16 | int i;
17 |
18 | for (i = 0; i 57) ddh = ddh + 7;
23 | if (ddl > 57) ddl = ddl + 7;
24 | str.push_back(ddh);
25 | str.push_back(ddl);
26 | }
27 | return str;
28 | }
29 |
30 | std::string StrToHex(STu8 *pbSrc, STu32 nLen)
31 | {
32 | std::string str;
33 | STu8 h1, h2;
34 | STu8 s1, s2;
35 | int i;
36 |
37 | for (i = 0; i 9)
44 | s1 -= 7;
45 |
46 | s2 = toupper(h2) - 0x30;
47 | if (s2 > 9)
48 | s2 -= 7;
49 |
50 | str.push_back(s1 * 16 + s2);
51 | }
52 | return str;
53 | }
54 | };
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 SurrealSky
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.32407.337
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PETOOLS", "PETOOLS\PETOOLS.vcxproj", "{382BBBA3-9C9A-4C64-85C4-9D8D829D1A6E}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4858E49D-2D26-49A3-A94F-A9F6EC21FE67}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Win32 = Debug|Win32
13 | Release|Win32 = Release|Win32
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {382BBBA3-9C9A-4C64-85C4-9D8D829D1A6E}.Debug|Win32.ActiveCfg = Debug|Win32
17 | {382BBBA3-9C9A-4C64-85C4-9D8D829D1A6E}.Debug|Win32.Build.0 = Debug|Win32
18 | {382BBBA3-9C9A-4C64-85C4-9D8D829D1A6E}.Release|Win32.ActiveCfg = Release|Win32
19 | {382BBBA3-9C9A-4C64-85C4-9D8D829D1A6E}.Release|Win32.Build.0 = Release|Win32
20 | EndGlobalSection
21 | GlobalSection(SolutionProperties) = preSolution
22 | HideSolutionNode = FALSE
23 | EndGlobalSection
24 | GlobalSection(ExtensibilityGlobals) = postSolution
25 | SolutionGuid = {58929CCC-EA0B-4CC0-B752-8A7D56BA8A61}
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/typedef.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by wzh.
3 | //
4 |
5 | #ifndef NDKAPPECG_TYPEDEF_H
6 | #define NDKAPPECG_TYPEDEF_H
7 |
8 | namespace SurrealTypes
9 | {
10 | #if defined(_MSC_VER)
11 | //
12 | // Windows/Visual C++
13 | //
14 | typedef unsigned __int8 STbool;
15 | typedef unsigned __int8 STu8;
16 | typedef signed __int8 STs8;
17 | typedef signed __int16 STs16;
18 | typedef unsigned __int16 STu16;
19 | typedef signed __int32 STs32;
20 | typedef unsigned __int32 STu32;
21 | typedef signed __int64 STs64;
22 | typedef unsigned __int64 STu64;
23 | typedef float STfp32;
24 | typedef double STfp64;
25 | #else
26 | typedef unsigned char STbool;
27 | typedef unsigned char STu8;
28 | typedef char STs8;
29 | typedef unsigned short STu16;
30 | typedef signed short STs16;
31 | typedef unsigned int STu32;
32 | typedef signed int STs32;
33 | typedef signed long long STs64;
34 | typedef unsigned long long STu64;
35 | typedef float STfp32;
36 | typedef double STfp64;
37 | #endif
38 |
39 | #define TRUE 1
40 | #define FALSE 0
41 |
42 | #define STswab64(x) ((x&0x00000000000000ff) << 56|(((x&0x000000000000ff00) << 40)|((x&0x0000000000ff0000) << 24)|((x&0x00000000ff000000) << 8)|((x&0x000000ff00000000) >> 8)|((x&0x0000ff0000000000) >> 24)|((x&0x00ff000000000000) >> 40)|((x&0xff00000000000000) >> 56)))
43 | #define STswab32(x) ((x&0x000000ff) << 24 | (x&0x0000ff00) << 8 | (x&0x00ff0000) >> 8 | (x&0xff000000) >> 24)
44 | #define STswab16(x) ((x&0x00ff) << 8 | (x&0xff00) >> 8)
45 | }
46 |
47 | #endif
48 |
49 |
50 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/LogLib/DebugLog.cpp:
--------------------------------------------------------------------------------
1 | #include "./DebugLog.h"
2 | #include"../LogLib/log4z.h"
3 |
4 | using namespace zsummer::log4z;
5 |
6 | namespace SurrealDebugLog
7 | {
8 | void DebugLog(const std::string& OutputString)
9 | {
10 | #ifdef Dbg
11 | ILog4zManager::getRef().setLoggerPath(LOG4Z_MAIN_LOGGER_ID, "./log");
12 | ILog4zManager::getRef().start();
13 | ILog4zManager::getRef().setLoggerLevel(LOG4Z_MAIN_LOGGER_ID, LOG_LEVEL_TRACE);
14 | //LOGD: LOG WITH level LOG_DEBUG
15 | //LOGI: LOG WITH level LOG_INFO
16 |
17 | LOGD(OutputString);
18 |
19 | #endif
20 | }
21 |
22 | void DebugLog(const std::string& Tag, const std::string OutputString)
23 | {
24 | #ifdef Dbg
25 | ILog4zManager::getRef().setLoggerPath(LOG4Z_MAIN_LOGGER_ID, "./log");
26 | ILog4zManager::getRef().start();
27 | ILog4zManager::getRef().setLoggerLevel(LOG4Z_MAIN_LOGGER_ID, LOG_LEVEL_TRACE);
28 | //LOGD: LOG WITH level LOG_DEBUG
29 | //LOGI: LOG WITH level LOG_INFO
30 |
31 | LOGD(Tag <<":"<
19 |
20 | //
21 | // constants
22 | //
23 |
24 | // handler action codes
25 | #define HE_ACTION_EXITING 0x00000001
26 | #define HE_ACTION_SAVED 0x00000002
27 | #define HE_ACTION_FILEACCESSINFO 0x00000004
28 | #define HE_ACTION_WINDOWCREATED 0x00000008
29 |
30 | // flags for HE_SETTINGS
31 | #define HE_SET_FORCEREADONLY 0x00000001
32 | #define HE_SET_NORESIZE 0x00000002
33 | #define HE_SET_SETCURRENTOFFSET 0x00000004
34 | #define HE_SET_SETSELECTION 0x00000008
35 | #define HE_SET_ACTIONHANDLER 0x00000010
36 | #define HE_SET_INPUTFILE 0x00000020
37 | #define HE_SET_MEMORYBLOCKINPUT 0x00000040
38 | #define HE_SET_ONTOP 0x00000080
39 | #define HE_SET_PARENTWINDOW 0x00000100
40 | #define HE_SET_MINIMIZETOTRAY 0x00000200
41 | #define HE_SET_SAVEWINDOWPOSITION 0x00000400
42 | #define HE_SET_RESTOREWINDOWPOSITION 0x00000800
43 | #define HE_SET_USERWINDOWPOSITION 0x00001000
44 |
45 | //
46 | // structures
47 | //
48 |
49 | // force byte alignment of structures
50 | #if defined(__BORLANDC__)
51 | #pragma option -a1
52 | #else if defined(_MSC_VER)
53 | #pragma pack(1)
54 | #endif
55 |
56 | #ifndef EXTERN_HE_STRUCTS
57 | #define EXTERN_HE_STRUCTS
58 |
59 | typedef struct _HE_DATA_INFO
60 | {
61 | void* pDataBuff;
62 | DWORD dwSize; // data indicator
63 | BOOL bReadOnly;
64 | } HE_DATA_INFO, *PHE_DATA_INFO;
65 |
66 | typedef struct _HE_POS
67 | {
68 | DWORD dwOffset;
69 | BOOL bHiword; // (opt.) first digit of the pair ? ...or the 2nd one ?
70 | BOOL bTextSection; // (opt.) Caret in the text part ?
71 | } HE_POS, *PHE_POS;
72 |
73 | #endif // EXTERN_HE_STRUCTS
74 |
75 | typedef struct _HE_WIN_POS
76 | {
77 | int iState; // SW_SHOWNORMAL/SW_MAXIMIZE/SW_MINIMIZE
78 | int ix, iy, icx, icy; // left, top, width, height
79 | } HE_WIN_POS, *PHE_WIN_POS;
80 |
81 | typedef struct _HE_ACTION
82 | {
83 | DWORD dwActionCode;
84 |
85 | DWORD dwNewSize; // HE_ACTION_SAVED
86 |
87 | BOOL bReadWrite; // HE_ACTION_FILEACCESSINFO
88 |
89 | HWND hwnd16Edit; // HE_ACTION_WINDOWCREATED
90 | } HE_ACTION, *PHE_ACTION;
91 |
92 | typedef BOOL (__stdcall* procActionHandler)(PHE_ACTION pa);
93 |
94 | typedef struct _HE_SETTINGS
95 | {
96 | DWORD dwMask; // HE_SET_XXX flags
97 |
98 | procActionHandler pHandler; // HE_SET_ACTIONHANDLER
99 |
100 | HE_POS posCaret; // HE_SET_SETCURRENTOFFSET
101 |
102 | DWORD dwSelStartOff; // HE_SET_SETSELECTION
103 | DWORD dwSelEndOff; //
104 |
105 | HWND hwndParent; // HE_SET_PARENTWINDOW
106 |
107 | union
108 | {
109 | char* szFilePath; // HE_SET_INPUTFILE
110 |
111 | HE_DATA_INFO diMem; // HE_SET_MEMORYBLOCKINPUT
112 | };
113 |
114 | HE_WIN_POS wpUser; // HE_SET_USERWINDOWPOSITION
115 | } HE_SETTINGS, *PHE_SETTINGS;
116 |
117 | #if defined(_MSC_VER)
118 | #pragma pack()
119 | #endif
120 |
121 | //
122 | // function prototypes
123 | //
124 |
125 | #ifdef __cplusplus
126 | extern "C"
127 | {
128 | #endif // __cplusplus
129 |
130 | BOOL __stdcall HESpecifySettings(PHE_SETTINGS sets);
131 | BOOL __stdcall HEEnterWindowLoop();
132 | BOOL __stdcall HEEnterWindowLoopInNewThread();
133 |
134 | #ifdef __cplusplus
135 | }
136 | #endif // __cplusplus
137 |
138 | #endif // __16EditDll_h__
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | #[Dd]ebug/
17 | [Dd]ebugPublic/
18 | #[Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | #[Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015/2017 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # Visual Studio 2017 auto generated files
33 | Generated\ Files/
34 |
35 | # MSTest test Results
36 | [Tt]est[Rr]esult*/
37 | [Bb]uild[Ll]og.*
38 |
39 | # NUNIT
40 | *.VisualState.xml
41 | TestResult.xml
42 |
43 | # Build Results of an ATL Project
44 | [Dd]ebugPS/
45 | [Rr]eleasePS/
46 | dlldata.c
47 |
48 | # Benchmark Results
49 | BenchmarkDotNet.Artifacts/
50 |
51 | # .NET Core
52 | project.lock.json
53 | project.fragment.lock.json
54 | artifacts/
55 | **/Properties/launchSettings.json
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_i.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *.log
81 | *.vspscc
82 | *.vssscc
83 | .builds
84 | *.pidb
85 | *.svclog
86 | *.scc
87 |
88 | # Chutzpah Test files
89 | _Chutzpah*
90 |
91 | # Visual C++ cache files
92 | ipch/
93 | *.aps
94 | *.ncb
95 | *.opendb
96 | *.opensdf
97 | *.sdf
98 | *.cachefile
99 | *.VC.db
100 | *.VC.VC.opendb
101 |
102 | # Visual Studio profiler
103 | *.psess
104 | *.vsp
105 | *.vspx
106 | *.sap
107 |
108 | # Visual Studio Trace Files
109 | *.e2e
110 |
111 | # TFS 2012 Local Workspace
112 | $tf/
113 |
114 | # Guidance Automation Toolkit
115 | *.gpState
116 |
117 | # ReSharper is a .NET coding add-in
118 | _ReSharper*/
119 | *.[Rr]e[Ss]harper
120 | *.DotSettings.user
121 |
122 | # JustCode is a .NET coding add-in
123 | .JustCode
124 |
125 | # TeamCity is a build add-in
126 | _TeamCity*
127 |
128 | # DotCover is a Code Coverage Tool
129 | *.dotCover
130 |
131 | # AxoCover is a Code Coverage Tool
132 | .axoCover/*
133 | !.axoCover/settings.json
134 |
135 | # Visual Studio code coverage results
136 | *.coverage
137 | *.coveragexml
138 |
139 | # NCrunch
140 | _NCrunch_*
141 | .*crunch*.local.xml
142 | nCrunchTemp_*
143 |
144 | # MightyMoose
145 | *.mm.*
146 | AutoTest.Net/
147 |
148 | # Web workbench (sass)
149 | .sass-cache/
150 |
151 | # Installshield output folder
152 | [Ee]xpress/
153 |
154 | # DocProject is a documentation generator add-in
155 | DocProject/buildhelp/
156 | DocProject/Help/*.HxT
157 | DocProject/Help/*.HxC
158 | DocProject/Help/*.hhc
159 | DocProject/Help/*.hhk
160 | DocProject/Help/*.hhp
161 | DocProject/Help/Html2
162 | DocProject/Help/html
163 |
164 | # Click-Once directory
165 | publish/
166 |
167 | # Publish Web Output
168 | *.[Pp]ublish.xml
169 | *.azurePubxml
170 | # Note: Comment the next line if you want to checkin your web deploy settings,
171 | # but database connection strings (with potential passwords) will be unencrypted
172 | *.pubxml
173 | *.publishproj
174 |
175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
176 | # checkin your Azure Web App publish settings, but sensitive information contained
177 | # in these scripts will be unencrypted
178 | PublishScripts/
179 |
180 | # NuGet Packages
181 | *.nupkg
182 | # The packages folder can be ignored because of Package Restore
183 | **/[Pp]ackages/*
184 | # except build/, which is used as an MSBuild target.
185 | !**/[Pp]ackages/build/
186 | # Uncomment if necessary however generally it will be regenerated when needed
187 | #!**/[Pp]ackages/repositories.config
188 | # NuGet v3's project.json files produces more ignorable files
189 | *.nuget.props
190 | *.nuget.targets
191 |
192 | # Microsoft Azure Build Output
193 | csx/
194 | *.build.csdef
195 |
196 | # Microsoft Azure Emulator
197 | ecf/
198 | rcf/
199 |
200 | # Windows Store app package directories and files
201 | AppPackages/
202 | BundleArtifacts/
203 | Package.StoreAssociation.xml
204 | _pkginfo.txt
205 | *.appx
206 |
207 | # Visual Studio cache files
208 | # files ending in .cache can be ignored
209 | *.[Cc]ache
210 | # but keep track of directories ending in .cache
211 | !*.[Cc]ache/
212 |
213 | # Others
214 | ClientBin/
215 | ~$*
216 | *~
217 | *.dbmdl
218 | *.dbproj.schemaview
219 | *.jfm
220 | *.pfx
221 | *.publishsettings
222 | orleans.codegen.cs
223 |
224 | # Including strong name files can present a security risk
225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
226 | #*.snk
227 |
228 | # Since there are multiple workflows, uncomment next line to ignore bower_components
229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
230 | #bower_components/
231 |
232 | # RIA/Silverlight projects
233 | Generated_Code/
234 |
235 | # Backup & report files from converting an old project file
236 | # to a newer Visual Studio version. Backup files are not needed,
237 | # because we have git ;-)
238 | _UpgradeReport_Files/
239 | Backup*/
240 | UpgradeLog*.XML
241 | UpgradeLog*.htm
242 | ServiceFabricBackup/
243 | *.rptproj.bak
244 |
245 | # SQL Server files
246 | *.mdf
247 | *.ldf
248 | *.ndf
249 |
250 | # Business Intelligence projects
251 | *.rdl.data
252 | *.bim.layout
253 | *.bim_*.settings
254 | *.rptproj.rsuser
255 |
256 | # Microsoft Fakes
257 | FakesAssemblies/
258 |
259 | # GhostDoc plugin setting file
260 | *.GhostDoc.xml
261 |
262 | # Node.js Tools for Visual Studio
263 | .ntvs_analysis.dat
264 | node_modules/
265 |
266 | # Visual Studio 6 build log
267 | *.plg
268 |
269 | # Visual Studio 6 workspace options file
270 | *.opt
271 |
272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
273 | *.vbw
274 |
275 | # Visual Studio LightSwitch build output
276 | **/*.HTMLClient/GeneratedArtifacts
277 | **/*.DesktopClient/GeneratedArtifacts
278 | **/*.DesktopClient/ModelManifest.xml
279 | **/*.Server/GeneratedArtifacts
280 | **/*.Server/ModelManifest.xml
281 | _Pvt_Extensions
282 |
283 | # Paket dependency manager
284 | .paket/paket.exe
285 | paket-files/
286 |
287 | # FAKE - F# Make
288 | .fake/
289 |
290 | # JetBrains Rider
291 | .idea/
292 | *.sln.iml
293 |
294 | # CodeRush
295 | .cr/
296 |
297 | # Python Tools for Visual Studio (PTVS)
298 | __pycache__/
299 | *.pyc
300 |
301 | # Cake - Uncomment if you are using it
302 | # tools/**
303 | # !tools/packages.config
304 |
305 | # Tabs Studio
306 | *.tss
307 |
308 | # Telerik's JustMock configuration file
309 | *.jmconfig
310 |
311 | # BizTalk build output
312 | *.btp.cs
313 | *.btm.cs
314 | *.odx.cs
315 | *.xsd.cs
316 |
317 | # OpenCover UI analysis results
318 | OpenCover/
319 |
320 | # Azure Stream Analytics local run output
321 | ASALocalRun/
322 |
323 | # MSBuild Binary and Structured Log
324 | *.binlog
325 |
326 | # NVidia Nsight GPU debugger configuration file
327 | *.nvuser
328 |
329 | # MFractors (Xamarin productivity tool) working folder
330 | .mfractor/
331 | *.tlog
332 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLS.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {aca3e5de-9a6e-490f-a0ff-d51ab68cb20b}
18 |
19 |
20 | {9bb16d05-43b9-4f6f-b9a9-6f43332c03db}
21 |
22 |
23 | {190770a1-c831-4826-8e45-62f3662f5ac6}
24 |
25 |
26 | {45e0e910-4eb6-473c-9670-b7a4e8d3b499}
27 |
28 |
29 | {5f86cbbb-d6fa-45bd-9b80-a9f4e5e2c5d5}
30 |
31 |
32 |
33 |
34 |
35 | 资源文件
36 |
37 |
38 | 资源文件
39 |
40 |
41 |
42 |
43 | 头文件
44 |
45 |
46 | 头文件
47 |
48 |
49 | 头文件
50 |
51 |
52 | 头文件
53 |
54 |
55 | 头文件
56 |
57 |
58 | Assistant
59 |
60 |
61 | 头文件
62 |
63 |
64 | 头文件
65 |
66 |
67 | 头文件
68 |
69 |
70 | 头文件
71 |
72 |
73 | 头文件
74 |
75 |
76 | 头文件
77 |
78 |
79 | ControlsClass
80 |
81 |
82 | ControlsClass
83 |
84 |
85 | ControlsClass
86 |
87 |
88 | ControlsClass
89 |
90 |
91 | ControlsClass
92 |
93 |
94 | 头文件
95 |
96 |
97 | CommonLib\LogLib
98 |
99 |
100 | CommonLib\LogLib
101 |
102 |
103 | CommonLib
104 |
105 |
106 | CommonLib
107 |
108 |
109 | CommonLib\disasm
110 |
111 |
112 | 头文件
113 |
114 |
115 | 头文件
116 |
117 |
118 |
119 |
120 | 源文件
121 |
122 |
123 | 源文件
124 |
125 |
126 | 源文件
127 |
128 |
129 | 源文件
130 |
131 |
132 | Assistant
133 |
134 |
135 | 源文件
136 |
137 |
138 | 源文件
139 |
140 |
141 | 源文件
142 |
143 |
144 | 源文件
145 |
146 |
147 | ControlsClass
148 |
149 |
150 | ControlsClass
151 |
152 |
153 | ControlsClass
154 |
155 |
156 | ControlsClass
157 |
158 |
159 | ControlsClass
160 |
161 |
162 | 源文件
163 |
164 |
165 | CommonLib\LogLib
166 |
167 |
168 | CommonLib\LogLib
169 |
170 |
171 | CommonLib
172 |
173 |
174 | CommonLib
175 |
176 |
177 | CommonLib\disasm
178 |
179 |
180 | CommonLib\disasm
181 |
182 |
183 | CommonLib\disasm
184 |
185 |
186 | 源文件
187 |
188 |
189 | 源文件
190 |
191 |
192 |
193 |
194 | 资源文件
195 |
196 |
197 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/16Edit/APIs.tXt:
--------------------------------------------------------------------------------
1 |
2 | ----------------------------------------
3 | 16Edit - programming interface reference
4 | ----------------------------------------
5 |
6 |
7 | General Notes:
8 | --------------
9 | Per process can only one 16Edit window be opened at the same time.
10 |
11 | 16Edit uses an own clipboard format, so it's not possible to correspond with
12 | other programms. Anyway one can transfer data between 16Edit instances.
13 |
14 | Keep attention on the byte alignment of the 16Edit structures!
15 |
16 |
17 | API:
18 | ----
19 | To open up a 16Edit window instance in your project you always have to call
20 | "HESpecifySettings" first and after that either "HEEnterWindowLoop" or
21 | "HEEnterWindowLoopInNewThread".
22 |
23 | -------------------------------------------------------------------------------------
24 |
25 | BOOL __stdcall HESpecifySettings(PHE_SETTINGS sets);
26 |
27 |
28 | This function configures 16Edit and specifies the input which is either a
29 | memory block (HE_SET_MEMORYBLOCKINPUT) or a file (HE_SET_INPUTFILE).
30 |
31 | This function could fail because of the following reasons:
32 | - neither an input file nor an input memory block was specified
33 | - the input file could not be loaded
34 | - not enough memory available
35 | - the 16Edit window is opened
36 | .. all other errors or bad items in HE_SETTINGS are ignored or validated.
37 |
38 | -------------------------------------------------------------------------------------
39 |
40 | Possible flags for "HE_SETTINGS.dwMask":
41 |
42 | #define HE_SET_FORCEREADONLY 0x00000001
43 | #define HE_SET_NORESIZE 0x00000002
44 | #define HE_SET_SETCURRENTOFFSET 0x00000004
45 | #define HE_SET_SETSELECTION 0x00000008
46 | #define HE_SET_ACTIONHANDLER 0x00000010
47 | #define HE_SET_INPUTFILE 0x00000020
48 | #define HE_SET_MEMORYBLOCKINPUT 0x00000040
49 | #define HE_SET_ONTOP 0x00000080
50 | #define HE_SET_PARENTWINDOW 0x00000100
51 | #define HE_SET_MINIMIZETOTRAY 0x00000200
52 | #define HE_SET_SAVEWINDOWPOSITION 0x00000400
53 | #define HE_SET_RESTOREWINDOWPOSITION 0x00000800
54 | #define HE_SET_USERWINDOWPOSITION 0x00001000
55 |
56 |
57 | HE_SET_FORCEREADONLY:
58 | Forbids any changes in the buffer, also if read-write-access could be
59 | obtained.
60 |
61 | HE_SET_NORESIZE:
62 | Forbids any operations which modify the size of the buffer. In fact the
63 | cutting and pasting functions are disabled.
64 |
65 | HE_SET_SETCURRENTOFFSET:
66 | The caret is set to the position specified in "HE_SETTINGS.posCaret" on
67 | startup.
68 |
69 | HE_SET_SETSELECTION:
70 | The buffer block defined by "HE_SETTINGS.dwSelStartOff" and
71 | "HE_SETTINGS.dwSelEndOff" is selected on startup.
72 |
73 | You can only use either HE_SET_SETCURRENTOFFSET or HE_SET_SETSELECTION !
74 |
75 | HE_SET_ACTIONHANDLER:
76 | Installs an action handler which will get called in special effets are
77 | occurring or passed. The address of this handler should be put into
78 | "HE_SETTINGS.pHandler". Look down for the description of "HE_ACTION" for more
79 | information.
80 |
81 | HE_SET_INPUTFILE:
82 | A file ("HE_SETTINGS.szFilePath") is used as input. 16Edit tries to get write
83 | access. The client is informed about the result through the
84 | HE_ACTION_FILEACCESSINFO action event.
85 |
86 | HE_SET_MEMORYBLOCKINPUT:
87 | A memory block ("HE_SETTINGS.diMem") is used as input. Also if the user is
88 | allowed to resize the memory block, it's not able to make it grow over the
89 | size specifed in "HE_SETTINGS.diData.dwSize" !
90 |
91 | You can only specify either HE_SET_INPUTFILE or HE_SET_MEMORYBLOCKINPUT !
92 |
93 | HE_SET_ONTOP:
94 | The main window is set to top state on startup.
95 |
96 | HE_SET_PARENTWINDOW:
97 | The main window gets a client window of the window whose handle is set it
98 | "HE_SETTINGS.hwndParent".
99 |
100 | HE_SET_MINIMIZETOTRAY:
101 | Every time the main window is minimized it inserts an icon in the system tray and the
102 | window isn't visible in the task bar anymore. The minimized window can be restored
103 | either by double clicking on the icon in the tray or by a right click which causes a
104 | menu to appear.
105 |
106 | HE_SET_SAVEWINDOWPOSITION:
107 | 16Edit saves its window size,position and state in an ini file (16Edit.ini) which
108 | will be saved in the same directory as 16Edit.dll.
109 |
110 | HE_SET_RESTOREWINDOWPOSITION:
111 | If you specify this flag then 16Edit will restore the old window size,position and
112 | state if a 16Edit.ini lies in the same directory as 16Edit.dll.
113 | See HE_SET_SAVEWINDOWPOSITION.
114 |
115 | HE_SET_USERWINDOWPOSITION:
116 | "HE_SETTINGS.wpUser" is used to setup the main window on startup.
117 | HE_SET_RESTOREWINDOWPOSITION has no effect in this case.
118 |
119 | -------------------------------------------------------------------------------------
120 |
121 | typedef struct HE_DATA_INFO
122 | {
123 | void* pDataBuff;
124 | DWORD dwSize;
125 | BOOL bReadOnly;
126 | } *PHE_DATA_INFO;
127 |
128 |
129 | This is the structure for an input memory block (HE_SET_MEMORYBLOCKINPUT). All structure
130 | items are self-explaining, I think.
131 |
132 | -------------------------------------------------------------------------------------
133 |
134 | typedef struct HE_POS
135 | {
136 | DWORD dwOffset;
137 | BOOL bHiword; // (opt.) first digit of the pair ? ...or the 2nd one ?
138 | BOOL bTextSection; // (opt.) Caret in the text part ?
139 | } *PHE_POS;
140 |
141 |
142 | This structure is used if you wish to set the caret on startup (HE_SET_SETCURRENTOFFSET).
143 |
144 | -------------------------------------------------------------------------------------
145 |
146 | typedef struct _HE_WIN_POS
147 | {
148 | int iState; // SW_SHOWNORMAL/SW_MAXIMIZE/SW_MINIMIZE
149 | int ix, iy, icx, icy; // left, top, width, height
150 | } HE_WIN_POS, *PHE_WIN_POS;
151 |
152 |
153 | Used to describe the state of a window.
154 |
155 | -------------------------------------------------------------------------------------
156 |
157 | typedef struct _HE_SETTINGS
158 | {
159 | DWORD dwMask; // HE_SET_XXX flags
160 |
161 | procActionHandler pHandler; // HE_SET_ACTIONHANDLER
162 |
163 | HE_POS posCaret; // HE_SET_SETCURRENTOFFSET
164 |
165 | DWORD dwSelStartOff; // HE_SET_SETSELECTION
166 | DWORD dwSelEndOff; //
167 |
168 | HWND hwndParent; // HE_SET_PARENTWINDOW
169 |
170 | union
171 | {
172 | char* szFilePath; // HE_SET_INPUTFILE
173 |
174 | HE_DATA_INFO diMem; // HE_SET_MEMORYBLOCKINPUT
175 | };
176 |
177 | HE_WIN_POS wpUser; // HE_SET_USERWINDOWPOSITION
178 | } HE_SETTINGS, *PHE_SETTINGS;
179 |
180 |
181 | dwMask:
182 | is a combination of HE_SET_XXX flags.
183 |
184 | pHandler: (HE_SET_ACTIONHANDLER)
185 | Optional address of a action handler routine.
186 |
187 | posCaret: (HE_SET_SETCURRENTOFFSET)
188 | Optional address of a HE_POS structure for the caret position.
189 |
190 | dwSelStartOff/dwSelEndOff: (HE_SET_SETSELECTION)
191 | Optional selection start/end.
192 |
193 | hwndParent: (HE_SET_PARENTWINDOW)
194 | Optional parent window handle.
195 |
196 | szFilePath: (HE_SET_INPUTFILE)
197 | Optional NUL terminated string pointer to the input file path.
198 |
199 | diMem: (HE_SET_MEMORYBLOCKINPUT)
200 | Optional information about the input memory block.
201 |
202 | wpUser: (HE_SET_USERWINDOWPOSITION)
203 | Apply user window state on startup.
204 |
205 | Look at the HE_SET_XXX flag definition above for more information.
206 |
207 | -------------------------------------------------------------------------------------
208 |
209 | typedef struct HE_ACTION
210 | {
211 | DWORD dwActionCode;
212 |
213 | DWORD dwNewSize; // HE_ACTION_SAVED
214 |
215 | BOOL bReadWrite; // HE_ACTION_FILEACCESSINFO
216 |
217 | HWND hwnd16Edit; // HE_ACTION_WINDOWCREATED
218 | } *PHE_ACTION;
219 |
220 | typedef BOOL (__stdcall* procActionHandler)(PHE_ACTION pa);
221 |
222 |
223 | As mentioned you can specify an action handler. Every time if one of the following
224 | mentioned events occurres, the action handler is called. The event type is signed by
225 | "PHE_ACTION->dwActionCode".
226 | The BOOL return value is up to now useless.
227 |
228 | -------------------------------------------------------------------------------------
229 |
230 | Possible values for "HE_ACTION.dwActionCode":
231 |
232 | #define HE_ACTION_EXITING 0x00000001
233 | #define HE_ACTION_SAVED 0x00000002
234 | #define HE_ACTION_FILEACCESSINFO 0x00000004
235 | #define HE_ACTION_WINDOWCREATED 0x00000008
236 |
237 |
238 | HE_ACTION_EXITING:
239 | The user is closing the window. No additional information.
240 |
241 | HE_ACTION_SAVED:
242 | The modification were saved to the input file/memory block. "HE_ACTION.dwNewSize"
243 | holds the new size.
244 |
245 | HE_ACTION_FILEACCESSINFO:
246 | This event occurs if input is a file and 16Edit finished the file opening
247 | process. "HE_ACTION.bReadWrite" shows whether 16Edit was able to gain read and
248 | write access.
249 |
250 | HE_ACTION_WINDOWCREATED:
251 | The handler will be called after the main window was created and set up.
252 | "HE_ACTION.hwnd16Edit" will hold the handle of the 16Edit main window.
253 |
254 | -------------------------------------------------------------------------------------
255 |
256 | BOOL __stdcall HEEnterWindowLoop();
257 | BOOL __stdcall HEEnterWindowLoopInNewThread();
258 |
259 |
260 | Both routines open the 16Edit main window up.
261 | But "HEEnterWindowLoop" enters the window loop within the thread which calls
262 | the function and "HEEnterWindowLoopInNewThread" creates a new thread which is
263 | entering the window loop.
264 | Both routines fail if the window of the 16Edit.dll instance is already opened.
265 |
266 |
--------------------------------------------------------------------------------
/PETOOLS/PETOOLS/PETOOLS.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {382BBBA3-9C9A-4C64-85C4-9D8D829D1A6E}
15 | PETOOLS
16 | MFCProj
17 | 10.0
18 |
19 |
20 |
21 | Application
22 | true
23 | MultiByte
24 | Dynamic
25 | v142
26 |
27 |
28 | Application
29 | false
30 | true
31 | MultiByte
32 | Dynamic
33 | false
34 | v142
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | true
49 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(SolutionDir)$(Configuration)\;$(SolutionDir)\
50 | $(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\CommonLib\;
51 |
52 |
53 | false
54 | $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86;$(SolutionDir)$(Configuration)\;$(SolutionDir)\
55 | $(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\CommonLib\;
56 |
57 |
58 |
59 | Use
60 | Level3
61 | Disabled
62 | WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)
63 | true
64 |
65 |
66 | Windows
67 | true
68 | AsInvoker
69 |
70 |
71 | true
72 |
73 |
74 | true
75 |
76 |
77 | false
78 | true
79 | _DEBUG;%(PreprocessorDefinitions)
80 |
81 |
82 | 0x0804
83 | _DEBUG;%(PreprocessorDefinitions)
84 | $(IntDir);%(AdditionalIncludeDirectories)
85 |
86 |
87 | C:\masm32\include
88 |
89 |
90 |
91 |
92 | Level3
93 | Use
94 | MaxSpeed
95 | true
96 | true
97 | WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)
98 |
99 |
100 | MultiThreadedDLL
101 |
102 |
103 | Windows
104 | true
105 | true
106 | true
107 |
108 |
109 |
110 |
111 | false
112 | true
113 | NDEBUG;%(PreprocessorDefinitions)
114 |
115 |
116 | 0x0804
117 | NDEBUG;%(PreprocessorDefinitions)
118 | $(IntDir);%(AdditionalIncludeDirectories)
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 | NotUsing
156 | NotUsing
157 |
158 |
159 | NotUsing
160 | NotUsing
161 |
162 |
163 | NotUsing
164 | NotUsing
165 |
166 |
167 | NotUsing
168 | NotUsing
169 |
170 |
171 | NotUsing
172 | NotUsing
173 |
174 |
175 | NotUsing
176 | NotUsing
177 |
178 |
179 | NotUsing
180 | NotUsing
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 | NotUsing
189 | NotUsing
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 | Create
203 | Create
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/zlib/zconf.h:
--------------------------------------------------------------------------------
1 | /* zconf.h -- configuration of the zlib compression library
2 | * Copyright (C) 1995-2013 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* @(#) $Id$ */
7 |
8 | #ifndef ZCONF_H
9 | #define ZCONF_H
10 |
11 | /*
12 | * If you *really* need a unique prefix for all types and library functions,
13 | * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14 | * Even better than compiling with -DZ_PREFIX would be to use configure to set
15 | * this permanently in zconf.h using "./configure --zprefix".
16 | */
17 | #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
18 | # define Z_PREFIX_SET
19 |
20 | /* all linked symbols */
21 | # define _dist_code z__dist_code
22 | # define _length_code z__length_code
23 | # define _tr_align z__tr_align
24 | # define _tr_flush_bits z__tr_flush_bits
25 | # define _tr_flush_block z__tr_flush_block
26 | # define _tr_init z__tr_init
27 | # define _tr_stored_block z__tr_stored_block
28 | # define _tr_tally z__tr_tally
29 | # define adler32 z_adler32
30 | # define adler32_combine z_adler32_combine
31 | # define adler32_combine64 z_adler32_combine64
32 | # ifndef Z_SOLO
33 | # define compress z_compress
34 | # define compress2 z_compress2
35 | # define compressBound z_compressBound
36 | # endif
37 | # define crc32 z_crc32
38 | # define crc32_combine z_crc32_combine
39 | # define crc32_combine64 z_crc32_combine64
40 | # define deflate z_deflate
41 | # define deflateBound z_deflateBound
42 | # define deflateCopy z_deflateCopy
43 | # define deflateEnd z_deflateEnd
44 | # define deflateInit2_ z_deflateInit2_
45 | # define deflateInit_ z_deflateInit_
46 | # define deflateParams z_deflateParams
47 | # define deflatePending z_deflatePending
48 | # define deflatePrime z_deflatePrime
49 | # define deflateReset z_deflateReset
50 | # define deflateResetKeep z_deflateResetKeep
51 | # define deflateSetDictionary z_deflateSetDictionary
52 | # define deflateSetHeader z_deflateSetHeader
53 | # define deflateTune z_deflateTune
54 | # define deflate_copyright z_deflate_copyright
55 | # define get_crc_table z_get_crc_table
56 | # ifndef Z_SOLO
57 | # define gz_error z_gz_error
58 | # define gz_intmax z_gz_intmax
59 | # define gz_strwinerror z_gz_strwinerror
60 | # define gzbuffer z_gzbuffer
61 | # define gzclearerr z_gzclearerr
62 | # define gzclose z_gzclose
63 | # define gzclose_r z_gzclose_r
64 | # define gzclose_w z_gzclose_w
65 | # define gzdirect z_gzdirect
66 | # define gzdopen z_gzdopen
67 | # define gzeof z_gzeof
68 | # define gzerror z_gzerror
69 | # define gzflush z_gzflush
70 | # define gzgetc z_gzgetc
71 | # define gzgetc_ z_gzgetc_
72 | # define gzgets z_gzgets
73 | # define gzoffset z_gzoffset
74 | # define gzoffset64 z_gzoffset64
75 | # define gzopen z_gzopen
76 | # define gzopen64 z_gzopen64
77 | # ifdef _WIN32
78 | # define gzopen_w z_gzopen_w
79 | # endif
80 | # define gzprintf z_gzprintf
81 | # define gzvprintf z_gzvprintf
82 | # define gzputc z_gzputc
83 | # define gzputs z_gzputs
84 | # define gzread z_gzread
85 | # define gzrewind z_gzrewind
86 | # define gzseek z_gzseek
87 | # define gzseek64 z_gzseek64
88 | # define gzsetparams z_gzsetparams
89 | # define gztell z_gztell
90 | # define gztell64 z_gztell64
91 | # define gzungetc z_gzungetc
92 | # define gzwrite z_gzwrite
93 | # endif
94 | # define inflate z_inflate
95 | # define inflateBack z_inflateBack
96 | # define inflateBackEnd z_inflateBackEnd
97 | # define inflateBackInit_ z_inflateBackInit_
98 | # define inflateCopy z_inflateCopy
99 | # define inflateEnd z_inflateEnd
100 | # define inflateGetHeader z_inflateGetHeader
101 | # define inflateInit2_ z_inflateInit2_
102 | # define inflateInit_ z_inflateInit_
103 | # define inflateMark z_inflateMark
104 | # define inflatePrime z_inflatePrime
105 | # define inflateReset z_inflateReset
106 | # define inflateReset2 z_inflateReset2
107 | # define inflateSetDictionary z_inflateSetDictionary
108 | # define inflateGetDictionary z_inflateGetDictionary
109 | # define inflateSync z_inflateSync
110 | # define inflateSyncPoint z_inflateSyncPoint
111 | # define inflateUndermine z_inflateUndermine
112 | # define inflateResetKeep z_inflateResetKeep
113 | # define inflate_copyright z_inflate_copyright
114 | # define inflate_fast z_inflate_fast
115 | # define inflate_table z_inflate_table
116 | # ifndef Z_SOLO
117 | # define uncompress z_uncompress
118 | # endif
119 | # define zError z_zError
120 | # ifndef Z_SOLO
121 | # define zcalloc z_zcalloc
122 | # define zcfree z_zcfree
123 | # endif
124 | # define zlibCompileFlags z_zlibCompileFlags
125 | # define zlibVersion z_zlibVersion
126 |
127 | /* all zlib typedefs in zlib.h and zconf.h */
128 | # define Byte z_Byte
129 | # define Bytef z_Bytef
130 | # define alloc_func z_alloc_func
131 | # define charf z_charf
132 | # define free_func z_free_func
133 | # ifndef Z_SOLO
134 | # define gzFile z_gzFile
135 | # endif
136 | # define gz_header z_gz_header
137 | # define gz_headerp z_gz_headerp
138 | # define in_func z_in_func
139 | # define intf z_intf
140 | # define out_func z_out_func
141 | # define uInt z_uInt
142 | # define uIntf z_uIntf
143 | # define uLong z_uLong
144 | # define uLongf z_uLongf
145 | # define voidp z_voidp
146 | # define voidpc z_voidpc
147 | # define voidpf z_voidpf
148 |
149 | /* all zlib structs in zlib.h and zconf.h */
150 | # define gz_header_s z_gz_header_s
151 | # define internal_state z_internal_state
152 |
153 | #endif
154 |
155 | #if defined(__MSDOS__) && !defined(MSDOS)
156 | # define MSDOS
157 | #endif
158 | #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
159 | # define OS2
160 | #endif
161 | #if defined(_WINDOWS) && !defined(WINDOWS)
162 | # define WINDOWS
163 | #endif
164 | #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
165 | # ifndef WIN32
166 | # define WIN32
167 | # endif
168 | #endif
169 | #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
170 | # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
171 | # ifndef SYS16BIT
172 | # define SYS16BIT
173 | # endif
174 | # endif
175 | #endif
176 |
177 | /*
178 | * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
179 | * than 64k bytes at a time (needed on systems with 16-bit int).
180 | */
181 | #ifdef SYS16BIT
182 | # define MAXSEG_64K
183 | #endif
184 | #ifdef MSDOS
185 | # define UNALIGNED_OK
186 | #endif
187 |
188 | #ifdef __STDC_VERSION__
189 | # ifndef STDC
190 | # define STDC
191 | # endif
192 | # if __STDC_VERSION__ >= 199901L
193 | # ifndef STDC99
194 | # define STDC99
195 | # endif
196 | # endif
197 | #endif
198 | #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
199 | # define STDC
200 | #endif
201 | #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
202 | # define STDC
203 | #endif
204 | #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
205 | # define STDC
206 | #endif
207 | #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
208 | # define STDC
209 | #endif
210 |
211 | #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
212 | # define STDC
213 | #endif
214 |
215 | #ifndef STDC
216 | # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
217 | # define const /* note: need a more gentle solution here */
218 | # endif
219 | #endif
220 |
221 | #if defined(ZLIB_CONST) && !defined(z_const)
222 | # define z_const const
223 | #else
224 | # define z_const
225 | #endif
226 |
227 | /* Some Mac compilers merge all .h files incorrectly: */
228 | #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
229 | # define NO_DUMMY_DECL
230 | #endif
231 |
232 | /* Maximum value for memLevel in deflateInit2 */
233 | #ifndef MAX_MEM_LEVEL
234 | # ifdef MAXSEG_64K
235 | # define MAX_MEM_LEVEL 8
236 | # else
237 | # define MAX_MEM_LEVEL 9
238 | # endif
239 | #endif
240 |
241 | /* Maximum value for windowBits in deflateInit2 and inflateInit2.
242 | * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
243 | * created by gzip. (Files created by minigzip can still be extracted by
244 | * gzip.)
245 | */
246 | #ifndef MAX_WBITS
247 | # define MAX_WBITS 15 /* 32K LZ77 window */
248 | #endif
249 |
250 | /* The memory requirements for deflate are (in bytes):
251 | (1 << (windowBits+2)) + (1 << (memLevel+9))
252 | that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
253 | plus a few kilobytes for small objects. For example, if you want to reduce
254 | the default memory requirements from 256K to 128K, compile with
255 | make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
256 | Of course this will generally degrade compression (there's no free lunch).
257 |
258 | The memory requirements for inflate are (in bytes) 1 << windowBits
259 | that is, 32K for windowBits=15 (default value) plus a few kilobytes
260 | for small objects.
261 | */
262 |
263 | /* Type declarations */
264 |
265 | #ifndef OF /* function prototypes */
266 | # ifdef STDC
267 | # define OF(args) args
268 | # else
269 | # define OF(args) ()
270 | # endif
271 | #endif
272 |
273 | #ifndef Z_ARG /* function prototypes for stdarg */
274 | # if defined(STDC) || defined(Z_HAVE_STDARG_H)
275 | # define Z_ARG(args) args
276 | # else
277 | # define Z_ARG(args) ()
278 | # endif
279 | #endif
280 |
281 | /* The following definitions for FAR are needed only for MSDOS mixed
282 | * model programming (small or medium model with some far allocations).
283 | * This was tested only with MSC; for other MSDOS compilers you may have
284 | * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
285 | * just define FAR to be empty.
286 | */
287 | #ifdef SYS16BIT
288 | # if defined(M_I86SM) || defined(M_I86MM)
289 | /* MSC small or medium model */
290 | # define SMALL_MEDIUM
291 | # ifdef _MSC_VER
292 | # define FAR _far
293 | # else
294 | # define FAR far
295 | # endif
296 | # endif
297 | # if (defined(__SMALL__) || defined(__MEDIUM__))
298 | /* Turbo C small or medium model */
299 | # define SMALL_MEDIUM
300 | # ifdef __BORLANDC__
301 | # define FAR _far
302 | # else
303 | # define FAR far
304 | # endif
305 | # endif
306 | #endif
307 |
308 | #if defined(WINDOWS) || defined(WIN32)
309 | /* If building or using zlib as a DLL, define ZLIB_DLL.
310 | * This is not mandatory, but it offers a little performance increase.
311 | */
312 | # ifdef ZLIB_DLL
313 | # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
314 | # ifdef ZLIB_INTERNAL
315 | # define ZEXTERN extern __declspec(dllexport)
316 | # else
317 | # define ZEXTERN extern __declspec(dllimport)
318 | # endif
319 | # endif
320 | # endif /* ZLIB_DLL */
321 | /* If building or using zlib with the WINAPI/WINAPIV calling convention,
322 | * define ZLIB_WINAPI.
323 | * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
324 | */
325 | # ifdef ZLIB_WINAPI
326 | # ifdef FAR
327 | # undef FAR
328 | # endif
329 | # include
330 | /* No need for _export, use ZLIB.DEF instead. */
331 | /* For complete Windows compatibility, use WINAPI, not __stdcall. */
332 | # define ZEXPORT WINAPI
333 | # ifdef WIN32
334 | # define ZEXPORTVA WINAPIV
335 | # else
336 | # define ZEXPORTVA FAR CDECL
337 | # endif
338 | # endif
339 | #endif
340 |
341 | #if defined (__BEOS__)
342 | # ifdef ZLIB_DLL
343 | # ifdef ZLIB_INTERNAL
344 | # define ZEXPORT __declspec(dllexport)
345 | # define ZEXPORTVA __declspec(dllexport)
346 | # else
347 | # define ZEXPORT __declspec(dllimport)
348 | # define ZEXPORTVA __declspec(dllimport)
349 | # endif
350 | # endif
351 | #endif
352 |
353 | #ifndef ZEXTERN
354 | # define ZEXTERN extern
355 | #endif
356 | #ifndef ZEXPORT
357 | # define ZEXPORT
358 | #endif
359 | #ifndef ZEXPORTVA
360 | # define ZEXPORTVA
361 | #endif
362 |
363 | #ifndef FAR
364 | # define FAR
365 | #endif
366 |
367 | #if !defined(__MACTYPES__)
368 | typedef unsigned char Byte; /* 8 bits */
369 | #endif
370 | typedef unsigned int uInt; /* 16 bits or more */
371 | typedef unsigned long uLong; /* 32 bits or more */
372 |
373 | #ifdef SMALL_MEDIUM
374 | /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
375 | # define Bytef Byte FAR
376 | #else
377 | typedef Byte FAR Bytef;
378 | #endif
379 | typedef char FAR charf;
380 | typedef int FAR intf;
381 | typedef uInt FAR uIntf;
382 | typedef uLong FAR uLongf;
383 |
384 | #ifdef STDC
385 | typedef void const *voidpc;
386 | typedef void FAR *voidpf;
387 | typedef void *voidp;
388 | #else
389 | typedef Byte const *voidpc;
390 | typedef Byte FAR *voidpf;
391 | typedef Byte *voidp;
392 | #endif
393 |
394 | #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
395 | # include
396 | # if (UINT_MAX == 0xffffffffUL)
397 | # define Z_U4 unsigned
398 | # elif (ULONG_MAX == 0xffffffffUL)
399 | # define Z_U4 unsigned long
400 | # elif (USHRT_MAX == 0xffffffffUL)
401 | # define Z_U4 unsigned short
402 | # endif
403 | #endif
404 |
405 | #ifdef Z_U4
406 | typedef Z_U4 z_crc_t;
407 | #else
408 | typedef unsigned long z_crc_t;
409 | #endif
410 |
411 | #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
412 | # define Z_HAVE_UNISTD_H
413 | #endif
414 |
415 | #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
416 | # define Z_HAVE_STDARG_H
417 | #endif
418 |
419 | #ifdef STDC
420 | # ifndef Z_SOLO
421 | # include /* for off_t */
422 | # endif
423 | #endif
424 |
425 | #if defined(STDC) || defined(Z_HAVE_STDARG_H)
426 | # ifndef Z_SOLO
427 | # include /* for va_list */
428 | # endif
429 | #endif
430 |
431 | #ifdef _WIN32
432 | # ifndef Z_SOLO
433 | # include /* for wchar_t */
434 | # endif
435 | #endif
436 |
437 | /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
438 | * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
439 | * though the former does not conform to the LFS document), but considering
440 | * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
441 | * equivalently requesting no 64-bit operations
442 | */
443 | #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
444 | # undef _LARGEFILE64_SOURCE
445 | #endif
446 |
447 | #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
448 | # define Z_HAVE_UNISTD_H
449 | #endif
450 | #ifndef Z_SOLO
451 | # if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
452 | # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
453 | # ifdef VMS
454 | # include /* for off_t */
455 | # endif
456 | # ifndef z_off_t
457 | # define z_off_t off_t
458 | # endif
459 | # endif
460 | #endif
461 |
462 | #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
463 | # define Z_LFS64
464 | #endif
465 |
466 | #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
467 | # define Z_LARGE64
468 | #endif
469 |
470 | #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
471 | # define Z_WANT64
472 | #endif
473 |
474 | #if !defined(SEEK_SET) && !defined(Z_SOLO)
475 | # define SEEK_SET 0 /* Seek from beginning of file. */
476 | # define SEEK_CUR 1 /* Seek from current position. */
477 | # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
478 | #endif
479 |
480 | #ifndef z_off_t
481 | # define z_off_t long
482 | #endif
483 |
484 | #if !defined(_WIN32) && defined(Z_LARGE64)
485 | # define z_off64_t off64_t
486 | #else
487 | # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
488 | # define z_off64_t __int64
489 | # else
490 | # define z_off64_t z_off_t
491 | # endif
492 | #endif
493 |
494 | /* MVS linker does not support external names larger than 8 bytes */
495 | #if defined(__MVS__)
496 | #pragma map(deflateInit_,"DEIN")
497 | #pragma map(deflateInit2_,"DEIN2")
498 | #pragma map(deflateEnd,"DEEND")
499 | #pragma map(deflateBound,"DEBND")
500 | #pragma map(inflateInit_,"ININ")
501 | #pragma map(inflateInit2_,"ININ2")
502 | #pragma map(inflateEnd,"INEND")
503 | #pragma map(inflateSync,"INSY")
504 | #pragma map(inflateSetDictionary,"INSEDI")
505 | #pragma map(compressBound,"CMBND")
506 | #pragma map(inflate_table,"INTABL")
507 | #pragma map(inflate_fast,"INFA")
508 | #pragma map(inflate_copyright,"INCOPY")
509 | #endif
510 |
511 | #endif /* ZCONF_H */
512 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/xml/Markup.h:
--------------------------------------------------------------------------------
1 | // Markup.h: interface for the CMarkup class.
2 | //
3 | // Markup Release 11.5
4 | // Copyright (C) 2011 First Objective Software, Inc. All rights reserved
5 | // Go to www.firstobject.com for the latest CMarkup and EDOM documentation
6 | // Use in commercial applications requires written permission
7 | // This software is provided "as is", with no warranty.
8 |
9 | #if !defined(_MARKUP_H_INCLUDED_)
10 | #define _MARKUP_H_INCLUDED_
11 |
12 | #include
13 | #include // memcpy, memset, strcmp...
14 |
15 | // Major build options
16 | // MARKUP_WCHAR wide char (2-byte UTF-16 on Windows, 4-byte UTF-32 on Linux and OS X)
17 | // MARKUP_MBCS ANSI/double-byte strings on Windows
18 | // MARKUP_STL (default except VC++) use STL strings instead of MFC strings
19 | // MARKUP_SAFESTR to use string _s functions in VC++ 2005 (_MSC_VER >= 1400)
20 | // MARKUP_WINCONV (default for VC++) for Windows API character conversion
21 | // MARKUP_ICONV (default for GNU) for character conversion on Linux and OS X and other platforms
22 | // MARKUP_STDCONV to use neither WINCONV or ICONV, falls back to setlocale based conversion for ANSI
23 | //
24 | #if ! defined(MARKUP_WINDOWS)
25 | #if defined(_WIN32) || defined(WIN32)
26 | #define MARKUP_WINDOWS
27 | #endif // WIN32 or _WIN32
28 | #endif // not MARKUP_WINDOWS
29 | #if _MSC_VER > 1000 // VC++
30 | #pragma once
31 | #if ! defined(MARKUP_SAFESTR) // not VC++ safe strings
32 | #pragma warning(disable:4996) // VC++ 2005 deprecated function warnings
33 | #endif // not VC++ safe strings
34 | #if defined(MARKUP_STL) && _MSC_VER < 1400 // STL pre VC++ 2005
35 | #pragma warning(disable:4786) // std::string long names
36 | #endif // VC++ 2005 STL
37 | #else // not VC++
38 | #if ! defined(MARKUP_STL)
39 | #define MARKUP_STL
40 | #endif // not STL
41 | #if defined(__GNUC__) && ! defined(MARKUP_ICONV) && ! defined(MARKUP_STDCONV) && ! defined(MARKUP_WINCONV)
42 | #if ! defined(MARKUP_WINDOWS)
43 | #define MARKUP_ICONV
44 | #endif // not Windows
45 | #endif // GNUC and not ICONV not STDCONV not WINCONV
46 | #endif // not VC++
47 | #if (defined(_UNICODE) || defined(UNICODE)) && ! defined(MARKUP_WCHAR)
48 | #define MARKUP_WCHAR
49 | #endif // _UNICODE or UNICODE
50 | #if (defined(_MBCS) || defined(MBCS)) && ! defined(MARKUP_MBCS)
51 | #define MARKUP_MBCS
52 | #endif // _MBCS and not MBCS
53 | #if ! defined(MARKUP_SIZEOFWCHAR)
54 | #if __SIZEOF_WCHAR_T__ == 4 || __WCHAR_MAX__ > 0x10000
55 | #define MARKUP_SIZEOFWCHAR 4
56 | #else // sizeof(wchar_t) != 4
57 | #define MARKUP_SIZEOFWCHAR 2
58 | #endif // sizeof(wchar_t) != 4
59 | #endif // not MARKUP_SIZEOFWCHAR
60 | #if ! defined(MARKUP_WINCONV) && ! defined(MARKUP_STDCONV) && ! defined(MARKUP_ICONV)
61 | #define MARKUP_WINCONV
62 | #endif // not WINCONV not STDCONV not ICONV
63 | #if ! defined(MARKUP_FILEBLOCKSIZE)
64 | #define MARKUP_FILEBLOCKSIZE 16384
65 | #endif
66 |
67 | // Text type and function defines (compiler and build-option dependent)
68 | //
69 | #define MCD_ACP 0
70 | #define MCD_UTF8 65001
71 | #define MCD_UTF16 1200
72 | #define MCD_UTF32 65005
73 | #if defined(MARKUP_WCHAR)
74 | #define MCD_CHAR wchar_t
75 | #define MCD_PCSZ const wchar_t*
76 | #define MCD_PSZLEN (int)wcslen
77 | #define MCD_PSZCHR wcschr
78 | #define MCD_PSZSTR wcsstr
79 | #define MCD_PSZTOL wcstol
80 | #if defined(MARKUP_SAFESTR) // VC++ safe strings
81 | #define MCD_SSZ(sz) sz,(sizeof(sz)/sizeof(MCD_CHAR))
82 | #define MCD_PSZCPY(sz,p) wcscpy_s(MCD_SSZ(sz),p)
83 | #define MCD_PSZNCPY(sz,p,n) wcsncpy_s(MCD_SSZ(sz),p,n)
84 | #define MCD_SPRINTF swprintf_s
85 | #define MCD_FOPEN(f,n,m) {if(_wfopen_s(&f,n,m)!=0)f=NULL;}
86 | #else // not VC++ safe strings
87 | #if defined(__GNUC__) && ! defined(MARKUP_WINDOWS) // non-Windows GNUC
88 | #define MCD_SSZ(sz) sz,(sizeof(sz)/sizeof(MCD_CHAR))
89 | #else // not non-Windows GNUC
90 | #define MCD_SSZ(sz) sz
91 | #endif // not non-Windows GNUC
92 | #define MCD_PSZCPY wcscpy
93 | #define MCD_PSZNCPY wcsncpy
94 | #define MCD_SPRINTF swprintf
95 | #define MCD_FOPEN(f,n,m) f=_wfopen(n,m)
96 | #endif // not VC++ safe strings
97 | #define MCD_T(s) L ## s
98 | #if MARKUP_SIZEOFWCHAR == 4 // sizeof(wchar_t) == 4
99 | #define MCD_ENC MCD_T("UTF-32")
100 | #else // sizeof(wchar_t) == 2
101 | #define MCD_ENC MCD_T("UTF-16")
102 | #endif
103 | #define MCD_CLEN(p) 1
104 | #else // not MARKUP_WCHAR
105 | #define MCD_CHAR char
106 | #define MCD_PCSZ const char*
107 | #define MCD_PSZLEN (int)strlen
108 | #define MCD_PSZCHR strchr
109 | #define MCD_PSZSTR strstr
110 | #define MCD_PSZTOL strtol
111 | #if defined(MARKUP_SAFESTR) // VC++ safe strings
112 | #define MCD_SSZ(sz) sz,(sizeof(sz)/sizeof(MCD_CHAR))
113 | #define MCD_PSZCPY(sz,p) strcpy_s(MCD_SSZ(sz),p)
114 | #define MCD_PSZNCPY(sz,p,n) strncpy_s(MCD_SSZ(sz),p,n)
115 | #define MCD_SPRINTF sprintf_s
116 | #define MCD_FOPEN(f,n,m) {if(fopen_s(&f,n,m)!=0)f=NULL;}
117 | #else // not VC++ safe strings
118 | #define MCD_SSZ(sz) sz
119 | #define MCD_PSZCPY strcpy
120 | #define MCD_PSZNCPY strncpy
121 | #define MCD_SPRINTF sprintf
122 | #define MCD_FOPEN(f,n,m) f=fopen(n,m)
123 | #endif // not VC++ safe strings
124 | #define MCD_T(s) s
125 | #if defined(MARKUP_MBCS) // MBCS/double byte
126 | #define MCD_ENC MCD_T("")
127 | #if defined(MARKUP_WINCONV)
128 | #define MCD_CLEN(p) (int)_mbclen((const unsigned char*)p)
129 | #else // not WINCONV
130 | #define MCD_CLEN(p) (int)mblen(p,MB_CUR_MAX)
131 | #endif // not WINCONV
132 | #else // not MBCS/double byte
133 | #define MCD_ENC MCD_T("UTF-8")
134 | #define MCD_CLEN(p) 1
135 | #endif // not MBCS/double byte
136 | #endif // not MARKUP_WCHAR
137 | #if _MSC_VER < 1000 // not VC++
138 | #define MCD_STRERROR strerror(errno)
139 | #endif // not VC++
140 |
141 | // String type and function defines (compiler and build-option dependent)
142 | // Define MARKUP_STL to use STL strings
143 | //
144 | #if defined(MARKUP_STL) // STL
145 | #include
146 | #if defined(MARKUP_WCHAR)
147 | #define MCD_STR std::wstring
148 | #else // not MARKUP_WCHAR
149 | #define MCD_STR std::string
150 | #endif // not MARKUP_WCHAR
151 | #define MCD_2PCSZ(s) s.c_str()
152 | #define MCD_STRLENGTH(s) (int)s.size()
153 | #define MCD_STRCLEAR(s) s.erase()
154 | #define MCD_STRCLEARSIZE(s) MCD_STR t; s.swap(t)
155 | #define MCD_STRISEMPTY(s) s.empty()
156 | #define MCD_STRMID(s,n,l) s.substr(n,l)
157 | #define MCD_STRASSIGN(s,p,n) s.assign(p,n)
158 | #define MCD_STRCAPACITY(s) (int)s.capacity()
159 | #define MCD_STRINSERTREPLACE(d,i,r,s) d.replace(i,r,s)
160 | #define MCD_GETBUFFER(s,n) new MCD_CHAR[n+1]; if ((int)s.capacity()<(int)n) s.reserve(n)
161 | #define MCD_RELEASEBUFFER(s,p,n) s.replace(0,s.size(),p,n); delete[]p
162 | #define MCD_BLDRESERVE(s,n) s.reserve(n)
163 | #define MCD_BLDCHECK(s,n,d) ;
164 | #define MCD_BLDRELEASE(s) ;
165 | #define MCD_BLDAPPENDN(s,p,n) s.append(p,n)
166 | #define MCD_BLDAPPEND(s,p) s.append(p)
167 | #define MCD_BLDAPPEND1(s,c) s+=(MCD_CHAR)(c)
168 | #define MCD_BLDLEN(s) (int)s.size()
169 | #define MCD_BLDTRUNC(s,n) s.resize(n)
170 | #else // not STL, i.e. MFC
171 | // afx.h provides CString, to avoid "WINVER not defined" #include stdafh.x in Markup.cpp
172 | #include
173 | #define MCD_STR CString
174 | #define MCD_2PCSZ(s) ((MCD_PCSZ)s)
175 | #define MCD_STRLENGTH(s) s.GetLength()
176 | #define MCD_STRCLEAR(s) s.Empty()
177 | #define MCD_STRCLEARSIZE(s) s=MCD_STR()
178 | #define MCD_STRISEMPTY(s) s.IsEmpty()
179 | #define MCD_STRMID(s,n,l) s.Mid(n,l)
180 | #define MCD_STRASSIGN(s,p,n) memcpy(s.GetBuffer(n),p,(n)*sizeof(MCD_CHAR));s.ReleaseBuffer(n);
181 | #define MCD_STRCAPACITY(s) (((CStringData*)((MCD_PCSZ)s)-1)->nAllocLength)
182 | #define MCD_GETBUFFER(s,n) s.GetBuffer(n)
183 | #define MCD_RELEASEBUFFER(s,p,n) s.ReleaseBuffer(n)
184 | #define MCD_BLDRESERVE(s,n) MCD_CHAR*pD=s.GetBuffer(n); int nL=0
185 | #define MCD_BLDCHECK(s,n,d) if(nL+(int)(d)>n){s.ReleaseBuffer(nL);n<<=2;pD=s.GetBuffer(n);}
186 | #define MCD_BLDRELEASE(s) s.ReleaseBuffer(nL)
187 | #define MCD_BLDAPPENDN(s,p,n) MCD_PSZNCPY(&pD[nL],p,n);nL+=n
188 | #define MCD_BLDAPPEND(s,p) MCD_PSZCPY(&pD[nL],p);nL+=MCD_PSZLEN(p)
189 | #define MCD_BLDAPPEND1(s,c) pD[nL++]=(MCD_CHAR)(c)
190 | #define MCD_BLDLEN(s) nL
191 | #define MCD_BLDTRUNC(s,n) nL=n
192 | #endif // not STL
193 | #define MCD_STRTOINT(s) MCD_PSZTOL(MCD_2PCSZ(s),NULL,10)
194 |
195 | // Allow function args to accept string objects as constant string pointers
196 | struct MCD_CSTR
197 | {
198 | MCD_CSTR() { pcsz=NULL; };
199 | MCD_CSTR( MCD_PCSZ p ) { pcsz=p; };
200 | MCD_CSTR( const MCD_STR& s ) { pcsz = MCD_2PCSZ(s); };
201 | operator MCD_PCSZ() const { return pcsz; };
202 | MCD_PCSZ pcsz;
203 | };
204 |
205 | // On Linux and OS X, filenames are not specified in wchar_t
206 | #if defined(MARKUP_WCHAR) && defined(__GNUC__)
207 | #undef MCD_FOPEN
208 | #define MCD_FOPEN(f,n,m) f=fopen(n,m)
209 | #define MCD_T_FILENAME(s) s
210 | #define MCD_PCSZ_FILENAME const char*
211 | struct MCD_CSTR_FILENAME
212 | {
213 | MCD_CSTR_FILENAME() { pcsz=NULL; };
214 | MCD_CSTR_FILENAME( MCD_PCSZ_FILENAME p ) { pcsz=p; };
215 | MCD_CSTR_FILENAME( const std::string& s ) { pcsz = s.c_str(); };
216 | operator MCD_PCSZ_FILENAME() const { return pcsz; };
217 | MCD_PCSZ_FILENAME pcsz;
218 | };
219 | #else // not WCHAR GNUC
220 | #define MCD_CSTR_FILENAME MCD_CSTR
221 | #define MCD_T_FILENAME MCD_T
222 | #define MCD_PCSZ_FILENAME MCD_PCSZ
223 | #endif // not WCHAR GNUC
224 |
225 | // File fseek, ftell and offset type
226 | #if defined(__GNUC__) && ! defined(MARKUP_WINDOWS) // non-Windows GNUC
227 | #define MCD_FSEEK fseeko
228 | #define MCD_FTELL ftello
229 | #define MCD_INTFILEOFFSET off_t
230 | #elif _MSC_VER >= 1000 && defined(MARKUP_HUGEFILE) // VC++ HUGEFILE
231 | #if _MSC_VER < 1400 // before VC++ 2005
232 | extern "C" int __cdecl _fseeki64(FILE *, __int64, int);
233 | extern "C" __int64 __cdecl _ftelli64(FILE *);
234 | #endif // before VC++ 2005
235 | #define MCD_FSEEK _fseeki64
236 | #define MCD_FTELL _ftelli64
237 | #define MCD_INTFILEOFFSET __int64
238 | #else // not non-Windows GNUC or VC++ HUGEFILE
239 | #define MCD_FSEEK fseek
240 | #define MCD_FTELL ftell
241 | #define MCD_INTFILEOFFSET long
242 | #endif // not non-Windows GNUC or VC++ HUGEFILE
243 |
244 | // End of line choices: none, return, newline, or CRLF
245 | #if defined(MARKUP_EOL_NONE)
246 | #define MCD_EOL MCD_T("")
247 | #elif defined(MARKUP_EOL_RETURN) // rare; only used on some old operating systems
248 | #define MCD_EOL MCD_T("\r")
249 | #elif defined(MARKUP_EOL_NEWLINE) // Unix standard
250 | #define MCD_EOL MCD_T("\n")
251 | #elif defined(MARKUP_EOL_CRLF) || defined(MARKUP_WINDOWS) // Windows standard
252 | #define MCD_EOL MCD_T("\r\n")
253 | #else // not Windows and not otherwise specified
254 | #define MCD_EOL MCD_T("\n")
255 | #endif // not Windows and not otherwise specified
256 | #define MCD_EOLLEN (sizeof(MCD_EOL)/sizeof(MCD_CHAR)-1) // string length of MCD_EOL
257 |
258 | struct FilePos;
259 | struct TokenPos;
260 | struct NodePos;
261 | struct PathPos;
262 | struct SavedPosMapArray;
263 | struct ElemPosTree;
264 |
265 | class CMarkup
266 | {
267 | public:
268 | CMarkup() { x_InitMarkup(); SetDoc( NULL ); };
269 | CMarkup( MCD_CSTR szDoc ) { x_InitMarkup(); SetDoc( szDoc ); };
270 | CMarkup( int nFlags ) { x_InitMarkup(); SetDoc( NULL ); m_nDocFlags = nFlags; };
271 | CMarkup( const CMarkup& markup ) { x_InitMarkup(); *this = markup; };
272 | void operator=( const CMarkup& markup );
273 | ~CMarkup();
274 |
275 | // Navigate
276 | bool Load( MCD_CSTR_FILENAME szFileName );
277 | bool SetDoc( MCD_PCSZ pDoc );
278 | bool SetDoc( const MCD_STR& strDoc );
279 | bool IsWellFormed();
280 | bool FindElem( MCD_CSTR szName=NULL );
281 | bool FindChildElem( MCD_CSTR szName=NULL );
282 | bool IntoElem();
283 | bool OutOfElem();
284 | void ResetChildPos() { x_SetPos(m_iPosParent,m_iPos,0); };
285 | void ResetMainPos() { x_SetPos(m_iPosParent,0,0); };
286 | void ResetPos() { x_SetPos(0,0,0); };
287 | MCD_STR GetTagName() const;
288 | MCD_STR GetChildTagName() const { return x_GetTagName(m_iPosChild); };
289 | MCD_STR GetData() { return x_GetData(m_iPos); };
290 | MCD_STR GetChildData() { return x_GetData(m_iPosChild); };
291 | MCD_STR GetElemContent() const { return x_GetElemContent(m_iPos); };
292 | MCD_STR GetAttrib( MCD_CSTR szAttrib ) const { return x_GetAttrib(m_iPos,szAttrib); };
293 | MCD_STR GetChildAttrib( MCD_CSTR szAttrib ) const { return x_GetAttrib(m_iPosChild,szAttrib); };
294 | bool GetNthAttrib( int n, MCD_STR& strAttrib, MCD_STR& strValue ) const;
295 | MCD_STR GetAttribName( int n ) const;
296 | int FindNode( int nType=0 );
297 | int GetNodeType() { return m_nNodeType; };
298 | bool SavePos( MCD_CSTR szPosName=MCD_T(""), int nMap = 0 );
299 | bool RestorePos( MCD_CSTR szPosName=MCD_T(""), int nMap = 0 );
300 | bool SetMapSize( int nSize, int nMap = 0 );
301 | MCD_STR GetError() const;
302 | const MCD_STR& GetResult() const { return m_strResult; };
303 | int GetDocFlags() const { return m_nDocFlags; };
304 | void SetDocFlags( int nFlags ) { m_nDocFlags = (nFlags & ~(MDF_READFILE|MDF_WRITEFILE|MDF_APPENDFILE)); };
305 | enum MarkupDocFlags
306 | {
307 | MDF_UTF16LEFILE = 1,
308 | MDF_UTF8PREAMBLE = 4,
309 | MDF_IGNORECASE = 8,
310 | MDF_READFILE = 16,
311 | MDF_WRITEFILE = 32,
312 | MDF_APPENDFILE = 64,
313 | MDF_UTF16BEFILE = 128,
314 | MDF_TRIMWHITESPACE = 256,
315 | MDF_COLLAPSEWHITESPACE = 512
316 | };
317 | enum MarkupNodeFlags
318 | {
319 | MNF_WITHCDATA = 0x01,
320 | MNF_WITHNOLINES = 0x02,
321 | MNF_WITHXHTMLSPACE = 0x04,
322 | MNF_WITHREFS = 0x08,
323 | MNF_WITHNOEND = 0x10,
324 | MNF_ESCAPEQUOTES = 0x100,
325 | MNF_NONENDED = 0x100000,
326 | MNF_ILLDATA = 0x200000
327 | };
328 | enum MarkupNodeType
329 | {
330 | MNT_ELEMENT = 1, // 0x0001
331 | MNT_TEXT = 2, // 0x0002
332 | MNT_WHITESPACE = 4, // 0x0004
333 | MNT_TEXT_AND_WHITESPACE = 6, // 0x0006
334 | MNT_CDATA_SECTION = 8, // 0x0008
335 | MNT_PROCESSING_INSTRUCTION = 16, // 0x0010
336 | MNT_COMMENT = 32, // 0x0020
337 | MNT_DOCUMENT_TYPE = 64, // 0x0040
338 | MNT_EXCLUDE_WHITESPACE = 123, // 0x007b
339 | MNT_LONE_END_TAG = 128, // 0x0080
340 | MNT_NODE_ERROR = 32768 // 0x8000
341 | };
342 |
343 | // Create
344 | bool Save( MCD_CSTR_FILENAME szFileName );
345 | const MCD_STR& GetDoc() const { return m_strDoc; };
346 | bool AddElem( MCD_CSTR szName, MCD_CSTR szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags); };
347 | bool InsertElem( MCD_CSTR szName, MCD_CSTR szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags|MNF_INSERT); };
348 | bool AddChildElem( MCD_CSTR szName, MCD_CSTR szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags|MNF_CHILD); };
349 | bool InsertChildElem( MCD_CSTR szName, MCD_CSTR szData=NULL, int nFlags=0 ) { return x_AddElem(szName,szData,nFlags|MNF_INSERT|MNF_CHILD); };
350 | bool AddElem( MCD_CSTR szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags); };
351 | bool InsertElem( MCD_CSTR szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags|MNF_INSERT); };
352 | bool AddChildElem( MCD_CSTR szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags|MNF_CHILD); };
353 | bool InsertChildElem( MCD_CSTR szName, int nValue, int nFlags=0 ) { return x_AddElem(szName,nValue,nFlags|MNF_INSERT|MNF_CHILD); };
354 | bool AddAttrib( MCD_CSTR szAttrib, MCD_CSTR szValue ) { return x_SetAttrib(m_iPos,szAttrib,szValue); };
355 | bool AddChildAttrib( MCD_CSTR szAttrib, MCD_CSTR szValue ) { return x_SetAttrib(m_iPosChild,szAttrib,szValue); };
356 | bool AddAttrib( MCD_CSTR szAttrib, int nValue ) { return x_SetAttrib(m_iPos,szAttrib,nValue); };
357 | bool AddChildAttrib( MCD_CSTR szAttrib, int nValue ) { return x_SetAttrib(m_iPosChild,szAttrib,nValue); };
358 | bool AddSubDoc( MCD_CSTR szSubDoc ) { return x_AddSubDoc(szSubDoc,0); };
359 | bool InsertSubDoc( MCD_CSTR szSubDoc ) { return x_AddSubDoc(szSubDoc,MNF_INSERT); };
360 | MCD_STR GetSubDoc() { return x_GetSubDoc(m_iPos); };
361 | bool AddChildSubDoc( MCD_CSTR szSubDoc ) { return x_AddSubDoc(szSubDoc,MNF_CHILD); };
362 | bool InsertChildSubDoc( MCD_CSTR szSubDoc ) { return x_AddSubDoc(szSubDoc,MNF_CHILD|MNF_INSERT); };
363 | MCD_STR GetChildSubDoc() { return x_GetSubDoc(m_iPosChild); };
364 | bool AddNode( int nType, MCD_CSTR szText ) { return x_AddNode(nType,szText,0); };
365 | bool InsertNode( int nType, MCD_CSTR szText ) { return x_AddNode(nType,szText,MNF_INSERT); };
366 |
367 | // Modify
368 | bool RemoveElem();
369 | bool RemoveChildElem();
370 | bool RemoveNode();
371 | bool SetAttrib( MCD_CSTR szAttrib, MCD_CSTR szValue, int nFlags=0 ) { return x_SetAttrib(m_iPos,szAttrib,szValue,nFlags); };
372 | bool SetChildAttrib( MCD_CSTR szAttrib, MCD_CSTR szValue, int nFlags=0 ) { return x_SetAttrib(m_iPosChild,szAttrib,szValue,nFlags); };
373 | bool SetAttrib( MCD_CSTR szAttrib, int nValue, int nFlags=0 ) { return x_SetAttrib(m_iPos,szAttrib,nValue,nFlags); };
374 | bool SetChildAttrib( MCD_CSTR szAttrib, int nValue, int nFlags=0 ) { return x_SetAttrib(m_iPosChild,szAttrib,nValue,nFlags); };
375 | bool SetData( MCD_CSTR szData, int nFlags=0 ) { return x_SetData(m_iPos,szData,nFlags); };
376 | bool SetChildData( MCD_CSTR szData, int nFlags=0 ) { return x_SetData(m_iPosChild,szData,nFlags); };
377 | bool SetData( int nValue ) { return x_SetData(m_iPos,nValue); };
378 | bool SetChildData( int nValue ) { return x_SetData(m_iPosChild,nValue); };
379 | bool SetElemContent( MCD_CSTR szContent ) { return x_SetElemContent(szContent); };
380 |
381 |
382 | // Utility
383 | static bool ReadTextFile( MCD_CSTR_FILENAME szFileName, MCD_STR& strDoc, MCD_STR* pstrResult=NULL, int* pnDocFlags=NULL, MCD_STR* pstrEncoding=NULL );
384 | static bool WriteTextFile( MCD_CSTR_FILENAME szFileName, const MCD_STR& strDoc, MCD_STR* pstrResult=NULL, int* pnDocFlags=NULL, MCD_STR* pstrEncoding=NULL );
385 | static MCD_STR EscapeText( MCD_CSTR szText, int nFlags = 0 );
386 | static MCD_STR UnescapeText( MCD_CSTR szText, int nTextLength = -1, int nFlags = 0 );
387 | static int UTF16To8( char *pszUTF8, const unsigned short* pwszUTF16, int nUTF8Count );
388 | static int UTF8To16( unsigned short* pwszUTF16, const char* pszUTF8, int nUTF8Count );
389 | static MCD_STR UTF8ToA( MCD_CSTR pszUTF8, int* pnFailed = NULL );
390 | static MCD_STR AToUTF8( MCD_CSTR pszANSI );
391 | static void EncodeCharUTF8( int nUChar, char* pszUTF8, int& nUTF8Len );
392 | static int DecodeCharUTF8( const char*& pszUTF8, const char* pszUTF8End = NULL );
393 | static void EncodeCharUTF16( int nUChar, unsigned short* pwszUTF16, int& nUTF16Len );
394 | static int DecodeCharUTF16( const unsigned short*& pwszUTF16, const unsigned short* pszUTF16End = NULL );
395 | static bool DetectUTF8( const char* pText, int nTextLen, int* pnNonASCII = NULL, bool* bErrorAtEnd = NULL );
396 | static MCD_STR GetDeclaredEncoding( MCD_CSTR szDoc );
397 | static int GetEncodingCodePage( MCD_CSTR pszEncoding );
398 |
399 | protected:
400 |
401 | #if defined(_DEBUG)
402 | MCD_PCSZ m_pDebugCur;
403 | MCD_PCSZ m_pDebugPos;
404 | #endif // DEBUG
405 |
406 | MCD_STR m_strDoc;
407 | MCD_STR m_strResult;
408 |
409 | int m_iPosParent;
410 | int m_iPos;
411 | int m_iPosChild;
412 | int m_iPosFree;
413 | int m_iPosDeleted;
414 | int m_nNodeType;
415 | int m_nNodeOffset;
416 | int m_nNodeLength;
417 | int m_nDocFlags;
418 |
419 | FilePos* m_pFilePos;
420 | SavedPosMapArray* m_pSavedPosMaps;
421 | ElemPosTree* m_pElemPosTree;
422 |
423 | enum MarkupNodeFlagsInternal
424 | {
425 | MNF_INSERT = 0x002000,
426 | MNF_CHILD = 0x004000
427 | };
428 |
429 | #if defined(_DEBUG) // DEBUG
430 | void x_SetDebugState();
431 | #define MARKUP_SETDEBUGSTATE x_SetDebugState()
432 | #else // not DEBUG
433 | #define MARKUP_SETDEBUGSTATE
434 | #endif // not DEBUG
435 |
436 | void x_InitMarkup();
437 | void x_SetPos( int iPosParent, int iPos, int iPosChild );
438 | int x_GetFreePos();
439 | bool x_AllocElemPos( int nNewSize = 0 );
440 | int x_GetParent( int i );
441 | bool x_ParseDoc();
442 | int x_ParseElem( int iPos, TokenPos& token );
443 | int x_FindElem( int iPosParent, int iPos, PathPos& path ) const;
444 | MCD_STR x_GetPath( int iPos ) const;
445 | MCD_STR x_GetTagName( int iPos ) const;
446 | MCD_STR x_GetData( int iPos );
447 | MCD_STR x_GetAttrib( int iPos, MCD_PCSZ pAttrib ) const;
448 | static MCD_STR x_EncodeCDATASection( MCD_PCSZ szData );
449 | bool x_AddElem( MCD_PCSZ pName, MCD_PCSZ pValue, int nFlags );
450 | bool x_AddElem( MCD_PCSZ pName, int nValue, int nFlags );
451 | MCD_STR x_GetSubDoc( int iPos );
452 | bool x_AddSubDoc( MCD_PCSZ pSubDoc, int nFlags );
453 | bool x_SetAttrib( int iPos, MCD_PCSZ pAttrib, MCD_PCSZ pValue, int nFlags=0 );
454 | bool x_SetAttrib( int iPos, MCD_PCSZ pAttrib, int nValue, int nFlags=0 );
455 | bool x_AddNode( int nNodeType, MCD_PCSZ pText, int nNodeFlags );
456 | void x_RemoveNode( int iPosParent, int& iPos, int& nNodeType, int& nNodeOffset, int& nNodeLength );
457 | static bool x_CreateNode( MCD_STR& strNode, int nNodeType, MCD_PCSZ pText );
458 | int x_InsertNew( int iPosParent, int& iPosRel, NodePos& node );
459 | void x_AdjustForNode( int iPosParent, int iPos, int nShift );
460 | void x_Adjust( int iPos, int nShift, bool bAfterPos = false );
461 | void x_LinkElem( int iPosParent, int iPosBefore, int iPos );
462 | int x_UnlinkElem( int iPos );
463 | int x_UnlinkPrevElem( int iPosParent, int iPosBefore, int iPos );
464 | int x_ReleaseSubDoc( int iPos );
465 | int x_ReleasePos( int iPos );
466 | void x_CheckSavedPos();
467 | bool x_SetData( int iPos, MCD_PCSZ szData, int nFlags );
468 | bool x_SetData( int iPos, int nValue );
469 | int x_RemoveElem( int iPos );
470 | MCD_STR x_GetElemContent( int iPos ) const;
471 | bool x_SetElemContent( MCD_PCSZ szContent );
472 | void x_DocChange( int nLeft, int nReplace, const MCD_STR& strInsert );
473 | };
474 |
475 | #endif // !defined(_MARKUP_H_INCLUDED_)
476 |
--------------------------------------------------------------------------------
/PETOOLS/CommonLib/LogLib/log4z.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Log4z License
3 | * -----------
4 | *
5 | * Log4z is licensed under the terms of the MIT license reproduced below.
6 | * This means that Log4z is free software and can be used for both academic
7 | * and commercial purposes at absolutely no cost.
8 | *
9 | *
10 | * ===============================================================================
11 | *
12 | * Copyright (C) 2010-2017 YaweiZhang .
13 | *
14 | * Permission is hereby granted, free of charge, to any person obtaining a copy
15 | * of this software and associated documentation files (the "Software"), to deal
16 | * in the Software without restriction, including without limitation the rights
17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 | * copies of the Software, and to permit persons to whom the Software is
19 | * furnished to do so, subject to the following conditions:
20 | *
21 | * The above copyright notice and this permission notice shall be included in
22 | * all copies or substantial portions of the Software.
23 | *
24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 | * THE SOFTWARE.
31 | *
32 | * ===============================================================================
33 | *
34 | * (end of COPYRIGHT)
35 | */
36 |
37 |
38 | /*
39 | * AUTHORS: YaweiZhang
40 | * VERSION: 3.5.0
41 | * PURPOSE: A lightweight library for error reporting and logging to file and screen .
42 | * CREATION: 2010.10.4
43 | * LCHANGE: 2017.08.20
44 | * LICENSE: Expat/MIT License, See Copyright Notice at the begin of this file.
45 | */
46 |
47 |
48 | /*
49 | * contact me:
50 | * tencent qq group: 19811947
51 | * mail: yawei.zhang@foxmail.com
52 | */
53 |
54 |
55 | /*
56 | * UPDATES LOG
57 | *
58 | * VERSION 0.1.0
59 | * create the first project.
60 | * It support put log to screen and files,
61 | * support log level, support one day one log file.
62 | * support multi-thread, cross-platform.
63 | *
64 | * VERSION ....
65 | * ...
66 | *
67 | * VERSION 0.9.0
68 | * support config files.
69 | * support color text in screen.
70 | * support multiple output to different files.
71 | *
72 | * VERSION 1.0.0
73 | * support comments in the config file.
74 | * add a advanced demo in the ./project
75 | * fix some details.
76 | *
77 | * VERSION 1.0.1
78 | * change and add some Comments in the log4z
79 | * simplify the 'fast_test' demo projects.
80 | *
81 | * VERSION 1.1.0
82 | * the method Start will wait for the logger thread started.
83 | * config and add method change.
84 | * namespace change.
85 | *
86 | * VERSION 1.1.1
87 | * add status info method.
88 | * optimize.
89 | *
90 | * VERSION 1.2.0
91 | * add stress test demo
92 | * rewrite Stream module,better performance.
93 | *
94 | * VERSION 1.2.1
95 | * fixed type name 'long' stream format on 64/32 operation system.
96 | * logger will not loss any log on process normal exit.
97 | *
98 | * VERSION 2.0.0
99 | * new interface:
100 | * merge some Main interface and Dynamic interface
101 | * add Change Logger Attribute method by thread-safe
102 | * new config design.
103 | * log file name append process id.
104 | *
105 | * VERSION 2.1
106 | * support binary text output
107 | * rewrite write file module, support vs2005 open Chinese characters path
108 | *
109 | * VERSION 2.2
110 | * optimized binary stream output view
111 | * support wchar * string.
112 | *
113 | * VERSION 2.3
114 | * adjust output file named.
115 | * support different month different directory.
116 | * adjust some detail.
117 | *
118 | * VERSION 2.4
119 | * support rolling log file.
120 | * support hot update configure
121 | * used precision time in log.
122 | * micro set default logger attribute
123 | * fix tls bug in windows xp dll
124 | *
125 | * VERSION 2.5
126 | * screen output can choice synchronous or not
127 | * fix sometimes color will disorder on windows.
128 | * eliminate some compiler warning
129 | * fix sem_timewait in linux
130 | * add format-style method at input log, cannot support vs2003 and VC6.
131 | * fix WCHAR String cannot output
132 | * optimize std::string, binary log input, and support std::wstring.
133 | * clean code, better readability
134 | *
135 | * VERSION 2.6
136 | * add PrePushLog
137 | * better performance when log is filter out.
138 | * interface replace std::string because it's in shared library is unsafe.
139 | * add log level 'trace'
140 | *
141 | * VERSION 2.6.1
142 | * fix bug from defined _MSC_VER
143 | *
144 | * VERSION 2.7
145 | * compatible mac machine, now log4z can working in linux/windows/mac.
146 | *
147 | * VERSION 2.8
148 | * support synchronous written to file and thread-safe
149 | * fix compatibility on MinGW. a constant value suffix.
150 | * ignore utf-8 file BOM when load configure file
151 | * use macro WIN32_LEAN_AND_MEAN replace head file winsock2.h
152 | * new naming notations
153 | *
154 | * VERSION 3.0
155 | * new naming notations
156 | * support for reading config from a string.
157 | * remove all TLS code, used dispatch_semaphore in apple OS.
158 | * support system: windows, linux, mac, iOS
159 | *
160 | * VERSION 3.1
161 | * add method enable/disable logger by specific logger id
162 | * add method enable/disable log suffix line number.
163 | * add method enable/disable log output to file.
164 | *
165 | * VERSION 3.2
166 | * add interface setLoggerName,setLoggerPath,setAutoUpdate
167 | * support auto update from configure file
168 | *
169 | * VERSION 3.3
170 | * support map vector list
171 | * support continuum via travis.
172 | * new hot change design, all change realize need via push log flow.
173 | * support oem string convert.
174 | * new method to read whole content of file.
175 | * check configure's checksum when auto update it.
176 | * some other optimize.
177 | *
178 | * VERSION 3.5
179 | * optimization
180 | *
181 | */
182 |
183 |
184 | #pragma once
185 | #ifndef _ZSUMMER_LOG4Z_H_
186 | #define _ZSUMMER_LOG4Z_H_
187 |
188 | #include
189 | #include
190 | #include
191 | #include
192 | #include
193 | #include
194 | #include
195 | #ifdef WIN32
196 | #define WIN32_LEAN_AND_MEAN
197 | #include
198 | #endif
199 | #include
200 | #include