Skip to content

Commit

Permalink
add support for v8.3 ida pro plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
geocine committed Feb 11, 2024
1 parent baa5c8e commit 22bc7eb
Show file tree
Hide file tree
Showing 8 changed files with 1,231 additions and 1,113 deletions.
3 changes: 2 additions & 1 deletion PluginGeneric/AttachDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "AttachDialog.h"
#include <Psapi.h>
#include <string>
#include <ScyllaHideIDAProPlugin/IdaHwndHelper.h>

#ifdef OLLY1
#include "..\ScyllaHideOlly1Plugin\resource.h"
Expand All @@ -27,7 +28,7 @@ extern HWND hwmain; // Handle of main OllyDbg window
#elif OLLY2
HWND hwmain = hwollymain;
#elif __IDP__
HWND hwmain = (HWND)callui(ui_get_hwnd).vptr;
HWND hwmain = getIdaHwnd();
#elif X64DBG
extern HWND hwndDlg;
HWND hwmain;
Expand Down
2,197 changes: 1,100 additions & 1,097 deletions PluginGeneric/OptionsDialog.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ScyllaHide.sln
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ Global
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|Win32.Build.0 = Release|Win32
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|x64.ActiveCfg = Release|Win32
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.ActiveCfg = Debug|Win32
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|Win32
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|x64
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.ActiveCfg = Release|Win32
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|Win32
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|x64
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Debug|Win32.ActiveCfg = Debug|Win32
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Debug|x64.ActiveCfg = Debug|x64
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Release|Win32.ActiveCfg = Release|Win32
Expand Down
15 changes: 15 additions & 0 deletions ScyllaHideIDAProPlugin/IdaHwndHelper.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// IdaHwndHelper.cpp

//for 64bit - p64
#pragma comment(lib, "x64_win_qt/Qt5Core.lib")
#pragma comment(lib, "x64_win_qt/Qt5Gui.lib")
#pragma comment(lib, "x64_win_qt/Qt5Widgets.lib")

#include <ScyllaHideIDAProPlugin/IdaHwndHelper.h>
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>

HWND WINAPI getIdaHwnd() {
QWidget* topWidget = QApplication::topLevelAt(QCursor::pos()); // Assuming get_current_widget() is defined elsewhere
return (HWND)topWidget->winId();
}
20 changes: 20 additions & 0 deletions ScyllaHideIDAProPlugin/IdaHwndHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

// IdaHwndHelper.h

#ifndef IDA_HWND_HELPER_H
#define IDA_HWND_HELPER_H

#include <windows.h> // Make sure to include Windows.h for HWND

#ifdef __cplusplus
extern "C" {
#endif

HWND WINAPI getIdaHwnd();

#ifdef __cplusplus
}
#endif

#endif // IDA_HWND_HELPER_H
19 changes: 10 additions & 9 deletions ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#define USE_STANDARD_FILE_FUNCTIONS
#pragma warning(disable : 4996 4512 4127 4201)


//for 64bit - p64
#ifdef BUILD_IDA_64BIT
#define __EA64__
#pragma comment(lib, "x86_win_vc_64/ida.lib")
#pragma comment(lib, "x64_win_vc_64_pro/ida.lib")
#else
//for 32bit - plw
#pragma comment(lib, "x86_win_vc_32/ida.lib")
#pragma comment(lib, "x64_win_vc_32_pro/ida.lib")
#endif

#include <Windows.h>
Expand All @@ -22,6 +21,7 @@
#include <Scylla/Version.h>
#include <Scylla/Util.h>
#include <Scylla/OsInfo.h>
#include <ScyllaHideIDAProPlugin/IdaHwndHelper.h>

