Skip to content

Commit

Permalink
add handle int 3
Browse files Browse the repository at this point in the history
fix mouse scroll
fix memory leak PEFile read import
  • Loading branch information
unknown authored and yutewiyof committed Jul 5, 2019
0 parents commit 2993019
Show file tree
Hide file tree
Showing 17 changed files with 243 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Plugin example/api.cpp
@@ -0,0 +1,43 @@

#ifndef _PLUGIN_HPP_
#define _PLUGIN_HPP_

#include <windows.h>

#define WSTR(x) L##x

typedef int (*FPCmd)(int argc, const wchar_t *argv[], const wchar_t *szCommandLine, void *pUserData);

typedef void (*PVFV)();

struct SYSER_PLUGIN_MODULE
{
wchar_t PluginInfo[32];
PVFV fpOnDebuggerOpen;
PVFV fpOnDebuggerClose;
PVFV fpOnDebuggerPlunge;
};

struct CSyserUI
{
virtual bool RegisterPluginModule(const wchar_t *ModuleName, SYSER_PLUGIN_MODULE *pPluginModule);
virtual bool UnregisterPluginModule(const wchar_t *ModuleName);
virtual int GetInstrLen(unsigned long Address);
virtual bool CalcExp(const wchar_t *szExp, unsigned long *pResult);
virtual bool InsertCmd(const wchar_t *szCmd, FPCmd pCmdProc, void *pUserData, const wchar_t *pComment, const wchar_t *pUsage);
virtual void RemoveCmd(const wchar_t *szCmd);
virtual int RunCmd(const wchar_t *szCmd);
virtual void Outputf(const wchar_t *szMsg, ...);
virtual void Output(const unsigned long *szMsg);
virtual void *InsertMenu(void *hParentMenu, const wchar_t *szMenuName, void *fpMenuProc);
virtual bool RemoveMenu(void *hMenu);
virtual bool EnableMenu(void *hMenu, bool bEnable);
virtual void *GetMainTabWnd();
virtual void *GetMainMenu();
virtual void *GetWisp();
virtual unsigned long WriteMemory(unsigned long Address, void *Buffer, unsigned long Size);
virtual unsigned long ReadMemory(unsigned long Address, void *Buffer, unsigned long Size);
};

extern "C" __declspec(dllimport) CSyserUI *gpSyserPluginUI;
#endif
67 changes: 67 additions & 0 deletions Plugin example/plugin.cpp
@@ -0,0 +1,67 @@

#include "plugin.hpp"

void OnDebuggerOpen()
{
//Syser Loaded Notify
//::DbgPrint("SPCommand : OnDebuggerOpen\n");
}

void OnDebuggerClose()
{
//Syser Unload Notify
//::DbgPrint("SPCommand : OnDebuggerClose\n");
}

void OnDebuggerPlunge()
{
//Syser
//::DbgPrint("SPCommand : OnDebuggerPlunge\n");
}

SYSER_PLUGIN_MODULE PluginModule =
{
L"Syser Command Plugin Module",
OnDebuggerOpen,
OnDebuggerClose,
OnDebuggerPlunge,
};

int syser_calc(int argc, const wchar_t *argv[], const wchar_t *szCommandLine, void *pUserData)
{
DWORD dwValue;
if(argc>=2)
{
if(gpSyserPluginUI->CalcExp(argv[1], &dwValue))
{
gpSyserPluginUI->Outputf(WSTR("%s = %08x\n"), argv[1], dwValue);
}
}
gpSyserPluginUI->Outputf(WSTR("hello world!\n"));
return 0;
}

BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
if(!gpSyserPluginUI->RegisterPluginModule(WSTR("SPCommand"), &PluginModule))
return FALSE;
gpSyserPluginUI->InsertCmd(WSTR("calc"), syser_calc, NULL, WSTR("calc expression value."), WSTR("calc [parameter]"));
//::DbgPrint("SPCommand : DllAttach\n");
break;
case DLL_PROCESS_DETACH:
gpSyserPluginUI->RemoveCmd(WSTR("calc"));
gpSyserPluginUI->UnregisterPluginModule(WSTR("SPCommand"));
//::DbgPrint("SPCommand : DllDetach\n");
break;

case DLL_THREAD_ATTACH:
break;

case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
4 changes: 4 additions & 0 deletions changelog
@@ -0,0 +1,4 @@
1607 210517
- add handle int 3
- fix mouse scroll
- fix memory leak PEFile read import
Binary file added images/SyserDebuggerx32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/SyserDebuggerx64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions readme
@@ -0,0 +1,18 @@

reverse engineering old syser win32 debugger into beautiful C++ code
improve handle x64 arch

<img width="40%" src="https://raw.githubusercontent.com/marakew/syser/master/images/SyserDebuggerx32.png">
<img width="40%" src="https://raw.githubusercontent.com/marakew/syser/master/images/SyserDebuggerx64.png">

## links
https://exelab.ru/f/index.php?action=vthread&forum=3&topic=24745 release
https://exelab.ru/f/index.php?action=vthread&forum=7&topic=24494 research
https://www.reddit.com/r/ReverseEngineering/comments/6dh7ip/resorect_one_more_old_debugger_syser_debugger_by/
http://forum.exetools.com/showthread.php?t=18259

