├── source ├── Code │ ├── alt │ │ ├── altobj.hpp │ │ ├── altbase.hpp │ │ ├── altstring.hpp │ │ ├── altfile.hpp │ │ ├── altstack.hpp │ │ ├── altqueue.hpp │ │ └── altarray.hpp │ ├── time.hpp │ ├── compress.hpp │ ├── sysdep.hpp │ ├── srctxtfile.hpp │ ├── osdefine.hpp │ ├── txtfile.hpp │ ├── utxtfile.hpp │ ├── modf.cpp │ ├── cmdparser.hpp │ ├── handle.hpp │ ├── options.hpp │ ├── srctxtfile.cpp │ ├── pageimage.hpp │ ├── time.cpp │ ├── fileiont.hpp │ ├── sysdep.cpp │ ├── cmdparser.cpp │ └── pagemem.hpp ├── WispSyser │ ├── functionlistwnd.cpp │ ├── functionlistwnd.hpp │ ├── x87x86double.asm │ ├── x87x64double.asm │ ├── terminalwnd.hpp │ ├── aboutform.hpp │ ├── syserdefine.hpp │ ├── pluginlistform.hpp │ ├── keymappingpage.hpp │ ├── sehchainwnd.hpp │ ├── gdtwnd.hpp │ ├── idtwnd.hpp │ ├── syseroptionform.hpp │ ├── processlist.hpp │ ├── debuggerselectform.hpp │ ├── strinputwnd.hpp │ ├── callstackwnd.hpp │ ├── runtracewnd.hpp │ ├── consolewnd.hpp │ ├── crossreferenceform.hpp │ ├── pagemapwnd.hpp │ ├── codebpedit.hpp │ ├── dataviewform.hpp │ ├── findlistwnd.hpp │ ├── multidataview.hpp │ ├── currentfunction.hpp │ ├── multicodeview.hpp │ ├── terminalwnd.cpp │ ├── modulelist.hpp │ ├── othercmd.hpp │ ├── searchdialog.hpp │ ├── reghelpwnd.hpp │ ├── commentlist.hpp │ ├── databpedit.hpp │ ├── watchlist.hpp │ ├── sdsmodulelist.hpp │ ├── runtrace.hpp │ ├── sseregisterlist.hpp │ ├── multisourcecodeview.hpp │ ├── dataoperatordlg.hpp │ ├── typeviewerform.hpp │ ├── breakpointform.hpp │ ├── pluginlistform.cpp │ ├── strinputwnd.cpp │ ├── plugin.hpp │ ├── findstringform.hpp │ ├── syserconfig.hpp │ ├── sehchainwnd.cpp │ ├── aboutform.cpp │ ├── multisourcecodeview.cpp │ ├── fpuregisterlist.hpp │ ├── plugin.cpp │ ├── stackwatchlist.hpp │ ├── sourcedebugframewnd.hpp │ ├── dataview.hpp │ ├── SyserRing3.hpp │ ├── sourcecodewnd.hpp │ ├── winwisp.hpp │ ├── findlistwnd.cpp │ ├── dataviewform.cpp │ ├── peexplorerform.hpp │ ├── genereglist.hpp │ ├── multidataview.cpp │ ├── mainframe.hpp │ ├── pagemapwnd.cpp │ └── consolewnd.cpp ├── Syser.dat ├── Syser.ico ├── Wisp.dat ├── Wisp │ ├── wispapp.cpp │ ├── wispapp.hpp │ ├── wisptipwnd.hpp │ ├── dibdata.cpp │ ├── wispprogressform.hpp │ ├── wispprogress.hpp │ ├── wispcombobox.hpp │ ├── wispsoftkeyboard.hpp │ ├── wispprogressform.cpp │ ├── wispmultitabview.cpp │ ├── wispmsgbox.hpp │ ├── wispform.hpp │ ├── wispmultitabview.hpp │ ├── wispfont.hpp │ ├── wispcheckbox.hpp │ ├── wispbutton.hpp │ ├── wispradiobox.hpp │ ├── wispsplitwnd.hpp │ ├── wispstatic.hpp │ ├── wispcolorstrwnd.hpp │ ├── wisprgbselect.hpp │ ├── wisptipwnd.cpp │ ├── wispprogress.cpp │ ├── wisptoolbar.hpp │ ├── wisptabwnd.hpp │ ├── wispoptionform.hpp │ ├── wispdib.hpp │ ├── wispedit.hpp │ ├── wispcombobox.cpp │ └── wispcalcwnd.hpp ├── unpack.cpp ├── resource.rc ├── EXEAnalyzer │ ├── mzhead.hpp │ ├── pehead.hpp │ ├── instrsym.hpp │ └── sdwin.hpp ├── syser.manifest ├── MFCSymbols.cpp └── pdb2sds.cpp ├── cmake.bat ├── x32 ├── cmake_build.bat ├── Wisp.dat ├── Syser.dat ├── cmake_clean.bat ├── sdx32.dll ├── msdia80.dll ├── syserx32.exe ├── syserx32.lib ├── unpackx32.exe ├── pdb2sdsx32.exe ├── cmake32_ninja_debug.bat ├── cmake32_debug.bat ├── cmake32_ninja_release.bat ├── cmake32_release.bat ├── cmake32_ninja_debug_clang.bat ├── cmake32_debug_clang.bat ├── cmake32_ninja_release_clang.bat ├── cmake32_release_clang.bat ├── README └── plugin.hpp ├── x64 ├── cmake_build.bat ├── Wisp.dat ├── Syser.dat ├── cmake_clean.bat ├── sdx64.dll ├── msdia80.dll ├── syserx64.exe ├── syserx64.lib ├── unpackx64.exe ├── pdb2sdsx64.exe ├── cmake64_ninja_debug.bat ├── cmake64_debug.bat ├── cmake64_ninja_release.bat ├── cmake64_release.bat ├── cmake64_debug_clang.bat ├── cmake64_ninja_debug_clang.bat ├── cmake64_ninja_release_clang.bat ├── cmake64_release_clang.bat ├── README └── plugin.hpp ├── images ├── attach_struct.png ├── struct_viewer.png ├── SyserDebuggerx64.png ├── SyserDebuggerx64src.png └── SyserDebuggerx64src1.png ├── addition └── DiaSDK │ ├── bin │ ├── msdia80.dll │ ├── msdia80.pdb │ └── amd64 │ │ ├── msdia80.dll │ │ └── msdia80.pdb │ ├── lib │ ├── diaguids.lib │ └── amd64 │ │ └── diaguids.lib │ └── include │ └── diacreate.h ├── cmake └── msvc-showcmd.cmake └── readme.md /source/Code/alt/altobj.hpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cmake.bat: -------------------------------------------------------------------------------- 1 | "D:\Dev\cmake-3.23.1-windows-x86_64\bin\cmake.exe" %* -------------------------------------------------------------------------------- /x32/cmake_build.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat --build . -v > cbuild.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake_build.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat --build . -v > cbuild.log 2>&1 -------------------------------------------------------------------------------- /x32/Wisp.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/Wisp.dat -------------------------------------------------------------------------------- /x64/Wisp.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/Wisp.dat -------------------------------------------------------------------------------- /source/WispSyser/functionlistwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "functionlistwnd.hpp" 3 | -------------------------------------------------------------------------------- /x32/Syser.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/Syser.dat -------------------------------------------------------------------------------- /x32/cmake_clean.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat --build . --target clean -v > cclean.log 2>&1 -------------------------------------------------------------------------------- /x32/sdx32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/sdx32.dll -------------------------------------------------------------------------------- /x64/Syser.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/Syser.dat -------------------------------------------------------------------------------- /x64/cmake_clean.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat --build . --target clean -v > cclean.log 2>&1 -------------------------------------------------------------------------------- /x64/sdx64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/sdx64.dll -------------------------------------------------------------------------------- /source/Syser.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/source/Syser.dat -------------------------------------------------------------------------------- /source/Syser.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/source/Syser.ico -------------------------------------------------------------------------------- /source/Wisp.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/source/Wisp.dat -------------------------------------------------------------------------------- /x32/msdia80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/msdia80.dll -------------------------------------------------------------------------------- /x32/syserx32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/syserx32.exe -------------------------------------------------------------------------------- /x32/syserx32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/syserx32.lib -------------------------------------------------------------------------------- /x32/unpackx32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/unpackx32.exe -------------------------------------------------------------------------------- /x64/msdia80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/msdia80.dll -------------------------------------------------------------------------------- /x64/syserx64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/syserx64.exe -------------------------------------------------------------------------------- /x64/syserx64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/syserx64.lib -------------------------------------------------------------------------------- /x64/unpackx64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/unpackx64.exe -------------------------------------------------------------------------------- /x32/pdb2sdsx32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x32/pdb2sdsx32.exe -------------------------------------------------------------------------------- /x64/pdb2sdsx64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/x64/pdb2sdsx64.exe -------------------------------------------------------------------------------- /images/attach_struct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/images/attach_struct.png -------------------------------------------------------------------------------- /images/struct_viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/images/struct_viewer.png -------------------------------------------------------------------------------- /images/SyserDebuggerx64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/images/SyserDebuggerx64.png -------------------------------------------------------------------------------- /source/Code/alt/altbase.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALT_BASE_HPP_ 3 | #define _ALT_BASE_HPP_ 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /source/Code/alt/altstring.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALT_STRING_HPP_ 3 | #define _ALT_STRING_HPP_ 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /addition/DiaSDK/bin/msdia80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/addition/DiaSDK/bin/msdia80.dll -------------------------------------------------------------------------------- /addition/DiaSDK/bin/msdia80.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/addition/DiaSDK/bin/msdia80.pdb -------------------------------------------------------------------------------- /addition/DiaSDK/lib/diaguids.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/addition/DiaSDK/lib/diaguids.lib -------------------------------------------------------------------------------- /images/SyserDebuggerx64src.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/images/SyserDebuggerx64src.png -------------------------------------------------------------------------------- /images/SyserDebuggerx64src1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/images/SyserDebuggerx64src1.png -------------------------------------------------------------------------------- /addition/DiaSDK/bin/amd64/msdia80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/addition/DiaSDK/bin/amd64/msdia80.dll -------------------------------------------------------------------------------- /addition/DiaSDK/bin/amd64/msdia80.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/addition/DiaSDK/bin/amd64/msdia80.pdb -------------------------------------------------------------------------------- /source/WispSyser/functionlistwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FUNCTIONLISTWND_HPP_ 3 | #define _FUNCTIONLISTWND_HPP_ 4 | #endif 5 | -------------------------------------------------------------------------------- /addition/DiaSDK/lib/amd64/diaguids.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marakew/syser/HEAD/addition/DiaSDK/lib/amd64/diaguids.lib -------------------------------------------------------------------------------- /source/Code/time.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TIME_HPP_ 3 | #define _TIME_HPP_ 4 | 5 | char *Time2Str(unsigned long TimeStamp, char *szBuffer); 6 | 7 | #endif -------------------------------------------------------------------------------- /x32/cmake32_ninja_debug.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x32 > build32_debug.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_ninja_debug.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x64 > build64_debug.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_debug.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x32 > build32_release.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_ninja_release.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x32 > build32_release.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_debug.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x64 > build64_debug.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_ninja_release.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x64 > build64_release.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_release.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x32 > build32_release.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_release.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x64 > build64_release.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_ninja_debug_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x32 -DUSE_CLANGCL=1 > build32_debug.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_debug_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x64 -DUSE_CLANGCL=1 > build64_debug.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_ninja_debug_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x64 -DUSE_CLANGCL=1 > build64_debug.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_debug_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Debug ..\source\ -DPLATFORM=x32 -DUSE_CLANGCL=1 > build32_release.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_ninja_release_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x32 -DUSE_CLANGCL=1 > build32_release.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_ninja_release_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"Ninja" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x64 -DUSE_CLANGCL=1 > build64_release.log 2>&1 -------------------------------------------------------------------------------- /x32/cmake32_release_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x32 -DUSE_CLANGCL=1 > build32_release.log 2>&1 -------------------------------------------------------------------------------- /x64/cmake64_release_clang.bat: -------------------------------------------------------------------------------- 1 | ..\cmake.bat -G"NMake Makefiles" --debug-output --trace --trace-expand --debug-trycompile -DCMAKE_BUILD_TYPE=Release ..\source\ -DPLATFORM=x64 -DUSE_CLANGCL=1 > build64_release.log 2>&1 -------------------------------------------------------------------------------- /source/Code/compress.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _COMPRESS_HPP_ 3 | #define _COMPRESS_HPP_ 4 | 5 | long lzo_compress(void *in, long in_len, void *out); 6 | long lzo_decompress(void *in, long in_len, void *out); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /source/WispSyser/x87x86double.asm: -------------------------------------------------------------------------------- 1 | 2 | .386 3 | .model flat, C 4 | 5 | .code 6 | 7 | REAL10toDOUBLE PROC, ipt:PTR QWORD, opt:PTR REAL8 8 | mov eax, ipt 9 | fld TBYTE PTR [eax] 10 | mov eax, opt 11 | fstp REAL8 PTR [eax] 12 | ret 13 | REAL10toDOUBLE ENDP 14 | END -------------------------------------------------------------------------------- /source/WispSyser/x87x64double.asm: -------------------------------------------------------------------------------- 1 | 2 | .code 3 | 4 | REAL10toDOUBLE PROC, ipt:PTR QWORD, opt:PTR REAL8 5 | ; mov rax, ipt 6 | ; fld TBYTE PTR [rax] 7 | fld TBYTE PTR [rcx] 8 | ; mov rax, opt 9 | ; fstp REAL8 PTR [rax] 10 | fstp REAL8 PTR [rdx] 11 | ret 12 | REAL10toDOUBLE ENDP 13 | END -------------------------------------------------------------------------------- /source/Wisp/wispapp.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "wispapp.hpp" 3 | 4 | bool CWispApp::Start() 5 | { 6 | return Init(); 7 | } 8 | 9 | bool CWispApp::Stop() 10 | { 11 | Release(); 12 | return false; 13 | } 14 | 15 | bool CWispApp::Run() 16 | { 17 | Pump(); 18 | return false; 19 | } 20 | -------------------------------------------------------------------------------- /source/WispSyser/terminalwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TERMINALWND_HPP_ 3 | #define _TERMINALWND_HPP_ 4 | 5 | #include "../Wisp/wispconsolewnd.hpp" 6 | 7 | struct CTerminalWnd : public CWispTerminalWnd 8 | { 9 | virtual bool MsgProc(WISP_MSG *pMsg) override; 10 | bool OnKeyEvent(WISP_MSG *pMsg); 11 | }; 12 | 13 | #endif -------------------------------------------------------------------------------- /source/Code/sysdep.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SYSDEP_HPP_ 3 | #define _SYSDEP_HPP_ 4 | 5 | #include "define.h" 6 | 7 | int GetModulePath(char *szPathName, bool bSeparator); 8 | int GetModulePath(WCHAR *szPathName, bool bSeparator); 9 | int DebugPrintf(const char *format, ...); 10 | int DebugPrintf(const WCHAR *format, ...); 11 | #endif -------------------------------------------------------------------------------- /source/Code/srctxtfile.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SRCTXTFILE_HPP_ 3 | #define _SRCTXTFILE_HPP_ 4 | 5 | #include "txtfile.hpp" 6 | 7 | struct CSrcTXTFile : public CTXTFile 8 | { 9 | TList m_Lines; 10 | unsigned long m_Mode; 11 | 12 | bool OpenEx(const char *FileName, HANDLE OpenHandle, unsigned long Mode); 13 | }; 14 | 15 | #endif -------------------------------------------------------------------------------- /source/WispSyser/aboutform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ABOUTFORM_HPP_ 3 | #define _ABOUTFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | 7 | struct CAboutForm : public CWispForm 8 | { 9 | CAboutForm(); 10 | virtual ~CAboutForm(); 11 | virtual bool MsgProc(WISP_MSG *pMsg) override; 12 | bool OnCreateForm(WISP_MSG *pMsg); 13 | }; 14 | 15 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispapp.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPAPP_HPP_ 3 | #define _WISPAPP_HPP_ 4 | 5 | #include "wispbase.hpp" 6 | 7 | struct CWispApp : public CWispBase 8 | { 9 | 10 | public: 11 | virtual bool Start(); // { return Init(); } 12 | virtual bool Stop(); // { Release(); return false; } 13 | virtual bool Run(); // { Pump(); return false; } 14 | }; 15 | 16 | #endif -------------------------------------------------------------------------------- /source/Code/alt/altfile.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALT_FILE_HPP_ 3 | #define _ALT_FILE_HPP_ 4 | 5 | #include "../define.h" 6 | 7 | namespace ALT 8 | { 9 | struct ALTFileStream 10 | { 11 | virtual unsigned long Write(const void *Buffer, unsigned long Size) { return 0; } 12 | virtual unsigned long Read(void *Buffer, unsigned long Size) { return 0; } 13 | }; 14 | } 15 | 16 | #endif -------------------------------------------------------------------------------- /source/Wisp/wisptipwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPTIPWND_HPP_ 3 | #define _WISPTIPWND_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispwnd.hpp" 7 | 8 | struct CWispTipWnd : public CWispWnd 9 | { 10 | CWispWnd *m_pTipOwnerWnd; 11 | 12 | CWispTipWnd(); 13 | 14 | bool OnUpdate(WISP_MSG *pMsg); 15 | void AutoAdjustPostion(CWispWnd *pWnd); 16 | virtual bool MsgProc(WISP_MSG *pMsg) override; 17 | }; 18 | #endif -------------------------------------------------------------------------------- /source/Wisp/dibdata.cpp: -------------------------------------------------------------------------------- 1 | 2 | unsigned long BTCaret[24] = 3 | { 4 | 0, 5 | 0, 6 | 0x0FFFFFF, 7 | 0x0FFFFFF, 8 | 0x0FFFFFF, 9 | 0x0FFFFFF, 10 | 0x0FFFFFF, 11 | 0x0FFFFFF, 12 | 0x0FFFFFF, 13 | 0x0FFFFFF, 14 | 0x0FFFFFF, 15 | 0x0FFFFFF, 16 | 0x0FFFFFF, 17 | 0x0FFFFFF, 18 | 0x0FFFFFF, 19 | 0x0FFFFFF, 20 | 0x0FFFFFF, 21 | 0x0FFFFFF, 22 | 0x0FFFFFF, 23 | 0x0FFFFFF, 24 | 0x0FFFFFF, 25 | 0x0FFFFFF, 26 | 0, 27 | 0, 28 | }; 29 | -------------------------------------------------------------------------------- /source/WispSyser/syserdefine.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SYSERDEFINE_HPP_ 3 | #define _SYSERDEFINE_HPP_ 4 | 5 | #include "../Code/define.h" 6 | //#include "../Code/cmdparser.hpp" 7 | 8 | struct SYSER_CMD_ENTRY 9 | { 10 | const WCHAR *CmdStr; 11 | const WCHAR *CmdCmt; 12 | void *CmdProc; //CMDPROC 13 | const WCHAR *CmdUsage; 14 | }; 15 | 16 | extern SYSER_CMD_ENTRY SysCmdTable[]; 17 | extern SYSER_CMD_ENTRY ShareCmdTable[]; 18 | extern SYSER_CMD_ENTRY OtherCmdTable[]; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /source/WispSyser/pluginlistform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PLUGINLISTFORM_HPP_ 3 | #define _PLUGINLISTFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | 8 | struct CPluginListForm : public CWispForm 9 | { 10 | CWispList *m_pList; 11 | 12 | CPluginListForm(); 13 | virtual ~CPluginListForm(); 14 | 15 | virtual bool MsgProc(WISP_MSG *pMsg) override; 16 | void UpdateContext(); 17 | bool OnCreateForm(WISP_MSG *pMsg); 18 | void Create(); 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/WispSyser/keymappingpage.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _KEYMAPPINGPAGE_HPP_ 3 | #define _KEYMAPPINGPAGE_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | 7 | struct KEYMAP 8 | { 9 | const char *Name; 10 | unsigned int FirstKey; 11 | unsigned int NextKey; 12 | unsigned int CmdID; 13 | unsigned int r; 14 | unsigned int s; 15 | }; 16 | 17 | extern KEYMAP gGlobalKeyMap[]; 18 | 19 | struct CKeyMappingPage : public CWispForm 20 | { 21 | WCHAR *GetHotKey(unsigned int KeyType, WCHAR *szKeys); 22 | }; 23 | 24 | #endif -------------------------------------------------------------------------------- /source/Code/alt/altstack.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALT_STACK_HPP_ 3 | #define _ALT_STACK_HPP_ 4 | 5 | #include "../define.h" 6 | #include "altqueue.hpp" 7 | 8 | template 9 | struct TStack : public TQueue 10 | { 11 | public: 12 | //TStack(const TStack&) {} 13 | TStack() {} 14 | ~TStack() {} 15 | 16 | void Push(const T & Value); //??? 17 | bool Pop(T & Value); //??? 18 | T & operator[](int n) 19 | { 20 | int POS = this->Count-1-n; 21 | return TQueue::operator[](POS); 22 | } 23 | }; 24 | 25 | #endif -------------------------------------------------------------------------------- /source/WispSyser/sehchainwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SEHCHAINWND_HPP_ 3 | #define _SEHCHAINWND_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | 7 | struct CSEHChainWnd : public CWispList 8 | { 9 | CSEHChainWnd(); 10 | virtual ~CSEHChainWnd(); 11 | 12 | virtual bool MsgProc(WISP_MSG *pMsg) override; 13 | bool OnCreate(WISP_MSG *pMsg); 14 | bool OnClose(WISP_MSG *pMsg); 15 | bool OnEvent(WISP_MSG *pMsg); 16 | 17 | void UpdateContext(); 18 | 19 | void Create(); 20 | }; 21 | 22 | #endif -------------------------------------------------------------------------------- /source/WispSyser/gdtwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GDTWND_HPP_ 3 | #define _GDTWND_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | 7 | struct CGDTWnd : public CWispList 8 | { 9 | void *m_pGDTAddress; 10 | unsigned long m_dwGDTSize; 11 | unsigned long m_dwBeginIndex; 12 | 13 | CGDTWnd(); 14 | virtual ~CGDTWnd(); 15 | 16 | virtual bool MsgProc(WISP_MSG *pMsg) override; 17 | bool OnCreate(WISP_MSG *pMsg); 18 | bool OnClose(WISP_MSG *pMsg); 19 | 20 | bool InsertGDT(); 21 | void InitContext(); 22 | void Create(); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /source/WispSyser/idtwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _IDTWND_HPP_ 3 | #define _IDTWND_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | 7 | struct CIDTWnd : public CWispList 8 | { 9 | void *m_pIDTAddress; 10 | unsigned long m_dwIDTSize; 11 | unsigned long m_dwBeginIndex; 12 | 13 | CIDTWnd(); 14 | virtual ~CIDTWnd(); 15 | 16 | virtual bool MsgProc(WISP_MSG *pMsg) override; 17 | bool OnCreate(WISP_MSG *pMsg); 18 | bool OnClose(WISP_MSG *pMsg); 19 | 20 | bool InsertIDT(); 21 | void InitContext(); 22 | void Create(); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /source/WispSyser/syseroptionform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SYSEROPTIONFORM_HPP_ 3 | #define _SYSEROPTIONFORM_HPP_ 4 | 5 | #include "../Wisp/wispoptionform.hpp" 6 | 7 | struct CSyserOptionForm : public CWispOptionForm 8 | { 9 | CSyserOptionForm(); 10 | virtual ~CSyserOptionForm(); 11 | virtual bool InitWnd() override; 12 | virtual bool MsgProc(WISP_MSG *pMsg) override; 13 | bool OnCreateForm(WISP_MSG *pMsg); 14 | virtual void OnApply() override; 15 | 16 | virtual bool OnDefaulting() override; 17 | virtual void OnDefault() override; 18 | }; 19 | 20 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispprogressform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPPROGRESSFORM_HPP_ 3 | #define _WISPPROGRESSFORM_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispform.hpp" 7 | #include "wispprogress.hpp" 8 | #include "wispstatic.hpp" 9 | 10 | struct CWispProgressForm : public CWispForm 11 | { 12 | CWispProgress *m_pProgress; 13 | CWispStaticStr *m_pStaticStr; 14 | 15 | CWispProgressForm(); 16 | virtual ~CWispProgressForm(); 17 | 18 | virtual bool MsgProc(WISP_MSG *pMsg) override; 19 | 20 | bool OnCreateForm(WISP_MSG *pMsg); 21 | 22 | void SetText(const WCHAR *Text); 23 | }; 24 | 25 | #endif -------------------------------------------------------------------------------- /source/WispSyser/processlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PROCESSLIST_HPP_ 3 | #define _PROCESSLIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | 7 | struct CProcessList : public CWispList 8 | { 9 | CListStringItem *m_pSystemList; 10 | 11 | CProcessList(); 12 | virtual ~CProcessList(); 13 | 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | 16 | bool OnUpdate(WISP_MSG *pMsg); 17 | bool OnCreate(WISP_MSG *pMsg); 18 | bool OnClose(WISP_MSG *pMsg); 19 | 20 | virtual void OnLButton(CListStringItem *Item, int nCol) override; 21 | 22 | bool UpdateContext(); 23 | void Create(); 24 | }; 25 | 26 | #endif -------------------------------------------------------------------------------- /source/WispSyser/debuggerselectform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DEBUGGERSELECTFORM_HPP_ 3 | #define _DEBUGGERSELECTFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | 8 | struct CDebuggerSelectForm : public CWispForm 9 | { 10 | CWispList *m_pList; 11 | 12 | CDebuggerSelectForm(); 13 | virtual ~CDebuggerSelectForm(); 14 | 15 | virtual bool MsgProc(WISP_MSG *pMsg) override; 16 | bool OnCreateForm(WISP_MSG *pMsg); 17 | bool OnEvent(WISP_MSG *pMsg); 18 | 19 | bool OnEventPlug(WISP_MSG *pMsg); 20 | bool OnEventModuleList(WISP_MSG *pMsg); 21 | void Create(); 22 | }; 23 | 24 | #endif -------------------------------------------------------------------------------- /source/WispSyser/strinputwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STRINPUTWND_HPP_ 3 | #define _STRINPUTWND_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | 7 | struct CStrInputWnd : public CWispForm 8 | { 9 | TWideString *m_pResult; 10 | const WCHAR *m_szCaption; 11 | const WCHAR *m_szDefault; 12 | 13 | CStrInputWnd(); 14 | virtual ~CStrInputWnd(); 15 | 16 | virtual bool MsgProc(WISP_MSG *pMsg) override; 17 | bool OnCreateForm(WISP_MSG *pMsg); 18 | bool OnCommand(WISP_MSG *pMsg); 19 | bool OnCmdOK(WISP_MSG *pMsg); 20 | 21 | static bool Input(TWideString *Result, const WCHAR *szDefault, const WCHAR *szCaption); 22 | }; 23 | 24 | #endif -------------------------------------------------------------------------------- /source/WispSyser/callstackwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CALLSTACKWND_HPP_ 3 | #define _CALLSTACKWND_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | 7 | struct CCallStackWnd : public CWispList 8 | { 9 | CListStringItem *m_pItem; 10 | 11 | CCallStackWnd(); 12 | virtual ~CCallStackWnd(); 13 | 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | bool OnCreate(WISP_MSG *pMsg); 16 | bool OnClose(WISP_MSG *pMsg); 17 | bool OnEvent(WISP_MSG *pMsg); 18 | 19 | virtual void OnMouseDblClick(CListStringItem *Item, int nCol) override; 20 | 21 | void SetLineItem(CListStringItem *Item); 22 | void UpdateContext(); 23 | 24 | void Create(); 25 | }; 26 | 27 | #endif -------------------------------------------------------------------------------- /source/Code/osdefine.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _OSDEFINE_HPP_ 3 | #define _OSDEFINE_HPP_ 4 | 5 | #define _WIN32_WINDOWS 0x0410 6 | #define _WIN32_WINNT 0x0500 7 | 8 | //#define WIN32_LEAN_AND_MEAN 9 | 10 | //#include 11 | //#include 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | //suxx 18 | #if 1 19 | #undef CreateFile 20 | #undef DeleteFile 21 | #undef FindFirstFile 22 | #undef FindNextFile 23 | #undef GetOpenFileName 24 | #undef SendMessage 25 | #undef PostMessage 26 | #undef DispatchMessage 27 | #undef GetCharWidth 28 | #undef SetWindowText 29 | #undef AppendMenu 30 | #undef MoveMemory 31 | #endif 32 | 33 | #endif -------------------------------------------------------------------------------- /source/WispSyser/runtracewnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _RUNTRACEWND_HPP_ 3 | #define _RUNTRACEWND_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | 7 | struct CRunTraceWnd : public CWispList 8 | { 9 | unsigned long m_Color[16]; 10 | 11 | CRunTraceWnd(); 12 | virtual ~CRunTraceWnd(); 13 | 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | bool OnUpdate(WISP_MSG *pMsg); 16 | bool OnCreate(WISP_MSG *pMsg); 17 | bool OnClose(WISP_MSG *pMsg); 18 | bool OnMouseDblClick(WISP_MSG *pMsg); 19 | bool OnKeyEvent(WISP_MSG *pMsg); 20 | //bool OnCommand(WISP_MSG *pMsg); 21 | bool OnEvent(WISP_MSG *pMsg); 22 | 23 | void UpdateContext(); 24 | 25 | void Create(); 26 | }; 27 | 28 | #endif -------------------------------------------------------------------------------- /source/WispSyser/consolewnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONSOLEWND_HPP_ 3 | #define _CONSOLEWND_HPP_ 4 | 5 | #include "../Wisp/wispconsolewnd.hpp" 6 | 7 | struct CConsoleWnd : public CWispConsoleWnd 8 | { 9 | unsigned long m_StartCmd; 10 | 11 | CConsoleWnd(); 12 | virtual ~CConsoleWnd(); 13 | 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | bool OnCreate(WISP_MSG *pMsg); 16 | bool OnKeyEvent(WISP_MSG *pMsg); 17 | 18 | virtual void OnBeginCmd(const WCHAR *szCmd) override;// {} 19 | //virtual void OnCmd(const WCHAR *szCmd) override;// {} 20 | virtual void OnEndCmd(const WCHAR *szCmd) override;// {} 21 | 22 | bool Run(const char *szFile, const char *szParam, unsigned long *pResult); 23 | }; 24 | 25 | #endif -------------------------------------------------------------------------------- /source/Code/txtfile.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TXTFILE_HPP_ 3 | #define _TXTFILE_HPP_ 4 | 5 | #include "define.h" 6 | #include "imagefile.hpp" 7 | #include "alt/altlist.hpp" 8 | 9 | struct CTXTFile : public CImageFile 10 | { 11 | CTXTFile(); 12 | ~CTXTFile(); 13 | 14 | virtual bool Open(const char *FileName, HANDLE OpenHandle) override; 15 | bool Save(const char *FileName); 16 | virtual void Close() override; 17 | int SetLineEndIdentity(const char *Buffer, unsigned long long Length); 18 | bool Insert(unsigned long Pos, unsigned long Length, const char *String); 19 | bool Replace(unsigned long Pos, unsigned long Length, const char *String, unsigned long NewPos); 20 | 21 | TList m_StrList; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /source/Code/utxtfile.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _UTXTFILE_HPP_ 3 | #define _UTXTFILE_HPP_ 4 | 5 | #include "define.h" 6 | #include "imagefile.hpp" 7 | #include "alt/altlist.hpp" 8 | 9 | struct UCTXTFile : public CImageFile 10 | { 11 | UCTXTFile(); 12 | ~UCTXTFile(); 13 | 14 | virtual bool Open(const char *FileName, HANDLE OpenHandle) override; 15 | bool Save(const char *FileName); 16 | virtual void Close() override; 17 | int SetLineEndIdentity(const WCHAR *Buffer, unsigned long long Length); 18 | bool Insert(unsigned long Pos, unsigned long Length, const WCHAR *String); 19 | bool Replace(unsigned long Pos, unsigned long Length, const WCHAR *String, unsigned long NewPos); 20 | 21 | TList m_StrList; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /source/Code/modf.cpp: -------------------------------------------------------------------------------- 1 | 2 | extern "C" double __cdecl modf(double x, double *iptr) 3 | { 4 | union {double f; unsigned long long i;} u = {x}; 5 | unsigned long long mask; 6 | int e = (int)(u.i>>52 & 0x7ff) - 0x3ff; 7 | 8 | /* no fractional part */ 9 | if (e >= 52) { 10 | *iptr = x; 11 | if (e == 0x400 && u.i<<12 != 0) /* nan */ 12 | return x; 13 | u.i &= 1ULL<<63; 14 | return u.f; 15 | } 16 | 17 | /* no integral part*/ 18 | if (e < 0) { 19 | u.i &= 1ULL<<63; 20 | *iptr = u.f; 21 | return x; 22 | } 23 | 24 | mask = -1ULL>>12>>e; 25 | if ((u.i & mask) == 0) { 26 | *iptr = x; 27 | u.i &= 1ULL<<63; 28 | return u.f; 29 | } 30 | u.i &= ~mask; 31 | *iptr = u.f; 32 | return x - u.f; 33 | } 34 | -------------------------------------------------------------------------------- /source/WispSyser/crossreferenceform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CROSSREFERENCEFORM_HPP_ 3 | #define _CROSSREFERENCEFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | 8 | struct CCrossReferenceForm : public CWispForm 9 | { 10 | CWispList *m_pListWnd; 11 | 12 | CCrossReferenceForm(); 13 | virtual ~CCrossReferenceForm(); 14 | 15 | virtual bool MsgProc(WISP_MSG *pMsg) override; 16 | 17 | bool OnCreateForm(WISP_MSG *pMsg); 18 | bool OnCommand(WISP_MSG *pMsg); 19 | bool OnCmdSelect(WISP_MSG *pMsg); 20 | bool OnEvent(WISP_MSG *pMsg); 21 | bool OnEventGoto(WISP_MSG *pMsg); 22 | bool OpenTRefList(TList & Addrs, ULONG_PTR Address); 23 | bool OpenOpRefList(TList & Addrs, ULONG_PTR Address); 24 | }; 25 | 26 | #endif -------------------------------------------------------------------------------- /source/WispSyser/pagemapwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PAGEMAPWND_HPP_ 3 | #define _PAGEMAPWND_HPP_ 4 | 5 | #include "../Wisp/wispsplitwnd.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | 8 | struct CPageMapWnd: public CWispSplitWnd 9 | { 10 | bool _field_260; 11 | 12 | CWispList m_PageDirectList; 13 | CWispList m_PageTableList; 14 | unsigned long *m_PageDirectBaseAddress; 15 | unsigned long *m_PageTableBaseAddress; 16 | 17 | CPageMapWnd(); 18 | virtual ~CPageMapWnd(); 19 | 20 | virtual bool MsgProc(WISP_MSG *pMsg) override; 21 | bool OnCreate(WISP_MSG *pMsg); 22 | bool OnDestroy(WISP_MSG *pMsg); 23 | bool OnCommand(WISP_MSG *pMsg); 24 | 25 | bool InsertPageTableList(WISP_MSG *pMsg); 26 | 27 | void Create(); 28 | void InitContext(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /source/Wisp/wispprogress.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPPROGRESS_HPP_ 3 | #define _WISPPROGRESS_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispbasewnd.hpp" 7 | 8 | struct CWispProgress : public CWispBaseWnd 9 | { 10 | int m_nStep; 11 | int m_nPos; 12 | int m_nLower; 13 | int m_nUpper; 14 | 15 | CWispProgress(); 16 | virtual ~CWispProgress(); 17 | virtual bool MsgProc(WISP_MSG *pMsg) override; 18 | 19 | bool OnUpdate(WISP_MSG *pMsg); 20 | bool Create(unsigned int Style, const WISP_RECT & rect, CWispBaseWnd *pParentWnd, unsigned int nID); 21 | 22 | int GetPos(); 23 | void SetPos(int nPos); 24 | void GetRange(int & nLower, int & nUpper); 25 | void SetRange(int nLower, int nUpper); 26 | void SetStep(int nStep); 27 | void StepIt(); 28 | void OffsetPos(int nPos); 29 | }; 30 | 31 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispcombobox.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPCOMBOBOX_HPP_ 3 | #define _WISPCOMBOBOX_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispedit.hpp" 7 | #include "wisplist.hpp" 8 | #include "wispbutton.hpp" 9 | 10 | struct CWispComboBox : public CWispEdit 11 | { 12 | unsigned int m_nCurSel; 13 | CWispList m_ComboList; 14 | CWispButton m_Button; 15 | 16 | CWispComboBox(); 17 | virtual ~CWispComboBox(); 18 | virtual bool MsgProc(WISP_MSG *pMsg) override; 19 | bool OnCreate(WISP_MSG *pMsg); 20 | bool OnDestroy(WISP_MSG *pMsg); 21 | bool OnEvent(WISP_MSG *pMsg); 22 | bool OnEventButton(WISP_MSG *pMsg); 23 | bool OnEventComboList(WISP_MSG *pMsg); 24 | bool OnCmdComboList(WISP_MSG *pMsg); 25 | bool OnCommand(WISP_MSG *pMsg); 26 | 27 | void SetCurSel(int nSelect); 28 | int GetCurSel(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /source/WispSyser/codebpedit.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CODEBPEDIT_HPP_ 3 | #define _CODEBPEDIT_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wispedit.hpp" 7 | #include "../Wisp/wispcheckbox.hpp" 8 | #include "../EXEAnalyzer/debugger.hpp" 9 | 10 | struct CCodeBPEdit : public CWispForm 11 | { 12 | BREAK_POINT *m_pBP; 13 | BREAK_POINT::MODULE *m_pModuleBP; 14 | CWispEdit *m_pName; 15 | CWispEdit *m_pAddress; 16 | CWispEdit *m_pCondition; 17 | CWispEdit *m_pCommand; 18 | CWispCheckBox *m_pEnable; 19 | bool m_bEnableBP; 20 | 21 | CCodeBPEdit(); 22 | virtual ~CCodeBPEdit(); 23 | 24 | virtual bool MsgProc(WISP_MSG *pMsg) override; 25 | 26 | bool OnCreateForm(WISP_MSG *pMsg); 27 | 28 | bool OnCommand(WISP_MSG *pMsg); 29 | bool OnCmdEdit(WISP_MSG *pMsg); 30 | bool OnCmdOK(WISP_MSG *pMsg); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /x32/README: -------------------------------------------------------------------------------- 1 | 2 | avail name for expcalc and any expr in syser 3 | 4 | under x64: 5 | RAX RBX RCX RDX RBP RSP RSI RDI RIP R8 R9 R10 R11 R12 R13 R14 R15 6 | EAX EBX ECX EDX EBP ESP ESI EDI EIP R8D R9D R10D R11D R12D R13D R14D R15D EFLAG EFL 7 | AX BX CX DX BP SP SI DI IP R8W R9W R10W R11W R12W R13W R14W R15W 8 | AH BH CH DH AL BL CL DL BPL SPL SIL DIL R8B R9B R10B R11B R12B R13B R14B R15B 9 | 10 | under x86: 11 | EAX EBX ECX EDX EBP ESP ESI EDI EIP EFLAG EFL 12 | AX BX CX DX BP SP SI DI IP 13 | AH BH CH DH AL BL CL DL 14 | 15 | for both x64,x86: 16 | 17 | seg through ":", as example ":ds" 18 | ES CS SS DS FS GS 19 | 20 | PID - process id 21 | TID - thread id 22 | 23 | BPCOUNT - hit count to BreakPoint, if BreakPoint with condition 24 | OPCODE OPCODE1 OPCODE2 OPCODE4 - bytes on BreakPoint, if BreakPoint with condition -------------------------------------------------------------------------------- /x64/README: -------------------------------------------------------------------------------- 1 | 2 | avail name for expcalc and any expr in syser 3 | 4 | under x64: 5 | RAX RBX RCX RDX RBP RSP RSI RDI RIP R8 R9 R10 R11 R12 R13 R14 R15 6 | EAX EBX ECX EDX EBP ESP ESI EDI EIP R8D R9D R10D R11D R12D R13D R14D R15D EFLAG EFL 7 | AX BX CX DX BP SP SI DI IP R8W R9W R10W R11W R12W R13W R14W R15W 8 | AH BH CH DH AL BL CL DL BPL SPL SIL DIL R8B R9B R10B R11B R12B R13B R14B R15B 9 | 10 | under x86: 11 | EAX EBX ECX EDX EBP ESP ESI EDI EIP EFLAG EFL 12 | AX BX CX DX BP SP SI DI IP 13 | AH BH CH DH AL BL CL DL 14 | 15 | for both x64,x86: 16 | 17 | seg through ":", as example ":ds" 18 | ES CS SS DS FS GS 19 | 20 | PID - process id 21 | TID - thread id 22 | 23 | BPCOUNT - hit count to BreakPoint, if BreakPoint with condition 24 | OPCODE OPCODE1 OPCODE2 OPCODE4 - bytes on BreakPoint, if BreakPoint with condition -------------------------------------------------------------------------------- /source/unpack.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Code/define.h" 3 | #include "Code/polyfs.hpp" 4 | 5 | int CopyCallback(CFileIO *pSrcIO, CFileIO *pDstIO, 6 | const char *pSrcPath, const char *pDstPath, unsigned long Length, void *Data) 7 | { 8 | printf("copy: %s -> %s, %d\n", pSrcPath, pDstPath, Length); 9 | return 0; 10 | } 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | if (argc != 3) 15 | { 16 | printf("usage %s: File.dat UnpackDir\n", argv[0]); 17 | return 1; 18 | } 19 | 20 | CPFSFileIO PFSFileIO; 21 | PFSFileIO.ChangeFileIO(gpFileIO); 22 | 23 | if (!PFSFileIO.OpenDisk(argv[1], 1)) 24 | { 25 | PFSFileIO.CloseDisk(); 26 | printf("OpenDisk: error"); 27 | return 1; 28 | } 29 | 30 | if (!CFileIO::XCopy(&PFSFileIO, gpFileIO, "\\", argv[2], CopyCallback, 0)) 31 | { 32 | printf("XCopy: error"); 33 | } 34 | 35 | PFSFileIO.CloseDisk(); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /source/resource.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 101 ICON "Syser.ico" 4 | 5 | 2250 DIALOG 0, 0, 218, 55 6 | STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN 7 | CAPTION "" 8 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 9 | FONT 8, "MS Shell DLG" 10 | { 11 | CONTROL "&Arguments:", -1, STATIC, SS_LEFT | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 7, 7, 47, 12 12 | CONTROL "", 2251, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 54, 7, 155, 12 13 | CONTROL "&Start directory:", -1, STATIC, SS_LEFT | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 7, 22, 47, 12 14 | CONTROL "", 2253, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 54, 22, 155, 12 15 | CONTROL "&Debug child processes also", 2252, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 40, 150, 12 16 | } 17 | -------------------------------------------------------------------------------- /source/WispSyser/dataviewform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DATAVIEWFORM_HPP_ 3 | #define _DATAVIEWFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wispedit.hpp" 7 | #include "../Wisp/wispstatic.hpp" 8 | #include "../Wisp/wispbutton.hpp" 9 | #include "dataview.hpp" 10 | 11 | struct CDataViewForm : public CWispForm 12 | { 13 | CDataView m_DataView; 14 | CWispEdit *m_pAddressName; 15 | CWispButton *m_pGoto; 16 | CWispStaticGroup *m_pAddress; 17 | 18 | CDataViewForm(); 19 | virtual ~CDataViewForm(); 20 | 21 | virtual bool MsgProc(WISP_MSG *pMsg) override; 22 | 23 | bool OnCreateForm(WISP_MSG *pMsg); 24 | bool OnClose(WISP_MSG *pMsg); 25 | bool OnSize(WISP_MSG *pMsg); 26 | bool OnCommand(WISP_MSG *pMsg); 27 | bool OnCmdEdit(WISP_MSG *pMsg); 28 | bool OnEvent(WISP_MSG *pMsg); 29 | bool OnEventGoto(WISP_MSG *pMsg); 30 | void UpdateContext(); 31 | void Create(); 32 | }; 33 | 34 | #endif -------------------------------------------------------------------------------- /source/WispSyser/findlistwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FINDLISTWND_HPP_ 3 | #define _FINDLISTWND_HPP_ 4 | 5 | #include "../Wisp/wispwnd.hpp" 6 | #include "findstringform.hpp" 7 | 8 | struct CStatusWnd : public CWispWnd 9 | { 10 | TWideString m_StatusStr; 11 | 12 | CStatusWnd(); 13 | virtual ~CStatusWnd(); 14 | 15 | virtual bool MsgProc(WISP_MSG *pMsg) override; 16 | 17 | bool OnCreate(WISP_MSG *pMsg); 18 | bool OnUpdateClient(WISP_MSG *pMsg); 19 | }; 20 | 21 | struct CFindListWnd : public CWispWnd 22 | { 23 | CStatusWnd m_StatusWnd; 24 | CStringReferenceList m_StringReferenceList; 25 | unsigned long m_ShowFormat; 26 | 27 | CFindListWnd(); 28 | virtual ~CFindListWnd(); 29 | 30 | virtual bool MsgProc(WISP_MSG *pMsg) override; 31 | 32 | bool OnCreate(WISP_MSG *pMsg); 33 | bool OnCommand(WISP_MSG *pMsg); 34 | bool OnCmdStrFind(WISP_MSG *pMsg); 35 | bool OnSize(WISP_MSG *pMsg); 36 | }; 37 | 38 | #endif -------------------------------------------------------------------------------- /source/WispSyser/multidataview.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MULTIDATAVIEW_HPP_ 3 | #define _MULTIDATAVIEW_HPP_ 4 | 5 | #include "../Wisp/wispmultitabview.hpp" 6 | #include "dataview.hpp" 7 | 8 | struct CMultiDataView : public CWispMultiTabView 9 | { 10 | 11 | CMultiDataView(); 12 | virtual ~CMultiDataView(); 13 | 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | 16 | bool OnCreate(WISP_MSG *pMsg); 17 | bool OnCommand(WISP_MSG *pMsg); 18 | bool OnEvent(WISP_MSG *pMsg); 19 | bool OnEventFullScr(WISP_MSG *pMsg); 20 | bool OnEventNewView(WISP_MSG *pMsg); 21 | 22 | CDataView *InsertView(CDataView *pSrcView); 23 | 24 | void UpdateContext(); 25 | 26 | void DataWidthUpdate(); 27 | 28 | void ResetContext(); 29 | 30 | int GetActiveDataWidth(); 31 | void SetActiveDataWidth(int Width); 32 | ULONG_PTR GetActiveAddress(); 33 | void SetActiveAddress(ULONG_PTR Address, const WCHAR *pStrAddress); 34 | }; 35 | 36 | #endif -------------------------------------------------------------------------------- /source/WispSyser/currentfunction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _CURRENTFUNCTION_HPP_ 2 | #define _CURRENTFUNCTION_HPP_ 3 | 4 | #include "../Code/alt/altlist.hpp" 5 | #include "../EXEAnalyzer/sdsmodule.hpp" 6 | 7 | struct CCurrentFunction 8 | { 9 | ULONG_PTR m_ImageBaseTRUE; 10 | ULONG_PTR m_ImageBase; 11 | ULONG_PTR m_ImageHighBase; 12 | unsigned long m_Length; 13 | CSDSModule *m_pSDSMod; 14 | FUNCTION *m_pFunc; 15 | TList m_Vars; 16 | TList m_ClassFunctions; 17 | BASICTYPE *m_Class; 18 | 19 | CCurrentFunction(); 20 | virtual ~CCurrentFunction(); 21 | 22 | DATATYPE *GetLocal(char *pStr, bool bNoCase); 23 | FUNCTION *GetFunction(const char *FuncName, bool X); 24 | const char *GetSymbol(unsigned long displacement, unsigned int base, DATATYPE **Type) const; 25 | void AddClassFunctions(BASICTYPE *Type); 26 | void Update(); 27 | void Init(CSDSModule *pSDSMod, FUNCTION *pFunc); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /source/WispSyser/multicodeview.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MULTICODEVIEW_HPP_ 3 | #define _MULTICODEVIEW_HPP_ 4 | 5 | #include "../Code/alt/altmap.hpp" 6 | #include "../Wisp/wispmultitabview.hpp" 7 | #include "codeview.hpp" 8 | 9 | struct CMultiCodeView : public CWispMultiTabView 10 | { 11 | map m_Bookmark; 12 | 13 | CMultiCodeView(); 14 | virtual ~CMultiCodeView(); 15 | 16 | virtual bool MsgProc(WISP_MSG *pMsg) override; 17 | 18 | bool OnCreate(WISP_MSG *pMsg); 19 | 20 | virtual void OnActiveWnd(CWispWnd *pWnd) override; 21 | 22 | CCodeView *InsertView(CCodeView *pSrcView); 23 | 24 | void UpdateContext(); 25 | void ResetContext(); 26 | 27 | ULONG_PTR GetActiveAddress(); 28 | void SetActiveAddress(ULONG_PTR Address, bool bHistory); 29 | 30 | void ClearBM(); 31 | bool IsBM(ULONG_PTR Address); 32 | void ToggleBM(ULONG_PTR Address); 33 | void ToggleBM(); 34 | void NextBM(); 35 | void PrevBM(); 36 | }; 37 | 38 | #endif -------------------------------------------------------------------------------- /source/WispSyser/terminalwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | 5 | #include "terminalwnd.hpp" 6 | 7 | WISP_MSG_MAP_BEGIN(CTerminalWnd) 8 | WISP_MSG_MAP(WISP_WM_KEY_EVENT, OnKeyEvent) 9 | WISP_MSG_MAP_END(CWispTerminalWnd) 10 | 11 | bool CTerminalWnd::OnKeyEvent(WISP_MSG *pMsg) 12 | { 13 | if (pMsg->KeyEvent.KeyType == VK_TAB && pMsg->KeyEvent.bKeyDown) 14 | { 15 | WCHAR *pStr = TStrRChr(m_InputStr.operator const WCHAR*(), 0x20); 16 | if (pStr && TStrLen(pStr)>2) 17 | { 18 | char szStr[64]; 19 | int Len = TStrCpy(szStr, pStr+1); 20 | if (gpSyser->m_SyserUI.GetModuleName(szStr) > Len) 21 | { 22 | m_InputStr.SetAt(PTR_DELTA(pStr,m_InputStr.m_pData)/2+1, 0); 23 | WCHAR szuStr[64]; 24 | AnsiToUnicode(szStr, szuStr, lenof(szuStr)); 25 | m_InputStr += szuStr; 26 | m_CaretPos.x = m_InputStr.m_nLength; 27 | } 28 | } 29 | } 30 | return true; 31 | } 32 | -------------------------------------------------------------------------------- /source/WispSyser/modulelist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MODULELIST_HPP_ 3 | #define _MODULELIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../Wisp/wispmenu.hpp" 7 | 8 | struct CDbgModule; 9 | struct CModuleListWnd : public CWispList 10 | { 11 | bool m_bClose; 12 | CWispMenu m_PopupMenu; 13 | CDbgModule *m_pDbgMod; 14 | 15 | CModuleListWnd(); 16 | virtual ~CModuleListWnd(); 17 | 18 | virtual bool MsgProc(WISP_MSG *pMsg) override; 19 | bool OnUpdate(WISP_MSG *pMsg); 20 | bool OnCreate(WISP_MSG *pMsg); 21 | bool OnDestroy(WISP_MSG *pMsg); 22 | bool OnClose(WISP_MSG *pMsg); 23 | bool OnKeyEvent(WISP_MSG *pMsg); 24 | bool OnEvent(WISP_MSG *pMsg); 25 | 26 | bool OnEventOpenPEExplorer(WISP_MSG *pMsg); 27 | bool OnEventGotoBase(WISP_MSG *pMsg); 28 | bool OnEventAnalyze(WISP_MSG *pMsg); 29 | 30 | virtual void OnLButton(CListStringItem *Item, int nCol) override; 31 | 32 | void Create(bool bClose); 33 | void UpdateContext(); 34 | }; 35 | 36 | #endif -------------------------------------------------------------------------------- /source/WispSyser/othercmd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _OTHERCMD_HPP_ 3 | #define _OTHERCMD_HPP_ 4 | 5 | #include "../Code/define.h" 6 | 7 | struct IOCTL_ENTRY 8 | { 9 | const char *Name; 10 | unsigned long ControlCode; 11 | }; 12 | 13 | extern IOCTL_ENTRY stIoctlList[]; 14 | 15 | struct NTSTATUS_ENTRY 16 | { 17 | const char *MsgDesc; 18 | const char *MsgName; 19 | unsigned long MsgNumber; 20 | }; 21 | 22 | extern NTSTATUS_ENTRY stNtStatusList[]; 23 | 24 | struct WINERROR_ENTRY 25 | { 26 | unsigned long MsgNumber; 27 | const char *MsgDesc; 28 | const char *MsgName; 29 | }; 30 | 31 | extern WINERROR_ENTRY stWinErrorList[]; 32 | 33 | struct BUGCHECKCODE_ENTRY 34 | { 35 | unsigned long MsgNumber; 36 | const char *MsgName; 37 | const char *MsgDesc; 38 | }; 39 | 40 | extern BUGCHECKCODE_ENTRY stBugCheckCodeList[]; 41 | 42 | struct WINDOWS_MSG_ENTRY 43 | { 44 | unsigned long MsgNumber; 45 | const char *MsgName; 46 | }; 47 | 48 | extern WINDOWS_MSG_ENTRY stMsgList[]; 49 | 50 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispsoftkeyboard.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPSOFTKEYBOARD_HPP_ 3 | #define _WISPSOFTKEYBOARD_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispwnd.hpp" 7 | #include "wispbutton.hpp" 8 | #include "wispstatic.hpp" 9 | 10 | struct WISP_SKB_KEY 11 | { 12 | const WCHAR *szKeyName; 13 | unsigned int VKCmdID; 14 | WISP_RECT BTRect; 15 | }; 16 | 17 | struct CWispSoftKeyboard : public CWispWnd 18 | { 19 | CWispSoftKeyboard(); 20 | virtual ~CWispSoftKeyboard(); 21 | 22 | static WISP_SKB_KEY m_SoftKeyTable[]; 23 | CWispBaseWnd **m_BTAry; 24 | CWispStaticDIB m_StaticDIB; 25 | 26 | bool CreateEx(int x, int y, CWispWnd *pParentWnd, unsigned int Style, unsigned int ShowMode, unsigned int CmdID); 27 | virtual bool MsgProc(WISP_MSG *pMsg) override; 28 | bool OnCreate(WISP_MSG *pMsg); 29 | bool OnDestroy(WISP_MSG *pMsg); 30 | bool OnKeyEvent(WISP_MSG *pMsg); 31 | bool OnGetFocus(WISP_MSG *pMsg); 32 | bool OnCommand(WISP_MSG *pMsg); 33 | void Create(); 34 | }; 35 | 36 | #endif -------------------------------------------------------------------------------- /source/WispSyser/searchdialog.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SEARCHDIALOG_HPP_ 3 | #define _SEARCHDIALOG_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wispedit.hpp" 7 | #include "../Wisp/wispcheckbox.hpp" 8 | #include "../Wisp/wispcombobox.hpp" 9 | 10 | struct CSearchDialog : public CWispForm 11 | { 12 | CWispComboBox *m_pWidth; 13 | CWispEdit *m_pBegin; 14 | CWispEdit *m_pEnd; 15 | CWispEdit *m_pValue; 16 | CWispCheckBox *m_pCase; 17 | ULONG_PTR m_Begin; 18 | ULONG_PTR m_End; 19 | ULONG_PTR m_SearchResult; 20 | bool m_bCase; 21 | char m_PatternBuffer[64]; 22 | unsigned long m_SearchResultLen; 23 | 24 | CSearchDialog(); 25 | virtual ~CSearchDialog(); 26 | 27 | virtual bool MsgProc(WISP_MSG *pMsg) override; 28 | 29 | bool OnCreateForm(WISP_MSG *pMsg); 30 | 31 | bool OnCommand(WISP_MSG *pMsg); 32 | bool OnCmd1(WISP_MSG *pMsg); 33 | 34 | bool OnEvent(WISP_MSG *pMsg); 35 | bool OnEventModule(WISP_MSG *pMsg); 36 | bool OnEventOK(WISP_MSG *pMsg); 37 | bool OnEventSearch(WISP_MSG *pMsg); 38 | }; 39 | 40 | #endif -------------------------------------------------------------------------------- /source/WispSyser/reghelpwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _REGHELPWND_HPP_ 3 | #define _REGHELPWND_HPP_ 4 | 5 | #include "../Wisp/wispwnd.hpp" 6 | #include "../Wisp/wisptabwnd.hpp" 7 | 8 | struct stRegisterBitName 9 | { 10 | const WCHAR* RegName; 11 | int BeginBitIndex; 12 | int BitLen; 13 | const WCHAR* Descriptor; 14 | }; 15 | 16 | struct CRegHelpWnd: public CWispWnd 17 | { 18 | int m_RegisterGroup; 19 | 20 | CRegHelpWnd(); 21 | virtual ~CRegHelpWnd(); 22 | 23 | virtual bool MsgProc(WISP_MSG *pMsg) override; 24 | 25 | bool OnUpdateClient(WISP_MSG *pMsg); 26 | 27 | bool DrawRegister(int x, int y, unsigned int NumberMask, unsigned int ReservedMask, unsigned int LineMask, unsigned int OtherMask, CWispDC DrawDC, stRegisterBitName *RegBitName, const WCHAR *RegisterName); 28 | int SetRegisterGroup(int index); 29 | }; 30 | 31 | struct CX86RegHelpTabWnd: public CWispTabWnd 32 | { 33 | CRegHelpWnd m_RegisterGroup[6]; 34 | 35 | virtual bool MsgProc(WISP_MSG *pMsg) override; 36 | 37 | bool OnCreate(WISP_MSG *pMsg); 38 | void Create(); 39 | }; 40 | 41 | #endif -------------------------------------------------------------------------------- /source/WispSyser/commentlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _COMMENTLIST_HPP_ 3 | #define _COMMENTLIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../Wisp/wispmenu.hpp" 7 | 8 | struct CCommentList : public CWispList 9 | { 10 | CWispMenu m_PopupMenu; 11 | CListStringItem *m_pItem; 12 | CWispMenu::MenuItem *m_pGotoItem; 13 | 14 | CCommentList(); 15 | virtual ~CCommentList(); 16 | 17 | virtual bool MsgProc(WISP_MSG *pMsg) override; 18 | bool OnCreate(WISP_MSG *pMsg); 19 | bool OnDestroy(WISP_MSG *pMsg); 20 | bool OnClose(WISP_MSG *pMsg); 21 | bool OnKeyEvent(WISP_MSG *pMsg); 22 | bool OnMouseDblClick(WISP_MSG *pMsg); 23 | bool OnEvent(WISP_MSG *pMsg); 24 | 25 | bool OnEventGoto(WISP_MSG *pMsg); 26 | bool OnEventRemove(WISP_MSG *pMsg); 27 | 28 | virtual bool Edit(CListStringItem *Item, int nCol, TWideString& String) override; //Content? 0x80000111 //+54 29 | virtual bool OnEditing(CListStringItem *Item, int nCol, TWideString& String) override; //80000113,80000112 //+58 30 | 31 | void Create(); 32 | void UpdateContext(); 33 | }; 34 | 35 | #endif -------------------------------------------------------------------------------- /source/WispSyser/databpedit.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DATABPEDIT_HPP_ 3 | #define _DATABPEDIT_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wispedit.hpp" 7 | #include "../Wisp/wispcheckbox.hpp" 8 | #include "../Wisp/wispradiobox.hpp" 9 | #include "../EXEAnalyzer/debugger.hpp" 10 | 11 | struct CDataBPEdit : public CWispForm 12 | { 13 | BREAK_POINT *m_pBP; 14 | CWispEdit *m_pName; 15 | CWispEdit *m_pAddress; 16 | CWispEdit *m_pCondition; 17 | CWispEdit *m_pCommand; 18 | CWispCheckBox *m_pEnable; 19 | CWispRadioBox *m_pWriteOnly; 20 | CWispRadioBox *m_pReadWrite; 21 | CWispRadioBox *m_pExecute; 22 | CWispRadioBox *m_pIO; 23 | CWispRadioBox *m_pLenAll; 24 | CWispRadioBox *m_pLenByte; 25 | CWispRadioBox *m_pLenWord; 26 | CWispRadioBox *m_pLenDWord; 27 | bool m_bEnableBP; 28 | 29 | CDataBPEdit(); 30 | virtual ~CDataBPEdit(); 31 | 32 | virtual bool MsgProc(WISP_MSG *pMsg) override; 33 | 34 | bool OnCreateForm(WISP_MSG *pMsg); 35 | 36 | bool OnCommand(WISP_MSG *pMsg); 37 | bool OnCmdEdit(WISP_MSG *pMsg); 38 | bool OnCmdOK(WISP_MSG *pMsg); 39 | }; 40 | 41 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispprogressform.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "wispprogressform.hpp" 3 | 4 | WISP_FORM_RES_ITEM WispProgressForm[] = 5 | { 6 | {WISP_CTRL_FORM, {0, 0, 325, 60}, 0, 6, 0, 0, 0}, 7 | {WISP_CTRL_STATIC_STRING, {10, 10, 300, 16}, 2, 0, 0, 0, 0}, 8 | {WISP_CTRL_PROGRESS, {10, 30, 300, 16}, 1, 0, 0, 0, 0}, 9 | {0}, 10 | }; 11 | 12 | CWispProgressForm::CWispProgressForm() 13 | { 14 | m_pProgress = NULL; 15 | m_pStaticStr = NULL; 16 | m_Resource = WispProgressForm; 17 | } 18 | CWispProgressForm::~CWispProgressForm() 19 | { 20 | } 21 | 22 | WISP_MSG_MAP_BEGIN(CWispProgressForm) 23 | WISP_MSG_MAP(WISP_WM_CREATE_FORM, OnCreateForm) 24 | WISP_MSG_MAP_END(CWispForm) 25 | 26 | bool CWispProgressForm::OnCreateForm(WISP_MSG *pMsg) 27 | { 28 | m_pProgress = (CWispProgress *)GetFormItem(1); 29 | m_pProgress->SetRange(0, 99); 30 | m_pProgress->m_nPos = 0; 31 | m_pStaticStr = (CWispStaticStr *)GetFormItem(2); 32 | return true; 33 | } 34 | 35 | void CWispProgressForm::SetText(const WCHAR *Text) 36 | { 37 | m_pStaticStr->SetWindowText(Text); 38 | } 39 | -------------------------------------------------------------------------------- /source/WispSyser/watchlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WATCHLIST_HPP_ 3 | #define _WATCHLIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../Wisp/wispmenu.hpp" 7 | 8 | struct CWatchList : public CWispList 9 | { 10 | void ResetContext(); 11 | void UpdateLine(CListStringItem *pItem); 12 | void UpdateContext(); 13 | 14 | CListStringItem *m_pFirstItem; 15 | CWispMenu m_PopupMenu; 16 | CWispMenu::MenuItem *m_pMenuItemRemove; 17 | 18 | CWatchList(); 19 | virtual ~CWatchList(); 20 | 21 | virtual bool MsgProc(WISP_MSG *pMsg) override; 22 | 23 | bool OnUpdate(WISP_MSG *pMsg); 24 | bool OnCreate(WISP_MSG *pMsg); 25 | bool OnDestroy(WISP_MSG *pMsg); 26 | bool OnKeyEvent(WISP_MSG *pMsg); 27 | bool OnEventAdd(WISP_MSG *pMsg); 28 | bool OnEventDel(WISP_MSG *pMsg); 29 | bool OnEvent(WISP_MSG *pMsg); 30 | 31 | virtual bool Edit(CListStringItem *Item, int nCol, TWideString& String) override; 32 | virtual bool OnEditing(CListStringItem *Item, int nCol, TWideString& String) override; 33 | virtual void OnEdit(CListStringItem *Item, int nCol, TWideString& String) override; 34 | }; 35 | 36 | #endif -------------------------------------------------------------------------------- /source/Code/cmdparser.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CMDPARSER_HPP_ 3 | #define _CMDPARSER_HPP_ 4 | 5 | #include "define.h" 6 | #include "alt/altmap.hpp" 7 | #include "tstrmem.hpp" 8 | 9 | typedef int (*CMDPROC)(int argc, const WCHAR *argv[], const WCHAR *szCmd, void *pUserData); 10 | 11 | struct COMMAND_ENTRY 12 | { 13 | const WCHAR *pComment; 14 | const WCHAR *pUsage; 15 | CMDPROC pCmdProc; 16 | void *pUserData; 17 | }; 18 | 19 | struct CCmdParser 20 | { 21 | CCmdParser(); 22 | 23 | virtual ~CCmdParser(); //??? 24 | 25 | virtual void PrintString(const WCHAR *szStr); //??? 26 | 27 | map m_CmdMap; 28 | 29 | virtual void Reset(); 30 | virtual bool InsertCmd(const WCHAR *szCmd, CMDPROC pCmdProc, void *pUserData, const WCHAR *pComment, const WCHAR *pUsage); 31 | virtual void RemoveCmd(const WCHAR *szCmd); 32 | 33 | bool CompareParam(const WCHAR *pParam1, const WCHAR *pParam2); 34 | int GetParam(WCHAR *pStr, const WCHAR **pParam); 35 | bool ParseCmd(const WCHAR *szCmd, unsigned long *pResult); 36 | void ParseCmds(const WCHAR *szCmds, WCHAR Delim); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /source/Wisp/wispmultitabview.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "wispmultitabview.hpp" 3 | 4 | #define ID_TOOLBAR 0x40000003 5 | 6 | CWispMultiTabView::CWispMultiTabView() 7 | { 8 | m_nWithToolbar = 0; 9 | } 10 | CWispMultiTabView::~CWispMultiTabView() 11 | { 12 | } 13 | 14 | WISP_MSG_MAP_BEGIN(CWispMultiTabView) 15 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 16 | WISP_MSG_MAP(WISP_WM_DESTROY, OnDestroy) 17 | WISP_MSG_MAP(WISP_WM_SIZE, OnSize) 18 | WISP_MSG_MAP_END(CWispTabWnd) 19 | 20 | bool CWispMultiTabView::OnCreate(WISP_MSG *pMsg) 21 | { 22 | if (m_nWithToolbar) 23 | m_Toolbar.CreateEx(this, 0, 0, ID_TOOLBAR, 0x10000); 24 | return true; 25 | } 26 | bool CWispMultiTabView::OnSize(WISP_MSG *pMsg) 27 | { 28 | int y = (m_TabSpaceHeight - m_Toolbar.m_WindowRect.cy)/2; 29 | if (!(m_Style & 0x10000)) 30 | y += m_ClientRect.cy - m_TabSpaceHeight; 31 | int x = m_ClientRect.cx - m_Toolbar.m_WindowRect.cx - 2; 32 | if (m_Toolbar.IsWindow()) 33 | m_Toolbar.MoveToClient(x, y, true); 34 | return true; 35 | } 36 | bool CWispMultiTabView::OnDestroy(WISP_MSG *pMsg) 37 | { 38 | return true; 39 | } 40 | -------------------------------------------------------------------------------- /source/Wisp/wispmsgbox.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPMSGBOX_HPP_ 3 | #define _WISPMSGBOX_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altlist.hpp" 7 | #include "wispwnd.hpp" 8 | #include "wispdib.hpp" 9 | 10 | struct CWispMsgBox : public CWispWnd 11 | { 12 | CWispMsgBox(); 13 | virtual ~CWispMsgBox(); 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | bool OnUpdateClient(WISP_MSG *pMsg); 16 | bool OnCommand(WISP_MSG *pMsg); 17 | bool Create(CWispBaseWnd *pParentWnd); 18 | static int StaticShowMsgBox(const WCHAR *pText, const WCHAR *pCaption, unsigned int uType, CWispBaseWnd *pParentWnd); 19 | int ShowMsgBox(const WCHAR *pText, const WCHAR *pCaption, unsigned int uType); 20 | void AddButton(const WCHAR *pText, int nID); 21 | void AddDefaultButton(unsigned int uType); 22 | void AddDefaultIcon(unsigned int uType); 23 | void RemoveAllButtons(); 24 | 25 | struct BTNPAIR 26 | { 27 | TWideString pBtnText; 28 | int nID; 29 | }; 30 | 31 | TList m_lButtons; 32 | TWideString m_strText; 33 | int m_nBtnWidth; 34 | CWispDIB m_dibIcon; 35 | int m_nReturnStatus; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /source/Code/alt/altqueue.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALT_QUEUE_HPP_ 3 | #define _ALT_QUEUE_HPP_ 4 | 5 | #include "../define.h" 6 | #include "altarray.hpp" 7 | 8 | template 9 | struct TQueue : public TArray 10 | { 11 | int m_HeadIndex; 12 | public: 13 | TQueue() 14 | { 15 | m_HeadIndex = -1; 16 | } 17 | ~TQueue() 18 | { 19 | } 20 | 21 | void Clear() 22 | { 23 | TArray::Clear(); 24 | m_HeadIndex = -1; 25 | } 26 | 27 | bool Append(const T & Value) 28 | { 29 | if (this->Size == 0) return false; 30 | if (this->Count < this->Size) this->Count++; 31 | m_HeadIndex = (m_HeadIndex+1)%this->Size; 32 | this->m_ValueAry[m_HeadIndex] = Value; 33 | return true; 34 | } 35 | 36 | T * Append(const T *Value) 37 | { 38 | if (this->Size == 0) return 0; 39 | if (this->Count < this->Size) this->Count++; 40 | m_HeadIndex = (m_HeadIndex+1)%this->Size; 41 | if (Value) 42 | this->m_ValueAry[m_HeadIndex] = *Value; 43 | return &this->m_ValueAry[m_HeadIndex]; 44 | } 45 | 46 | T & operator[](int n) 47 | { 48 | int POS = m_HeadIndex+1+n; 49 | return TArray::operator[](POS); 50 | } 51 | }; 52 | 53 | #endif -------------------------------------------------------------------------------- /source/WispSyser/sdsmodulelist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDSMODULELIST_HPP_ 3 | #define _SDSMODULELIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../Wisp/wispmenu.hpp" 7 | #include "../EXEAnalyzer/sdsmodule.hpp" 8 | 9 | struct CSDSModuleList : public CWispList 10 | { 11 | CWispDIB *m_pDibC; 12 | CWispDIB *m_pDibCPP; 13 | CWispDIB *m_pDibH; 14 | CWispDIB *m_pDibMod; 15 | CListStringItem *m_pItem; 16 | CSDSModule *m_pSDSMod; 17 | CWispMenu m_PopupMenu; 18 | 19 | bool MsgProc(WISP_MSG *pMsg) override; 20 | bool OnCreate(WISP_MSG *pMsg); 21 | bool OnDestroy(WISP_MSG *pMsg); 22 | bool OnEvent(WISP_MSG *pMsg); 23 | bool OnEventActive(WISP_MSG *pMsg); 24 | bool OnEventUnload(WISP_MSG *pMsg); 25 | 26 | void ExpandModule(CListStringItem *Item); 27 | void ShowPopupMenu(); 28 | bool OnKeyEvent(WISP_MSG *pMsg); 29 | 30 | virtual void OnMouseDblClick(CListStringItem *Item, int nCol) override; 31 | 32 | void AppendSrcFiles(CListStringItem *ParentItem, CSDSModule *pSDSMod); 33 | void AppendSDSModule(CSDSModule *pSDSMod); 34 | bool RemoveSDSModule(CSDSModule *pSDSMod); 35 | void ExpandSDSModule(CSDSModule *pSDSMod); 36 | }; 37 | 38 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPFORM_HPP_ 3 | #define _WISPFORM_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altmap.hpp" 7 | #include "wispwnd.hpp" 8 | 9 | struct WISP_FORM_RES_ITEM 10 | { 11 | unsigned int Type; 12 | WISP_RECT rc; 13 | unsigned int CmdID; 14 | unsigned int Style; 15 | const WCHAR *pName; 16 | void *pData; 17 | const WCHAR *pTipString; 18 | }; 19 | 20 | struct CWispForm : public CWispWnd 21 | { 22 | CWispForm(); 23 | virtual ~CWispForm(); 24 | virtual bool MsgProc(WISP_MSG *pMsg) override; 25 | 26 | bool OnEvent(WISP_MSG *pMsg); 27 | bool OnCommand(WISP_MSG *pMsg); 28 | bool OnKeyEvent(WISP_MSG *pMsg); 29 | bool OnCmdOk(WISP_MSG *pMsg); 30 | bool OnCmdCancel(WISP_MSG *pMsg); 31 | bool OnCmdDefault(WISP_MSG *pMsg); 32 | 33 | bool LoadForm(WISP_FORM_RES_ITEM *ItemAry); 34 | bool Create(CWispWnd *pParentWnd, int ShowMode); 35 | virtual bool Destroy() override; 36 | CWispBaseWnd *GetFormItem(unsigned int CmdID); 37 | map m_FormItemMap; 38 | 39 | unsigned int GetFormResult(); 40 | unsigned int m_Result; 41 | WISP_FORM_RES_ITEM *m_Resource; 42 | }; 43 | 44 | #endif -------------------------------------------------------------------------------- /source/WispSyser/runtrace.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _RUNTRACE_HPP_ 3 | #define _RUNTRACE_HPP_ 4 | 5 | #include "../EXEAnalyzer/x86debugger.hpp" 6 | 7 | struct CTracePoint 8 | { 9 | ULONG_PTR Address; 10 | unsigned short Offset; 11 | unsigned short nWndIndex; 12 | }; 13 | 14 | struct CRunTrace 15 | { 16 | unsigned long m_MaxSize; 17 | unsigned long m_WriteIndex; //m_WriteTraceIndex 18 | CTracePoint *m_pTraces; 19 | bool m_bSaveREG; 20 | unsigned long m_LastWriteIndex; 21 | unsigned long m_CPURegWriteIndex; 22 | unsigned long XXX; 23 | unsigned long m_nTracesIndex; 24 | unsigned long m_CPURegReadIndex; 25 | X86_CPU_REG m_CurCPU; 26 | X86_CPU_REG m_LastCPU; 27 | unsigned long *m_pCPUType; 28 | ULONG_PTR *m_pCPUReg; 29 | unsigned long m_TracesContext; 30 | 31 | CRunTrace(); 32 | ~CRunTrace(); 33 | 34 | unsigned long UpdateContext(ULONG_PTR Address, ULONG_PTR CIP, unsigned short nWndIndex); 35 | void ReadContext(unsigned long TracePoint, X86_CPU_REG *pCPUReg, unsigned long *pCPUType); 36 | unsigned long Count(unsigned long CpuType) const; 37 | 38 | void Rotate(); 39 | CTracePoint *GetTracePoint(unsigned long TracePoint) const; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /source/WispSyser/sseregisterlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SSEREGISTERLIST_HPP_ 3 | #define _SSEREGISTERLIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../EXEAnalyzer/x86debugger.hpp" 7 | 8 | enum SSE_REG_INDEX 9 | { 10 | SSE_REG_0 = 0, 11 | SSE_REG_1, 12 | SSE_REG_2, 13 | SSE_REG_3, 14 | SSE_REG_4, 15 | SSE_REG_5, 16 | SSE_REG_6, 17 | SSE_REG_7, 18 | #ifdef _X64_ 19 | SSE_REG_8, 20 | SSE_REG_9, 21 | SSE_REG_10, 22 | SSE_REG_11, 23 | SSE_REG_12, 24 | SSE_REG_13, 25 | SSE_REG_14, 26 | SSE_REG_15, 27 | #endif 28 | SSE_REG_COUNT, 29 | }; 30 | 31 | struct CSSERegisterList : public CWispList 32 | { 33 | CListStringItem *m_hSSE128RegItem[SSE_REG_COUNT]; 34 | unsigned long m_OldXMMRegister[4][SSE_REG_COUNT]; 35 | unsigned long m_ColorChanges; 36 | unsigned long m_ColorSame; 37 | int m_nCPU; 38 | X86_CPU_REG_PTR m_CPUREGPTR; 39 | 40 | CSSERegisterList(); 41 | virtual ~CSSERegisterList(); 42 | 43 | bool MsgProc(WISP_MSG *pMsg) override; 44 | bool OnUpdate(WISP_MSG *pMsg); 45 | bool OnCreate(WISP_MSG *pMsg); 46 | bool OnGetFocus(WISP_MSG *pMsg); 47 | void ResetContext(); 48 | void UpdateContext(); 49 | }; 50 | 51 | #endif -------------------------------------------------------------------------------- /cmake/msvc-showcmd.cmake: -------------------------------------------------------------------------------- 1 | 2 | # solution to show full command and disable names collision while compilation 3 | 4 | # https://stackoverflow.com/questions/57358039/how-to-see-the-underlying-compiler-linker-command-line-with-cmake-nmake 5 | 6 | # another solution to disable 8.3 names generation while compilation 7 | # http://tips.defun.work/windows-perf.html 8 | #Run cmd with admin privileges: 9 | #fsutil behavior set disable8dot3 1 OR fsutil behavior set disable8dot3 3 10 | #(1 = all volumes / 3 = all but system colume) - then reboot. 11 | #Run cmd again with admin credentials and type: 12 | #fsutil 8dot3name strip /f /s C: 13 | #Repeat strip for every drive/partition. 14 | 15 | # append after project() 16 | 17 | set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0 FORCE) 18 | foreach(lang IN ITEMS C CXX) 19 | foreach(cmd IN ITEMS COMPILE_OBJECT CREATE_SHARED_LIBRARY CREATE_PREPROCESSED_SOURCE CREATE_ASSEMBLY_SOURCE LINK_EXECUTABLE) 20 | string(REPLACE "${CMAKE_START_TEMP_FILE}" "" CMAKE_${lang}_${cmd} "${CMAKE_${lang}_${cmd}}") 21 | string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_${lang}_${cmd} "${CMAKE_${lang}_${cmd}}") 22 | endforeach() 23 | endforeach() 24 | -------------------------------------------------------------------------------- /source/EXEAnalyzer/mzhead.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MZHEAD_HPP_ 3 | #define _MZHEAD_HPP_ 4 | 5 | #pragma pack(push,1) 6 | struct MZRELOC 7 | { 8 | /* 0x0000 */ unsigned short Offset; 9 | /* 0x0002 */ unsigned short Segment; 10 | }; /* size: 0x0004 */ 11 | #pragma pack(pop) 12 | 13 | #pragma pack(push,1) 14 | struct MZHEAD 15 | { 16 | /* 0x0000 */ unsigned short Signature; 17 | /* 0x0002 */ unsigned short cbLastPage; 18 | /* 0x0004 */ unsigned short nPage; 19 | /* 0x0006 */ unsigned short nReloc; 20 | /* 0x0008 */ unsigned short cpHead; 21 | /* 0x000a */ unsigned short Minalloc; 22 | /* 0x000c */ unsigned short Maxalloc; 23 | /* 0x000e */ unsigned short SS; 24 | /* 0x0010 */ unsigned short SP; 25 | /* 0x0012 */ unsigned short CheckSum; 26 | /* 0x0014 */ unsigned short IP; 27 | /* 0x0016 */ unsigned short CS; 28 | /* 0x0018 */ unsigned short fpReloc; 29 | /* 0x001a */ unsigned short nOverlay; 30 | /* 0x001c */ unsigned short Reserved[4]; 31 | /* 0x0024 */ unsigned short OemID; 32 | /* 0x0026 */ unsigned short OemInfo; 33 | /* 0x0028 */ unsigned short Reserved2[10]; 34 | /* 0x003c */ long pfNewHead; 35 | }; /* size: 0x0040 */ 36 | #pragma pack(pop) 37 | 38 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispmultitabview.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPMULTITABVIEW_HPP_ 3 | #define _WISPMULTITABVIEW_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wisptabwnd.hpp" 7 | #include "wisptoolbar.hpp" 8 | 9 | //enum 10 | //{ 11 | // WISP_MULTI_TAB_CMD_FULL_SCREEN = 0x40000000, 12 | // WISP_MULTI_TAB_CMD_NEW_VIEW = 0x40000001, 13 | // WISP_MULTI_TAB_CMD_REMOVE_VIEW = 0x40000002, 14 | //}; 15 | 16 | struct CWispMultiTabView : public CWispTabWnd 17 | { 18 | CWispMultiTabView(); 19 | virtual ~CWispMultiTabView(); 20 | int m_nWithToolbar; 21 | CWispToolbar m_Toolbar; 22 | 23 | // CWispButton m_FullScrBT; 24 | // CWispButton m_NewViewBT; 25 | // CWispButton m_RemoveViewBT; 26 | // CWispDIBList m_FullScrDIB; 27 | // CWispDIBList m_NewViewDIB; 28 | // CWispDIBList m_RemoveViewDIB; 29 | // CWispDIBList m_NormalViewDIB; 30 | // WISP_SIZE m_ViewBTSize; 31 | 32 | virtual bool MsgProc(WISP_MSG *pMsg) override; 33 | bool OnCreate(WISP_MSG *pMsg); 34 | bool OnSize(WISP_MSG *pMsg); 35 | bool OnDestroy(WISP_MSG *pMsg); 36 | 37 | //bool OnCommand(WISP_MSG *pMsg); 38 | //bool OnCmdFullScr(WISP_MSG *pMsg); 39 | //bool OnCmdNewView(WISP_MSG *pMsg); 40 | //bool OnCmdRemoveView(WISP_MSG *pMsg); 41 | }; 42 | #endif 43 | -------------------------------------------------------------------------------- /source/Wisp/wispfont.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPFONT_HPP_ 3 | #define _WISPFONT_HPP_ 4 | 5 | #include "../Code/define.h" 6 | //#include "../Code/osdefine.hpp" 7 | 8 | enum WISP_FONT_ID 9 | { 10 | WISP_FONT_8X16 = 0, 11 | WISP_FONT_6X12,// = 1, 12 | WISP_FONT_ASCI_12X16,// = 2, 13 | WISP_FONT_EBCD_12X16,// = 3, 14 | WISP_FONT_ANSI_12X16,// = 4, 15 | WISP_FONT_BDF, 16 | WISP_FONT_COUNT,// = 5, 17 | }; 18 | 19 | struct WISP_PHYS_FONT_INFO 20 | { 21 | int Width; 22 | int Height; 23 | const char *FontFN; 24 | const char *WideFontFN; 25 | }; 26 | 27 | struct CWispFont 28 | { 29 | CWispFont(); 30 | ~CWispFont(); 31 | 32 | bool LoadBDF(const char *FileName); 33 | bool LoadChar(WISP_PHYS_FONT_INFO *pPhysFont); 34 | bool LoadWideChar(WISP_PHYS_FONT_INFO *pPhysFont); 35 | 36 | void Destroy(); 37 | 38 | int m_CharLenAry[256]; 39 | 40 | int m_Height; 41 | int m_Width; 42 | unsigned char *m_Buffer; 43 | int m_BufSize; 44 | 45 | int m_WideHeight; 46 | int m_WideWidth; 47 | unsigned char *m_WideBuffer; 48 | int m_WideBufSize; 49 | 50 | int m_BytesPerChar; 51 | 52 | unsigned char *GetCharPixelBuffer(WCHAR Char); 53 | 54 | int GetCharWidth(WCHAR Char); 55 | int GetCharHeight(WCHAR Char); 56 | }; 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /source/Code/handle.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _HANDLE_HPP_ 3 | #define _HANDLE_HPP_ 4 | 5 | #include "define.h" 6 | 7 | //for CPFSFileIO 8 | 9 | // (Type << 16) | (nDir << 10) | nSlot; 10 | 11 | typedef bool (*REL_HI_FUNC)(void *, void *); 12 | 13 | struct HANDLE_INFO 14 | { 15 | void *HandleInfo; 16 | unsigned long Attribute; 17 | }; 18 | 19 | struct HANDLE_TYPE_INFO 20 | { 21 | REL_HI_FUNC RelHIFunc; 22 | void *Param; 23 | bool bExist; 24 | }; 25 | 26 | struct CHandle 27 | { 28 | HANDLE_INFO *m_HandleInfoDir[64]; 29 | HANDLE_TYPE_INFO m_RegisterType[256]; 30 | 31 | CHandle(); 32 | 33 | ULONG_PTR CreateHandle(void *HandleInfo, unsigned long Type); 34 | bool CloseHandle(ULONG_PTR Handle); 35 | void CloseAllHandle(); 36 | void Reset(); 37 | ULONG_PTR GetFirstHandle(unsigned long Type) const; 38 | ULONG_PTR GetNextHandle(ULONG_PTR Handle) const; 39 | bool IsHandleExist(ULONG_PTR Handle) const; 40 | void *GetHandleInfo(ULONG_PTR Handle) const; 41 | unsigned long GetHandleType(ULONG_PTR Handle) const; 42 | unsigned long GetHandleSlot(ULONG_PTR Handle) const; 43 | unsigned long GetHandleDir(ULONG_PTR Handle) const; 44 | 45 | unsigned long Register(REL_HI_FUNC RelHIFunc, void *Param); 46 | bool Unregister(unsigned long Type); 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /source/Wisp/wispcheckbox.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPCHECKBOX_HPP_ 3 | #define _WISPCHECKBOX_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispbasewnd.hpp" 7 | 8 | struct CWispCheckBox : public CWispBaseWnd 9 | { 10 | CWispRect m_TextRect; 11 | CWispRect m_CheckBoxRect; 12 | // bool m_bIsThreeState; 13 | // int m_CurrentState; 14 | // unsigned int m_uStyle; 15 | bool m_bIsMultiLine;//??? 16 | bool m_bFocus;//??? 17 | bool m_bMouseDown; 18 | bool m_bMouseIn; 19 | // bool m_EnableState; 20 | 21 | CWispCheckBox(); 22 | virtual ~CWispCheckBox(); 23 | virtual bool MsgProc(WISP_MSG *pMsg) override; 24 | bool OnUpdate(WISP_MSG *pMsg); 25 | bool OnKeyEvent(WISP_MSG *pMsg); 26 | bool OnMouseLDown(WISP_MSG *pMsg); 27 | bool OnMouseLUp(WISP_MSG *pMsg); 28 | // bool OnGetFocus(WISP_MSG *pMsg) { m_bFocus = 1; return true; } 29 | // bool OnLostFocus(WISP_MSG *pMsg) { m_bFocus = 0; return true; } 30 | bool OnMouseLeave(WISP_MSG *pMsg); 31 | bool OnMouseMove(WISP_MSG *pMsg); 32 | virtual bool InitWnd() override; 33 | // void DrawFocusRect(WISP_MSG *pMsg); 34 | // void DrawBorder(); 35 | // void DrawCheckBox(WISP_MSG *pMsg); 36 | void DrawCaption(); 37 | // int SetState(int newState); 38 | // int GetState(); 39 | void Enable(bool bEnable); 40 | }; 41 | 42 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispbutton.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPBUTTON_HPP_ 3 | #define _WISPBUTTON_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispbasewnd.hpp" 7 | #include "wispdrawobj.hpp" 8 | 9 | struct CWispWnd; //??? 10 | 11 | struct CWispButton : public CWispBaseWnd 12 | { 13 | CWispButton(); 14 | virtual ~CWispButton(); 15 | 16 | virtual bool MsgProc(WISP_MSG *pMsg) override; 17 | 18 | virtual void RecalcLayout() override; 19 | 20 | bool OnKeyEvent(WISP_MSG *pMsg); 21 | bool OnMouseMove(WISP_MSG *pMsg); 22 | bool OnMouseLeave(WISP_MSG *pMsg); 23 | bool OnMove(WISP_MSG *pMsg); 24 | bool OnUpdate(WISP_MSG *pMsg); 25 | 26 | virtual bool InitWnd() override; 27 | 28 | virtual void OnButtonEnter(); // {} Press 29 | virtual void OnButtonLeave(); // {} Release 30 | 31 | bool m_bTextRect; 32 | WISP_RECT m_TextRect; 33 | 34 | bool m_bPressed; 35 | bool m_bMouseInBTRect; 36 | 37 | CWispDIB *m_DIBList[WISP_BT_DIB_COUNT]; 38 | 39 | bool CreateEx(CWispDIBList *pDIBList, int x, int y, CWispWnd *pParentWnd, unsigned int CmdID, unsigned int Style); 40 | bool CreateEx(CWispDIB *pDIB, int x, int y, CWispWnd *pParentWnd, unsigned int CmdID, unsigned int Style); 41 | bool SetDIB(CWispDIB *pDIB, WISP_BT_DIB DIB); 42 | bool SetDIBList(CWispDIBList *pDIBList); 43 | }; 44 | 45 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispradiobox.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPRADIOBOX_HPP_ 3 | #define _WISPRADIOBOX_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispbasewnd.hpp" 7 | 8 | struct CWispRadioBox : public CWispBaseWnd 9 | { 10 | CWispRect m_TextRect; 11 | CWispRect m_RadioBoxRect; 12 | // bool m_bIsThreeState; 13 | // int m_CurrentState; 14 | // unsigned int m_uStyle; 15 | bool m_bIsMultiLine;//??? 16 | bool m_bFocus;//??? 17 | bool m_bMouseDown; 18 | bool m_bMouseIn; 19 | // bool m_EnableState; 20 | 21 | CWispRadioBox(); 22 | virtual ~CWispRadioBox(); 23 | virtual bool MsgProc(WISP_MSG *pMsg) override; 24 | bool OnUpdate(WISP_MSG *pMsg); 25 | bool OnKeyEvent(WISP_MSG *pMsg); 26 | bool OnMouseLDown(WISP_MSG *pMsg); 27 | bool OnMouseLUp(WISP_MSG *pMsg); 28 | // bool OnGetFocus(WISP_MSG *pMsg) { m_bFocus = 1; return true; } 29 | // bool OnLostFocus(WISP_MSG *pMsg) { m_bFocus = 0; return true; } 30 | bool OnMouseLeave(WISP_MSG *pMsg); 31 | bool OnMouseMove(WISP_MSG *pMsg); 32 | virtual bool InitWnd() override; 33 | // void DrawFocusRect(WISP_MSG *pMsg); 34 | // void DrawBorder(); 35 | // void DrawCheckBox(WISP_MSG *pMsg); 36 | void DrawCaption(); 37 | // int SetState(int newState); 38 | // int GetState(); 39 | void Enable(bool bEnable); 40 | void UpdateForm(); 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /source/Code/options.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SETOPTIONS_HPP_ 3 | #define _SETOPTIONS_HPP_ 4 | 5 | #include "define.h" 6 | #include "alt/altmap.hpp" 7 | #include "tstrmem.hpp" 8 | 9 | enum 10 | { 11 | SETOPTION_INVALID = 0, 12 | SETOPTION_STR = 1, 13 | SETOPTION_INT = 2, 14 | SETOPTION_UINT = 3, 15 | SETOPTION_VOID = 4, 16 | }; 17 | 18 | struct SETOPTION 19 | { 20 | const WCHAR *Key; 21 | int Type; 22 | void *Value; 23 | int Size; 24 | }; 25 | 26 | struct COptions : public map 27 | { 28 | // map m_Options; 29 | 30 | void Parse(SETOPTION *Opt); 31 | bool SetStr(const WCHAR *Key, void *Str, int Size); 32 | bool SetInt(const WCHAR *Key, void *Int); 33 | bool SetUInt(const WCHAR *Key, void *UInt); 34 | bool SetVoid(const WCHAR *Key, void *Void); 35 | 36 | bool Remove(const WCHAR *Key); 37 | 38 | int Get(const WCHAR *Key, void *Value, int *pSize); 39 | WCHAR * GetStr(const WCHAR *Key, int *pSize); 40 | int GetInt(const WCHAR *Key); 41 | unsigned int GetUInt(const WCHAR *Key); 42 | void *GetVoid(const WCHAR *Key); 43 | 44 | bool SetStr(const char *Key, void *Str, int Size); 45 | bool SetInt(const char *Key, void *Int); 46 | bool SetUInt(const char *Key, void *UInt); 47 | bool SetVoid(const char *Key, void *Void); 48 | bool Remove(const char *Key); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /source/Wisp/wispsplitwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPSPLITWND_HPP_ 3 | #define _WISPSPLITWND_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altlist.hpp" 7 | #include "wispwnd.hpp" 8 | 9 | struct WISP_SPLIT_WND 10 | { 11 | CWispWnd *pWnd; 12 | int SizeXorY; 13 | unsigned int Style; 14 | WISP_RECT SplitRect; 15 | }; 16 | 17 | struct CWispSplitWnd : public CWispWnd 18 | { 19 | CWispSplitWnd(); 20 | virtual ~CWispSplitWnd(); 21 | virtual bool MsgProc(WISP_MSG *pMsg) override; 22 | bool OnDestroy(WISP_MSG *pMsg); 23 | bool OnCreate(WISP_MSG *pMsg); 24 | bool OnUpdate(WISP_MSG *pMsg); 25 | bool OnUpdateClient(WISP_MSG *pMsg); 26 | bool OnMouseMove(WISP_MSG *pMsg); 27 | bool OnMouseLeave(WISP_MSG *pMsg); 28 | bool OnKeyEvent(WISP_MSG *pMsg); 29 | bool OnSize(WISP_MSG *pMsg); 30 | bool OnMouseDblClick(WISP_MSG *pMsg); 31 | bool OnResizeChild(WISP_MSG *pMsg); 32 | WISP_SIZE m_Size; 33 | int m_SplitBorderSize; 34 | TList m_WndList; 35 | TListIter m_CurSplitWndIt; 36 | TListIter m_NextSplitWndIt; 37 | bool InsertWnd(CWispWnd *pWnd, unsigned int Style, int SizeXorY, int InsertPos); 38 | bool RemoveWnd(CWispWnd *pWnd); 39 | void AdjustWnd(int Pos); 40 | void AdjustWndPos(); 41 | int SetSize(int Pos, int SizeXorY); 42 | int GetSize(int Pos, int *pSizeXorY); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /source/Wisp/wispstatic.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPSTATIC_HPP_ 3 | #define _WISPSTATIC_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispbasewnd.hpp" 7 | #include "wispdib.hpp" 8 | 9 | struct CWispStaticStr : public CWispBaseWnd 10 | { 11 | CWispStaticStr(); 12 | virtual bool MsgProc(WISP_MSG *pMsg) override; 13 | bool OnUpdate(WISP_MSG *pMsg); 14 | virtual ~CWispStaticStr(); 15 | }; 16 | 17 | struct CWispStaticDIB : public CWispBaseWnd 18 | { 19 | CWispDIB *m_pDIB; 20 | 21 | CWispStaticDIB(); 22 | virtual ~CWispStaticDIB(); 23 | 24 | virtual bool MsgProc(WISP_MSG *pMsg) override; 25 | bool CreateEx(CWispDIB *pDIB, int x, int y, CWispBaseWnd *pParentWnd, unsigned int CmdID); 26 | bool OnUpdate(WISP_MSG *pMsg); 27 | }; 28 | 29 | struct CWispStaticGroup : public CWispBaseWnd 30 | { 31 | CWispStaticGroup(); 32 | virtual bool MsgProc(WISP_MSG *pMsg) override; 33 | bool OnUpdate(WISP_MSG *pMsg); 34 | bool OnGetFocus(WISP_MSG *pMsg); 35 | virtual ~CWispStaticGroup(); 36 | }; 37 | 38 | struct CWispStaticURL : public CWispBaseWnd 39 | { 40 | bool m_MouseEnter; 41 | 42 | CWispStaticURL(); 43 | virtual ~CWispStaticURL(); 44 | 45 | virtual bool MsgProc(WISP_MSG *pMsg) override; 46 | bool OnUpdate(WISP_MSG *pMsg); 47 | bool OnKeyEvent(WISP_MSG *pMsg); 48 | bool OnMouseEnter(WISP_MSG *pMsg); 49 | bool OnMouseLeave(WISP_MSG *pMsg); 50 | }; 51 | 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /source/WispSyser/multisourcecodeview.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MULTISOURCECODEVIEW_HPP_ 3 | #define _MULTISOURCECODEVIEW_HPP_ 4 | 5 | #include "../Code/alt/altmap.hpp" 6 | #include "../Wisp/wispmultitabview.hpp" 7 | #include "../EXEAnalyzer/sdsmodule.hpp" 8 | #include "sourcecodewnd.hpp" 9 | 10 | struct SCWKEY 11 | { 12 | unsigned long FileID; 13 | CSDSModule *pSDSMod; 14 | //CSourceCodeWnd *pSrcWnd; 15 | 16 | // SCWKEY(unsigned long FileID, CSDSModule *pSDSMod):FileID(FileID), pSDSMod(pSDSMod) {} 17 | bool operator==(const SCWKEY & other) const 18 | { 19 | return FileID == other.FileID && pSDSMod == other.pSDSMod; 20 | } 21 | bool operator<(const SCWKEY & other) const 22 | { 23 | if (FileID < other.FileID) return true; 24 | if (FileID > other.FileID) return false; 25 | if (pSDSMod < other.pSDSMod) return true; 26 | return false; 27 | } 28 | }; 29 | 30 | struct CMultiSourceCodeView : public CWispMultiTabView 31 | { 32 | map m_SourceCodeWndMap; 33 | 34 | virtual bool MsgProc(WISP_MSG *pMsg) override; 35 | 36 | bool OnCreate(WISP_MSG *pMsg); 37 | bool OnCommand(WISP_MSG *pMsg); 38 | bool OnEvent(WISP_MSG *pMsg); 39 | 40 | virtual bool OnRemoveTab(CWispWnd *pWnd) override; 41 | virtual void OnRemoved() override; 42 | virtual void OnActiveWnd(CWispWnd *pWnd) override; 43 | 44 | void UpdateContext(); 45 | }; 46 | 47 | #endif -------------------------------------------------------------------------------- /addition/DiaSDK/include/diacreate.h: -------------------------------------------------------------------------------- 1 | // diacreate.h - creation helper functions for DIA initialization 2 | //----------------------------------------------------------------- 3 | // 4 | // Copyright Microsoft Corporation. All Rights Reserved. 5 | // 6 | //--------------------------------------------------------------- 7 | #ifndef _DIACREATE_H_ 8 | #define _DIACREATE_H_ 9 | 10 | // 11 | // Create a dia data source object from the dia dll (by dll name - does not access the registry). 12 | // 13 | 14 | HRESULT STDMETHODCALLTYPE NoRegCoCreate( const __wchar_t *dllName, 15 | REFCLSID rclsid, 16 | REFIID riid, 17 | void **ppv); 18 | 19 | #ifndef _NATIVE_WCHAR_T_DEFINED 20 | #ifdef __cplusplus 21 | 22 | HRESULT STDMETHODCALLTYPE NoRegCoCreate( const wchar_t *dllName, 23 | REFCLSID rclsid, 24 | REFIID riid, 25 | void **ppv) 26 | { 27 | return NoRegCoCreate( (const __wchar_t *)dllName, rclsid, riid, ppv ); 28 | } 29 | 30 | #endif 31 | #endif 32 | 33 | 34 | 35 | // 36 | // Create a dia data source object from the dia dll (looks up the class id in the registry). 37 | // 38 | HRESULT STDMETHODCALLTYPE NoOleCoCreate( REFCLSID rclsid, 39 | REFIID riid, 40 | void **ppv); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /source/Wisp/wispcolorstrwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPCOLORSTRWND_HPP_ 3 | #define _WISPCOLORSTRWND_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispwnd.hpp" 7 | 8 | #define WISP_TERMINAL_LINE_SIZE 256 9 | 10 | struct CWispColorStrWnd : public CWispWnd 11 | { 12 | CWispColorStrWnd(); 13 | virtual ~CWispColorStrWnd(); 14 | virtual bool MsgProc(WISP_MSG *pMsg) override; 15 | 16 | bool OnCreate(WISP_MSG *pMsg); 17 | bool OnUpdateClient(WISP_MSG *pMsg); 18 | bool OnScrollEvent(WISP_MSG *pMsg); 19 | bool OnKeyEvent(WISP_MSG *pMsg); 20 | bool OnRecalcLayout(WISP_MSG *pMsg); 21 | bool OnMouseMove(WISP_MSG *pMsg); 22 | bool OnEvent(WISP_MSG *pMsg); 23 | bool OnEventCopy(WISP_MSG *pMsg); 24 | 25 | virtual bool InitWnd() override; 26 | virtual unsigned char GetLineStr(int LineIndex, unsigned long *pColorStr) = 0; 27 | virtual void SetMaxLines(int nLine); 28 | virtual void SetMaxChars(int nChar); 29 | void CalcPonitStrPos(WISP_POINT *pPoint, WISP_POINT *pStrPT); 30 | void UpdateCaretState(); 31 | void UpdateSelect(); 32 | void ResetSelect(); 33 | 34 | WISP_POINT m_ScrPos; 35 | WISP_POINT m_CaretPos; 36 | WISP_POINT m_RealSelStartPos; 37 | WISP_POINT m_RealSelEndPos; 38 | WISP_POINT *m_pSelStartPos; 39 | WISP_POINT *m_pSelEndPos; 40 | bool m_bSelect; 41 | 42 | int m_Margin; 43 | int m_nCharsPerLine; 44 | int m_nLinesPerPage; 45 | int m_MaxChars; 46 | int m_MaxLines; 47 | 48 | bool IsSelectChar(int SrcX, int ScrY); 49 | }; 50 | 51 | 52 | #endif -------------------------------------------------------------------------------- /source/WispSyser/dataoperatordlg.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DATAOPERATORDLG_HPP_ 3 | #define _DATAOPERATORDLG_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wispstatic.hpp" 7 | #include "../Wisp/wispbutton.hpp" 8 | #include "../Wisp/wispradiobox.hpp" 9 | #include "../Wisp/wispcheckbox.hpp" 10 | #include "../Wisp/wispedit.hpp" 11 | 12 | struct CDataOperatorDlg : CWispForm 13 | { 14 | CWispStaticStr *m_pNameDesc; 15 | CWispButton *m_pOK; 16 | CWispButton *m_pCancel; 17 | CWispRadioBox *m_pWidth8; 18 | CWispRadioBox *m_pWidth16; 19 | CWispRadioBox *m_pWidth32; 20 | CWispRadioBox *m_pWidth64; 21 | CWispRadioBox *m_pDec; 22 | CWispRadioBox *m_pHex; 23 | CWispCheckBox *m_pCount; 24 | CWispStaticStr *m_pValueName; 25 | CWispEdit *m_pBegin; 26 | CWispEdit *m_pEnd; 27 | CWispEdit *m_pValue; 28 | 29 | ULONG_PTR m_Begin; 30 | ULONG_PTR m_End; 31 | unsigned long m_Len; 32 | unsigned int m_Op; 33 | 34 | CDataOperatorDlg(); 35 | virtual ~CDataOperatorDlg(); 36 | 37 | virtual bool MsgProc(WISP_MSG *pMsg) override; 38 | bool OnCreateForm(WISP_MSG *pMsg); 39 | bool OnDestroy(WISP_MSG *pMsg); 40 | bool OnCommand(WISP_MSG *pMsg); 41 | bool OnEvent(WISP_MSG *pMsg); 42 | 43 | bool Create(CWispWnd *pParentWnd, int ShowMode, ULONG_PTR Start, ULONG_PTR End, unsigned long Length, unsigned int CmdID); 44 | int GetWidth(); 45 | bool OnCmd(WISP_MSG *pMsg); 46 | bool OnEventExecOp(WISP_MSG *pMsg); 47 | bool OnEventClose(WISP_MSG *pMsg); 48 | }; 49 | 50 | #endif -------------------------------------------------------------------------------- /source/Code/srctxtfile.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "srctxtfile.hpp" 3 | 4 | bool CSrcTXTFile::OpenEx(const char *FileName, HANDLE OpenHandle, unsigned long Mode) 5 | { 6 | if (!CImageFile::Open(FileName, OpenHandle)) 7 | return false; 8 | 9 | char *Buffer = new char[m_FileSize+1]; 10 | Buffer[m_FileSize] = 0; 11 | 12 | CImageFile::ReadFile(0, Buffer, m_FileSize); 13 | m_Mode = Mode; 14 | if (m_FileSize) 15 | { 16 | unsigned long Start = 0; 17 | unsigned long Index = 0; 18 | while (Index < m_FileSize) 19 | { 20 | if (Buffer[Index] == 13 || Buffer[Index] == 10) 21 | { 22 | unsigned long Skip = Index+1; 23 | if (Buffer[Index] == 13 && Buffer[Index+1] == 10) 24 | Skip = Index+2; 25 | 26 | unsigned long Len = ((m_Mode & 1) ? Skip : Index) - Start; 27 | char *Line = new char[Len+1]; 28 | TStrNCpy(Line, &Buffer[Start], Len); 29 | Line[Len] = 0; 30 | m_StrList.Append(&Line); 31 | if (m_Mode & 2) 32 | { 33 | m_Lines.Append(&Start); 34 | } 35 | Start = Skip; 36 | Index = Skip; 37 | } else 38 | { 39 | ++Index; 40 | } 41 | } 42 | 43 | if (Index != Start) 44 | { 45 | unsigned long Len = Index - Start; 46 | char *Line = new char[Len+1]; 47 | TStrNCpy(Line, &Buffer[Start], Len); 48 | Line[Len] = 0; 49 | m_StrList.Append(&Line); 50 | if (m_Mode & 2) 51 | { 52 | m_Lines.Append(&Start); 53 | } 54 | } 55 | } 56 | delete []Buffer; 57 | return true; 58 | } 59 | -------------------------------------------------------------------------------- /source/Code/pageimage.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PAGEIMAGE_HPP_ 3 | #define _PAGEIMAGE_HPP_ 4 | 5 | #include "define.h" 6 | #include "tstrmem.hpp" 7 | 8 | struct CMemoryImage 9 | { 10 | ULONG_PTR ImageBase = 0; 11 | ULONG_PTR ImageHighBase = 0; 12 | 13 | CMemoryImage(ULONG_PTR Address) : ImageBase(Address), ImageHighBase(Address) {} 14 | CMemoryImage(ULONG_PTR Address, ULONG_PTR HighAddress) : ImageBase(Address), ImageHighBase(HighAddress) {} 15 | 16 | bool InBaseRange(ULONG_PTR Address) 17 | { 18 | return Address >= ImageBase && Address < ImageHighBase; 19 | } 20 | }; 21 | 22 | inline bool operator<(const CMemoryImage & l, const CMemoryImage & r) 23 | { 24 | return (r.ImageBase == r.ImageHighBase) ? 25 | (l.ImageHighBase < r.ImageBase) : (l.ImageBase < r.ImageBase); 26 | } 27 | 28 | #define PAGE_READ 2 29 | #define PAGE_WRITE 4 30 | 31 | //0x0001 PAGE_ACCESS PAGE_MODIFY 32 | //0x0002 PAGE_READ 33 | //0x0004 PAGE_WRITE 34 | //0x0008 35 | //0x0010 PAGE_MAPPED 36 | //0x0020 PAGE_DATA PAGE_ALLOCED 37 | //0x0040 38 | //0x0080 39 | //0x1000 40 | //0x2000 41 | //0x4000 PAGE_DIRTY 42 | //0x8000 43 | 44 | struct CPageImage 45 | { 46 | virtual bool LoadPage(ULONG_PTR Address, void *Buffer) = 0; 47 | virtual bool SavePage(ULONG_PTR Address, const void *Buffer) { return false; } 48 | virtual unsigned long GetPageAttribute(ULONG_PTR Address) { return 6; } //PAGE_WRITE PAGE_READ 49 | 50 | TAnsiString m_FileName; 51 | 52 | unsigned long m_ImageSize = 0; 53 | ULONG_PTR m_ImageBase = 0; 54 | ULONG_PTR m_ImageHighBase = 0; 55 | }; 56 | 57 | #endif -------------------------------------------------------------------------------- /source/WispSyser/typeviewerform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TYPEVIEWERFORM_HPP_ 3 | #define _TYPEVIEWERFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | #include "../Wisp/wispedit.hpp" 8 | #include "../Wisp/wispbutton.hpp" 9 | #include "../Wisp/wispradiobox.hpp" 10 | #include "../Wisp/wispstatic.hpp" 11 | #include "../EXEAnalyzer/sdsmodule.hpp" 12 | 13 | struct CStructViewerForm : public CWispForm 14 | { 15 | CWispStaticStr *m_ItemDescription; 16 | CWispStaticStr *m_ItemAddressStr; 17 | CWispList *m_ItemOptions; 18 | CWispButton *m_ItemOk; 19 | CWispButton *m_ItemCancel; 20 | CWispRadioBox *m_ItemFloatingType; 21 | CWispRadioBox *m_ItemLockType; 22 | CWispRadioBox *m_ItemDec; 23 | CWispRadioBox *m_ItemHex; 24 | unsigned long X; 25 | CWispEdit *m_ItemAddress; 26 | CWispDIBList m_DIBList; 27 | ULONG_PTR m_Address; 28 | CSDSModule *m_pSDSMod; 29 | 30 | CStructViewerForm(); 31 | virtual ~CStructViewerForm(); 32 | 33 | virtual bool MsgProc(WISP_MSG *pMsg) override; 34 | 35 | bool OnCreateForm(WISP_MSG *pMsg); 36 | bool OnDestroy(WISP_MSG *pMsg); 37 | bool OnCommand(WISP_MSG *pMsg); 38 | bool OnCmdSelect(WISP_MSG *pMsg); 39 | bool OnEvent(WISP_MSG *pMsg); 40 | bool OnEventAdd(WISP_MSG *pMsg); 41 | bool OnEventClose(WISP_MSG *pMsg); 42 | bool OnEventLock(WISP_MSG *pMsg); 43 | bool OnEventFloating(WISP_MSG *pMsg); 44 | 45 | bool Create(CWispWnd *pParentWnd, int ShowMode, ULONG_PTR Address); 46 | void UpdateContext(); 47 | }; 48 | 49 | #endif -------------------------------------------------------------------------------- /source/Wisp/wisprgbselect.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPRGBSELECT_HPP_ 3 | #define _WISPRGBSELECT_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispform.hpp" 7 | #include "wispdib.hpp" 8 | #include "wispedit.hpp" 9 | #include "wispstatic.hpp" 10 | 11 | struct CWispRGBSelect : public CWispForm 12 | { 13 | WISP_RECT m_GammaFrameRC; 14 | WISP_RECT m_GammaRC; 15 | WISP_RECT m_ScaleFrameRC; 16 | WISP_RECT m_ScaleRC; 17 | WISP_RECT m_ScaleFullRC; 18 | WISP_RECT m_ResultRC; 19 | WISP_POINT m_GammaPoint; 20 | int m_nScale; 21 | CWispDIB m_GammaDIB; 22 | CWispDIB m_ScaleDIB; 23 | CWispStaticGroup *m_pStaticGroup; 24 | CWispEdit *m_pRedEdit; 25 | CWispEdit *m_pGreenEdit; 26 | CWispEdit *m_pBlueEdit; 27 | unsigned long m_Color; 28 | 29 | CWispRGBSelect(); 30 | virtual ~CWispRGBSelect(); 31 | virtual bool MsgProc(WISP_MSG *pMsg) override; 32 | bool OnDestroy(WISP_MSG *pMsg); 33 | bool OnUpdateClient(WISP_MSG *pMsg); 34 | bool OnMouseMove(WISP_MSG *pMsg); 35 | bool OnKeyEvent(WISP_MSG *pMsg); 36 | bool OnCreateForm(WISP_MSG *pMsg); 37 | 38 | bool OnCommand(WISP_MSG *pMsg); 39 | 40 | void ReadColorValue(); 41 | void ShowColorValue(); 42 | void DrawScale(); 43 | 44 | //void RGB2HSL(unsigned long Color, double &H, double &S, double &L); 45 | //long double Hue2RGB(double v1, double v2, double vH); 46 | //unsigned long HLS2RGB(double H, double L, double S); 47 | 48 | void ReDrawGamma(bool bGetPixel); 49 | void DrawGamma(CWispDIB *pDIB); 50 | 51 | static bool StaticCreate(unsigned long *pRetColor, unsigned long *pColor); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /source/syser.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/Code/alt/altarray.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ALT_ARRAY_HPP_ 3 | #define _ALT_ARRAY_HPP_ 4 | 5 | #include "../define.h" 6 | 7 | template 8 | struct TArray 9 | { 10 | int Count; 11 | int Size; 12 | T *m_ValueAry; 13 | public: 14 | //TArray(const TArray &) {} 15 | //TArray(T *, int) {} 16 | TArray() 17 | : Count(0) 18 | , Size(0) 19 | , m_ValueAry(nullptr) 20 | { 21 | Resize(N); 22 | } 23 | 24 | ~TArray() 25 | { 26 | SafeDeleteAry(m_ValueAry); 27 | Size = 0; 28 | Count = 0; 29 | } 30 | 31 | //void CopyConstruct(const TArray &) { } 32 | 33 | void Clear() 34 | { 35 | int OldSize = Size; 36 | SafeDeleteAry(m_ValueAry); 37 | Size = 0; 38 | Count = 0; 39 | Resize(OldSize); 40 | } 41 | 42 | bool Resize(int NewSize) 43 | { 44 | if (NewSize != Size) 45 | { 46 | SafeDeleteAry(m_ValueAry); 47 | Size = NewSize; 48 | Count = 0; 49 | m_ValueAry = new T[NewSize]; 50 | } 51 | return true; 52 | } 53 | 54 | bool Append(const T & Value) 55 | { 56 | if (Count >= Size) 57 | return false; 58 | m_ValueAry[Count] = Value; 59 | ++Count; 60 | return true; 61 | } 62 | 63 | bool Remove() 64 | { 65 | if (Count <= 0) 66 | return false; 67 | --Count; 68 | return true; 69 | } 70 | 71 | T & operator[](int n) 72 | { 73 | int POS = (Size-Count+n)%Size; 74 | return m_ValueAry[POS]; 75 | } 76 | 77 | //void Attach(T *, int) {} 78 | //void Detach() {} 79 | 80 | int Find(const T & Value) const 81 | { 82 | for (int n = 0; n < Count; ++n) 83 | { 84 | if (m_ValueAry[n] == Value) 85 | return n; 86 | } 87 | return 0; 88 | } 89 | }; 90 | 91 | #endif -------------------------------------------------------------------------------- /source/WispSyser/breakpointform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BREAKPOINTFORM_HPP_ 3 | #define _BREAKPOINTFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | #include "../Wisp/wispedit.hpp" 8 | #include "../Wisp/wispbutton.hpp" 9 | #include "../Wisp/wisptabwnd.hpp" 10 | #include "../EXEAnalyzer/debugger.hpp" 11 | 12 | struct CBreakPointForm : public CWispForm 13 | { 14 | CWispList *m_pCodeBP; 15 | CWispList *m_pDataBP; 16 | CWispList *m_pCurList; 17 | CWispTabWnd *m_pTabWnd; 18 | CWispButton *m_pEdit; 19 | CWispButton *m_pRemove; 20 | CWispButton *m_pRemoveAll; 21 | CWispButton *m_pEnableAll; 22 | CWispButton *m_pDisableAll; 23 | 24 | CBreakPointForm(); 25 | virtual ~CBreakPointForm(); 26 | 27 | virtual bool MsgProc(WISP_MSG *pMsg) override; 28 | 29 | bool OnCreateForm(WISP_MSG *pMsg); 30 | 31 | bool OnCommand(WISP_MSG *pMsg); 32 | bool OnCmdTabSelect(WISP_MSG *pMsg); 33 | bool OnCmdListSelect(WISP_MSG *pMsg); 34 | 35 | bool OnEvent(WISP_MSG *pMsg); 36 | bool OnEventEdit(WISP_MSG *pMsg); 37 | bool OnEventNew(WISP_MSG *pMsg); 38 | bool OnEventRemove(WISP_MSG *pMsg); 39 | bool OnEventRemoveAll(WISP_MSG *pMsg); 40 | bool OnEventEnableAll(WISP_MSG *pMsg); 41 | bool OnEventDisableAll(WISP_MSG *pMsg); 42 | 43 | 44 | void CreateShow(); 45 | int FillCode(); 46 | int ShowCode(); 47 | int FillData(); 48 | int ShowData(); 49 | void UpdateButton(); 50 | 51 | void InitContext(CWispList *pList); 52 | void DrawBP(CWispList *pList, CListStringItem *Item, BREAK_POINT *BreakPoint); 53 | void DrawModuleBP(CWispList *pList, CListStringItem *Item, BREAK_POINT::MODULE *BreakPoint); 54 | void Create(); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /source/Wisp/wisptipwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "wisptipwnd.hpp" 3 | #include "wispbase.hpp" 4 | 5 | CWispTipWnd::CWispTipWnd() 6 | { 7 | m_CtrlType = WISP_CTRL_TIP_WND; 8 | m_pTipOwnerWnd = 0; 9 | } 10 | 11 | bool CWispTipWnd::OnUpdate(WISP_MSG *pMsg) 12 | { 13 | WISP_RECT rc = m_WindowRect; 14 | m_WindowDC.DrawFrameRect(&rc, 1, 1); 15 | 16 | rc.x += 1; 17 | rc.y += 1; 18 | rc.cx -= 2; 19 | rc.cy -= 2; 20 | m_WindowDC.DrawFullRect(&rc, m_pWispBase->m_pWispDrawObj->m_crSystem[111]); 21 | if (m_WndText.m_nLength) 22 | { 23 | rc.x += 2; 24 | rc.y += 1; 25 | rc.cx -= 4; 26 | rc.cy -= 2; 27 | m_WindowDC.DrawString(m_WndText.operator const WCHAR*(), &rc, 0, 0, -1); 28 | } 29 | return false; 30 | } 31 | 32 | void CWispTipWnd::AutoAdjustPostion(CWispWnd *pWnd) 33 | { 34 | WISP_RECT rc; 35 | m_WindowDC.DrawString(m_WndText.operator const WCHAR*(), &rc, 0x400, 0, -1); 36 | rc.cy += 5; 37 | rc.cx += 8; 38 | m_pTipOwnerWnd = pWnd; 39 | m_WindowDC.GetTextExtent(m_WndText.operator const WCHAR*(), -1, 0); 40 | 41 | 42 | rc.x = m_pWispBase->m_MousePT.x - rc.cx / 2; 43 | rc.y = m_pWispBase->m_MousePT.y + 20; 44 | if (rc.x <= 0) 45 | rc.x = 10; 46 | 47 | if (rc.y <= 10) 48 | rc.y = 10; 49 | 50 | if (rc.x2()-1 >= m_pWispBase->m_FrameBufferInfo.Width) 51 | rc.x = m_pWispBase->m_FrameBufferInfo.Width - rc.cx - 10; 52 | if (rc.y2()-1 >= m_pWispBase->m_FrameBufferInfo.Height) 53 | rc.y = m_pWispBase->m_MousePT.y-30; 54 | 55 | MoveToScreen(rc.x, rc.y, true); 56 | Resize(rc.cx, rc.cy, true); 57 | Top(true); 58 | } 59 | 60 | WISP_MSG_MAP_BEGIN(CWispTipWnd) 61 | WISP_MSG_MAP(WISP_WM_UPDATE, OnUpdate) 62 | WISP_MSG_MAP_END(CWispBaseWnd) 63 | 64 | -------------------------------------------------------------------------------- /source/WispSyser/pluginlistform.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "pluginlistform.hpp" 5 | 6 | WISP_FORM_RES_ITEM PluginListForm[] = 7 | { 8 | {WISP_CTRL_FORM, {0, 0, 400, 200}, 0, 0xB, WSTR("Plugin List"), (void*)("\\SyserIcon\\Plugin.ico"), WSTR("Syser Plugin List !")}, 9 | {WISP_CTRL_LIST, {5, 5, 300, 160}, 1, 0x10006, 0, 0, 0}, 10 | {WISP_CTRL_STATIC_DIB, {315, 30, 64, 64}, 0, 0, 0, (void*)("\\SyserIcon\\Plugin.ico"), 0}, 11 | {WISP_CTRL_BUTTON, {312, 120, 70, 20}, WISP_ID_OK, 0, WSTR("OK"), 0, 0}, 12 | {0}, 13 | }; 14 | 15 | CPluginListForm::CPluginListForm() 16 | { 17 | m_Resource = PluginListForm; 18 | } 19 | 20 | CPluginListForm::~CPluginListForm() 21 | { 22 | } 23 | 24 | WISP_MSG_MAP_BEGIN(CPluginListForm) 25 | WISP_MSG_MAP(WISP_WM_CREATE_FORM, OnCreateForm) 26 | WISP_MSG_MAP_END(CWispForm) 27 | 28 | void CPluginListForm::UpdateContext() 29 | { 30 | for (map::IT it = gpSyser->m_PluginMap.begin(); 31 | it != gpSyser->m_PluginMap.end(); ++it) 32 | { 33 | CListStringItem *pItem = m_pList->InsertItem(it->first.operator const WCHAR*(), 0, 0, 0, -1); 34 | m_pList->SetItemText(pItem, 1, it->second.PluginInfo); 35 | } 36 | } 37 | 38 | bool CPluginListForm::OnCreateForm(WISP_MSG *pMsg) 39 | { 40 | m_pList = (CWispList *)GetFormItem(1); 41 | m_pList->InsertColumn(WSTR("Module Name"), 100, 0, 0, -1); 42 | m_pList->InsertColumn(WSTR("Information"), 190, 0, 0, -1); 43 | UpdateContext(); 44 | return true; 45 | } 46 | 47 | void CPluginListForm::Create() 48 | { 49 | if (IsWindow()) 50 | { 51 | UpdateContext(); 52 | Show(WISP_SH_MINSIZE); 53 | } else 54 | { 55 | CWispForm::Create(0, WISP_SH_MINSIZE); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /source/WispSyser/strinputwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "strinputwnd.hpp" 3 | 4 | WISP_MSG_MAP_BEGIN(CStrInputWnd) 5 | WISP_MSG_MAP(WISP_WM_CREATE_FORM, OnCreateForm) 6 | WISP_MSG_MAP_ON_COMMAND 7 | WISP_MSG_MAP_END(CWispForm) 8 | 9 | WISP_CMD_MAP_BEGIN(CStrInputWnd) 10 | WISP_CMD_MAP(WISP_ID_OK, OnCmdOK) 11 | WISP_CMD_MAP_END 12 | 13 | WISP_FORM_RES_ITEM StrInput[] = 14 | { 15 | {WISP_CTRL_FORM, {0, 0, 300, 100}, 0, 0xB, WSTR("Please Input ..."), 0, 0}, 16 | {WISP_CTRL_STATIC_GROUP, {10, 10, 270, 50}, 2, 0, WSTR("Text"), 0, 0}, 17 | {WISP_CTRL_EDIT, {20, 30, 200, 16}, 1, 0x1000006, 0, 0, 0}, 18 | {WISP_CTRL_BUTTON, {230, 30, 40, 16}, WISP_ID_OK, 0, WSTR("OK"), 0, 0}, 19 | {0} 20 | }; 21 | 22 | CStrInputWnd::CStrInputWnd() 23 | { 24 | m_szCaption = 0; 25 | m_szDefault = 0; 26 | m_Resource = StrInput; 27 | } 28 | 29 | CStrInputWnd::~CStrInputWnd() 30 | { 31 | } 32 | 33 | bool CStrInputWnd::OnCreateForm(WISP_MSG *pMsg) 34 | { 35 | if (m_szDefault) 36 | { 37 | CWispWnd *pWnd = (CWispWnd *)GetFormItem(2); 38 | pWnd->SetWindowText(m_szDefault); 39 | } 40 | if (m_szCaption) 41 | SetWindowText(m_szCaption); 42 | return true; 43 | } 44 | 45 | bool CStrInputWnd::OnCmdOK(WISP_MSG *pMsg) 46 | { 47 | if (pMsg->Command.CmdMsg == 0x80000002) 48 | { 49 | CWispWnd *pWnd = (CWispWnd *)GetFormItem(1); 50 | *m_pResult = pWnd->GetWindowText(); 51 | } 52 | return true; 53 | } 54 | 55 | bool CStrInputWnd::Input(TWideString *Result, const WCHAR *szDefault, const WCHAR *szCaption) 56 | { 57 | CStrInputWnd InputWnd; 58 | InputWnd.m_pResult = Result; 59 | InputWnd.m_szDefault = szDefault; 60 | InputWnd.m_szCaption = szCaption; 61 | InputWnd.Create(0, 5); 62 | return InputWnd.m_Result == WISP_ID_OK; 63 | } 64 | 65 | -------------------------------------------------------------------------------- /source/Code/time.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "time.hpp" 3 | #include "tstrmem.hpp" 4 | 5 | bool IsLeapYear(int Year) { return (!(Year & 3) && Year != (Year/100)*100) || Year == (Year/400)*400; } 6 | int LeapYears(int Year) { return (Year/4) - Year/100 + Year/400 - 477; } 7 | 8 | char *Time2Str(unsigned long TimeStamp, char *szBuffer) 9 | { 10 | int DayInMonth[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; 11 | 12 | unsigned long nHour = TimeStamp / 86400; 13 | unsigned long Hour = TimeStamp % 86400 / 3600; 14 | unsigned long nMinute = TimeStamp % 86400 % 3600; 15 | unsigned long Minute = nMinute / 60; 16 | unsigned long Year = TimeStamp / 86400 / 365 + 1970; 17 | unsigned long Second = nMinute % 60; 18 | unsigned long nDays = TimeStamp / 86400 % 365; 19 | unsigned long nDaysLeapYear = LeapYears(Year); //(Year/4) - Year/100 + Year/400 - 477; 20 | if (IsLeapYear(Year))// (!(Year & 3) && Year != (Year/100)*100) || Year == (Year/400)*400) 21 | --nDaysLeapYear; 22 | 23 | if (nDays < nDaysLeapYear) 24 | --Year; 25 | 26 | unsigned long v7 = 365*(Year-1970) + LeapYears(Year); //(Year/4) - Year/100 + Year/400 - 477; 27 | if (IsLeapYear(Year))// (!(Year & 3) && Year != (Year/100)*100) || Year == (Year/400)*400) 28 | { 29 | --v7; 30 | DayInMonth[1] = 29; 31 | } 32 | 33 | unsigned long Day = nHour - v7; 34 | unsigned long Month; 35 | for (Month = 0; Month < 12; ++Month) 36 | { 37 | unsigned long v10 = DayInMonth[Month]; 38 | if (Day < v10) break; 39 | Day -= v10; 40 | } 41 | TSPrintf(szBuffer, "%02d/%02d/%d %02d:%02d:%02d", 42 | (unsigned short)(Day + 1), (unsigned short)(Month + 1), (unsigned short)Year, 43 | (unsigned short)Hour, (unsigned short)Minute, (unsigned short)Second); 44 | return szBuffer; 45 | } 46 | -------------------------------------------------------------------------------- /source/WispSyser/plugin.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PLUGIN_HPP_ 3 | #define _PLUGIN_HPP_ 4 | 5 | #include "../Code/define.h" 6 | 7 | typedef void (*FPMenuProc)(); 8 | typedef int (*FPCmd)(int argc, const WCHAR *argv[], const WCHAR *szCommandLine, void *pUserData); 9 | 10 | typedef void (*PVFV)(); 11 | 12 | struct SYSER_PLUGIN_MODULE 13 | { 14 | WCHAR PluginInfo[32]; 15 | PVFV fpOnDebuggerOpen; 16 | PVFV fpOnDebuggerClose; 17 | PVFV fpOnDebuggerPlunge; 18 | }; 19 | 20 | struct CSyserPluginUI 21 | { 22 | virtual bool RegisterPluginModule(const WCHAR *ModuleName, SYSER_PLUGIN_MODULE *pPluginModule) = 0; 23 | virtual bool UnregisterPluginModule(const WCHAR *ModuleName) = 0; 24 | 25 | virtual int GetInstrLen(ULONG_PTR Address) = 0; 26 | 27 | virtual bool CalcExp(const WCHAR *szExp, ULONG_PTR *pResult) = 0; 28 | 29 | virtual bool InsertCmd(const WCHAR *szCmd, FPCmd pCmdProc, void *pUserData, const WCHAR *pComment, const WCHAR *pUsage) = 0; 30 | virtual void RemoveCmd(const WCHAR *szCmd) = 0; 31 | virtual int RunCmd(const WCHAR *szCmd) = 0; 32 | 33 | virtual void Outputf(const WCHAR *szFormat, ...) = 0; 34 | virtual void Output(const unsigned long *szMsg) = 0; 35 | 36 | virtual void *InsertMenu(void *hParentMenu, const WCHAR *szMenuName, FPMenuProc fpMenuProc) = 0; 37 | virtual bool RemoveMenu(void *hMenu) = 0; 38 | virtual bool EnableMenu(void *hMenu, bool bEnable) = 0; 39 | 40 | virtual void *GetMainTabWnd() = 0; 41 | virtual void *GetMainMenu() = 0; 42 | virtual void *GetWisp() = 0; 43 | 44 | virtual unsigned long WriteMemory(ULONG_PTR Address, const void *Buffer, unsigned long Size) = 0; 45 | virtual unsigned long ReadMemory(ULONG_PTR Address, void *Buffer, unsigned long Size) = 0; 46 | }; 47 | 48 | extern "C" __declspec(dllimport) CSyserPluginUI *gpSyserPluginUI; 49 | 50 | #endif -------------------------------------------------------------------------------- /x32/plugin.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PLUGIN_HPP_ 3 | #define _PLUGIN_HPP_ 4 | 5 | #include "../Code/define.h" 6 | 7 | typedef void (*FPMenuProc)(); 8 | typedef int (*FPCmd)(int argc, const WCHAR *argv[], const WCHAR *szCommandLine, void *pUserData); 9 | 10 | typedef void (*PVFV)(); 11 | 12 | struct SYSER_PLUGIN_MODULE 13 | { 14 | WCHAR PluginInfo[32]; 15 | PVFV fpOnDebuggerOpen; 16 | PVFV fpOnDebuggerClose; 17 | PVFV fpOnDebuggerPlunge; 18 | }; 19 | 20 | struct CSyserPluginUI 21 | { 22 | virtual bool RegisterPluginModule(const WCHAR *ModuleName, SYSER_PLUGIN_MODULE *pPluginModule) = 0; 23 | virtual bool UnregisterPluginModule(const WCHAR *ModuleName) = 0; 24 | 25 | virtual int GetInstrLen(ULONG_PTR Address) = 0; 26 | 27 | virtual bool CalcExp(const WCHAR *szExp, ULONG_PTR *pResult) = 0; 28 | 29 | virtual bool InsertCmd(const WCHAR *szCmd, FPCmd pCmdProc, void *pUserData, const WCHAR *pComment, const WCHAR *pUsage) = 0; 30 | virtual void RemoveCmd(const WCHAR *szCmd) = 0; 31 | virtual int RunCmd(const WCHAR *szCmd) = 0; 32 | 33 | virtual void Outputf(const WCHAR *szFormat, ...) = 0; 34 | virtual void Output(const unsigned long *szMsg) = 0; 35 | 36 | virtual void *InsertMenu(void *hParentMenu, const WCHAR *szMenuName, FPMenuProc fpMenuProc) = 0; 37 | virtual bool RemoveMenu(void *hMenu) = 0; 38 | virtual bool EnableMenu(void *hMenu, bool bEnable) = 0; 39 | 40 | virtual void *GetMainTabWnd() = 0; 41 | virtual void *GetMainMenu() = 0; 42 | virtual void *GetWisp() = 0; 43 | 44 | virtual unsigned long WriteMemory(ULONG_PTR Address, const void *Buffer, unsigned long Size) = 0; 45 | virtual unsigned long ReadMemory(ULONG_PTR Address, void *Buffer, unsigned long Size) = 0; 46 | }; 47 | 48 | extern "C" __declspec(dllimport) CSyserPluginUI *gpSyserPluginUI; 49 | 50 | #endif -------------------------------------------------------------------------------- /x64/plugin.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PLUGIN_HPP_ 3 | #define _PLUGIN_HPP_ 4 | 5 | #include "../Code/define.h" 6 | 7 | typedef void (*FPMenuProc)(); 8 | typedef int (*FPCmd)(int argc, const WCHAR *argv[], const WCHAR *szCommandLine, void *pUserData); 9 | 10 | typedef void (*PVFV)(); 11 | 12 | struct SYSER_PLUGIN_MODULE 13 | { 14 | WCHAR PluginInfo[32]; 15 | PVFV fpOnDebuggerOpen; 16 | PVFV fpOnDebuggerClose; 17 | PVFV fpOnDebuggerPlunge; 18 | }; 19 | 20 | struct CSyserPluginUI 21 | { 22 | virtual bool RegisterPluginModule(const WCHAR *ModuleName, SYSER_PLUGIN_MODULE *pPluginModule) = 0; 23 | virtual bool UnregisterPluginModule(const WCHAR *ModuleName) = 0; 24 | 25 | virtual int GetInstrLen(ULONG_PTR Address) = 0; 26 | 27 | virtual bool CalcExp(const WCHAR *szExp, ULONG_PTR *pResult) = 0; 28 | 29 | virtual bool InsertCmd(const WCHAR *szCmd, FPCmd pCmdProc, void *pUserData, const WCHAR *pComment, const WCHAR *pUsage) = 0; 30 | virtual void RemoveCmd(const WCHAR *szCmd) = 0; 31 | virtual int RunCmd(const WCHAR *szCmd) = 0; 32 | 33 | virtual void Outputf(const WCHAR *szFormat, ...) = 0; 34 | virtual void Output(const unsigned long *szMsg) = 0; 35 | 36 | virtual void *InsertMenu(void *hParentMenu, const WCHAR *szMenuName, FPMenuProc fpMenuProc) = 0; 37 | virtual bool RemoveMenu(void *hMenu) = 0; 38 | virtual bool EnableMenu(void *hMenu, bool bEnable) = 0; 39 | 40 | virtual void *GetMainTabWnd() = 0; 41 | virtual void *GetMainMenu() = 0; 42 | virtual void *GetWisp() = 0; 43 | 44 | virtual unsigned long WriteMemory(ULONG_PTR Address, const void *Buffer, unsigned long Size) = 0; 45 | virtual unsigned long ReadMemory(ULONG_PTR Address, void *Buffer, unsigned long Size) = 0; 46 | }; 47 | 48 | extern "C" __declspec(dllimport) CSyserPluginUI *gpSyserPluginUI; 49 | 50 | #endif -------------------------------------------------------------------------------- /source/WispSyser/findstringform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FINDSTRINGFORM_HPP_ 3 | #define _FINDSTRINGFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wispedit.hpp" 7 | #include "../Wisp/wispbutton.hpp" 8 | 9 | #include "../Code/alt/altmap.hpp" 10 | #include "../Wisp/wisplist.hpp" 11 | #include "../Wisp/wispmenu.hpp" 12 | 13 | struct CStringReferenceList; 14 | 15 | struct CFindStringForm : public CWispForm 16 | { 17 | CWispButton *m_pFindNext; 18 | CWispButton *m_pClose; 19 | CWispEdit *m_pFindWhat; 20 | CStringReferenceList *m_pStringReferenceList; 21 | 22 | CFindStringForm(); 23 | virtual ~CFindStringForm(); 24 | 25 | virtual bool MsgProc(WISP_MSG *pMsg) override; 26 | 27 | bool OnCreateForm(WISP_MSG *pMsg); 28 | 29 | bool OnCommand(WISP_MSG *pMsg); 30 | bool OnCmdFindWhat(WISP_MSG *pMsg); 31 | 32 | bool OnEvent(WISP_MSG *pMsg); 33 | bool OnEvent1(WISP_MSG *pMsg); 34 | }; 35 | 36 | struct CStringReferenceList : public CWispList 37 | { 38 | unsigned long m_ShowFormat; 39 | int m_nSearchLen; 40 | CWispMenu m_PopupMenu; 41 | TWideString m_SearchString; 42 | map m_KeyMap; 43 | CFindStringForm m_FindStringForm; 44 | CWispMenu::MenuItem *m_SearchAgainMenuItem; 45 | 46 | CStringReferenceList(); 47 | virtual ~CStringReferenceList(); 48 | 49 | virtual bool MsgProc(WISP_MSG *pMsg) override; 50 | 51 | void LoadKeyMap(); 52 | 53 | bool OnCreate(WISP_MSG *pMsg); 54 | bool OnDestroy(WISP_MSG *pMsg); 55 | 56 | bool OnCommand(WISP_MSG *pMsg); 57 | 58 | bool OnEvent(WISP_MSG *pMsg); 59 | bool OnEventSearch(WISP_MSG *pMsg); 60 | bool OnEventSearchAgain(WISP_MSG *pMsg); 61 | 62 | bool OnChar(WISP_MSG *pMsg); 63 | void PopupMenu(); 64 | bool OnKeyEvent(WISP_MSG *pMsg); 65 | bool OnMouseDblClick(WISP_MSG *pMsg); 66 | 67 | void InitContext(int,int); 68 | bool Search(const WCHAR *pString); 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /source/WispSyser/syserconfig.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SYSERCONFIG_HPP_ 3 | #define _SYSERCONFIG_HPP_ 4 | 5 | #include "../Code/define.h" 6 | 7 | #pragma pack(push, 1) 8 | struct SYSER_CFG 9 | { 10 | unsigned int iID; 11 | unsigned int iSplitRight; 12 | unsigned int iBigFont; 13 | WCHAR szFontFileName[MAX_FN_LEN]; 14 | unsigned int iFollowMode; 15 | unsigned int iShowStartSplash; 16 | unsigned int iShowFullSym; 17 | unsigned int iShowCCByte; 18 | unsigned int iMouseSensitivity; 19 | unsigned int iHistoryLines; 20 | unsigned int iSourceCodeShowTips; 21 | unsigned int iSourceCodeSyntaxColors; 22 | unsigned int iSourceCodeShowLineNumbers; 23 | unsigned int iConnectType; 24 | unsigned int iComPort; 25 | unsigned int iVideoDetectMode; 26 | unsigned int iStackSize; 27 | unsigned int iHardTimerEnable; 28 | WCHAR szDebuggerFileName[MAX_FN_LEN]; 29 | unsigned int iWidth; 30 | unsigned int iHeight; 31 | unsigned int iWidthMax; 32 | unsigned int iHeightMax; 33 | unsigned int iGeneralHeapSize; 34 | unsigned int iSourceHeapSize; 35 | unsigned int iAzertyKeyboard; 36 | unsigned int i3here; 37 | unsigned int i1here; 38 | unsigned int faultsCmdStatus; 39 | }; 40 | #pragma pack(pop) 41 | 42 | extern SYSER_CFG gSyserConfig; 43 | extern SYSER_CFG gSyserDefConfig; 44 | 45 | #if 0 46 | enum SV_COLOR 47 | { 48 | COLOR_NULL = 0, 49 | COLOR_BG = 1, 50 | //TODO 51 | }; 52 | #endif 53 | #pragma pack(push, 1) 54 | struct SYSER_COLORS 55 | { 56 | unsigned int iID; 57 | unsigned long Color[51]; 58 | }; 59 | #pragma pack(pop) 60 | 61 | extern SYSER_COLORS gSyserColors; 62 | extern SYSER_COLORS gSyserDefColors; 63 | 64 | bool ReadConfig(const char *FileName, void *Buffer, unsigned long Size); 65 | bool ReadConfigSize(const char *FileName, void *Buffer, unsigned long Size, unsigned long *FileSize); 66 | bool WriteConfig(const char *FileName, void *Buffer, unsigned long Size); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /source/WispSyser/sehchainwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "sehchainwnd.hpp" 5 | #include "syserconfig.hpp" 6 | 7 | CSEHChainWnd::CSEHChainWnd() 8 | { 9 | } 10 | CSEHChainWnd::~CSEHChainWnd() 11 | { 12 | } 13 | 14 | WISP_MSG_MAP_BEGIN(CSEHChainWnd) 15 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 16 | WISP_MSG_MAP(WISP_WM_CLOSE, OnClose) 17 | WISP_MSG_MAP_ON_EVENT 18 | WISP_MSG_MAP_END(CWispList) 19 | 20 | 21 | WISP_EVENT_MAP_BEGIN(CSEHChainWnd) 22 | // WISP_EVENT_MAP(..., OnEvent...) 23 | WISP_EVENT_MAP_END 24 | 25 | 26 | bool CSEHChainWnd::OnCreate(WISP_MSG *pMsg) 27 | { 28 | InsertColumn(WSTR("Address"), 70, 0, 0, -1); 29 | InsertColumn(WSTR("SE Handler"), 200, 0, 0, -1); 30 | UpdateContext(); 31 | return true; 32 | } 33 | bool CSEHChainWnd::OnClose(WISP_MSG *pMsg) 34 | { 35 | Show(WISP_SH_HIDDEN); 36 | return false; 37 | } 38 | 39 | void CSEHChainWnd::Create() 40 | { 41 | if (IsWindow()) 42 | { 43 | Show(WISP_SH_MINSIZE); 44 | } else 45 | { 46 | CreateWnd(WSTR("SEH Chain"), 0,0,620,280, 0, 0x10, 0x100BB, WISP_SH_MINSIZE); 47 | Center(0); 48 | } 49 | } 50 | 51 | void CSEHChainWnd::UpdateContext() 52 | { 53 | WCHAR display[20]; 54 | 55 | X86_CPU_REG_PTR CpuReg; 56 | gpSyser->m_pDebugger->GetX86RegPtr(&CpuReg); 57 | 58 | ULONG_PTR AddressTIB; 59 | unsigned long Limit; 60 | gpSyser->m_pDebugger->GetSegRegBase(*CpuReg.pFS, &AddressTIB, &Limit); 61 | 62 | unsigned long Mem[2]; 63 | if (gpSyser->m_pDebugger->ReadMemory(AddressTIB, Mem, 8) == 8) 64 | { 65 | while (Mem[0] != -1) 66 | { 67 | AddressTIB = Mem[0]; 68 | if (gpSyser->m_pDebugger->ReadMemory(AddressTIB, Mem, 8) != 8) break; 69 | TSPrintf(display, WSTR("%08X"), AddressTIB); 70 | CListStringItem *pItem = InsertItem(display, 0, 0, 0, -1); 71 | SetItemFormat(pItem, 1, Mem[1], WSTR("%X")); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /source/WispSyser/aboutform.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "aboutform.hpp" 3 | #include "../wisp/wispstatic.hpp" 4 | 5 | WISP_FORM_RES_ITEM AboutForm[] = 6 | { 7 | {WISP_CTRL_FORM, {0, 0, 300, 250}, 0, 0xB, WSTR("About Syser"), 0, 0}, 8 | {WISP_CTRL_STATIC_DIB, {10, 10, 32, 32}, 0, 0, 0, (void*)("\\SyserIcon\\Syser.ico:2"), 0}, 9 | {WISP_CTRL_STATIC_DIB, {85, 20, 16, 16}, 0, 0, 0, (void*)("\\SyserIcon\\Explorer.ico:1"), 0}, 10 | {WISP_CTRL_STATIC_URL, {110, 20, 180, 20}, 0, 0, WSTR("https://github.com/marakew/"), 0, 0}, 11 | {WISP_CTRL_STATIC_DIB, {85, 50, 16, 16}, 0, 0, 0, (void*)("\\SyserIcon\\Email.ico:1"), 0}, 12 | {WISP_CTRL_STATIC_URL, {110, 50, 180, 20}, 0, 0, WSTR("mailto:newsyser@gmail.com"), 0, 0}, 13 | {WISP_CTRL_STATIC_GROUP, {10, 80, 270, 110}, 0, 0, WSTR("Version Info"), 0, 0}, 14 | {WISP_CTRL_STATIC_STRING, {20, 100, 250, 90}, 1, 0, 0, 0, WSTR("Syser Version")}, 15 | {WISP_CTRL_BUTTON, {120, 200, 50, 18}, WISP_ID_OK, 0, WSTR("OK"), 0, 0}, 16 | {0}, 17 | }; 18 | 19 | CAboutForm::CAboutForm() 20 | { 21 | m_Resource = AboutForm; 22 | } 23 | CAboutForm::~CAboutForm() 24 | { 25 | } 26 | 27 | WISP_MSG_MAP_BEGIN(CAboutForm) 28 | WISP_MSG_MAP(WISP_WM_CREATE_FORM, OnCreateForm) 29 | WISP_MSG_MAP_END(CWispForm) 30 | 31 | bool CAboutForm::OnCreateForm(WISP_MSG *pMsg) 32 | { 33 | CWispStaticStr *pStringItem = (CWispStaticStr *)GetFormItem(1); 34 | if (pStringItem) 35 | { 36 | //WCHAR szDate[64]; 37 | //WCHAR szTime[64]; 38 | //TStrCpy(szDate, "" __DATE__ ""); 39 | //TStrCpy(szTime, "" __TIME__ ""); 40 | 41 | WCHAR Ver[32]; 42 | WCHAR Date[64]; 43 | TStrCpy(Ver, "Develop"); //1.99.1900.1120"); 44 | TStrCpy(Date, "" __DATE__ " " __TIME__ ""); 45 | WCHAR Build[512]; 46 | TSPrintf(Build, WSTR("Version : %s \n" 47 | "Build Date : %s \n\n" 48 | "Development Team\n\n" 49 | "reversecode"), 50 | Ver, Date); 51 | pStringItem->SetWindowText(Build); 52 | } 53 | return true; 54 | } 55 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | the original [syser debugger](https://github.com/yanfengwu-syser/syserdebugger) now is opensource
3 | 4 | reverse engineering old syser win32 debugger
5 | improved handle x64 arch and fix some bugs
6 | my syser IDA reverse engineering [database idb](https://github.com/marakew/rep/tree/master/syser)
7 | you able to see about my reverse engineering skills
8 | 9 | struct viewer
10 | note: pdb2sds.exe .pdb .sds must be same arch!
11 | for source level debugging don't convert .exe to .sds
12 | syser debugger will automatic detect .pdb for .exe
13 | pdb2sds.exe while convert doest include source level debug info
14 | only structs and variables
15 | 16 | convert any .pdb or .exe by util pdb2sds.exe
17 | load .sds file from syser menu
18 | Menu "File"->"Load Symbol File"
19 | check from console by command
20 | >sdsmod
21 | File BP(s) Size(k) CheckSum TimeStamp ModuleName
22 | 0 0k 00000001 00000001 testx64.pdb
23 | 1 Module(s)
24 | 25 | start debug .exe
26 | open popup menu on data window by right mouse button
27 | choose a struct by select it
28 | choose "Attach type to Addr"
29 | choose "Lock Type"
30 | enter at "Address" address of struct
31 | 32 | [sources](source)
33 | 34 | If you want to thank me 35 | ``` 36 | BTC 3HdQ9tLRoZ1uRGV6rfoDoUhF75DqzJa4UM 37 | ``` 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /source/Wisp/wispprogress.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "wispprogress.hpp" 3 | #include "wispbase.hpp" 4 | 5 | CWispProgress::CWispProgress() 6 | { 7 | m_nPos = 0; 8 | m_nLower = 0; 9 | m_nStep = 1; 10 | m_nUpper = 9; 11 | m_CtrlType = WISP_CTRL_PROGRESS; 12 | } 13 | 14 | CWispProgress::~CWispProgress() 15 | { 16 | //EMPTY 17 | } 18 | 19 | WISP_MSG_MAP_BEGIN(CWispProgress) 20 | WISP_MSG_MAP(WISP_WM_UPDATE, OnUpdate) 21 | WISP_MSG_MAP_END(CWispBaseWnd) 22 | 23 | bool CWispProgress::OnUpdate(WISP_MSG *pMsg) 24 | { 25 | WISP_RECT rcItem; 26 | rcItem.y = 0; 27 | rcItem.x = 0; 28 | rcItem.cx = m_WindowRect.cx; 29 | rcItem.cy = m_WindowRect.cy; 30 | if ( (m_Style & 0x40) == 0 ) 31 | m_pWispBase->m_pWispDrawObj->DrawCtrlClient(&m_WindowDC, &rcItem); 32 | 33 | int nPersent = 1000 * m_nPos / (m_nUpper - m_nLower); 34 | m_pWispBase->m_pWispDrawObj->DrawProgress(&m_WindowDC, &rcItem, m_Style, nPersent); 35 | return true; 36 | } 37 | 38 | bool CWispProgress::Create(unsigned int Style, const WISP_RECT & rect, CWispBaseWnd *pParentWnd, unsigned int nID) 39 | { 40 | return CWispBaseWnd::Create(0, rect, pParentWnd, nID, Style, 0); 41 | } 42 | 43 | int CWispProgress::GetPos() 44 | { 45 | return m_nPos; 46 | } 47 | void CWispProgress::SetPos(int nPos) 48 | { 49 | m_nPos = nPos; 50 | //Update((WISP_RECT*)0); 51 | } 52 | 53 | void CWispProgress::GetRange(int & nLower, int & nUpper) 54 | { 55 | nLower = m_nLower; 56 | nUpper = m_nUpper; 57 | } 58 | void CWispProgress::SetRange(int nLower, int nUpper) 59 | { 60 | m_nLower = nLower; 61 | m_nUpper = nUpper; 62 | Update((WISP_RECT*)0); 63 | } 64 | 65 | void CWispProgress::SetStep(int nStep) 66 | { 67 | m_nStep = nStep; 68 | //Update((WISP_RECT*)0); 69 | } 70 | 71 | void CWispProgress::StepIt() 72 | { 73 | m_nPos += m_nStep; 74 | //Update((WISP_RECT*)0); 75 | } 76 | 77 | void CWispProgress::OffsetPos(int nOffet) 78 | { 79 | m_nPos += nOffet; 80 | //Update((WISP_RECT*)0); 81 | } 82 | -------------------------------------------------------------------------------- /source/Code/fileiont.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _LOCALFILEIO_HPP_ 3 | #define _LOCALFILEIO_HPP_ 4 | 5 | #include "define.h" 6 | #include "fileio.hpp" 7 | 8 | struct CLocalFileIO : public CFileIO 9 | { 10 | static WCHAR m_CurDirName[MAX_PATH]; 11 | 12 | void SetCurDir(const WCHAR *DirName); 13 | 14 | virtual bool OpenFile(const char *FileName, HANDLE *phFile, unsigned long Mode) override; 15 | virtual bool CreateFile(const char *FileName, HANDLE *phFile, unsigned long Mode) override; 16 | virtual bool CreateDir(const char *FileName) override; 17 | virtual bool CloseHandle(HANDLE hFile) override; 18 | 19 | virtual void FlushFile(HANDLE hFile) override; 20 | 21 | virtual unsigned long ReadFile(HANDLE hFile, void *Buffer, unsigned long Size) override; 22 | virtual unsigned long ReadFile(HANDLE hFile, void *Buffer, unsigned long Size, unsigned __int64 Offset) override; 23 | 24 | virtual unsigned long WriteFile(HANDLE hFile, const void *Buffer, unsigned long Size) override; 25 | virtual unsigned long WriteFile(HANDLE hFile, const void *Buffer, unsigned long Size, unsigned __int64 Offset) override; 26 | 27 | virtual unsigned __int64 SetFilePointer(HANDLE hFile, __int64 Offset, unsigned long Pos) override; 28 | 29 | virtual unsigned __int64 GetFileLength(HANDLE hFile) override; 30 | virtual bool SetFileLength(HANDLE hFile, unsigned __int64 Length) override; 31 | 32 | virtual bool DeleteFile(const char *FileName) override; 33 | virtual bool RenameFile(const char *FileName, const char *NewFileName) override; 34 | 35 | virtual bool GetFileTime(const char *FileName, void *lpLastWriteTime, void *lpCreationTime, void *lpLastAccessTime) override; //new+ 36 | 37 | virtual bool IsDir(const char *FileName) override; 38 | virtual bool DeleteDir(const char *FileName) override; 39 | 40 | virtual bool FindFirstFile(const char *DirName, FILE_FIND_DATA *pFindData) override; 41 | virtual bool FindNextFile(FILE_FIND_DATA *pFindData) override; 42 | virtual bool FindClose(FILE_FIND_DATA *pFindData) override; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /source/WispSyser/multisourcecodeview.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "multisourcecodeview.hpp" 5 | #include "syserconfig.hpp" 6 | 7 | WISP_MSG_MAP_BEGIN(CMultiSourceCodeView) 8 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 9 | WISP_MSG_MAP_ON_COMMAND 10 | WISP_MSG_MAP_ON_EVENT 11 | WISP_MSG_MAP_END(CWispMultiTabView) 12 | 13 | WISP_CMD_MAP_BEGIN(CMultiSourceCodeView) 14 | WISP_CMD_MAP_END 15 | 16 | WISP_EVENT_MAP_BEGIN(CMultiSourceCodeView) 17 | WISP_EVENT_MAP_END 18 | 19 | bool CMultiSourceCodeView::OnCreate(WISP_MSG *pMsg) 20 | { 21 | SetBGColor(gSyserColors.Color[0]); 22 | return true; 23 | } 24 | 25 | bool CMultiSourceCodeView::OnRemoveTab(CWispWnd *pWnd) 26 | { 27 | CSourceCodeWnd *pSrcWnd = (CSourceCodeWnd *)pWnd; 28 | SCWKEY Key; 29 | Key.FileID = pSrcWnd->m_CurrentFileID; 30 | Key.pSDSMod = pSrcWnd->m_pSDSMod; 31 | map::IT it = m_SourceCodeWndMap.find(Key); 32 | if (it != m_SourceCodeWndMap.end()) 33 | m_SourceCodeWndMap.erase(Key); 34 | CListStringItem *Item = gpSyser->m_MainFrame.m_SourceDebugFrameWnd.m_SDSModuleList.FullFindItem(0, 8); 35 | if (Item && gpSyser->m_MainFrame.m_SourceDebugFrameWnd.m_SDSModuleList.GetItemLevel(Item) == 1 && 36 | it->first.pSDSMod == (CSDSModule *)gpSyser->m_MainFrame.m_SourceDebugFrameWnd.m_SDSModuleList.GetItemValue(Item, 0)) 37 | { 38 | gpSyser->m_MainFrame.m_SourceDebugFrameWnd.m_SDSModuleList.Unselect(Item); 39 | } 40 | return true; 41 | } 42 | void CMultiSourceCodeView::OnRemoved() 43 | { 44 | if (!m_WndList.Size()) 45 | gpSyser->m_MainFrame.m_SourceDebugFrameWnd.UpdateMenu(); 46 | } 47 | 48 | void CMultiSourceCodeView::OnActiveWnd(CWispWnd *pWnd) 49 | { 50 | gpSyser->m_MainFrame.m_SourceDebugFrameWnd.UpdateMenu(); 51 | } 52 | 53 | void CMultiSourceCodeView::UpdateContext() 54 | { 55 | TListIter It = m_WndList.Begin(); 56 | while (It != m_WndList.End()) 57 | { 58 | static_cast(It->pWnd)->UpdateContextSrc(); 59 | static_cast(It->pWnd)->UpdateContextPics(); 60 | ++It; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /source/WispSyser/fpuregisterlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FPUREGISTERLIST_HPP_ 3 | #define _FPUREGISTERLIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../EXEAnalyzer/x86debugger.hpp" 7 | 8 | enum FPU_REG_INDEX 9 | { 10 | FPU_REG_ST_0 = 0, 11 | FPU_REG_ST_1 = 1, 12 | FPU_REG_ST_2 = 2, 13 | FPU_REG_ST_3 = 3, 14 | FPU_REG_ST_4 = 4, 15 | FPU_REG_ST_5 = 5, 16 | FPU_REG_ST_6 = 6, 17 | FPU_REG_ST_7 = 7, 18 | 19 | FPU_REG_STATE = 8, 20 | FPU_REG_STATUS_IE = 9, 21 | FPU_REG_STATUS_DE = 10, 22 | FPU_REG_STATUS_ZE = 11, 23 | FPU_REG_STATUS_OE = 12, 24 | FPU_REG_STATUS_UE = 13, 25 | FPU_REG_STATUS_PE = 14, 26 | FPU_REG_STATUS_SF = 15, 27 | FPU_REG_STATUS_ES = 16, 28 | FPU_REG_STATUS_C0 = 17, 29 | FPU_REG_STATUS_C1 = 18, 30 | FPU_REG_STATUS_C2 = 19, 31 | FPU_REG_STATUS_TOP = 20, 32 | FPU_REG_STATUS_C3 = 21, 33 | FPU_REG_STATUS_B = 22, 34 | 35 | FPU_REG_CONTROL = 23, 36 | FPU_REG_CONTROL_IM = 24, 37 | FPU_REG_CONTROL_DM = 25, 38 | FPU_REG_CONTROL_ZM = 26, 39 | FPU_REG_CONTROL_OM = 27, 40 | FPU_REG_CONTROL_UM = 28, 41 | FPU_REG_CONTROL_PM = 29, 42 | FPU_REG_CONTROL_PC = 30, 43 | FPU_REG_CONTROL_RC = 31, 44 | FPU_REG_CONTROL_X = 32, 45 | 46 | FPU_REG_TAG = 33, 47 | FPU_REG_TAG_0 = 34, 48 | FPU_REG_TAG_1 = 35, 49 | FPU_REG_TAG_2 = 36, 50 | FPU_REG_TAG_3 = 37, 51 | FPU_REG_TAG_4 = 38, 52 | FPU_REG_TAG_5 = 39, 53 | FPU_REG_TAG_6 = 40, 54 | FPU_REG_TAG_7 = 41, 55 | 56 | FPU_REG_COUNT = 42, 57 | }; 58 | 59 | struct FPU_REG 60 | { 61 | unsigned char RegisterArea[80]; //SIZE_OF_80387_REGISTERS 62 | stFPU_STATUS_REG StatusWord; 63 | stFPU_CONTROL_REG ControlWord; 64 | stFPU_TAG_REG TagWord; 65 | }; 66 | 67 | struct CFpuRegisterList : public CWispList 68 | { 69 | CListStringItem *m_hFpuRegItem[FPU_REG_COUNT]; 70 | unsigned long m_ColorChanges; 71 | unsigned long m_ColorSame; 72 | int m_nCPU; 73 | X86_CPU_REG_PTR m_CPUREGPTR; 74 | FPU_REG m_FPUREG; 75 | 76 | CFpuRegisterList(); 77 | virtual ~CFpuRegisterList(); 78 | 79 | bool MsgProc(WISP_MSG *pMsg) override; 80 | bool OnUpdate(WISP_MSG *pMsg); 81 | bool OnCreate(WISP_MSG *pMsg); 82 | bool OnGetFocus(WISP_MSG *pMsg); 83 | void ResetContext(); 84 | void UpdateContext(); 85 | }; 86 | 87 | #endif -------------------------------------------------------------------------------- /source/WispSyser/plugin.cpp: -------------------------------------------------------------------------------- 1 | #include "plugin.hpp" 2 | 3 | void OnDebuggerOpen() 4 | { 5 | //Syser Loaded Notify 6 | //::DbgPrint("SPCommand : OnDebuggerOpen\n"); 7 | } 8 | 9 | void OnDebuggerClose() 10 | { 11 | //Syser Unload Notify 12 | //::DbgPrint("SPCommand : OnDebuggerClose\n"); 13 | } 14 | 15 | void OnDebuggerPlunge() 16 | { 17 | //Syser 18 | //::DbgPrint("SPCommand : OnDebuggerPlunge\n"); 19 | } 20 | 21 | SYSER_PLUGIN_MODULE PluginModule = 22 | { 23 | L"Syser Command Plugin Module", 24 | OnDebuggerOpen, 25 | OnDebuggerClose, 26 | OnDebuggerPlunge, 27 | }; 28 | 29 | int syser_calc(int argc, const wchar_t *argv[], const wchar_t *szCommandLine, void *pUserData) 30 | { 31 | DWORD dwValue; 32 | if(argc>=2) 33 | { 34 | if(gpSyserPluginUI->CalcExp(argv[1], &dwValue)) 35 | { 36 | gpSyserPluginUI->Outputf(WSTR("%s = %08x\n"), argv[1], dwValue); 37 | } 38 | } 39 | gpSyserPluginUI->Outputf(WSTR("hello world!\n")); 40 | return 0; 41 | } 42 | 43 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) 44 | { 45 | switch (dwReason) 46 | { 47 | case DLL_PROCESS_ATTACH: 48 | if(!gpSyserPluginUI->RegisterPluginModule(WSTR("SPCommand"), &PluginModule)) 49 | return FALSE; 50 | gpSyserPluginUI->InsertCmd(WSTR("calc"), syser_calc, NULL, WSTR("calc expression value."), WSTR("calc [parameter]")); 51 | //::DbgPrint("SPCommand : DllAttach\n"); 52 | break; 53 | case DLL_PROCESS_DETACH: 54 | gpSyserPluginUI->RemoveCmd(WSTR("calc")); 55 | gpSyserPluginUI->UnregisterPluginModule(WSTR("SPCommand")); 56 | //::DbgPrint("SPCommand : DllDetach\n"); 57 | break; 58 | 59 | case DLL_THREAD_ATTACH: 60 | break; 61 | 62 | case DLL_THREAD_DETACH: 63 | break; 64 | } 65 | return TRUE; 66 | } 67 | -------------------------------------------------------------------------------- /source/MFCSymbols.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include "Code/define.h" 6 | #include "Code/tstrmem.hpp" 7 | #include "Code/sysdep.hpp" 8 | #include "Code/fileiont.hpp" 9 | 10 | int Find(CFileIO *This, const char *FullFileName, int FileLength, void *pData) 11 | { 12 | char *Txt = (char*)pData; 13 | 14 | char szModuleName[MAX_FN_LEN]; 15 | //::GetSystemDirectoryA(szModuleName, MAX_FN_LEN); 16 | GetModulePath(szModuleName, true); //+++ 17 | 18 | HANDLE Handle; 19 | if (!gpFileIO->OpenFile(FullFileName, &Handle, 0x10000)) 20 | return 0; 21 | 22 | unsigned long long Size = gpFileIO->GetFileLength(Handle); 23 | unsigned long *Sym = (unsigned long *)new char[Size]; 24 | gpFileIO->ReadFile(Handle, Sym, Size, 0); 25 | gpFileIO->CloseHandle(Handle); 26 | 27 | FullFileName = TGetFileName(FullFileName); 28 | //TStrCat(szModuleName, "\\drivers\\plugin\\"); 29 | TStrCat(szModuleName, FullFileName); 30 | 31 | char *pStr = TStrIStr(szModuleName, ".sym"); 32 | if (pStr) *pStr = 0; 33 | 34 | FILE *f = fopen(szModuleName, "w"); 35 | if (!f) 36 | { 37 | delete [](char*)Sym; 38 | return 0; 39 | } 40 | unsigned long Count = Sym[0]; 41 | unsigned long FuncOrd = Sym[1]; 42 | 43 | for (unsigned long n = 0; n < Count; ++n) 44 | { 45 | if (Txt[Sym[n+2]]) 46 | { 47 | fprintf(f,"%d %s\n",FuncOrd+n, &Txt[Sym[n+2]]); 48 | fflush(f); 49 | } 50 | } 51 | 52 | fclose(f); 53 | 54 | delete [](char*)Sym; 55 | return 0; 56 | } 57 | 58 | int main() 59 | { 60 | ::FreeConsole(); 61 | 62 | char szMfcSymFile[MAX_FN_LEN]; 63 | GetModulePath(szMfcSymFile, true); 64 | TStrCat(szMfcSymFile, "mfcsym.txt"); 65 | 66 | HANDLE Handle; 67 | if (!gpFileIO->OpenFile(szMfcSymFile, &Handle, 0x10000)) 68 | return 1; 69 | 70 | char *pStr = TStrRChr(szMfcSymFile, '\\'); 71 | if (pStr && *pStr == '\\') 72 | *pStr = 0; 73 | //char *pStr = TGetFileName(szMfcSymFile); 74 | //if (pStr) 75 | // *pStr = 0; 76 | else ::GetCurrentDirectoryA(MAX_FN_LEN, szMfcSymFile); 77 | 78 | TStrCat(szMfcSymFile, "\\*.sym"); 79 | 80 | unsigned long long Size = gpFileIO->GetFileLength(Handle); 81 | char *Txt = new char[Size]; 82 | 83 | gpFileIO->ReadFile(Handle, Txt, Size, 0); 84 | gpFileIO->CloseHandle(Handle); 85 | 86 | gpFileIO->XFind(szMfcSymFile, Find, Txt, false, nullptr); //??? 87 | 88 | delete []Txt; 89 | return 0; 90 | } 91 | -------------------------------------------------------------------------------- /source/Wisp/wisptoolbar.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPTOOLBAR_HPP_ 3 | #define _WISPTOOLBAR_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altlist.hpp" 7 | #include "wispwnd.hpp" 8 | #include "wispdib.hpp" 9 | 10 | struct CWispButton; 11 | struct CWispEdit; 12 | struct CWispStaticDIB; 13 | struct CWispStaticStr; 14 | 15 | #define WISP_TOOLBAR_SEPARATOR 0x10000 16 | #define WISP_TOOLBAR_ALIGN 0x20000 17 | #define WISP_TOOLBAR_BTN 0 18 | #define WISP_TOOLBAR_EDIT 1 19 | #define WISP_TOOLBAR_DIB 2 20 | #define WISP_TOOLBAR_STR 4 21 | 22 | 23 | struct WISP_TOOLBAR_RES_ITEM 24 | { 25 | unsigned int CmdID; 26 | unsigned int DIBIndex; 27 | unsigned int Type; 28 | const WCHAR *pString; 29 | unsigned int Width; 30 | unsigned int Style; 31 | }; 32 | 33 | struct WISP_TOOLBAR_ITEM 34 | { 35 | union { 36 | CWispBaseWnd *pItem; 37 | CWispButton *pButton; 38 | CWispEdit *pEdit; 39 | CWispStaticDIB *pStaticDIB; 40 | CWispStaticStr *pStaticStr; 41 | }; 42 | CWispDIB *pDIB; 43 | unsigned int Type; 44 | }; 45 | 46 | struct CWispToolbar : public CWispWnd 47 | { 48 | CWispToolbar(); 49 | virtual ~CWispToolbar(); 50 | 51 | TList m_BTList; 52 | CWispDIBList *m_pDIBList; 53 | int m_Margin; 54 | int m_SeparatorWidth; 55 | 56 | virtual void SetOwner(CWispBaseWnd *pOwnerWnd) override; 57 | virtual bool MsgProc(WISP_MSG *pMsg) override; 58 | bool OnDestroy(WISP_MSG *pMsg); 59 | bool OnUpdateClient(WISP_MSG *pMsg); 60 | bool OnRecalcLayout(WISP_MSG *pMsg); 61 | bool OnResizeChild(WISP_MSG *pMsg); 62 | bool CreateEx(CWispWnd *pParentWnd, int y, int cy, unsigned int CmdID, unsigned int Style); 63 | CWispBaseWnd *GetItem(unsigned int CmdID); 64 | bool LoadToolbar(CWispDIBList *pDIBList, WISP_TOOLBAR_RES_ITEM *pResItem); 65 | bool InsertButton(int Pos, unsigned int Type, unsigned int CmdID, unsigned int Style, CWispDIB *pDIB, const WCHAR *HelpString); 66 | bool InsertEdit(int Pos, unsigned int Type, int Width, unsigned int CmdID, unsigned int Style, const WCHAR *HelpString); 67 | bool InsertStaticDIB(int Pos, unsigned int Type, unsigned int CmdID, CWispDIB *pDIB); 68 | bool InsertStaticStr(int Pos, unsigned int Type, unsigned int CmdID, const WCHAR *HelpString); 69 | bool InsertSeparator(int Pos, unsigned int Type); 70 | bool RemoveItem(int Pos); 71 | bool Enable(unsigned int nID, bool bEnable); 72 | }; 73 | 74 | #endif -------------------------------------------------------------------------------- /source/EXEAnalyzer/pehead.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PEHEAD_HPP_ 3 | #define _PEHEAD_HPP_ 4 | 5 | #pragma pack(push,1) 6 | struct PE_DATA_DIR 7 | { 8 | /* 0x0000 */ unsigned long VirtualAddress; 9 | /* 0x0004 */ unsigned long Size; 10 | }; /* size: 0x0008 */ 11 | #pragma pack(pop) 12 | 13 | #pragma pack(push,1) 14 | struct PE_HEAD 15 | { 16 | /* 0x0000 */ unsigned long Signature; 17 | //_IMAGE_FILE_HEADER 18 | /* 0x0004 */ unsigned short Machine; 19 | /* 0x0006 */ unsigned short NumberOfSections; 20 | /* 0x0008 */ unsigned long TimeDateStamp; 21 | /* 0x000c */ unsigned long PointerToSymbolTable; 22 | /* 0x0010 */ unsigned long NumberOfSymbols; 23 | /* 0x0014 */ unsigned short SizeOfOptionalHeader; 24 | /* 0x0016 */ unsigned short Characteristics; 25 | //_IMAGE_OPTIONAL_HEADER 26 | /* 0x0018 */ unsigned short Magic; 27 | /* 0x001a */ unsigned char MajorLinkerVersion; 28 | /* 0x001b */ unsigned char MinorLinkerVersion; 29 | /* 0x001c */ unsigned long SizeOfCode; 30 | /* 0x0020 */ unsigned long SizeOfInitializedData; 31 | /* 0x0024 */ unsigned long SizeOfUninitializedData; 32 | /* 0x0028 */ unsigned long AddressOfEntryPoint; 33 | /* 0x002c */ unsigned long BaseOfCode; 34 | #ifndef _X64_ 35 | /* 0x0030 */ unsigned long BaseOfData; 36 | #endif 37 | /* 0x0034 */ ULONG_PTR ImageBase; 38 | /* 0x0038 */ unsigned long SectionAlignment; 39 | /* 0x003c */ unsigned long FileAlignment; 40 | /* 0x0040 */ unsigned short MajorOperatingSystemVersion; 41 | /* 0x0042 */ unsigned short MinorOperatingSystemVersion; 42 | /* 0x0044 */ unsigned short MajorImageVersion; 43 | /* 0x0046 */ unsigned short MinorImageVersion; 44 | /* 0x0048 */ unsigned short MajorSubsystemVersion; 45 | /* 0x004a */ unsigned short MinorSubsystemVersion; 46 | /* 0x004c */ unsigned long Win32VersionValue; 47 | /* 0x0050 */ unsigned long SizeOfImage; 48 | /* 0x0054 */ unsigned long SizeOfHeaders; 49 | /* 0x0058 */ unsigned long CheckSum; 50 | /* 0x005c */ unsigned short Subsystem; 51 | /* 0x005e */ unsigned short DllCharacteristics; 52 | /* 0x0060 */ ULONG_PTR SizeOfStackReserve; 53 | /* 0x0064 */ ULONG_PTR SizeOfStackCommit; 54 | /* 0x0068 */ ULONG_PTR SizeOfHeapReserve; 55 | /* 0x006c */ ULONG_PTR SizeOfHeapCommit; 56 | /* 0x0070 */ unsigned long LoaderFlags; 57 | /* 0x0074 */ unsigned long NumberOfRvaAndSizes; 58 | //0 EXPORT 59 | //1 IMPORT 60 | //2 RESOURCE 61 | //5 BASE RELOC 62 | //9 TLS 63 | 64 | /* 0x0078 */ PE_DATA_DIR DataDirectory[16]; 65 | }; /* size: 0x00f8 */ 66 | #pragma pack(pop) 67 | 68 | #endif -------------------------------------------------------------------------------- /source/WispSyser/stackwatchlist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _STACKWATCHLIST_HPP_ 3 | #define _STACKWATCHLIST_HPP_ 4 | 5 | #include "../Code/alt/altmap.hpp" 6 | #include "../Wisp/wisplist.hpp" 7 | #include "../Wisp/wispmenu.hpp" 8 | 9 | enum 10 | { 11 | SWL_MODE_ADDR = 0, 12 | SWL_MODE_REL = 1, 13 | SWL_MODE_CSP = 2, 14 | SWL_MODE_CBP = 3, 15 | }; 16 | 17 | struct CStackWatchList : public CWispList 18 | { 19 | int m_nScrollLine; 20 | ULONG_PTR m_CurAddr; 21 | CWispMenu::MenuItem *m_pMenuShowCode; 22 | CWispMenu::MenuItem *m_pMenuShowData; 23 | CWispMenu::MenuItem *m_pMenuOrder; 24 | CWispMenu m_PopupMenu; 25 | int m_Mode; 26 | ULONG_PTR m_RelCIP; 27 | bool m_bOrder; 28 | map m_KeyMap; 29 | #ifndef _X64_ 30 | map m_SEHMap_1; 31 | map m_SEHMap_2; 32 | #endif 33 | 34 | CStackWatchList(); 35 | virtual ~CStackWatchList(); 36 | 37 | virtual bool MsgProc(WISP_MSG *pMsg) override; 38 | bool OnUpdate(WISP_MSG *pMsg); 39 | bool OnCreate(WISP_MSG *pMsg); 40 | bool OnDestroy(WISP_MSG *pMsg); 41 | bool OnSize(WISP_MSG *pMsg); 42 | bool OnScrollEvent(WISP_MSG *pMsg); 43 | void OnKeyRButton(WISP_MSG *pMsg); 44 | unsigned int GetKeyMap(unsigned int CmdID); 45 | bool OnKeyEvent(WISP_MSG *pMsg); 46 | bool OnEvent(WISP_MSG *pMsg); 47 | bool OnEventShowCode(WISP_MSG *pMsg); 48 | bool OnEventGotoCode(WISP_MSG *pMsg); 49 | bool OnEventShowData(WISP_MSG *pMsg); 50 | bool OnEventGotoData(WISP_MSG *pMsg); 51 | bool OnEventAddressMode(WISP_MSG *pMsg); 52 | bool OnEventOffsetMode(WISP_MSG *pMsg); 53 | bool OnEventRelCSP(WISP_MSG *pMsg); 54 | bool OnEventRelCBP(WISP_MSG *pMsg); 55 | bool OnEventToggleOrder(WISP_MSG *pMsg); 56 | bool OnEventShowCBP(WISP_MSG *pMsg); 57 | bool OnEventShowCSP(WISP_MSG *pMsg); 58 | 59 | bool OnCommand(WISP_MSG *pMsg); 60 | bool OnCmdVSpinScroll(WISP_MSG *pMsg); 61 | 62 | virtual void OnLButton(CListStringItem *Item, int nCol) override; 63 | 64 | virtual bool Edit(CListStringItem *Item, int nCol, TWideString& String) override; 65 | virtual bool OnEditing(CListStringItem *Item, int nCol, TWideString& String) override; 66 | 67 | void DrawContextSEH(ULONG_PTR Address, ULONG_PTR Value, unsigned long *pColorString, int MaxSize); 68 | bool DrawContext(ULONG_PTR Address, ULONG_PTR Value, unsigned long *pColorString, int MaxSize, unsigned char *pType); 69 | void GetAddress(ULONG_PTR Address, WCHAR *pString); 70 | void LoadKeyMap(); 71 | void ResetContext(); 72 | void UpdateContextSEH(); 73 | void UpdateContext(ULONG_PTR Addr, bool bCurAddr); 74 | }; 75 | 76 | #endif -------------------------------------------------------------------------------- /source/WispSyser/sourcedebugframewnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SOURCEDEBUGFRAMEWND_HPP_ 3 | #define _SOURCEDEBUGFRAMEWND_HPP_ 4 | 5 | #include "../Wisp/wispwnd.hpp" 6 | #include "../Wisp/wispstatic.hpp" 7 | #include "../Wisp/wispmenu.hpp" 8 | #include "../Wisp/wispedit.hpp" 9 | #include "../Wisp/wisptoolbar.hpp" 10 | #include "../Wisp/wisptabwnd.hpp" 11 | #include "../Wisp/wispsplitwnd.hpp" 12 | //#include "..\Wisp/wispconsolewnd.hpp" 13 | #include "../Wisp/wispdib.hpp" 14 | 15 | #include "sdsmodulelist.hpp" 16 | #include "terminalwnd.hpp" 17 | #include "multisourcecodeview.hpp" 18 | #include "typeviewerwnd.hpp" 19 | #include "../EXEAnalyzer/sdsmodule.hpp" 20 | #include "sourcecodewnd.hpp" 21 | 22 | #define SRC_W_TAB 0 23 | #define SRC_T_TAB 1 24 | 25 | struct CSourceDebugFrameWnd : public CWispSplitWnd 26 | { 27 | CSDSModuleList m_SDSModuleList; 28 | CWispTabWnd m_SDSModuleListTabWnd; 29 | CWispTabWnd m_ContextTabWnd; //TAB 30 | CTerminalWnd m_TerminalWnd; 31 | CMultiSourceCodeView m_MultiSourceCodeView; 32 | CTypeViewerWnd m_TypeViewerWnd; 33 | CWispToolbar m_Toolbar; 34 | CWispMenu m_MainMenu; 35 | CWispSplitWnd m_ViewSplitWnd; 36 | CWispSplitWnd m_MainSplitWnd; 37 | CWispDIBList m_DIBList; 38 | 39 | CSourceDebugFrameWnd(); 40 | virtual ~CSourceDebugFrameWnd(); 41 | virtual bool MsgProc(WISP_MSG *pMsg) override; 42 | bool OnCreate(WISP_MSG *pMsg); 43 | bool OnDestroy(WISP_MSG *pMsg); 44 | bool OnCommand(WISP_MSG *pMsg); 45 | bool OnEvent(WISP_MSG *pMsg); 46 | void AdjustSplit(); 47 | bool OnSize(WISP_MSG *pMsg); 48 | bool OnGetFocus(WISP_MSG *pMsg); 49 | 50 | bool OnEventDbgStep(WISP_MSG *pMsg); 51 | bool OnEventDbgProceed(WISP_MSG *pMsg); 52 | bool OnEventDbgReturn(WISP_MSG *pMsg); 53 | bool OnEventDbgContinue(WISP_MSG *pMsg); 54 | bool OnEventBreakPointForm(WISP_MSG *pMsg); 55 | bool OnEventSDSModuleList(WISP_MSG *pMsg); 56 | bool OnEventWatchView(WISP_MSG *pMsg); 57 | bool OnEventTerminal(WISP_MSG *pMsg); 58 | 59 | bool OnEventCallStack(WISP_MSG *pMsg); 60 | 61 | bool OnEventRegView(WISP_MSG *pMsg); 62 | bool OnEventDataViewForm(WISP_MSG *pMsg); 63 | 64 | bool OnEventToggleBM(WISP_MSG *pMsg); 65 | bool OnEventNextBM(WISP_MSG *pMsg); 66 | bool OnEventPrevBM(WISP_MSG *pMsg); 67 | bool OnEventClearBM(WISP_MSG *pMsg); 68 | 69 | bool OnEventMenuDebug(WISP_MSG *pMsg); 70 | bool OnEventMenuMonitor(WISP_MSG *pMsg); 71 | bool OnEventMenuView(WISP_MSG *pMsg); 72 | bool OnEventGotoLine(WISP_MSG *pMsg); 73 | 74 | void UpdateMenu(); 75 | void UpdateContext(bool bUpdateSrc); 76 | 77 | CSourceCodeWnd *OpenSrcView(CSDSModule *pSDSMod, unsigned long FileID, unsigned long LineNumber); 78 | void RemoveSDSModule(CSDSModule *pSDSMod); 79 | }; 80 | 81 | #endif -------------------------------------------------------------------------------- /source/WispSyser/dataview.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _DATAVIEW_HPP_ 3 | #define _DATAVIEW_HPP_ 4 | 5 | #include "../Wisp/wisphexwnd.hpp" 6 | #include "../Wisp/wispmenu.hpp" 7 | #include "../Wisp/wisptoolbar.hpp" 8 | #include "dataoperatordlg.hpp" 9 | #include "typeviewerform.hpp" 10 | 11 | struct CDataView : public CWispHexWnd 12 | { 13 | ULONG_PTR m_RButtonAddress; 14 | ULONG_PTR m_LButtonAddress; 15 | unsigned long XXX; 16 | CWispMenu m_PopupMenu; 17 | CWispToolbar m_Toolbar; 18 | CDataOperatorDlg m_OperatorDlg; 19 | CStructViewerForm m_StructViewerForm; 20 | //CFindStringForm m_FindStringForm; 21 | map m_KeyMap; 22 | 23 | CDataView(); 24 | virtual ~CDataView(); 25 | 26 | virtual bool MsgProc(WISP_MSG *pMsg) override; 27 | bool OnCreate(WISP_MSG *pMsg); 28 | bool OnDestroy(WISP_MSG *pMsg); 29 | void OnKeyLButton(WISP_MSG *pMsg); 30 | void OnKeyRButton(WISP_MSG *pMsg); 31 | unsigned int GetKeyMap(unsigned int CmdID); 32 | bool OnKeyEvent(WISP_MSG *pMsg); 33 | bool OnEvent(WISP_MSG *pMsg); 34 | 35 | bool OnEventGotoData(WISP_MSG *pMsg); 36 | bool OnEventNewData(WISP_MSG *pMsg); 37 | bool OnEventGotoDasm(WISP_MSG *pMsg); 38 | bool OnEventNewDasm(WISP_MSG *pMsg); 39 | bool OnEventDasmPhysAddr(WISP_MSG *pMsg); 40 | bool OnEventShowPhysAddr(WISP_MSG *pMsg); 41 | bool OnEventToggleToolbar(WISP_MSG *pMsg); 42 | bool OnEventAttachType(WISP_MSG *pMsg); 43 | bool OnEventFindForm(WISP_MSG *pMsg); 44 | bool OnEventToggleOffsetMode(WISP_MSG *pMsg); 45 | bool OnEventToggleAddressMode(WISP_MSG *pMsg); 46 | bool OnEventDataWidth(WISP_MSG *pMsg); 47 | 48 | bool OnEventNewView(WISP_MSG *pMsg); 49 | 50 | bool OnEventOp(WISP_MSG *pMsg); 51 | 52 | bool OnEventShowDataAt(WISP_MSG *pMsg); 53 | 54 | bool OnEventShowDasm(WISP_MSG *pMsg); 55 | 56 | bool OnEventCopyVal(WISP_MSG *pMsg); 57 | bool OnEventCopyAddr(WISP_MSG *pMsg); 58 | 59 | bool OnEventCopySelect(WISP_MSG *pMsg); 60 | 61 | bool OnEventToggleFloatAddressMode(WISP_MSG *pMsg); 62 | 63 | bool OnEventNextHistory(WISP_MSG *pMsg); 64 | bool OnEventPrevHistory(WISP_MSG *pMsg); 65 | 66 | virtual unsigned long WriteMemory(ULONG_PTR Address, void *Buffer, unsigned long Size) override; 67 | virtual unsigned long ReadMemory(ULONG_PTR Address, void *Buffer, unsigned long Size) override; 68 | 69 | virtual unsigned int GetHexByteAttribute(ULONG_PTR Address) override; 70 | 71 | virtual ULONG_PTR GetFloatAddress(const TWideString & FloatAddress) override; 72 | 73 | virtual void OnChangeView() override; 74 | virtual void OnDataUpdated() override; 75 | virtual int GetStartLine() override; 76 | 77 | bool GetDataRange(ULONG_PTR *Start, ULONG_PTR *End, unsigned long *Len); 78 | void LoadKeyMap(); 79 | }; 80 | 81 | #endif -------------------------------------------------------------------------------- /source/Wisp/wisptabwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPTABWND_HPP_ 3 | #define _WISPTABWND_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altlist.hpp" 7 | #include "wispwnd.hpp" 8 | #include "wispdib.hpp" 9 | 10 | struct CWispButton; 11 | 12 | struct WISP_TAB_WND_ITEM 13 | { 14 | CWispWnd *pWnd; 15 | WCHAR Name[32]; 16 | WISP_RECT TabRC; 17 | CWispDIB *pDIB; 18 | CWispButton *pButton; 19 | }; 20 | 21 | struct CWispTabWnd : public CWispWnd 22 | { 23 | CWispTabWnd(); 24 | virtual ~CWispTabWnd(); 25 | 26 | TList m_WndList; 27 | CWispWnd *m_pActiveWnd; 28 | int m_ActiveWndIndex; 29 | int m_nHoverIndex; 30 | int m_TabHeight; 31 | int m_TabSpaceHeight; 32 | int m_TextSpaceWidth; 33 | WISP_RECT m_Rect; 34 | int m_FixedTabWidth; 35 | int m_FullWidth; 36 | WISP_SIZE m_ButtonSize; 37 | CWispDIBList *m_MiniCloseDIBList; 38 | unsigned long m_TextColor; 39 | 40 | virtual bool MsgProc(WISP_MSG *pMsg) override; 41 | bool OnEvent(WISP_MSG *pMsg); 42 | bool OnEventButtonClose(WISP_MSG *pMsg); 43 | bool OnKeyEvent(WISP_MSG *pMsg); 44 | bool OnUpdateClient(WISP_MSG *pMsg); 45 | bool OnDestroy(WISP_MSG *pMsg); 46 | bool OnSize(WISP_MSG *pMsg); 47 | bool OnRecalcLayout(WISP_MSG *pMsg); 48 | bool OnGetFocus(WISP_MSG *pMsg); 49 | bool OnMouseMove(WISP_MSG *pMsg); 50 | bool OnMouseLeave(WISP_MSG *pMsg); 51 | virtual bool InitWnd() override; 52 | void DrawTabTop(); 53 | void DrawTabButtom(); 54 | void DrawTabLeft(); 55 | void DrawTabRight(); 56 | 57 | void ResizeTabTop(); 58 | void ResizeTabButtom(); 59 | void ResizeTabLeft(); 60 | void ResizeTabRight(); 61 | 62 | unsigned int InsertWnd(const WCHAR *Name, CWispWnd *pWnd, CWispDIB *pDIB); 63 | unsigned int InsertWndAfter(int Index, const WCHAR *Name, CWispWnd *pWnd, CWispDIB *pDIB); 64 | unsigned int InsertWndBefore(int Index, const WCHAR *Name, CWispWnd *pWnd, CWispDIB *pDIB); 65 | unsigned int RemoveWnd(CWispWnd *pWnd, bool bDestroy); 66 | unsigned int RemoveWnd(int Index, bool bDestroy); 67 | CWispWnd *GetActiveWnd(); 68 | unsigned int GetActiveWndIndex(); 69 | CWispWnd *SetActiveWnd(unsigned int Index); 70 | bool SetTabText(unsigned int Index, const WCHAR *pStr); 71 | void ChangeActiveWnd(CWispWnd *pActiveWindow); 72 | void ActiveNextPage(); 73 | void ActivePrevPage(); 74 | unsigned int GetWndCount(); 75 | 76 | CWispWnd *GetWnd(int Index); 77 | CWispButton *GetButton(int Index); 78 | 79 | //+0x38 80 | virtual void InsertTab(WISP_TAB_WND_ITEM *pTabItem, const WCHAR *pString, CWispWnd *pWnd, CWispDIB *pDIB); 81 | //+0x3C 82 | virtual void RemoveTab(WISP_TAB_WND_ITEM *pTabItem, bool bDestroy); 83 | 84 | //+0x40 85 | virtual bool OnRemoveTab(CWispWnd *pWnd) { return true; } 86 | //+0x44 87 | virtual void OnRemoved() { } 88 | //+0x48 89 | virtual void OnActiveWnd(CWispWnd *pWnd) { } 90 | 91 | void RemoveAllTab(bool bDestory); 92 | }; 93 | 94 | 95 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispoptionform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPOPTIONFORM_HPP_ 3 | #define _WISPOPTIONFORM_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispform.hpp" 7 | #include "wisplist.hpp" 8 | #include "wispbutton.hpp" 9 | 10 | enum 11 | { 12 | OPTION_SUB = 0, 13 | OPTION_STRNUM = 1, 14 | OPTION_INT = 2, 15 | OPTION_STR = 3, 16 | OPTION_DIR = 4, 17 | OPTION_COLOR = 5, 18 | }; 19 | 20 | struct OPTION_FORM 21 | { 22 | const WCHAR *Name; 23 | int Type; 24 | //union 25 | //{ 26 | //unsigned char *DefaultValue; 27 | void *DefaultValue; 28 | //OPTION_FORM *Sub;//0 29 | //unsigned int *IntValue;//1,2 30 | //const WCHAR *StrValue;//3 31 | //const WCHAR *DirValue;//4 32 | //unsigned long *ColorValue; //5 33 | //}; 34 | int Size; 35 | const WCHAR **SelectValue; 36 | bool (*CheckValue)(unsigned int *IntValue); 37 | unsigned int *Update; 38 | //unsigned char *NewValue; 39 | void *NewValue; 40 | }; 41 | 42 | struct CWispOptionList : public CWispList 43 | { 44 | virtual void DrawContent(int nCol, CListStringItem::CONTENT *Content, WISP_RECT *pRect) override; //+94 45 | }; 46 | 47 | struct CWispOptionForm : public CWispForm 48 | { 49 | OPTION_FORM *m_OptionForm; 50 | int m_nChanges; 51 | CWispOptionList m_OptionList; 52 | CWispButton *m_pApply; 53 | CWispButton *m_pRestore; 54 | CWispButton *m_pDefault; 55 | 56 | CWispOptionForm(); 57 | virtual ~CWispOptionForm(); 58 | 59 | virtual bool MsgProc(WISP_MSG *pMsg) override; 60 | 61 | bool OnCreateForm(WISP_MSG *pMsg); 62 | 63 | void SetText(OPTION_FORM *Option, CListStringItem *Item); 64 | void LoadTexts(CListStringItem *ParentItem); 65 | void LoadItems(OPTION_FORM *Option, CListStringItem *ParentItem); 66 | 67 | bool OnDestroy(WISP_MSG *pMsg); 68 | bool OnSize(WISP_MSG *pMsg); 69 | bool OnCmdOptionList(WISP_MSG *pMsg); 70 | bool OnCommand(WISP_MSG *pMsg); 71 | bool OnEvent(WISP_MSG *pMsg); 72 | 73 | bool Process(CListStringItem *Item, OPTION_FORM *Option); 74 | 75 | bool OnEventApply(WISP_MSG *pMsg); 76 | bool OnEventRestore(WISP_MSG *pMsg); 77 | bool OnEventDefault(WISP_MSG *pMsg); 78 | 79 | void EventApply(CListStringItem *ParentItem); 80 | void EventRestore(CListStringItem *ParentItem); 81 | void EventDefault(CListStringItem *ParentItem); 82 | 83 | void Destroy(CListStringItem *Item); 84 | 85 | bool GetFormInput(int PosX, int PoxY, CListStringItem *Item, OPTION_FORM *pOptionGroup); 86 | 87 | virtual bool OnAppling(); //{ return true; } 88 | virtual void OnApply(); //{} 89 | 90 | virtual bool OnRestoring(); //{ return true; } 91 | virtual void OnRestore(); //{} 92 | 93 | virtual bool OnDefaulting(); //{ return true; } 94 | virtual void OnDefault(); //{} 95 | 96 | 97 | virtual void OnNew(CListStringItem *Item); 98 | virtual void OnOld(CListStringItem *Item); 99 | }; 100 | 101 | 102 | #endif -------------------------------------------------------------------------------- /source/EXEAnalyzer/instrsym.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _INSTRSYM_HPP_ 3 | #define _INSTRSYM_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/tstrmem.hpp" 7 | 8 | #include "inteldis.hpp" 9 | 10 | #define MAX_INSTR_LEN 16 11 | 12 | unsigned int GetSize(unsigned long long Address); 13 | bool GetSign(_DIS_ADDRESS *dis_a); 14 | 15 | struct CInstrSym : public CIntelDisassembler 16 | { 17 | 18 | unsigned char m_CodeBuffer[MAX_INSTR_LEN]; 19 | bool m_bUseSym; 20 | 21 | ULONG_PTR m_ImageBase; 22 | ULONG_PTR m_ImageHighBase; 23 | unsigned long m_UxAlign; 24 | unsigned long m_Style; 25 | 26 | virtual bool AddrToSym(ULONG_PTR Address, char *szSym, unsigned int SymLen); 27 | virtual unsigned long ReadMemory(ULONG_PTR Address, void *Buffer, unsigned long Size); 28 | virtual bool GetSymbolBase(ULONG_PTR *BaseAddr); 29 | 30 | WCHAR *OptItemToCS(_OPERAND_ITEM *OpArray, int nOp, WCHAR *pString, _INSTRUCTION_INFORMATION *pDasmInstr); 31 | void OptItemSymToCS(_OPERAND_ITEM *OpArray, WCHAR *pString, _INSTRUCTION_INFORMATION *pDasmInstr); 32 | WCHAR *InstrToCS(_INSTRUCTION_INFORMATION *pInstrInfo, WCHAR *pString); 33 | 34 | CInstrSym(); 35 | virtual ~CInstrSym(); 36 | 37 | void SetDasmStyle(unsigned long Style); 38 | unsigned long GetDasmStyle() const; 39 | 40 | static bool GetJump(unsigned char *CodeBuff, ULONG_PTR Address, ULONG_PTR *target); 41 | static bool CheckJump(unsigned char *CodeBuff, unsigned long eflags); 42 | 43 | unsigned long Dasm(_INSTRUCTION_INFORMATION *pDasmInstr, DIS_CPU *pDisCPU, unsigned long MaxSize); 44 | unsigned long Asm(char *pAsmString, unsigned char *CodeBuffer, ULONG_PTR Address); 45 | 46 | unsigned long PrevInstrLen(ULONG_PTR Address); 47 | 48 | unsigned long InstrCount(ULONG_PTR Address, unsigned long CodeSize, unsigned char *LenAry); 49 | 50 | bool IsProcessCode(ULONG_PTR Address); 51 | 52 | bool GetAddr(ULONG_PTR Address, ULONG_PTR *Addr); 53 | bool GetReturn(ULONG_PTR Address, ULONG_PTR *Value); 54 | 55 | int GetAddrImm(ULONG_PTR Address, ULONG_PTR *Addr, ULONG_PTR *Imm); 56 | 57 | bool GetAddrValue(ULONG_PTR Address, ULONG_PTR *Return); 58 | 59 | unsigned long GetCall(ULONG_PTR Address, char *FunctionName, ULONG_PTR *Return); 60 | 61 | bool GetFunctionName(ULONG_PTR Address, char *FunctionName); 62 | 63 | unsigned long InstrLen(ULONG_PTR Address, unsigned long MaxSize); 64 | 65 | static unsigned long InstrLen64(unsigned char *inbuff, unsigned long MaxSize); 66 | static unsigned long InstrLen32(unsigned char *inbuff, unsigned long MaxSize); 67 | static unsigned long InstrLen16(unsigned char *inbuff, unsigned long MaxSize); 68 | 69 | static const WCHAR *m_RegStr[3][GENE_IDX_MAX]; 70 | static const WCHAR *m_ScaleStr[4]; 71 | static const WCHAR *m_SizePtr[8+1]; 72 | static const WCHAR *m_SizeSym[10+1]; 73 | static const WCHAR *m_SegStr[SEG_IDX_MAX]; 74 | static const WCHAR *m_LengthStr[4+1]; 75 | static const WCHAR *m_DefaultOPSize[3]; 76 | }; 77 | 78 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispdib.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPDIB_HPP_ 3 | #define _WISPDIB_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altmap.hpp" 7 | #include "../Code/tstrmem.hpp" 8 | #include "utility.hpp" 9 | #include "wispdraw.hpp" 10 | 11 | enum PIXEL_FORMAT 12 | { 13 | COLORREF_PF_DEFAULT = 0, 14 | COLORREF_PF_PAL = 1, 15 | COLORREF_PF_555 = 2, //15 16 | COLORREF_PF_565 = 3, //16 17 | COLORREF_PF_888 = 4, //24 18 | COLORREF_PF_COUNT = 5, 19 | }; 20 | 21 | struct CWispDIB 22 | { 23 | CWispDIB(); 24 | ~CWispDIB(); 25 | 26 | WISP_FRAME_BUFFER_INFO m_PixelBuf; 27 | WISP_RECT m_PaintRect; 28 | unsigned int m_Type; //0=?,1=BMP,2=ICO,3=? 29 | unsigned long m_ColorKey; 30 | WISP_POINT m_HotPT; 31 | unsigned long *m_Pal; 32 | bool m_bAutoDelete; 33 | int m_RefCount; 34 | 35 | void CreatePaint(); 36 | void FillColor(unsigned long Color); 37 | bool Create(int Width, int Height, unsigned int Type, WISP_POINT *pHotPT, unsigned long ColorKey); 38 | void SetType(unsigned int Type); 39 | void SetColorKey(unsigned long ColorKey); 40 | void SetHotPoint(WISP_POINT *pHotPT); 41 | void SetHotPoint(int x, int y); 42 | bool GetPixel(int PosX, int PosY, unsigned long *pPixel); 43 | void Blt(const WISP_RECT & SrcRect, CWispDIB *pDesDIB, int x, int y); 44 | bool Load(const char *FileName, int Index); 45 | // void LoadIcon(const ICON_DIR_ENTRY & IconDirEntry); 46 | bool LoadIcon(const char *FileName, int Index); 47 | void Destroy(); 48 | bool Write(const char *FileName); 49 | void BltTiled(CWispDIB *pDIB); //??? 50 | }; 51 | 52 | enum WISP_DIBLIST_ID 53 | { 54 | WISP_DIBLIST_MIN = 0, 55 | WISP_DIBLIST_MAX = 1, 56 | WISP_DIBLIST_NORMAL = 2, 57 | WISP_DIBLIST_CLOSE = 3, 58 | WISP_DIBLIST_HORZ_DEC = 4, 59 | WISP_DIBLIST_HORZ_INC = 5, 60 | WISP_DIBLIST_VERT_DEC = 6, 61 | WISP_DIBLIST_VERT_INC = 7, 62 | WISP_DIBLIST_COUNT = 8, 63 | }; 64 | 65 | struct CWispDIBList 66 | { 67 | CWispDIBList(); 68 | ~CWispDIBList(); 69 | 70 | CWispDIB *m_DIBList; 71 | int m_RefCount; 72 | int m_Count; 73 | 74 | 75 | CWispDIB *GetDIB(int ID); 76 | 77 | bool Load(const char *FileName, int TileWidth, int TileHeight, int Count); 78 | bool LoadIcon(const char *FileName); 79 | void Destroy(); 80 | void SetType(unsigned int Type); 81 | void SetColorKey(unsigned long ColorKey); 82 | }; 83 | 84 | struct CWispDIBLib 85 | { 86 | map m_DIBMap; 87 | map m_DIBListMap; 88 | 89 | void ReleaseAll(); 90 | 91 | void Remove(const char *FileName); 92 | 93 | CWispDIBList *GetDIBList(const char *FileName, int TileWidth, int TileHeight, int Count); //LoadDIBList 94 | //16,16,0,0xFF00FF 95 | CWispDIBList *LoadDIBList(const char *FileName, int TileWidth, int TileHeight, int Count, unsigned long ColorKey); 96 | 97 | CWispDIB *GetDIB(const char *FileName, int Index); //LoadDIB 98 | CWispDIB *LoadDIB(const char *FileName, int Index, unsigned long ColorKey); 99 | }; 100 | 101 | #endif 102 | 103 | -------------------------------------------------------------------------------- /source/Wisp/wispedit.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPEDIT_HPP_ 3 | #define _WISPEDIT_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "wispwnd.hpp" 7 | 8 | struct _SELECTPOS 9 | { 10 | int begin; 11 | int end; 12 | }; 13 | 14 | struct CWispEdit : public CWispWnd 15 | { 16 | int m_CharLenArray[320]; 17 | int m_CurrentCaretHot; 18 | int m_CurrentCaretLine; 19 | int m_CurrentStringLen; 20 | char m_bIsMultiLine; 21 | int m_StringMaxLen; 22 | int m_LineMaxLen; 23 | unsigned int m_TextRowNum; 24 | unsigned int m_TextColNum; 25 | int m_CurrentLineCharIndex; 26 | int m_CurrentLineNum; 27 | WISP_RECT m_CurrentShowRect; 28 | int m_DebugValue; 29 | char m_bSelectFlag; 30 | int m_SelectBegin; 31 | int m_SelectEnd; 32 | bool bMouseLeftButtonDown; 33 | WISP_RECT m_SelectRect; 34 | unsigned int m_SelectColor; 35 | 36 | CWispEdit(); 37 | virtual ~CWispEdit(); 38 | 39 | virtual bool CreateWnd(const WCHAR *Name, int x, int y, int cx, int cy, CWispBaseWnd *pParentWnd, unsigned int CmdID, unsigned int uStyle, unsigned int ShowMode) override; 40 | bool Create(WISP_RECT &RectAtWnd, unsigned int uStyle, CWispWnd *pParentWnd, unsigned int CmdID); 41 | 42 | virtual bool MsgProc(WISP_MSG *pMsg) override; 43 | bool OnEventCopy(WISP_MSG *pMsg); 44 | bool OnEventPaste(WISP_MSG *pMsg); 45 | bool OnEvent(WISP_MSG *pMsg); 46 | bool OnGetFocus(WISP_MSG *pMsg); 47 | bool OnLostFocus(WISP_MSG *pMsg); 48 | bool OnChar(WISP_MSG *pMsg); 49 | bool OnUpdateClient(WISP_MSG *pMsg); 50 | bool OnUpdateBorder(WISP_MSG *pMsg); 51 | bool OnCreate(WISP_MSG *pMsg); 52 | bool OnKeyEvent(WISP_MSG *pMsg); 53 | bool OnMouseEvent(WISP_MSG *pMsg); 54 | bool OnMouseLeave(WISP_MSG *pMsg); 55 | bool OnMouseLeftButtonUp(WISP_MSG *pMsg); 56 | bool OnMouseLeftButtonDown(WISP_MSG *pMsg); 57 | bool OnMouseMove(WISP_MSG *pMsg); 58 | // void OnKeyBack(); 59 | void OnLeftKey(WISP_MSG *pMsg); 60 | void OnRightKey(WISP_MSG *pMsg); 61 | // void OnUpKey(WISP_MSG *pMsg); 62 | // void OnDownKey(WISP_MSG *pMsg); 63 | // void OnReturnKey(WISP_MSG *pMsg); 64 | void OnBackKey(WISP_MSG *pMsg); 65 | void OnHomeKey(WISP_MSG *pMsg); 66 | void OnEndKey(WISP_MSG *pMsg); 67 | void OnDeleteKey(WISP_MSG *pMsg); 68 | //void OnPageUpKey(WISP_MSG *pMsg); 69 | //void OnPageDownKey(WISP_MSG *pMsg); 70 | //bool OnShiftKey(WISP_MSG *pMsg); 71 | //int GetMaxShowCharNum(WCHAR*, int, int*, char); 72 | bool IsInsertChar(WCHAR wch); 73 | int InsertChar(const WCHAR *pChar, int nPosition, int nCount); 74 | int DeleteChar(int nPosition, int nCount, WISP_MSG *pMsg); 75 | int GetCurrentLinePosition(int nIndex); 76 | //int GetPrevLineBeginPosition(int, int*); 77 | //int GetCaretLineCharWidth(); 78 | int GetLineWidth(const WCHAR *pSrc); 79 | //int CalcLineNum(const WCHAR* pSrc, int nCount, int nPerLineMaxCharNum); 80 | //int CalcLineNumForWidth(const WCHAR* pSrc, int nCount, int nLineWidth); 81 | //int CaretLeftMove(); 82 | //int CaretRightMove(); 83 | void GetCurrentPosition(WISP_POINT *pPoint, int Len); 84 | virtual bool SetWindowText(const WCHAR *pString) override; 85 | int GetCharIndexByPoint(WISP_POINT point, WISP_POINT &retpoint); 86 | int Select(int Pos, int Len); 87 | }; 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /source/WispSyser/SyserRing3.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SYSER_HPP_ 3 | #define _SYSER_HPP_ 4 | 5 | #include "../Code/alt/altlist.hpp" 6 | #include "../Code/alt/altmap.hpp" 7 | #include "winwisp.hpp" 8 | #include "mainframe.hpp" 9 | #include "plugin.hpp" 10 | #include "syserui.hpp" 11 | #include "../EXEAnalyzer/x86debugger.hpp" 12 | #include "currentfunction.hpp" 13 | #include "../EXEAnalyzer/sourcedebug.hpp" 14 | 15 | struct RECENT_HISTORY_ITEM 16 | { 17 | TAnsiString FileName; 18 | unsigned long uFlag; 19 | bool operator!=(const RECENT_HISTORY_ITEM&other) const { return FileName != other.FileName; } 20 | }; 21 | 22 | struct HOT_KEY 23 | { 24 | unsigned int FirstKey; 25 | unsigned int NextKey; 26 | }; 27 | 28 | struct HOT_KEY_CFG 29 | { 30 | unsigned int ID; 31 | 32 | unsigned int KeyCount; 33 | struct KEY 34 | { 35 | unsigned int CmdID; 36 | unsigned int Repeat; 37 | 38 | unsigned int FirstKey; 39 | unsigned int NextKey; 40 | } Keys[255]; 41 | }; 42 | 43 | struct CSyser : public CWinWisp 44 | { 45 | map m_PluginMap; 46 | TList m_PluginHandles; 47 | 48 | HMODULE m_hDebuggerModule; 49 | CX86Debugger *m_pDebugger; 50 | CX86Debugger *m_pSysDebugger; 51 | HCURSOR m_hCursorCurCIP; 52 | TWideString m_szDbgFileNameFilter; 53 | CMainFrame m_MainFrame; 54 | CSyserUI m_SyserUI; 55 | CSourceDebug m_SourceDebug; 56 | CCurrentFunction m_CurrentFunctionContext; 57 | unsigned int m_TimeOffset; 58 | unsigned long m_TID; 59 | unsigned long m_PID; 60 | 61 | bool m_bInitializeOK; 62 | 63 | TList m_HistoryList; 64 | bool m_bHistoryModified; 65 | 66 | map > m_HotKeyMap; 67 | 68 | struct BPR 69 | { 70 | unsigned long Address; 71 | unsigned long Size; 72 | unsigned long State; 73 | unsigned long Type; 74 | unsigned long PageAddr; 75 | unsigned long PageAlign; 76 | unsigned long PageSize; 77 | TAnsiString Condition; 78 | TAnsiString Command; 79 | }; 80 | 81 | map> m_ProcsBPR; 82 | public: 83 | CSyser(); 84 | virtual ~CSyser(); 85 | 86 | void LoadConfig(); 87 | 88 | virtual bool Start() override; 89 | virtual bool Stop() override; 90 | virtual bool WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) override; 91 | 92 | HOT_KEY_CFG *GetHotKeyMap(); 93 | void LoadHotKey(); 94 | 95 | int GetHotKey(unsigned int CmdID, map & HotKeyMap); 96 | void RegisterHotKeyEvent(unsigned int CmdID, CWispBaseWnd *pWnd); 97 | 98 | void UnloadPlugins(); 99 | static int LoadPlugin(CFileIO *This, const char *FullFileName, int FileLength, void *pData); 100 | void LoadPlugins(); 101 | 102 | void UnloadDebugger(); 103 | bool LoadDebugger(const WCHAR *szModuleName); 104 | 105 | void AddHistory(const char *FileName, unsigned long uFlag); 106 | void SaveHistory(); 107 | void LoadHistory(); 108 | bool OpenFileDialog(char *szFileName, bool arguments = true); 109 | }; 110 | 111 | extern CSyser *gpSyser; 112 | #endif -------------------------------------------------------------------------------- /source/pdb2sds.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Code/alt/altlist.hpp" 4 | #include "Code/alt/altmap.hpp" 5 | #include "Code/sysdep.hpp" 6 | 7 | #include "Code/define.h" 8 | #include "Code/tstrmem.hpp" 9 | 10 | #include "EXEAnalyzer/sourcedebug.hpp" 11 | #include "EXEAnalyzer/sdsmodule.hpp" 12 | 13 | 14 | void CreateProgress(unsigned long MaxPos) 15 | { 16 | printf("\n%d ", MaxPos); 17 | } 18 | 19 | void UpdateProgress(unsigned long Pos) 20 | { 21 | printf("*"); 22 | } 23 | 24 | void UpdateCaption(const WCHAR *Text) 25 | { 26 | char szText[256]; 27 | TStrCpy(szText, Text); 28 | printf("%s ", szText); 29 | } 30 | 31 | void DestroyProgress() 32 | { 33 | printf("\n"); 34 | } 35 | 36 | CSourceDebug SourceDebug; 37 | 38 | int main(int argc, char *argv[]) 39 | { 40 | if (argc < 2) 41 | { 42 | printf("error: incorrect args!\n%s file.pdb\nor\n%s file.exe", TGetFileName(argv[0]),TGetFileName(argv[0])); 43 | return 1; 44 | } 45 | SourceDebug.m_CreateProgress = CreateProgress; 46 | SourceDebug.m_UpdateProgress = UpdateProgress; 47 | SourceDebug.m_UpdateCaption = UpdateCaption; 48 | SourceDebug.m_DestroyProgress = DestroyProgress; 49 | 50 | char szModule[MAX_FN_LEN]; 51 | //TStrCpy(szModule, "L:\\flash2G_my\\syser\\Syser\\source\\x32_\\syserx32.exe"); //SYSER 52 | TStrCpy(szModule, "L:\\flash2G_my\\syser\\Syser\\source\\x32_\\testx32.exe"); //TEST 53 | TStrCpy(szModule, argv[1]); 54 | //TStrCpy(szModule, "L:\\flash2G_my\\syser\\Syser\\source\\x32\\testx32.exe"); //WORK 55 | char SDSFullFileName[MAX_FN_LEN]; 56 | char *pSDSFullFileName = SDSFullFileName; 57 | SDSFullFileName[0] = 0; 58 | //TStrCpy(SDSFullFileName, "L:\\flash2G_my\\syser\\Syser\\source\\x32\\testx32.exe.sds"); //MY LAST 59 | // TStrCpy(SDSFullFileName, "L:\\flash2G_my\\syser\\Syser\\source\\x32_\\testx32.exe.sds"); //MY LAST 60 | //TStrCpy(SDSFullFileName, "L:\\flash2G_my\\syser\\Syser\\source\\x32_\\testx32.exe.sds_MY"); //ERROR 61 | //TStrCpy(SDSFullFileName, "L:\\flash2G_my\\syser\\Syser\\source\\x32_\\testx32.exe.sds_SYS"); 62 | //#define LOAD_SDS 63 | //#ifndef LOAD_SDS 64 | if (pSDSFullFileName[0] == 0) 65 | { 66 | printf("OPEN Module %s\n", szModule); 67 | if (!SourceDebug.CheckSDS(szModule, pSDSFullFileName)) 68 | { 69 | if (!SourceDebug.Load(szModule, pSDSFullFileName, eUseSourcesNone)) 70 | { 71 | printf("OPEN ERROR\n"); 72 | return 1; 73 | } else 74 | { 75 | printf("Convert OK\n"); 76 | } 77 | } else 78 | { 79 | printf("Check SDS OK\n"); 80 | } 81 | } 82 | //#endif 83 | printf("SDSFile %s\n", pSDSFullFileName); 84 | //printf("SIZE %d\n", sizeof(SDSFILE)); 85 | 86 | CSDSModule sdsmodule; 87 | if (!sdsmodule.Load(pSDSFullFileName)) 88 | { 89 | printf("Check Load SDS: ERROR\n"); 90 | return 1; 91 | } 92 | 93 | FILESIG FileSig = CSDSModule::GetFILESIG(pSDSFullFileName); 94 | printf("Sig: Timestamp 0x%08x CheckSum 0x%08x\n", FileSig.TimeStamp, FileSig.CheckSum); 95 | if (FileSig.TimeStamp == 0 && FileSig.CheckSum == 0) 96 | { 97 | printf("Sig - ERROR\n"); 98 | return 1; 99 | } 100 | return 0; 101 | } 102 | -------------------------------------------------------------------------------- /source/WispSyser/sourcecodewnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SOURCECODEWND_HPP_ 3 | #define _SOURCECODEWND_HPP_ 4 | 5 | //#include "../Wisp/wispbase.hpp" 6 | //#include "SyserRing3.hpp" 7 | #include "syserui.hpp" 8 | #include "../Code/alt/altmap.hpp" 9 | #include "../Code/srctxtfile.hpp" 10 | #include "../Wisp/wisplist.hpp" 11 | #include "currentfunction.hpp" 12 | #include "../EXEAnalyzer/sdsmodule.hpp" 13 | 14 | struct CSourceCodeWnd : public CWispList 15 | { 16 | unsigned long m_Color[41]; 17 | CSrcTXTFile m_SrcTxtFile; 18 | bool m_FileOpen; 19 | unsigned long m_TxtFileLineNumber; 20 | map m_FileLNMap; 21 | CCurrentFunction m_CurrentFunction; 22 | bool m_bComment; 23 | //??? 24 | CSyserCodeDoc *m_pSyserCodeDoc; 25 | CWispDIBList *m_pLineMarkDIBList; 26 | unsigned long m_CurrentFileID; 27 | CSDSModule *m_pSDSMod; 28 | CWispMenu m_PopupMenu; 29 | WISP_POINT m_LogicMousePosWnd; 30 | map m_Bookmark; 31 | ULONG_PTR m_CurAddr; 32 | 33 | TAnsiString m_WatchVar; 34 | TAnsiString m_WatchVarComplex; 35 | 36 | CSourceCodeWnd(); 37 | virtual ~CSourceCodeWnd(); 38 | 39 | virtual bool MsgProc(WISP_MSG *pMsg) override; 40 | bool OnCreate(WISP_MSG *pMsg); 41 | bool OnDestroy(WISP_MSG *pMsg); 42 | bool IsAddWatch(); 43 | void OnPopupMenu(WISP_MSG *pMsg); 44 | bool OnKeyEvent(WISP_MSG *pMsg); 45 | bool OnEvent(WISP_MSG *pMsg); 46 | bool OnUpdateClient(WISP_MSG *pMsg); 47 | 48 | bool OnEventExpansion(WISP_MSG *pMsg); 49 | bool OnEventCollapse(WISP_MSG *pMsg); 50 | bool OnEventGotoLine(WISP_MSG *pMsg); 51 | bool OnEventAddWatch(WISP_MSG *pMsg); 52 | bool OnEventToggleBM(WISP_MSG *pMsg); 53 | unsigned long GetAddr(CListStringItem *Item); 54 | bool OnEventInsDelBP(WISP_MSG *pMsg); 55 | bool OnEventEnDisBP(WISP_MSG *pMsg); 56 | bool OnEventGotoHere(WISP_MSG *pMsg); 57 | bool OnEventShowHere(WISP_MSG *pMsg); 58 | 59 | virtual void OnLButton(CListStringItem *Item, int nCol) override; 60 | virtual void OnRButton(CListStringItem *Item, int nCol) override; 61 | 62 | virtual bool GetTipText(CListStringItem *Item, int nCol, int *pPosX, int *pPosY, WCHAR *pOutText) override; 63 | 64 | virtual bool Edit(CListStringItem *Item, int nCol, TWideString& String) override; 65 | virtual bool OnEditing(CListStringItem *Item, int nCol, TWideString& String) override; 66 | 67 | void ClearBM(); 68 | bool IsBM(unsigned long Address); 69 | void ToggleBM(); 70 | void NextBM(); 71 | void PrevBM(); 72 | 73 | void ShowLineNum(unsigned long LineNumber); 74 | 75 | unsigned long *OptItemToCS(_OPERAND_ITEM *OpArray, int nOp, unsigned long *pColorString, _INSTRUCTION_INFORMATION *pDasmInstr); 76 | unsigned long *InstrToCS(_INSTRUCTION_INFORMATION *pDasmInstr, unsigned long *pColorString); 77 | unsigned long *ColorDasm(ULONG_PTR ImageBase, ULONG_PTR Address, unsigned int MaxSize, unsigned long *pColorString, int nCodeAlign); 78 | void GetColorKeyword(char *String, unsigned long *pColorString, int *pLen); 79 | void OpenSrcFile(const char *Text, unsigned int Size, SrcFileNameID *SrcFile); 80 | void UpdateContextSrc(); 81 | bool UpdateContextPics(); 82 | 83 | bool GetOutput(char *Str, CListStringItem *Item, TAnsiString & String); 84 | }; 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /source/Wisp/wispcombobox.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "wispcombobox.hpp" 3 | #include "wispbase.hpp" 4 | 5 | #define ID_BUTTON 0x40000000 6 | #define ID_LIST 0x40000001 7 | 8 | CWispComboBox::CWispComboBox() 9 | { 10 | m_nCurSel = -1; 11 | m_CtrlType = WISP_CTRL_COMBO_BOX; 12 | } 13 | CWispComboBox::~CWispComboBox() 14 | { 15 | } 16 | 17 | WISP_MSG_MAP_BEGIN(CWispComboBox) 18 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 19 | WISP_MSG_MAP(WISP_WM_DESTROY, OnDestroy) 20 | WISP_MSG_MAP_ON_EVENT 21 | WISP_MSG_MAP_ON_COMMAND 22 | WISP_MSG_MAP_END(CWispEdit) 23 | 24 | bool CWispComboBox::OnCreate(WISP_MSG *pMsg) 25 | { 26 | CWispDIBList *pDIBList = gpCurWisp->m_DIBLib.GetDIBList("\\Skin\\Default\\VertInc.bmp", 16, 16, 0); 27 | m_Button.CreateEx(pDIBList, m_ClientRect.cx - pDIBList->m_DIBList->m_PaintRect.cx, 0, this, ID_BUTTON, 0x800000); 28 | m_ComboList.CreateWnd(0, 0,0,m_WindowRect.cx,pDIBList->m_DIBList->m_PaintRect.cy, 0, ID_LIST, 0x10000006, WISP_SH_HIDDEN); 29 | m_ComboList.SetOwner(this); 30 | m_ComboList.InsertColumn(0, -1, 0, 0, -1); 31 | return true; 32 | } 33 | bool CWispComboBox::OnDestroy(WISP_MSG *pMsg) 34 | { 35 | m_ComboList.Destroy(); 36 | return true; 37 | } 38 | 39 | WISP_EVENT_MAP_BEGIN(CWispComboBox) 40 | WISP_EVENT_MAP(ID_BUTTON, OnEventButton) 41 | WISP_EVENT_MAP(ID_LIST, OnEventComboList) 42 | WISP_EVENT_MAP_END 43 | 44 | bool CWispComboBox::OnEventButton(WISP_MSG *pMsg) 45 | { 46 | if (m_ComboList.IsWindowShow()) 47 | { 48 | m_ComboList.Show(WISP_SH_HIDDEN); 49 | } else 50 | { 51 | m_ComboList.MoveToScreen(m_ScrWindowRect.x, m_ScrWindowRect.y + m_ScrWindowRect.cy, false); 52 | int Count = m_ComboList.GetItemCount(0, true); 53 | m_ComboList.Resize(m_ComboList.m_WindowRect.cx, m_ComboList.m_nLineHeight * Count + m_BorderSize*2, false); 54 | m_ComboList.Show(WISP_SH_MINSIZE); 55 | m_ComboList.Top(true); 56 | m_ComboList.Focus(); 57 | } 58 | return true; 59 | } 60 | bool CWispComboBox::OnEventComboList(WISP_MSG *pMsg) 61 | { 62 | if (pMsg->Command.CmdMsg == 0x80000203) //WISP_ID_LBUTTON 63 | { 64 | CListStringItem *pItem = (CListStringItem *)pMsg->Command.Param2; 65 | m_nCurSel = m_ComboList.GetPosition(pItem); 66 | SetWindowText(m_ComboList.GetItemContent(pItem, 0)->String.operator const WCHAR*()); 67 | m_ComboList.Show(WISP_SH_HIDDEN); 68 | Focus(); 69 | SendCommand(0x80000400, m_nCurSel, pItem); //WISP_ID_COMBO_SELECT 70 | } 71 | return true; 72 | } 73 | bool CWispComboBox::OnCmdComboList(WISP_MSG *pMsg) 74 | { 75 | if (pMsg->Command.CmdMsg == 0x80000202 && (CWispButton *)pMsg->Command.Param2 != &m_Button) //WISP_ID_CHILD_LOST_FOCUS 76 | m_ComboList.Show(WISP_SH_HIDDEN); 77 | return true; 78 | } 79 | 80 | WISP_CMD_MAP_BEGIN(CWispComboBox) 81 | WISP_CMD_MAP(ID_LIST, OnCmdComboList) 82 | WISP_CMD_MAP_END 83 | 84 | void CWispComboBox::SetCurSel(int nSelect) 85 | { 86 | CListStringItem *pItem = m_ComboList.GetItem(nSelect, 0); 87 | if (pItem) 88 | { 89 | SetWindowText(m_ComboList.GetItemContent(pItem, 0)->String.operator const WCHAR*()); 90 | m_nCurSel = nSelect; 91 | Update((WISP_RECT*)0); 92 | } 93 | } 94 | int CWispComboBox::GetCurSel() 95 | { 96 | return m_nCurSel; 97 | } 98 | -------------------------------------------------------------------------------- /source/EXEAnalyzer/sdwin.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDWIN_HPP_ 3 | #define _SDWIN_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/alt/altmap.hpp" 7 | #include "x86debugger.hpp" 8 | #include "mzhead.hpp" 9 | #include "pehead.hpp" 10 | 11 | //#include "../Code/osdefine.hpp" 12 | 13 | //#include 14 | #if 0 15 | #include 16 | #endif 17 | struct CSDWin : public CX86Debugger 18 | { 19 | TAnsiString m_ProcessFileName; 20 | map m_ThreadIdMap; 21 | 22 | HANDLE m_hDbgThread; 23 | HANDLE m_hThread; 24 | HANDLE m_hProcess; 25 | HANDLE m_dwCurentProcessId; 26 | CONTEXT m_Context; 27 | ULONG_PTR m_ExceptionAddress; 28 | HANDLE m_hWaitExitEvent; 29 | bool m_bSuspend; 30 | bool m_Terminate; 31 | bool m_Attached; 32 | 33 | unsigned long m_StepCount; 34 | #if 0 35 | DWORD m_ImageType; 36 | STACKFRAME64 m_StackFrame; 37 | CONTEXT m_StackFrameContext; 38 | #endif 39 | public: 40 | CSDWin(); 41 | virtual ~CSDWin(); 42 | 43 | bool InsertHandle(unsigned long dwThreadId, HANDLE hThread); 44 | bool RemoveHandle(unsigned long dwThreadId); 45 | 46 | void DebugException(unsigned int Type); 47 | 48 | bool ReadPE(MZHEAD *pMZHead, PE_HEAD *pPEHead); 49 | unsigned int ProcessDebugEvent(DEBUG_EVENT *pEvent); 50 | static unsigned int __stdcall ThreadProc(void *pData); //WINAPI 51 | 52 | virtual void Release() override; 53 | virtual bool Open(const char *Name) override; 54 | virtual bool Close() override; 55 | 56 | virtual unsigned long WriteMemory(ULONG_PTR Address, const void *Buffer, unsigned long Size) override; 57 | virtual unsigned long ReadMemory(ULONG_PTR Address, void *Buffer, unsigned long Size) override; 58 | 59 | bool SaveRegisters(unsigned long dwThreadId); 60 | bool UpdateRegisters(unsigned long dwThreadId); 61 | bool StepBack(unsigned long dwThreadId); 62 | 63 | virtual bool SaveRegisters() override; 64 | virtual bool UpdateRegisters() override; 65 | 66 | virtual bool SetCodeBreakPoint(BREAK_POINT & BP) override; 67 | virtual bool ClearCodeBreakPoint(BREAK_POINT & BP) override; 68 | virtual bool SetDataBreakPoint(BREAK_POINT & BP) override; 69 | virtual bool ClearDataBreakPoint(BREAK_POINT & BP) override; 70 | 71 | bool SetTrace(bool trace); //++ 72 | virtual bool SetSingleStep() override; 73 | virtual bool RemoveSingleStep() override; 74 | virtual bool Pause() override; 75 | virtual bool ContinueDebug(bool bRestoreScr) override; 76 | #if 0 77 | virtual bool GetStack(STACK_FRAME *pStackFrame) override; 78 | #endif 79 | virtual void GetX86RegPtr(X86_CPU_REG_PTR *pCPURegPtr) override; 80 | virtual void GetX86RegPtr(X86_CPU_REG_PTR *pCPURegPtr, int nCPU) override; 81 | 82 | virtual bool GetSegRegBase(unsigned long Selector, ULONG_PTR *pAddress, unsigned long *pBits) override; 83 | }; 84 | 85 | struct CSyserUI; //??? include "plugin.hpp" CSyserPluginUI 86 | 87 | #if defined(MYLIBRARY_EXPORT) 88 | # define MYAPI __declspec(dllexport) 89 | #else 90 | # define MYAPI __declspec(dllimport) 91 | #endif 92 | 93 | extern "C" MYAPI void GetFileFilter(WCHAR *Filter); 94 | extern "C" MYAPI void GetInfo(char *pInfo); 95 | extern "C" MYAPI void *CreateDebugger(CSyserUI *pSyserUI); 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /source/WispSyser/winwisp.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WINWISP_HPP_ 3 | #define _WINWISP_HPP_ 4 | 5 | //#include "../Code/osdefine.hpp" 6 | #include "../Code/define.h" 7 | 8 | #include "../Wisp/wispapp.hpp" 9 | 10 | //#include 11 | 12 | 13 | //#define _WIN32_WINDOWS 0x0410 14 | //#define _WIN32_WINNT 0x0500 15 | 16 | //#define WIN32_LEAN_AND_MEAN 17 | 18 | //#include 19 | //#include 20 | 21 | //#include 22 | //#include 23 | 24 | struct CWinWisp : public CWispApp 25 | { 26 | long m_dwStyle; 27 | long m_dwExStyle; 28 | HWND m_hWnd; 29 | HINSTANCE m_hInstance; 30 | HICON m_hWindowClassIcon; 31 | HICON m_hTaskBarIcon; 32 | 33 | int m_nShowCmd; 34 | const char *m_lpCmdLine; 35 | 36 | HDC m_hWndDC; 37 | HDC m_hPaintDC; 38 | HBITMAP m_hPaintBitmap; 39 | 40 | HCURSOR m_hArrow; 41 | HCURSOR m_hDrag; 42 | HCURSOR m_hVResize; 43 | HCURSOR m_hHResize; 44 | HCURSOR m_hLResize; 45 | HCURSOR m_hRResize; 46 | 47 | WISP_RECT m_PaintRect; 48 | CRITICAL_SECTION m_hCriticalSection; 49 | TAnsiString m_TaskBarHintName; 50 | const char *m_pTaskBarIconName; 51 | long m_TaskbarWM; 52 | WISP_SIZE DesktopSize; 53 | 54 | 55 | public: 56 | CWinWisp(); 57 | virtual ~CWinWisp(); 58 | 59 | virtual bool CreateFrame(const WCHAR *WndName, int Width, int Height, int Bpp) override; 60 | virtual void DestroyFrame() override; 61 | 62 | virtual bool EndResize(int Width, int Height) override; 63 | virtual bool BeginResize(int Width, int Height) override; 64 | 65 | virtual void BeginDrag() override; 66 | virtual void EndDrag() override; 67 | 68 | virtual bool WakeUpMsgThread() override; 69 | virtual bool SleepMsgThread() override; 70 | 71 | virtual void EnterMsgCriticalSection() override; 72 | virtual void LeaveMsgCriticalSection() override; 73 | 74 | virtual void BeginDraw(WISP_RECT *pRect) override; 75 | virtual void EndDraw(WISP_RECT *pRect) override; 76 | 77 | virtual void SetCursor(unsigned int CursorType, WISP_POINT *pHotPT, WISP_SIZE *pSize, CWispDIB *pDIB) override; 78 | virtual void ChangeCursor(LONG_PTR Style, unsigned int CursorType, WISP_POINT *pHotPT, WISP_SIZE *pSize) override; 79 | 80 | virtual const WCHAR *GetClipboard() override; 81 | virtual bool SetClipboard(const WCHAR *Text) override; 82 | 83 | 84 | virtual bool GetOpenFolderName(WCHAR *Path, const WCHAR *Title) override; 85 | 86 | virtual bool GetOpenFileName(const WCHAR *lpstrInitialDir, const WCHAR *lpstrFilter, int, WCHAR *lpstrFile, int nMaxFile) override; 87 | 88 | virtual void ReportMsg(const WCHAR *Format, ...) override; 89 | 90 | virtual bool WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 91 | 92 | 93 | bool UnregisterTaskBar(int); 94 | bool RegisterTaskBar(const char *HintName, const char *IconName); 95 | bool UpdateTaskBar(const char *IconName); 96 | 97 | void CreateFrameBuffer(int Width, int Height); 98 | 99 | static LRESULT CALLBACK DefaultWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 100 | 101 | int WinMainStart(HINSTANCE hInstance, const char *lpCmdLine, int nShowCmd); 102 | }; 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /source/Code/sysdep.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "sysdep.hpp" 3 | #include "tstrmem.hpp" 4 | #include 5 | 6 | int GetModulePath(char *szPathName, bool bSeparator) 7 | { 8 | *szPathName = 0; 9 | GetModuleFileNameA(0, szPathName, MAX_FN_LEN); 10 | if (szPathName[1] == ':') 11 | { 12 | MAKE_CHAR_UPPER(szPathName[0]); 13 | } 14 | 15 | char *sep = TStrRChr(szPathName, '\\'); 16 | if (sep) 17 | { 18 | if (bSeparator) ++sep; 19 | *sep = 0; 20 | } 21 | return TStrLen(szPathName); 22 | } 23 | 24 | int GetModulePath(WCHAR *szPathName, bool bSeparator) 25 | { 26 | *szPathName = 0; 27 | GetModuleFileNameW(0, szPathName, MAX_FN_LEN); 28 | if (szPathName[1] == ':') 29 | { 30 | MAKE_CHAR_UPPER(szPathName[0]); 31 | } 32 | 33 | WCHAR *sep = TStrRChr(szPathName, L'\\'); 34 | if (sep) 35 | { 36 | if (bSeparator) ++sep; 37 | *sep = 0; 38 | } 39 | return TStrLen(szPathName); 40 | } 41 | 42 | int DebugPrintf(const char *format, ...) 43 | { 44 | char OutputString[1024]; 45 | va_list Next; 46 | va_start(Next, format); 47 | int Len = TVSPrintf(OutputString, format, Next); 48 | va_end(Next); 49 | OutputDebugStringA(OutputString); 50 | return Len; 51 | } 52 | 53 | int DebugPrintf(const WCHAR *format, ...) 54 | { 55 | WCHAR OutputString[1024]; 56 | va_list Next; 57 | va_start(Next, format); 58 | int Len = TVSPrintf(OutputString, format, Next); 59 | va_end(Next); 60 | OutputDebugStringW(OutputString); 61 | return Len; 62 | } 63 | 64 | //?gRandomMem@@3PAKA 27x5 = 135 + 2 65 | unsigned long gRandomMem[] = { 66 | 0x5A2B2E15, 0x15562E15, 0x9742A171, 0x8515582E, 0x0F510693, 67 | 0x0708C533, 0x14C80E0B, 0xFE161780, 0x712A3DC2, 0xEB494746, 68 | 0x08F9900A, 0xF7B908D0, 0x0384D5B6, 0x1B212C2B, 0x2022743F, 69 | 0x3416E197, 0x06777BC9, 0xBAB7C768, 0xE9837D6B, 0x2AF10303, 70 | 0xA6D7EB26, 0xE103EB3E, 0x90B7D0BD, 0x59CDE23D, 0x25EBEB07, 71 | 0x0A4A0690, 0x1207C337, 0x6920EE83, 0x690B739E, 0xEDDA9417, 72 | 0x6010EB06, 0x55F2E920, 0xE959CBF4, 0x089DF8FD, 0x525706F9, 73 | 0x43C35351, 0xFE9BB757, 0x5BE2809A, 0x4315191D, 0x34DBC2FB, 74 | 0x0F740504, 0x74280B52, 0x0D820552, 0x4C5CDFFC, 0x1E8DAB6E, 75 | 0x058A0E79, 0x0B72803C, 0xBADF5154, 0x776B6E07, 0x30D77509, 76 | 0x36E68A24, 0x76B669A1, 0x3B03FDB3, 0x18721A44, 0x721E6708, 77 | 0x650A1F0F, 0x6C0BFF46, 0xEB2D721C, 0x58F99002, 0x5F5A595B, 78 | 0xE23BB494, 0x1E0CECB7, 0x160AB907, 0x0DEA75AE, 0x1B7FB26C, 79 | 0xE0090666, 0x0000DAEB, 0x76DA06FF, 0x02F9DB83, 0xFE012A40, 80 | 0x6A0B0807, 0x0FEC5A2E, 0xC9706854, 0x0B40C803, 0x6D555419, 81 | 0x0ADDB179, 0x2073037D, 0x6968116F, 0x1F6E6407, 0xFFDE61A1, 82 | 0x54204350, 0x59736C27, 0x2DE40D43, 0x2EA36370, 0x9D5DC358, 83 | 0x1E2F06D4, 0x8071B569, 0x2F701B11, 0x7F014B70, 0x1A7307C2, 84 | 0x2A7550D9, 0xC52C2C52, 0xEAC518B8, 0x16431995, 0x63226066, 85 | 0xDC0C0BB7, 0x08CE0EE2, 0x0283C010, 0xDB40CCE9, 0x5A0C940C, 86 | 0xB78A50B8, 0x8781B15E, 0xD6821CB4, 0xBDA35C16, 0xFE15EEFD, 87 | 0x0E8920C2, 0xF9810352, 0xB90373CE, 0xB6EC4F04, 0x320E7037, 88 | 0x8A0354DD, 0x095C0507, 0x36230327, 0xEF1C49DD, 0x085F7789, 89 | 0x2DAF4E97, 0x2C1EC524, 0xF8A67060, 0x28E09740, 0x032A9303, 90 | 0xDB80AD79, 0x730470B6, 0xBB23A886, 0x0E6E344C, 0x4D1544DE, 91 | 0x6B754EA6, 0x1ADB6E82, 0x6A39A52C, 0x0D176109, 0xDA1B7313, 92 | 0x570954B6, 0x745F0E13, 0x1D22E44F, 0xFE7F8DDD, 0x123C1975, 93 | 0, 0 94 | }; 95 | -------------------------------------------------------------------------------- /source/Code/cmdparser.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "cmdparser.hpp" 3 | 4 | CCmdParser::CCmdParser() 5 | { 6 | //EMPTY 7 | } 8 | 9 | CCmdParser::~CCmdParser() 10 | { 11 | //EMPTY 12 | } 13 | 14 | void CCmdParser::PrintString(const WCHAR *szStr) 15 | { 16 | //EMPTY 17 | } 18 | 19 | void CCmdParser::Reset() 20 | { 21 | m_CmdMap.clear(); 22 | } 23 | 24 | bool CCmdParser::InsertCmd(const WCHAR *szCmd, CMDPROC pCmdProc, void *pUserData, const WCHAR *pComment, const WCHAR *pUsage) 25 | { 26 | WCHAR CmdStr[258]; 27 | TStrCpy(CmdStr, szCmd); 28 | TStrLwr(CmdStr); 29 | 30 | map::IT it = m_CmdMap.Insert(CmdStr); 31 | if (it == m_CmdMap.end()) 32 | return false; 33 | 34 | it->second.pCmdProc = pCmdProc; 35 | it->second.pUserData = pUserData; 36 | it->second.pComment = pComment; 37 | it->second.pUsage = pUsage; 38 | 39 | return true; 40 | } 41 | 42 | void CCmdParser::RemoveCmd(const WCHAR *szCmd) 43 | { 44 | TWideNoCaseString Cmd(szCmd); 45 | Cmd.MakeLower(); 46 | m_CmdMap.erase(Cmd); 47 | } 48 | 49 | int CCmdParser::GetParam(WCHAR *pStr, const WCHAR **pParam) 50 | { 51 | int Len = TStrLen(pStr); 52 | while (Len--) 53 | { 54 | if (pStr[Len] == '\n') 55 | pStr[Len] = 0; 56 | } 57 | int Count = 1; 58 | WCHAR *pPrm = pStr; 59 | *pParam = pStr; 60 | while (*pPrm) 61 | { 62 | pPrm = TStrChr(pPrm, ' '); 63 | if (!pPrm) 64 | break; 65 | while (*pPrm == ' ') 66 | *pPrm++ = 0; 67 | if (*pPrm) 68 | pParam[Count++] = pPrm; 69 | } 70 | return Count; 71 | } 72 | 73 | bool CCmdParser::CompareParam(const WCHAR *pParam1, const WCHAR *pParam2) 74 | { 75 | WCHAR Param1[256]; 76 | WCHAR Param2[256]; 77 | TStrCpyLimit(Param1, pParam1, lenof(Param1)); 78 | TStrCpyLimit(Param2, pParam2, lenof(Param2)); 79 | 80 | const WCHAR *Prm1[33]; 81 | const WCHAR *Prm2[33]; 82 | 83 | int nParam1 = GetParam(Param1, Prm1); 84 | int nParam2 = GetParam(Param2, Prm2); 85 | if (nParam1 != nParam2) 86 | return false; 87 | for (int n = 0; n < nParam1; ++n) 88 | { 89 | if (TStrCmp(Prm1[n], Prm2[n])) 90 | return false; 91 | } 92 | return true; 93 | } 94 | 95 | bool CCmdParser::ParseCmd(const WCHAR *szCmd, unsigned long *pResult) 96 | { 97 | WCHAR CmdStr[258]; 98 | const WCHAR *ParamStr[32]; 99 | 100 | while (*szCmd == 32 || *szCmd == 9) ++szCmd; //is_space 101 | 102 | if (TStrCpyLimit(CmdStr, szCmd, 256) == 0) 103 | return false; 104 | 105 | int ParamCount = GetParam(CmdStr, ParamStr); 106 | 107 | map::IT it = m_CmdMap.find(CmdStr); 108 | if (it == m_CmdMap.end()) 109 | return false; 110 | 111 | unsigned long ret = it->second.pCmdProc(ParamCount, ParamStr, szCmd, it->second.pUserData); 112 | if (pResult) *pResult = ret; 113 | return true; 114 | } 115 | 116 | void CCmdParser::ParseCmds(const WCHAR *szCmds, WCHAR Delim) 117 | { 118 | WCHAR CmdStr[514]; 119 | while (szCmds && *szCmds) 120 | { 121 | while (*szCmds == Delim) ++szCmds; 122 | WCHAR *pStrDelim = TStrChr(szCmds, Delim); 123 | if (pStrDelim) 124 | { 125 | TStrCpyLimit(CmdStr, szCmds, MIN(pStrDelim - szCmds, 512)); 126 | szCmds = pStrDelim; 127 | } else 128 | { 129 | TStrCpyLimit(CmdStr, szCmds, 512); 130 | szCmds = NULL; 131 | } 132 | ParseCmd(CmdStr, NULL); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /source/WispSyser/findlistwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "findlistwnd.hpp" 5 | #include "syserconfig.hpp" 6 | #include "resource.hpp" 7 | 8 | WISP_MSG_MAP_BEGIN(CStatusWnd) 9 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 10 | WISP_MSG_MAP(WISP_WM_UPDATE_CLIENT, OnUpdateClient) 11 | WISP_MSG_MAP_END(CWispWnd) 12 | 13 | CStatusWnd::CStatusWnd() 14 | { 15 | } 16 | CStatusWnd::~CStatusWnd() 17 | { 18 | } 19 | 20 | bool CStatusWnd::OnCreate(WISP_MSG *pMsg) 21 | { 22 | m_BorderSize = 2; 23 | m_StatusStr.Empty(); 24 | return true; 25 | } 26 | bool CStatusWnd::OnUpdateClient(WISP_MSG *pMsg) 27 | { 28 | CWispWnd::OnUpdateClient(pMsg); 29 | m_ClientDC.DrawString(4, 2, m_StatusStr.operator const WCHAR*(), -1, 0, 0); 30 | return false; 31 | } 32 | 33 | 34 | WISP_MSG_MAP_BEGIN(CFindListWnd) 35 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 36 | WISP_MSG_MAP(WISP_WM_SIZE, OnSize) 37 | WISP_MSG_MAP_ON_COMMAND 38 | WISP_MSG_MAP_END(CWispWnd) 39 | 40 | WISP_CMD_MAP_BEGIN(CFindListWnd) 41 | WISP_CMD_MAP(EVENT_ID_STRFIND, OnCmdStrFind) 42 | WISP_CMD_MAP_END 43 | 44 | CFindListWnd::CFindListWnd() 45 | { 46 | } 47 | CFindListWnd::~CFindListWnd() 48 | { 49 | } 50 | 51 | bool CFindListWnd::OnCreate(WISP_MSG *pMsg) 52 | { 53 | m_ShowFormat = 1; //??? 54 | m_StringReferenceList.CreateWnd(WSTR("String Reference"), 0,0,556,300, this, EVENT_ID_STRFIND, 0x40030000, WISP_SH_MINSIZE); 55 | m_StringReferenceList.m_ShowFormat = m_ShowFormat; 56 | 57 | gpSyser->m_MainFrame.m_SystemExplorer.m_FoundStringRefMap.clear(); 58 | 59 | int Ext = m_ClientDC.GetTextExtent(WSTR("X"), -1, 0); 60 | if (m_ShowFormat) 61 | { 62 | m_StringReferenceList.InsertColumn(WSTR("Address"), (3+ADDR_SIZE)*Ext+3, 0, 0, -1); //60 63 | m_StringReferenceList.InsertColumn(WSTR("Type"), 32, 0, 0, -1); 64 | m_StringReferenceList.InsertColumn(WSTR("Disassembly"), 200, 0, 0, -1); 65 | m_StringReferenceList.InsertColumn(WSTR("Text String"), 280, 0, 0, -1); 66 | } else 67 | { 68 | m_StringReferenceList.InsertColumn(WSTR("Address"), (3+ADDR_SIZE)*Ext+3, 0, 0, -1); //80 69 | m_StringReferenceList.InsertColumn(WSTR("Text String/Disassembly"), 200, 0, 0, -1); 70 | } 71 | 72 | m_StringReferenceList.m_ColorFocus = gSyserColors.Color[2]; 73 | m_StringReferenceList.m_ItemColor = gSyserColors.Color[1]; 74 | m_StringReferenceList.SetBGColor(gSyserColors.Color[0]); 75 | 76 | m_StatusWnd.CreateWnd(0, 0,300,564,20, this, 0, 6, WISP_SH_MINSIZE); 77 | m_StatusWnd.SetBGColor(gSyserColors.Color[0]); 78 | m_StatusWnd.m_ClientDC.SetTextColor(gSyserColors.Color[1]); 79 | 80 | m_StringReferenceList.InitContext(0, 0); 81 | return true; 82 | } 83 | bool CFindListWnd::OnCmdStrFind(WISP_MSG *pMsg) 84 | { 85 | if (pMsg->Command.CmdMsg == 0) 86 | { 87 | m_StatusWnd.m_StatusStr = m_StringReferenceList.m_SearchString; 88 | if (pMsg->Command.Param1 == 0 && m_StatusWnd.m_StatusStr.m_nLength) 89 | m_StatusWnd.m_StatusStr += WSTR(": not found"); 90 | m_StatusWnd.Update((WISP_RECT*)0); 91 | } 92 | return true; 93 | } 94 | bool CFindListWnd::OnSize(WISP_MSG *pMsg) 95 | { 96 | m_StringReferenceList.Resize(m_ClientRect.cx, m_ClientRect.cy - 20, 1); 97 | m_StatusWnd.Resize(m_ClientRect.cx, 20, 1); 98 | 99 | m_StringReferenceList.MoveToWindow(m_ClientRect.x, m_ClientRect.y, 1); 100 | m_StatusWnd.MoveToWindow(m_ClientRect.x, m_ClientRect.y + m_ClientRect.cy - 20, 1); 101 | return true; 102 | } 103 | -------------------------------------------------------------------------------- /source/WispSyser/dataviewform.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "dataviewform.hpp" 5 | 6 | WISP_FORM_RES_ITEM DataViewForm[] = 7 | { 8 | {WISP_CTRL_FORM, {0, 0, 500, 300}, 0, 0xAB, WSTR("Data View"), 0, 0}, 9 | {WISP_CTRL_STATIC_GROUP, {10, 10, 470, 40}, 2, 0, WSTR("Address"), 0, 0}, 10 | {WISP_CTRL_EDIT, {20, 25, 400, 16}, 1, 0x1000006, 0, 0, 0}, 11 | {WISP_CTRL_BUTTON, {430, 25, 40, 16}, 4, 0, WSTR("Goto"), 0, 0}, 12 | {0}, 13 | }; 14 | 15 | WISP_MSG_MAP_BEGIN(CDataViewForm) 16 | WISP_MSG_MAP(WISP_WM_CREATE_FORM, OnCreateForm) 17 | WISP_MSG_MAP(WISP_WM_CLOSE, OnClose) 18 | WISP_MSG_MAP(WISP_WM_SIZE, OnSize) 19 | WISP_MSG_MAP_ON_COMMAND 20 | WISP_MSG_MAP_ON_EVENT 21 | WISP_MSG_MAP_END(CWispForm) 22 | 23 | WISP_CMD_MAP_BEGIN(CDataViewForm) 24 | WISP_CMD_MAP(1, OnCmdEdit) 25 | WISP_CMD_MAP_END 26 | 27 | WISP_EVENT_MAP_BEGIN(CDataViewForm) 28 | WISP_EVENT_MAP(4, OnEventGoto) 29 | WISP_EVENT_MAP_END 30 | 31 | CDataViewForm::CDataViewForm() 32 | { 33 | m_Resource = DataViewForm; 34 | } 35 | 36 | CDataViewForm::~CDataViewForm() 37 | { 38 | } 39 | 40 | bool CDataViewForm::OnCreateForm(WISP_MSG *pMsg) 41 | { 42 | if (m_Style & 1) 43 | { 44 | AttachTitleDIB(gpCurWisp->m_DIBLib.LoadDIBList("\\Toolbar.bmp", 16, 16, 0, 0xFF00FF)->GetDIB(0x59)); 45 | } 46 | m_pAddressName = (CWispEdit *)GetFormItem(1); 47 | m_pAddress = (CWispStaticGroup *)GetFormItem(2); 48 | m_pGoto = (CWispButton *)GetFormItem(4); 49 | m_DataView.CreateWnd(0,10, 50 | m_pAddressName->m_ScrWindowRect.x - m_ScrWindowRect.x + 30, 51 | m_pAddress->m_WindowRect.cx, 52 | m_ClientRect.cy - (m_pAddressName->m_ScrWindowRect.x - m_ScrWindowRect.x + 30) - 10, this, 3, 0, WISP_SH_MINSIZE); 53 | OnSize(0); 54 | return true; 55 | } 56 | bool CDataViewForm::OnClose(WISP_MSG *pMsg) 57 | { 58 | gpSyser->m_MainFrame.FocusActive(); 59 | return true; 60 | } 61 | bool CDataViewForm::OnSize(WISP_MSG *pMsg) 62 | { 63 | m_pAddress->Resize(m_ClientRect.cx - 20, m_pAddress->m_WindowRect.cy, 1); 64 | m_pAddressName->Resize(m_pAddress->m_WindowRect.cx - m_pGoto->m_WindowRect.cx - 30, 65 | m_pAddressName->m_WindowRect.cy, 1); 66 | m_pGoto->MoveToWindow(m_pAddress->m_ScrWindowRect.x + m_pAddress->m_WindowRect.cx - m_ScrWindowRect.x - 50, 67 | m_pGoto->m_ScrWindowRect.y - m_ScrWindowRect.y, 1); 68 | m_DataView.Resize(m_pAddress->m_WindowRect.cx, 69 | m_ClientRect.cy - m_pAddressName->m_ScrWindowRect.x + m_ScrWindowRect.x - 40, 1); 70 | return true; 71 | } 72 | 73 | bool CDataViewForm::OnCmdEdit(WISP_MSG *pMsg) 74 | { 75 | if (pMsg->Command.CmdMsg == 0x80000703 && //WISP_ID_EDIT_KEYDOWN 76 | pMsg->Command.Param1 == 13) 77 | UpdateContext(); 78 | return true; 79 | } 80 | 81 | bool CDataViewForm::OnEventGoto(WISP_MSG *pMsg) 82 | { 83 | UpdateContext(); 84 | return false; 85 | } 86 | void CDataViewForm::UpdateContext() 87 | { 88 | if (IsWindowShow()) 89 | { 90 | ULONG_PTR Result; 91 | if (gpSyser->m_SyserUI.CalcExp(m_pAddressName->GetWindowText().operator const WCHAR*(), &Result)) 92 | { 93 | SetWindowText(m_pAddressName->GetWindowText().operator const WCHAR*()); 94 | m_DataView.ViewAddress(Result, true); 95 | } 96 | } 97 | } 98 | void CDataViewForm::Create() 99 | { 100 | if (IsWindow()) 101 | { 102 | Destroy(); 103 | } else 104 | { 105 | CWispForm::Create(0, WISP_SH_MINSIZE); 106 | Center(0); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /source/WispSyser/peexplorerform.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PEEXPLORERFORM_HPP_ 3 | #define _PEEXPLORERFORM_HPP_ 4 | 5 | #include "../Wisp/wispform.hpp" 6 | #include "../Wisp/wisptabwnd.hpp" 7 | #include "../Wisp/wispcombobox.hpp" 8 | #include "../Wisp/wisplist.hpp" 9 | #include "../EXEAnalyzer/pefile.hpp" 10 | 11 | struct CPEHeaderWnd : public CWispWnd 12 | { 13 | CWispList m_COFF; 14 | CWispList m_WIN; 15 | CListStringItem *m_pItems[33]; 16 | 17 | virtual bool MsgProc(WISP_MSG *pMsg) override; 18 | 19 | bool OnCreate(WISP_MSG *pMsg); 20 | bool OnEvent(WISP_MSG *pMsg); 21 | 22 | bool InitContext(); 23 | bool Open(CPEFile *pPEFile); 24 | }; 25 | 26 | struct CPERelcationWnd : public CWispWnd 27 | { 28 | CWispList m_ModuleList; 29 | CWispList m_EntryList; 30 | 31 | bool OnCreate(WISP_MSG *pMsg); 32 | bool OnEvent(WISP_MSG *pMsg); 33 | 34 | bool InitContext(); 35 | 36 | virtual bool MsgProc(WISP_MSG *pMsg) override; 37 | }; 38 | 39 | /// 40 | struct CPEImportModuleList : public CWispList 41 | { 42 | virtual bool MsgProc(WISP_MSG *pMsg) override; 43 | bool OnMouseDblClick(WISP_MSG *pMsg); 44 | }; 45 | 46 | struct CPEImportEntryList : public CWispList 47 | { 48 | virtual bool MsgProc(WISP_MSG *pMsg) override; 49 | bool OnMouseDblClick(WISP_MSG *pMsg); 50 | }; 51 | 52 | struct CPEImportWnd : public CWispWnd 53 | { 54 | CPEImportModuleList m_ModuleList; 55 | CPEImportEntryList m_EntryList; 56 | CPEFile *m_pPEFile; 57 | 58 | bool OnCreate(WISP_MSG *pMsg); 59 | bool OnEvent(WISP_MSG *pMsg); 60 | bool OnCommand(WISP_MSG *pMsg); 61 | bool OnCmdSelectEntry(WISP_MSG *pMsg); 62 | 63 | bool InitContext(); 64 | 65 | virtual bool MsgProc(WISP_MSG *pMsg) override; 66 | 67 | bool Open(CPEFile *pPEFile); 68 | ULONG_PTR GetImageBase(const char *szModuleName); 69 | }; 70 | /// 71 | struct CPEExportList : public CWispList 72 | { 73 | virtual bool MsgProc(WISP_MSG *pMsg) override; 74 | bool OnMouseDblClick(WISP_MSG *pMsg); 75 | }; 76 | 77 | struct CPEExportWnd : public CWispWnd 78 | { 79 | CPEExportList m_ExportList; 80 | 81 | bool OnCreate(WISP_MSG *pMsg); 82 | bool OnEvent(WISP_MSG *pMsg); 83 | 84 | bool InitContext(); 85 | 86 | virtual bool MsgProc(WISP_MSG *pMsg) override; 87 | 88 | bool Open(CPEFile *pPEFile); 89 | }; 90 | /// 91 | struct CPEDataDirectoryList : public CWispList 92 | { 93 | virtual bool MsgProc(WISP_MSG *pMsg) override; 94 | bool OnMouseDblClick(WISP_MSG *pMsg); 95 | }; 96 | 97 | struct CPEDataDirectoryWnd : public CWispWnd 98 | { 99 | CPEDataDirectoryList m_DirectoryList; 100 | CListStringItem *m_pItems[16]; 101 | 102 | bool OnCreate(WISP_MSG *pMsg); 103 | bool OnEvent(WISP_MSG *pMsg); 104 | 105 | bool InitContext(); 106 | 107 | virtual bool MsgProc(WISP_MSG *pMsg) override; 108 | 109 | bool Open(CPEFile *pPEFile); 110 | }; 111 | 112 | /// 113 | struct CPEExplorerForm : public CWispForm 114 | { 115 | CPEFile m_MemPEFile;//CMemPEFile 116 | CPEHeaderWnd *m_pPEHeaderWnd; 117 | CWispTabWnd *m_pTabWnd; 118 | CPERelcationWnd *m_pPERelcationWnd; 119 | CPEImportWnd *m_pPEImportWnd; 120 | CPEExportWnd *m_pPEExportWnd; 121 | CPEDataDirectoryWnd *m_pPEDataDirectoryWnd; 122 | CWispComboBox *m_pModuleList; 123 | 124 | CPEExplorerForm(); 125 | virtual ~CPEExplorerForm(); 126 | 127 | virtual bool MsgProc(WISP_MSG *pMsg) override; 128 | 129 | bool OnCreateForm(WISP_MSG *pMsg); 130 | bool OnEvent(WISP_MSG *pMsg); 131 | bool OnCommand(WISP_MSG *pMsg); 132 | bool OnCmdModuleSelect(WISP_MSG *pMsg); 133 | bool SelectModule(ULONG_PTR Address); 134 | bool OpenModule(ULONG_PTR Address); 135 | void Open(ULONG_PTR Address); 136 | void Create(); 137 | }; 138 | 139 | #endif -------------------------------------------------------------------------------- /source/WispSyser/genereglist.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _GENEREGLIST_HPP_ 3 | #define _GENEREGLIST_HPP_ 4 | 5 | #include "../Wisp/wisplist.hpp" 6 | #include "../Wisp/wispmenu.hpp" 7 | #include "../EXEAnalyzer/x86debugger.hpp" 8 | 9 | enum REG_GENE_INDEX 10 | { 11 | REG_GENE_CAX = 0, 12 | REG_GENE_CBX, 13 | REG_GENE_CCX, 14 | REG_GENE_CDX, 15 | REG_GENE_CSI, 16 | REG_GENE_CDI, 17 | REG_GENE_CBP, 18 | REG_GENE_CSP, 19 | #ifdef _X64_ 20 | REG_GENE_R8, 21 | REG_GENE_R9, 22 | REG_GENE_R10, 23 | REG_GENE_R11, 24 | REG_GENE_R12, 25 | REG_GENE_R13, 26 | REG_GENE_R14, 27 | REG_GENE_R15, 28 | #endif 29 | REG_GENE_CIP, 30 | 31 | REG_GENE_EFLAG, 32 | 33 | REG_GENE_CS, 34 | REG_GENE_DS, 35 | REG_GENE_ES, 36 | REG_GENE_FS, 37 | REG_GENE_GS, 38 | REG_GENE_SS, 39 | 40 | REG_GENE_AF, 41 | REG_GENE_CF, 42 | REG_GENE_DF, 43 | REG_GENE_IF, 44 | REG_GENE_OF, 45 | REG_GENE_PF, 46 | REG_GENE_SF, 47 | REG_GENE_ZF, 48 | 49 | REG_GENE_BASE_CS, 50 | REG_GENE_BASE_DS, 51 | REG_GENE_BASE_ES, 52 | REG_GENE_BASE_FS, 53 | REG_GENE_BASE_GS, 54 | REG_GENE_BASE_SS, 55 | #ifdef _RING0_ 56 | REG_GENE_GDTR, 57 | REG_GENE_IDTR, 58 | REG_GENE_LDTR, 59 | REG_GENE_TR, 60 | 61 | REG_GENE_BASE_GDTR, 62 | REG_GENE_LIMIT_GDTR, 63 | 64 | REG_GENE_BASE_IDTR, 65 | REG_GENE_LIMIT_IDTR, 66 | #endif 67 | REG_GENE_REGCOUNT, 68 | }; 69 | 70 | struct CPUREG 71 | { 72 | ULONG_PTR CAX; 73 | ULONG_PTR CBX; 74 | ULONG_PTR CCX; 75 | ULONG_PTR CDX; 76 | ULONG_PTR CDI; 77 | ULONG_PTR CSI; 78 | ULONG_PTR CBP; 79 | ULONG_PTR CSP; 80 | #ifdef _X64_ 81 | ULONG_PTR R8; 82 | ULONG_PTR R9; 83 | ULONG_PTR R10; 84 | ULONG_PTR R11; 85 | ULONG_PTR R12; 86 | ULONG_PTR R13; 87 | ULONG_PTR R14; 88 | ULONG_PTR R15; 89 | #endif 90 | ULONG_PTR CIP; 91 | // unsigned long EFL; 92 | EFL_REG EFL; 93 | unsigned short CS; 94 | unsigned short DS; 95 | unsigned short ES; 96 | unsigned short FS; 97 | unsigned short GS; 98 | unsigned short SS; 99 | 100 | ULONG_PTR DR[8]; 101 | }; 102 | 103 | struct CGeneRegList : public CWispList 104 | { 105 | CListStringItem *m_hGeneRegItem[REG_GENE_REGCOUNT]; 106 | CPUREG m_CPUREG; 107 | unsigned long m_ColorChanges; 108 | unsigned long m_ColorSame; 109 | CListStringItem *m_pEditItem; 110 | CWispMenu m_PopupMenu; 111 | CWispMenu::MenuItem *m_MenuItemShowCode; 112 | CWispMenu::MenuItem *m_MenuItemShowData; 113 | int m_nCPU; 114 | X86_CPU_REG_PTR m_CPUREGPTR; 115 | map m_KeyMap; 116 | 117 | CGeneRegList(); 118 | virtual ~CGeneRegList(); 119 | 120 | virtual bool MsgProc(WISP_MSG *pMsg) override; 121 | bool OnUpdate(WISP_MSG *pMsg); 122 | bool OnCreate(WISP_MSG *pMsg); 123 | bool OnClose(WISP_MSG *pMsg); 124 | bool OnDestroy(WISP_MSG *pMsg); 125 | // bool OnGetFocus(WISP_MSG *pMsg); 126 | bool OnKeyEvent(WISP_MSG *pMsg); 127 | bool OnEvent(WISP_MSG *pMsg); 128 | 129 | bool OnEventGotoData(WISP_MSG *pMsg); 130 | bool OnEventGotoCode(WISP_MSG *pMsg); 131 | bool OnEventCode(WISP_MSG *pMsg); 132 | bool OnEventData(WISP_MSG *pMsg); 133 | 134 | virtual void OnLButton(CListStringItem *Item, int nCol) override; 135 | 136 | virtual bool Edit(CListStringItem *Item, int nCol, TWideString& String) override; 137 | virtual bool OnEditing(CListStringItem *Item, int nCol, TWideString& String) override; 138 | 139 | void ResetContext(); 140 | void UpdateFlags(); 141 | void ReadString(X86_CPU_REG_PTR *pCPURegPtr); 142 | void UpdateContext(); 143 | void LoadKeyMap(); 144 | void ReadStringTrace(X86_CPU_REG *pCPUReg); 145 | void UpdateContextTrace(unsigned long CPUType, X86_CPU_REG *pCPUReg, ULONG_PTR CIP); 146 | }; 147 | 148 | #endif -------------------------------------------------------------------------------- /source/Wisp/wispcalcwnd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _WISPCALCWND_HPP_ 3 | #define _WISPCALCWND_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Code/tstrmem.hpp" 7 | #include "../Code/alt/altlist.hpp" 8 | #include "wispwnd.hpp" 9 | #include "wispbutton.hpp" 10 | #include "wispradiobox.hpp" 11 | 12 | struct _DefStruct 13 | { 14 | unsigned long forecolor; 15 | unsigned long backcolor; 16 | unsigned long numberButtonColor; 17 | unsigned long functionButtonColor; 18 | unsigned long hexButtonColor; 19 | unsigned long memoryButtonColor; 20 | unsigned long operationButtonColor; 21 | int precision; 22 | int fixedprecision; 23 | int style; 24 | char fixed; 25 | char beep; 26 | 27 | CWispFont font; 28 | }; 29 | 30 | enum _last_input_type 31 | { 32 | DIGIT = 1, 33 | OPERATION = 2, 34 | RECALL = 3, 35 | PASTE = 4, 36 | }; 37 | 38 | enum _num_base 39 | { 40 | NB_BINARY = 2, 41 | NB_OCTAL = 8, 42 | NB_DECIMAL = 10, 43 | NB_HEX = 16, 44 | }; 45 | 46 | enum _angle_type 47 | { 48 | ANG_DEGREE = 0, 49 | ANG_RADIAN = 1, 50 | ANG_GRADIENT = 2, 51 | }; 52 | 53 | struct CWispCalcWnd: public CWispWnd 54 | { 55 | CWispRadioBox *anglebutton[4]; 56 | CWispRadioBox *basebutton[4]; 57 | CWispButton *bpA; 58 | CWispButton *pbMR; 59 | CWispButton *pbMRplusminus; 60 | CWispButton *pbMC; 61 | CWispButton *pbClear; 62 | CWispButton *pbAC; 63 | CWispButton *pbRsh; 64 | CWispButton *pbplusmius; 65 | CWispButton *bpB; 66 | CWispButton *pb7; 67 | CWispButton *pb8; 68 | CWispButton *pb9; 69 | CWispButton *pbparenopen; 70 | CWispButton *pbparenclose; 71 | CWispButton *pband; 72 | CWispButton *pbXor; 73 | CWispButton *bpC; 74 | CWispButton *pb4; 75 | CWispButton *pb5; 76 | CWispButton *pb6; 77 | CWispButton *pbX; 78 | CWispButton *pbdivision; 79 | CWispButton *pbor; 80 | CWispButton *pbfactorial; 81 | CWispButton *pbD; 82 | CWispButton *pb1; 83 | CWispButton *pb2; 84 | CWispButton *pb3; 85 | CWispButton *pbplus; 86 | CWispButton *pbminus; 87 | CWispButton *pbshift; 88 | CWispButton *pbsquare; 89 | CWispButton *pbE; 90 | CWispButton *pb0; 91 | CWispButton *pbequal; 92 | CWispButton *pbnegate; 93 | CWispButton *pbmod; 94 | CWispButton *pbpower; 95 | CWispButton *pbF; 96 | 97 | _DefStruct kcalcdefaults; 98 | bool inverse; 99 | bool refresh_display; 100 | int display_size; 101 | int m_NumberBitWdith; 102 | int input_limit; 103 | int input_count; 104 | int decimal_point; 105 | int precedence_base; 106 | _num_base current_base; 107 | long long memory_num; 108 | _last_input_type last_input; 109 | char display_str[66]; 110 | 111 | TList history_list; 112 | int history_index; 113 | bool key_pressed; 114 | int mInternalSpacing; 115 | 116 | CWispCalcWnd(); 117 | virtual ~CWispCalcWnd(); 118 | 119 | bool Create(int x, int y, CWispBaseWnd *parent, unsigned int CmdID); 120 | 121 | virtual bool MsgProc(WISP_MSG *pMsg) override; 122 | 123 | bool OnCreate(WISP_MSG *pMsg); 124 | bool OnDestroy(WISP_MSG *pMsg); 125 | bool OnKeyEvent(WISP_MSG *pMsg); 126 | bool OnKeyDown(WISP_MSG *pMsg); 127 | bool OnKeyUp(WISP_MSG *pMsg); 128 | bool OnCommand(WISP_MSG *pMsg); 129 | bool OnUpdateClient(WISP_MSG *pMsg); 130 | 131 | void Create(); 132 | 133 | void UpdateDisplay(); 134 | 135 | void angle_selected(int number); 136 | void Qword_Selected(); 137 | void Dword_Selected(); 138 | void Word_Selected(); 139 | void Byte_Selected(); 140 | 141 | void Hex_Selected(); 142 | void Dec_Selected(); 143 | void Oct_Selected(); 144 | void Bin_Selected(); 145 | 146 | void history_next(); 147 | void history_prev(); 148 | 149 | void Base_Selected(int number); 150 | void base_selected(int number); 151 | }; 152 | 153 | #endif 154 | -------------------------------------------------------------------------------- /source/Code/pagemem.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _PAGEMEM_HPP_ 3 | #define _PAGEMEM_HPP_ 4 | 5 | #include "define.h" 6 | #include "alt/altmap.hpp" 7 | #include "pageimage.hpp" 8 | 9 | #define PAGE_SIZE 4096 10 | 11 | //for CPolyFS 12 | 13 | struct MEMORY_PAGE 14 | { 15 | unsigned char *PhysAddr; 16 | unsigned long Attribute; 17 | unsigned long AccessReadCount; 18 | unsigned long AccessWriteCount; 19 | unsigned long AccessExecuteCount; 20 | unsigned long AccessLoaderWriteCount; 21 | unsigned long PageData; 22 | }; 23 | 24 | struct MEMORY_PAGE_CACHE 25 | { 26 | MEMORY_PAGE *MemoryPage; 27 | unsigned long BaseAddr; 28 | unsigned long AccessCount; 29 | bool bExist; 30 | }; 31 | 32 | struct CPageMemory 33 | { 34 | public: 35 | CPageMemory(); 36 | virtual ~CPageMemory(); 37 | 38 | MEMORY_PAGE_CACHE m_PageDataCache1; 39 | MEMORY_PAGE_CACHE m_PageDataCache2; 40 | int m_PageUsedCount; 41 | int m_PageCount; 42 | unsigned char *m_PhysMemory; 43 | unsigned char *m_PageExistMap; 44 | MEMORY_PAGE *m_PageDir[1024]; 45 | int m_WriteAccessPageCount; 46 | int m_FreePhysIndex; 47 | unsigned long m_Style; 48 | map m_ImageList; 49 | 50 | virtual bool Init(int PageCount, unsigned long Style); 51 | virtual void Release(); 52 | virtual void RefreshCache(MEMORY_PAGE *pPage); 53 | virtual bool LoadPage(unsigned long Address, MEMORY_PAGE *pPage); 54 | virtual bool SavePage(unsigned long Address, MEMORY_PAGE *pPage); 55 | virtual bool ExchangePage(); 56 | virtual int FlushAllPage(); 57 | virtual bool MapImage(CPageImage *pImageFile); 58 | virtual bool UnmapImage(CPageImage *pImageFile); 59 | 60 | MEMORY_PAGE *GetDataPage(unsigned long Address, bool bWrite); 61 | 62 | CPageImage *GetImage(unsigned long Address); 63 | CPageImage *GetImage(const char *FileName); 64 | bool AllocatePage(unsigned long Address, unsigned long Attr, void *Buffer, unsigned long Size); 65 | bool AllocatePage(unsigned long Address, unsigned long Attr, unsigned char Data); 66 | bool ReleasePage(unsigned long Address); 67 | unsigned long ReleaseClearPage(); 68 | bool IsPageExist(unsigned long Address); 69 | bool IsPageDirExist(unsigned long Address); 70 | 71 | static unsigned long ReadMemory(unsigned long Address, void *Buffer, unsigned long Size, CPageMemory *pPageMemory); 72 | static unsigned long WriteMemory(unsigned long Address, const void *Buffer, unsigned long Size, CPageMemory *pPageMemory); 73 | 74 | unsigned long ReadString(unsigned long Address, char *Buffer, unsigned long Size); 75 | unsigned long WriteString(unsigned long Address, const char *Buffer, unsigned long Size); 76 | 77 | unsigned long ReadString(unsigned long Address, unsigned short *Buffer, unsigned long Size); 78 | unsigned long WriteString(unsigned long Address, const unsigned short *Buffer, unsigned long Size); 79 | 80 | unsigned long ReadString(unsigned long Address, unsigned long *Buffer, unsigned long Size); 81 | unsigned long WriteString(unsigned long Address, const unsigned long *Buffer, unsigned long Size); 82 | 83 | 84 | unsigned long ReadMemX(unsigned long Address, void *Buffer, unsigned long Size); 85 | unsigned long WriteMemX(unsigned long Address, const void *Buffer, unsigned long Size); 86 | unsigned long ZeroMemX(unsigned long Fill, unsigned long size); 87 | 88 | bool ReadMemB(unsigned long Address, void *Buffer); 89 | bool ReadMemW(unsigned long Address, void *Buffer); 90 | bool ReadMemD(unsigned long Address, void *Buffer); 91 | 92 | bool WriteMemB(unsigned long Address, const void *Buffer); 93 | bool WriteMemW(unsigned long Address, const void *Buffer); 94 | bool WriteMemD(unsigned long Address, const void *Buffer); 95 | 96 | bool NewPage(MEMORY_PAGE *pPage); 97 | bool DeletePage(MEMORY_PAGE *pPage); 98 | }; 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /source/WispSyser/multidataview.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "multidataview.hpp" 5 | #include "../Wisp/wispsplitwnd.hpp" 6 | #include "resource.hpp" 7 | 8 | WISP_MSG_MAP_BEGIN(CMultiDataView) 9 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 10 | WISP_MSG_MAP(WISP_WM_COMMAND, CWispWnd::OnCommand) 11 | // WISP_MSG_MAP_ON_COMMAND 12 | WISP_MSG_MAP_ON_EVENT 13 | WISP_MSG_MAP_END(CWispMultiTabView) 14 | 15 | 16 | WISP_EVENT_MAP_BEGIN(CMultiDataView) 17 | WISP_EVENT_MAP(0x40000000, OnEventFullScr) 18 | WISP_EVENT_MAP(0x40000001, OnEventNewView) 19 | // WISP_EVENT_MAP(0x40000002, OnEventRemoveView) 20 | WISP_EVENT_MAP_END 21 | 22 | // WISP_COMMAND_MAP_BEGIN(CMultiDataView) 23 | // case default: return CWispWnd::OnCommand(pMsg); 24 | // WISP_COMMAND_MAP_END 25 | 26 | CMultiDataView::CMultiDataView() 27 | { 28 | } 29 | 30 | CMultiDataView::~CMultiDataView() 31 | { 32 | } 33 | 34 | bool CMultiDataView::OnCreate(WISP_MSG *pMsg) 35 | { 36 | InsertView(0); 37 | return true; 38 | } 39 | 40 | bool CMultiDataView::OnEventFullScr(WISP_MSG *pMsg) 41 | { 42 | if (m_WindowRect.cy <= static_cast(m_ParentWnd)->m_WindowRect.cy - 20) 43 | static_cast(m_ParentWnd)->AdjustWnd(0); 44 | else 45 | gpSyser->m_MainFrame.m_SystemExplorer.AdjustSplit(); 46 | return true; 47 | } 48 | 49 | bool CMultiDataView::OnEventNewView(WISP_MSG *pMsg) 50 | { 51 | if (pMsg->Command.CmdMsg == 0x80000002) 52 | { 53 | InsertView((CDataView *)GetActiveWnd()); 54 | } 55 | return true; 56 | } 57 | 58 | CDataView *CMultiDataView::InsertView(CDataView *pSrcView) 59 | { 60 | if (m_WndList.Size() >= 9) return nullptr; 61 | CDataView *pNewView = new CDataView; 62 | WISP_RECT Rect; 63 | Rect.x = 0; 64 | Rect.y = 0; 65 | Rect.cx = 0; 66 | Rect.cy = 0; 67 | pNewView->CreateWnd(0, Rect, this, m_WndList.Size() + CMD_ID_DV0, 0, WISP_SH_MINSIZE); 68 | pNewView->m_AdvStyle |= 1; 69 | InsertWnd(WSTR("" UNREADSTR ""), pNewView, gpCurWisp->m_DIBLib.LoadDIBList("\\Toolbar.bmp", 16, 16, 0, 0xFF00FF)->GetDIB(0x7F)); 70 | SetActiveWnd(m_WndList.Size() - 1); 71 | SetActiveAddress(pSrcView ? pSrcView->m_CurAddr:0, 0); 72 | if (pSrcView) 73 | pNewView->m_ShowLength = pSrcView->m_ShowLength; 74 | return pNewView; 75 | } 76 | 77 | void CMultiDataView::UpdateContext() 78 | { 79 | TListIter It = m_WndList.Begin(); 80 | while (It != m_WndList.End()) 81 | { 82 | It->pWnd->Update((WISP_RECT*)0); 83 | ++It; 84 | } 85 | } 86 | 87 | void CMultiDataView::DataWidthUpdate() 88 | { 89 | TListIter It = m_WndList.Begin(); 90 | while (It != m_WndList.End()) 91 | { 92 | static_cast(It->pWnd)->DataWidthUpdate(); 93 | ++It; 94 | } 95 | } 96 | 97 | void CMultiDataView::ResetContext() 98 | { 99 | RemoveAllTab(true); 100 | InsertView(0); 101 | } 102 | 103 | int CMultiDataView::GetActiveDataWidth() 104 | { 105 | CDataView *pWnd = (CDataView *)GetActiveWnd(); 106 | if (pWnd) return pWnd->GetDataWidth(); 107 | return 1; 108 | } 109 | 110 | void CMultiDataView::SetActiveDataWidth(int Width) 111 | { 112 | CDataView *pWnd = (CDataView *)GetActiveWnd(); 113 | if (pWnd) pWnd->SetDataWidth(Width); 114 | } 115 | 116 | ULONG_PTR CMultiDataView::GetActiveAddress() 117 | { 118 | CDataView *pWnd = (CDataView *)GetActiveWnd(); 119 | if (pWnd) return pWnd->m_CurAddr; 120 | return 0; 121 | } 122 | void CMultiDataView::SetActiveAddress(ULONG_PTR Address, const WCHAR *pStrAddress) 123 | { 124 | CDataView *pWnd = (CDataView *)GetActiveWnd(); 125 | if (pWnd) 126 | { 127 | pWnd->ViewAddress(Address, true); 128 | if (pStrAddress) 129 | pWnd->SetFloatAddress(pStrAddress); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /source/WispSyser/mainframe.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MAINFRAME_HPP_ 3 | #define _MAINFRAME_HPP_ 4 | 5 | #include "../Code/define.h" 6 | #include "../Wisp/wispwnd.hpp" 7 | #include "../Wisp/wispstatic.hpp" 8 | #include "../Wisp/wisptabwnd.hpp" 9 | #include "../Wisp/wispsoftkeyboard.hpp" 10 | #include "../Wisp/wispcalcwnd.hpp" 11 | #include "../Wisp/wispprogressform.hpp" 12 | 13 | #include "systemexplorer.hpp" 14 | #include "consolewnd.hpp" 15 | #include "genereglist.hpp" 16 | #include "dataviewform.hpp" 17 | #include "debuggerselectform.hpp" 18 | #include "pluginlistform.hpp" 19 | #include "breakpointform.hpp" 20 | #include "processlist.hpp" 21 | #include "peexplorerform.hpp" 22 | #include "sourcedebugframewnd.hpp" 23 | #include "runtracewnd.hpp" 24 | #include "callstackwnd.hpp" 25 | #include "dataoperatordlg.hpp" 26 | #include "keymappingpage.hpp" 27 | #include "modulelist.hpp" 28 | #include "crossreferenceform.hpp" 29 | #include "commentlist.hpp" 30 | #include "pagemapwnd.hpp" 31 | #include "reghelpwnd.hpp" 32 | #include "idtwnd.hpp" 33 | #include "gdtwnd.hpp" 34 | #include "findstringform.hpp" 35 | #include "findlistwnd.hpp" 36 | 37 | #define CV_TAB 0 38 | #define TERM_TAB 1 39 | #define SRC_TAB 2 40 | 41 | struct CMainFrame : public CWispWnd 42 | { 43 | //Register View 44 | CWispTabWnd m_CPUTabWnd; 45 | CGeneRegList *m_pGeneRegList; 46 | CDataViewForm m_DataViewForm; 47 | CSystemExplorer m_SystemExplorer; 48 | CConsoleWnd m_ConsoleWnd; 49 | CSourceDebugFrameWnd m_SourceDebugFrameWnd; 50 | CWispTabWnd m_MainTabWnd; //TAB 51 | CWispProgressForm m_ProgressForm; 52 | CDebuggerSelectForm m_DebuggerSelectForm; 53 | CPluginListForm m_PluginListForm; 54 | CKeyMappingPage m_KeyMappingPage; 55 | CWispSoftKeyboard m_SoftKeyboard; 56 | CBreakPointForm m_BreakPointForm; 57 | CPageMapWnd m_PageMapWnd; 58 | CX86RegHelpTabWnd m_X86RegHelpTabWnd; 59 | CWispCalcWnd m_CalcWnd; 60 | //CObjectDirectoryWnd m_ObjectDirectoryWnd; 61 | CDataOperatorDlg m_DataOperatorDlg; 62 | CCrossReferenceForm m_CrossReferenceForm; 63 | CCommentList m_CommentList; 64 | CCallStackWnd m_CallStackWnd; 65 | CRunTraceWnd m_RunTraceWnd; 66 | CModuleListWnd m_ModuleListWnd; 67 | //CHwndListWnd m_HwndListWnd; 68 | //CHwndPropertyForm m_HwndPropertyForm; 69 | CProcessList m_ProcessList; 70 | CIDTWnd m_IDTWnd; 71 | CGDTWnd m_GDTWnd; 72 | CWispStaticStr m_StaticText; 73 | CStringReferenceList m_StringReferenceList; 74 | CFindListWnd m_FindListWnd; 75 | CPEExplorerForm m_PEExplorerForm; 76 | //CIBMAsciiWnd m_IBMAsciiWnd; 77 | //CIBMAsciiWnd m_EBCDICWnd; 78 | //CIBMAsciiWnd m_ANSIAsciiWnd; 79 | 80 | CMainFrame(); 81 | virtual ~CMainFrame(); 82 | 83 | virtual bool MsgProc(WISP_MSG *pMsg) override; 84 | 85 | bool OnCreate(WISP_MSG *pMsg); 86 | bool OnDestroy(WISP_MSG *pMsg); 87 | bool OnUpdate(WISP_MSG *pMsg); 88 | bool OnClose(WISP_MSG *pMsg); 89 | bool OnSize(WISP_MSG *pMsg); 90 | bool OnBeginMove(WISP_MSG *pMsg); 91 | bool OnEndMove(WISP_MSG *pMsg); 92 | bool OnEvent(WISP_MSG *pMsg); 93 | bool Move(); 94 | bool OnKeyEvent(WISP_MSG *pMsg); 95 | 96 | bool OnDebuggerPlunge(WISP_MSG *pMsg); //30 97 | bool OnDebuggerClose(WISP_MSG *pMsg); //31 98 | void FocusActive(); 99 | 100 | bool OnEventDbgStep(WISP_MSG *pMsg); 101 | bool OnEventDbgProceed(WISP_MSG *pMsg); 102 | bool OnEventStepBranch(WISP_MSG *pMsg); 103 | bool OnEventDbgReturn(WISP_MSG *pMsg); 104 | bool OnEventDbgContinue(WISP_MSG *pMsg); 105 | bool OnEventBreakPointForm(WISP_MSG *pMsg); 106 | bool OnEventCallStack(WISP_MSG *pMsg); 107 | bool OnEventRegView(WISP_MSG *pMsg); 108 | bool OnEventDataViewForm(WISP_MSG *pMsg); 109 | 110 | void CreateProgress(const WCHAR *Text, unsigned long MaxPos); 111 | void UpdateProgress(unsigned long Pos); 112 | void UpdateCaption(const WCHAR *Text); 113 | void DestroyProgress(); 114 | }; 115 | 116 | #endif -------------------------------------------------------------------------------- /source/WispSyser/pagemapwnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Code/fileiont.hpp" 3 | #include "pagemapwnd.hpp" 4 | 5 | WISP_MSG_MAP_BEGIN(CPageMapWnd) 6 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 7 | WISP_MSG_MAP(WISP_WM_DESTROY, OnDestroy) 8 | WISP_MSG_MAP(WISP_WM_CLOSE, OnClose) 9 | WISP_MSG_MAP_ON_COMMAND 10 | WISP_MSG_MAP_END(CWispSplitWnd) 11 | 12 | 13 | // WISP_COMMAND_MAP_BEGIN(CPageMapWnd) 14 | // case default: return CWispWnd::OnCommand(pMsg); 15 | // WISP_COMMAND_MAP_END 16 | 17 | CPageMapWnd::CPageMapWnd() 18 | { 19 | _field_260 = 0; 20 | #if 0 21 | m_PageTableBaseAddress = 0xC0000000;// PAGE_TABLE 22 | if (GETX86CR4(-1) & 0x20) 23 | m_PageDirectBaseAddress = 0xC0600000;// PAGE_DIR_PAE 24 | else m_PageDirectBaseAddress = 0xC0300000;// PAGE_DIR 25 | #else 26 | m_PageTableBaseAddress = 0; 27 | m_PageDirectBaseAddress = 0; 28 | #endif 29 | } 30 | CPageMapWnd::~CPageMapWnd() 31 | { 32 | } 33 | 34 | bool CPageMapWnd::OnCreate(WISP_MSG *pMsg) 35 | { 36 | WISP_RECT Rect; 37 | 38 | Rect.x = 0; 39 | Rect.y = 0; 40 | Rect.cx = m_ClientRect.cx / 2; 41 | Rect.cy = m_ClientRect.cy; 42 | 43 | m_PageDirectList.CreateWnd(0, Rect, this, 1, 0x10000, WISP_SH_MINSIZE); 44 | m_PageDirectList.InsertColumn(WSTR("Page Table Physical Address"), 68, 0, 0, -1); 45 | m_PageDirectList.InsertColumn(WSTR("Lines Address"), 120, 0, 0, -1); 46 | m_PageDirectList.InsertColumn(WSTR("Attribute"), 120, 0, 0, -1); 47 | m_PageDirectList.InsertColumn(WSTR(""), 80, 0, 0, -1); 48 | 49 | Rect.x = m_ClientRect.cx / 2; 50 | Rect.y = 0; 51 | Rect.cx = Rect.x; 52 | Rect.cy = m_ClientRect.cy; 53 | 54 | m_PageTableList.CreateWnd(0, Rect, this, 2, 0x10000, WISP_SH_MINSIZE); 55 | m_PageTableList.InsertColumn(WSTR("Lines Address"), 120, 0, 0, -1); 56 | m_PageTableList.InsertColumn(WSTR("Physical"), 80, 0, 0, -1); 57 | m_PageTableList.InsertColumn(WSTR("Attribute"), 120, 0, 0, -1); 58 | m_PageTableList.InsertColumn(WSTR(""), 80, 0, 0, -1); 59 | 60 | InsertWnd(&m_PageDirectList, 0, 100, -1); 61 | InsertWnd(&m_PageTableList, 0, 100, -1); 62 | 63 | AdjustWndPos(); 64 | 65 | #ifndef _RING0_ 66 | CLocalFileIO File; 67 | HANDLE Handle; 68 | if (!File.OpenFile("PageTable.bin", &Handle, 0x10000)) 69 | { 70 | m_PageTableBaseAddress = 0; 71 | m_PageDirectBaseAddress = 0; 72 | return true; 73 | } 74 | unsigned long len = File.GetFileLength(Handle); 75 | char *ptr = new char[len]; 76 | m_PageTableBaseAddress = (unsigned long*)ptr; 77 | File.ReadFile(Handle, ptr, len); 78 | m_PageDirectBaseAddress = (unsigned long*)(ptr + 0x300000); 79 | File.CloseHandle(Handle); 80 | #endif 81 | 82 | InitContext(); 83 | return true; 84 | } 85 | 86 | bool CPageMapWnd::OnDestroy(WISP_MSG *pMsg) 87 | { 88 | #ifndef _RING0_ 89 | delete []m_PageTableBaseAddress; 90 | #endif 91 | return true; 92 | } 93 | 94 | bool CPageMapWnd::OnCommand(WISP_MSG *pMsg) 95 | { 96 | if (pMsg->Command.CtrlType == 11 && //WISP_CTRL_LIST 97 | pMsg->Command.CmdMsg == 0x80000105 && //WISP_WM_UPDATE_HORZ_SCROLL_BAR 98 | pMsg->Command.CmdID == 1) 99 | { 100 | m_PageTableList.DeleteAllChildrenItems(nullptr); 101 | if (m_PageTableBaseAddress) 102 | InsertPageTableList(pMsg); 103 | } 104 | return true; 105 | } 106 | 107 | bool CPageMapWnd::InsertPageTableList(WISP_MSG *pMsg) 108 | { 109 | //TODO 110 | return true; 111 | } 112 | 113 | void CPageMapWnd::Create() 114 | { 115 | if (IsWindow()) 116 | { 117 | Destroy(); 118 | } else 119 | { 120 | WISP_RECT Rect; 121 | Rect.x = 0; 122 | Rect.y = 0; 123 | Rect.cx = 400; 124 | Rect.cy = 300; 125 | CreateWnd(WSTR("Page Map"), Rect, 0, 0, 0x200BB, WISP_SH_MINSIZE); 126 | Center(nullptr); 127 | } 128 | } 129 | 130 | void CPageMapWnd::InitContext() 131 | { 132 | //TODO 133 | } 134 | -------------------------------------------------------------------------------- /source/WispSyser/consolewnd.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "../Wisp/wispbase.hpp" 3 | #include "SyserRing3.hpp" 4 | #include "consolewnd.hpp" 5 | #include "../Code/sysdep.hpp" 6 | #include "syserconfig.hpp" 7 | #include "syserdefine.hpp" 8 | 9 | CConsoleWnd::CConsoleWnd() 10 | { 11 | m_StartCmd = 0; 12 | } 13 | CConsoleWnd::~CConsoleWnd() 14 | { 15 | } 16 | 17 | WISP_MSG_MAP_BEGIN(CConsoleWnd) 18 | WISP_MSG_MAP(WISP_WM_CREATE, OnCreate) 19 | WISP_MSG_MAP(WISP_WM_KEY_EVENT, OnKeyEvent) 20 | WISP_MSG_MAP_END(CWispConsoleWnd) 21 | 22 | SETOPTION SetEnv[] = 23 | { 24 | {WSTR("iFollowMode"), 2, &gSyserConfig.iFollowMode, 0}, 25 | {WSTR("iShowStartSplash"), 2, &gSyserConfig.iShowStartSplash, 0}, 26 | {WSTR("iShowFullSym"), 2, &gSyserConfig.iShowFullSym, 0}, 27 | {WSTR("iShowCCByte"), 2, &gSyserConfig.iShowCCByte, 0}, 28 | {WSTR("iMouseSensitivity"), 2, &gSyserConfig.iMouseSensitivity, 0}, 29 | {WSTR("iSourceCodeShowTips"), 2, &gSyserConfig.iSourceCodeShowTips, 0}, 30 | {WSTR("iSourceCodeSyntaxColors"), 2, &gSyserConfig.iSourceCodeSyntaxColors, 0}, 31 | {WSTR("iSourceCodeShowLineNumbers"), 2, &gSyserConfig.iSourceCodeShowLineNumbers, 0}, 32 | {WSTR("iConnectType"), 2, &gSyserConfig.iConnectType, 0}, 33 | {WSTR("iComPort"), 2, &gSyserConfig.iComPort, 0}, 34 | {WSTR("iHardTimerEnable"), 2, &gSyserConfig.iHardTimerEnable, 0}, 35 | {WSTR("szDebuggerFileName"), 1, gSyserConfig.szDebuggerFileName, MAX_FN_LEN}, 36 | {0} 37 | }; 38 | 39 | bool CConsoleWnd::OnCreate(WISP_MSG *pMsg) 40 | { 41 | for (int i = 0; SysCmdTable[i].CmdStr; ++i) 42 | { 43 | CCmdParser::InsertCmd(SysCmdTable[i].CmdStr, 44 | (CMDPROC)SysCmdTable[i].CmdProc, gpSyser, 45 | SysCmdTable[i].CmdCmt, 46 | SysCmdTable[i].CmdUsage); 47 | } 48 | 49 | for (int i = 0; ShareCmdTable[i].CmdStr; ++i) 50 | { 51 | CCmdParser::InsertCmd(ShareCmdTable[i].CmdStr, 52 | (CMDPROC)ShareCmdTable[i].CmdProc, gpSyser, 53 | ShareCmdTable[i].CmdCmt, 54 | ShareCmdTable[i].CmdUsage); 55 | } 56 | 57 | for (int i = 0; OtherCmdTable[i].CmdStr; ++i) 58 | { 59 | CCmdParser::InsertCmd(OtherCmdTable[i].CmdStr, 60 | (CMDPROC)OtherCmdTable[i].CmdProc, gpSyser, 61 | OtherCmdTable[i].CmdCmt, 62 | OtherCmdTable[i].CmdUsage); 63 | } 64 | 65 | m_Options.Parse(SetEnv); 66 | SetHistoryLines(gSyserConfig.iHistoryLines); 67 | return true; 68 | } 69 | 70 | bool CConsoleWnd::OnKeyEvent(WISP_MSG *pMsg) 71 | { 72 | if (pMsg->KeyEvent.KeyType == VK_TAB && pMsg->KeyEvent.bKeyDown) 73 | { 74 | const WCHAR *pStr = TStrRChr(m_InputStr.operator const WCHAR*(), 0x20); 75 | if (pStr && TStrLen(pStr)>2) 76 | { 77 | char szStr[64]; 78 | int Len = TStrCpy(szStr, pStr+1); 79 | if (gpSyser->m_SyserUI.GetModuleName(szStr) > Len) 80 | { 81 | m_InputStr.SetAt(PTR_DELTA(pStr,m_InputStr.m_pData)/2+1, 0); 82 | WCHAR szuStr[64]; 83 | AnsiToUnicode(szStr, szuStr, lenof(szuStr)); 84 | m_InputStr += szuStr; 85 | m_CaretPos.x = m_InputStr.m_nLength; 86 | } 87 | } 88 | } 89 | return true; 90 | } 91 | 92 | void CConsoleWnd::OnBeginCmd(const WCHAR *szCmd) 93 | { 94 | m_StartCmd = 1; 95 | } 96 | 97 | //virtual void OnCmd(const WCHAR *szCmd) 98 | 99 | void CConsoleWnd::OnEndCmd(const WCHAR *szCmd) 100 | { 101 | m_StartCmd = 0; 102 | } 103 | 104 | bool CConsoleWnd::Run(const char *szFile, const char *szParam, unsigned long *pResult) 105 | { 106 | WCHAR uCmd[MAX_FN_LEN]; 107 | char szCmd[MAX_FN_LEN]; 108 | 109 | int Lenght = TStrCpy(szCmd, "bat "); 110 | char *pStr = &szCmd[Lenght]; 111 | if (szParam) 112 | { 113 | pStr += TStrCpy(&szCmd[Lenght], szParam); 114 | pStr += TStrCpy(pStr, " "); 115 | } 116 | pStr += GetModulePath(pStr, true); 117 | TStrCpy(pStr, szFile); 118 | 119 | AnsiToUnicode(szCmd, uCmd, lenof(uCmd)); //??? Rtl 120 | return m_pConsoleWnd->CCmdParser::ParseCmd(uCmd, pResult); 121 | } 122 | --------------------------------------------------------------------------------