#include "..\PluginGeneric\Injector.h"
#include "..\PluginGeneric\OptionsDialog.h"
Expand Down Expand Up @@ -64,14 +64,14 @@ static void AttachProcess(DWORD dwPID)
switch (res) {
case -1:
{
MessageBoxA((HWND)callui(ui_get_hwnd).vptr,
MessageBoxA(getIdaHwnd(),
"Can't attach to that process !",
"ScyllaHide Plugin", MB_OK | MB_ICONERROR);
break;
}
case -2:
{
MessageBoxA((HWND)callui(ui_get_hwnd).vptr,
MessageBoxA(getIdaHwnd(),
"Can't find that PID !",
"ScyllaHide Plugin", MB_OK | MB_ICONERROR);
break;
Expand Down Expand Up @@ -102,7 +102,7 @@ static bool SetDebugPrivileges()
}

//callback for various debug events
static int idaapi debug_mainloop(void *user_data, int notif_code, va_list va)
static ssize_t idaapi debug_mainloop(void *user_data, int notif_code, va_list va)
{
switch (notif_code)
{
Expand Down Expand Up @@ -295,13 +295,14 @@ static void idaapi IDAP_term(void)
}

//called when user clicks in plugin menu or presses hotkey
static void idaapi IDAP_run(int arg)
static bool idaapi IDAP_run(size_t arg)
{
DialogBoxW(hinst, MAKEINTRESOURCE(IDD_OPTIONS), (HWND)callui(ui_get_hwnd).vptr, &OptionsDlgProc);
DialogBoxW(hinst, MAKEINTRESOURCE(IDD_OPTIONS), getIdaHwnd(), &OptionsDlgProc);
return true;
}

//init the plugin
static int idaapi IDAP_init(void)
static plugmod_t* idaapi IDAP_init(void)
{
//ensure target is PE executable
if (inf.filetype != f_PE) return PLUGIN_SKIP;
Expand Down
80 changes: 76 additions & 4 deletions ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
Expand All @@ -18,6 +26,25 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<SpectreMitigation>false</SpectreMitigation>
<VcpkgEnabled>false</VcpkgEnabled>
<VCToolsVersion Condition="'$(USE_XP_TOOLCHAIN)'!=''">14.27.29110</VCToolsVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<SpectreMitigation>false</SpectreMitigation>
<VcpkgEnabled>false</VcpkgEnabled>
<VCToolsVersion Condition="'$(USE_XP_TOOLCHAIN)'!=''">14.27.29110</VCToolsVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
Expand All @@ -42,6 +69,16 @@
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Scylla\scylla.props" />
<Import Project="$(SolutionDir)Scylla\scylla.debug.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Scylla\scylla.props" />
<Import Project="$(SolutionDir)Scylla\scylla.release.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Scylla\scylla.props" />
Expand All @@ -53,25 +90,58 @@
<Import Project="$(SolutionDir)Scylla\scylla.release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.dll</TargetExt>
<TargetName>$(TargetName)x64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.dll</TargetExt>
<TargetName>$(TargetName)x64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.plw</TargetExt>
<TargetExt>.dll</TargetExt>
<TargetName>$(TargetName)x86</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetExt>.plw</TargetExt>
<TargetExt>.dll</TargetExt>
<TargetName>$(TargetName)x86</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN64;__X64__;_DEBUG;__VC__;_WINDOWS;__NT__;__IDP__;QT_NO_DEBUG;QT_NAMESPACE=QT;QT_NO_UNICODE_LITERAL;%(PreprocessorDefinitions);BUILD_IDA_64BIT;</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)3rdparty;$(SolutionDir)3rdparty\idasdk\include;$(QTDIR)include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN64;__X64__;NDEBUG;__VC__;_WINDOWS;__NT__;__IDP__;QT_NO_DEBUG;QT_NAMESPACE=QT;QT_NO_UNICODE_LITERAL;%(PreprocessorDefinitions);BUILD_IDA_64BIT;</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)3rdparty;$(SolutionDir)3rdparty\idasdk\include;$(QTDIR)include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;__X86__;_DEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;__X86__;NDEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -88,6 +158,7 @@
<ClCompile Include="..\PluginGeneric\Injector.cpp" />
<ClCompile Include="..\PluginGeneric\OptionsDialog.cpp" />
<ClCompile Include="..\Scylla\VersionPatch.cpp" />
<ClCompile Include="IdaHwndHelper.cpp" />
<ClCompile Include="IdaServerClient.cpp" />
<ClCompile Include="ScyllaHideIDAProPlugin.cpp" />
</ItemGroup>
Expand All @@ -102,6 +173,7 @@
<ClInclude Include="..\PluginGeneric\Injector.h" />
<ClInclude Include="..\PluginGeneric\OptionsDialog.h" />
<ClInclude Include="..\Scylla\VersionPatch.h" />
<ClInclude Include="IdaHwndHelper.h" />
<ClInclude Include="IdaServerClient.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<ClCompile Include="..\Scylla\VersionPatch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="IdaHwndHelper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ScyllaHideIDAProPlugin.rc">
Expand Down Expand Up @@ -76,6 +79,9 @@
<ClInclude Include="..\Scylla\VersionPatch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IdaHwndHelper.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\PluginGeneric\findere.bmp">
Expand Down

0 comments on commit 22bc7eb

Please sign in to comment.