http://www.aoreteam.com/vb/showthread.php?t=12414
http://crack-tool.at.ua/forum/19-60-1#63
https://pediy.com/thread-218452.htm
https://bbs.pediy.com/thread-217773.htm
https://twitter.com/painter701/status/867904049441525760
Binary file added wisp/x32/APIDef.lib
Binary file not shown.
43 changes: 43 additions & 0 deletions wisp/x32/Plugin/plugin.hpp
@@ -0,0 +1,43 @@

#ifndef _PLUGIN_HPP_
#define _PLUGIN_HPP_

#include <windows.h>

#define WSTR(x) L##x

typedef int (*FPCmd)(int argc, const wchar_t *argv[], const wchar_t *szCommandLine, void *pUserData);

typedef void (*PVFV)();

struct SYSER_PLUGIN_MODULE
{
wchar_t PluginInfo[32];
PVFV fpOnDebuggerOpen;
PVFV fpOnDebuggerClose;
PVFV fpOnDebuggerPlunge;
};

struct CSyserUI
{
virtual bool RegisterPluginModule(const wchar_t *ModuleName, SYSER_PLUGIN_MODULE *pPluginModule);
virtual bool UnregisterPluginModule(const wchar_t *ModuleName);
virtual int GetInstrLen(unsigned long Address);
virtual bool CalcExp(const wchar_t *szExp, unsigned long *pResult);
virtual bool InsertCmd(const wchar_t *szCmd, FPCmd pCmdProc, void *pUserData, const wchar_t *pComment, const wchar_t *pUsage);
virtual void RemoveCmd(const wchar_t *szCmd);
virtual int RunCmd(const wchar_t *szCmd);
virtual void Outputf(const wchar_t *szMsg, ...);
virtual void Output(const unsigned long *szMsg);
virtual void *InsertMenu(void *hParentMenu, const wchar_t *szMenuName, void *fpMenuProc);
virtual bool RemoveMenu(void *hMenu);
virtual bool EnableMenu(void *hMenu, bool bEnable);
virtual void *GetMainTabWnd();
virtual void *GetMainMenu();
virtual void *GetWisp();
virtual unsigned long WriteMemory(unsigned long Address, void *Buffer, unsigned long Size);
virtual unsigned long ReadMemory(unsigned long Address, void *Buffer, unsigned long Size);
};

extern "C" __declspec(dllimport) CSyserUI *gpSyserPluginUI;
#endif
68 changes: 68 additions & 0 deletions wisp/x32/Plugin/spcommand.cpp
@@ -0,0 +1,68 @@

#include "plugin.hpp"

void OnDebuggerOpen()
{
//Syser Loaded Notify
//::DbgPrint("SPCommand : OnDebuggerOpen\n");
}

void OnDebuggerClose()
{
//Syser Unload Notify
//::DbgPrint("SPCommand : OnDebuggerClose\n");
}

void OnDebuggerPlunge()
{
//Syser
//::DbgPrint("SPCommand : OnDebuggerPlunge\n");
}

SYSER_PLUGIN_MODULE PluginModule =
{
L"Syser Command Plugin Module",
OnDebuggerOpen,
OnDebuggerClose,
OnDebuggerPlunge,
};

int syser_calc(int argc, const wchar_t *argv[], const wchar_t *szCommandLine, void *pUserData)
{
DWORD dwValue;
if(argc>=2)
{
if(gpSyserPluginUI->CalcExp(argv[1], &dwValue))
{
gpSyserPluginUI->Outputf(WSTR("%s = %08x\n"), argv[1], dwValue);
}
}
gpSyserPluginUI->Outputf(WSTR("hello world!\n"));
return 0;
}

BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
if(!gpSyserPluginUI->RegisterPluginModule(WSTR("SPCommand"), &PluginModule))
return FALSE;
gpSyserPluginUI->InsertCmd(WSTR("calc"), syser_calc, NULL, WSTR("calc expression value."), WSTR("calc [parameter]"));
//::DbgPrint("SPCommand : DllAttach\n");
break;
case DLL_PROCESS_DETACH:
gpSyserPluginUI->RemoveCmd(WSTR("calc"));
gpSyserPluginUI->UnregisterPluginModule(WSTR("SPCommand"));
//::DbgPrint("SPCommand : DllDetach\n");
break;

case DLL_THREAD_ATTACH:
break;

case DLL_THREAD_DETACH:
break;
}
return TRUE;
}

Binary file added wisp/x32/Plugin/spcommand.dll
Binary file not shown.
Binary file added wisp/x32/Syser.cfg
Binary file not shown.
Binary file added wisp/x32/Syser.dat
Binary file not shown.
Binary file added wisp/x32/SyserColor.cfg
Binary file not shown.
Binary file added wisp/x32/Wisp.dat
Binary file not shown.
Binary file added wisp/x32/sdwin32.dll
Binary file not shown.
Binary file added wisp/x32/syser.exe
Binary file not shown.
Binary file added wisp/x32/syser.lib
Binary file not shown.

0 comments on commit 2993019

Please sign in to comment.