Skip to content

Commit 22bc7eb

Browse files
committed
add support for v8.3 ida pro plugin
1 parent baa5c8e commit 22bc7eb

File tree

8 files changed

+1231
-1113
lines changed

8 files changed

+1231
-1113
lines changed

PluginGeneric/AttachDialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "AttachDialog.h"
22
#include <Psapi.h>
33
#include <string>
4+
#include <ScyllaHideIDAProPlugin/IdaHwndHelper.h>
45

56
#ifdef OLLY1
67
#include "..\ScyllaHideOlly1Plugin\resource.h"
@@ -27,7 +28,7 @@ extern HWND hwmain; // Handle of main OllyDbg window
2728
#elif OLLY2
2829
HWND hwmain = hwollymain;
2930
#elif __IDP__
30-
HWND hwmain = (HWND)callui(ui_get_hwnd).vptr;
31+
HWND hwmain = getIdaHwnd();
3132
#elif X64DBG
3233
extern HWND hwndDlg;
3334
HWND hwmain;

PluginGeneric/OptionsDialog.cpp

Lines changed: 1100 additions & 1097 deletions
Large diffs are not rendered by default.

ScyllaHide.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ Global
107107
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|Win32.Build.0 = Release|Win32
108108
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|x64.ActiveCfg = Release|Win32
109109
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.ActiveCfg = Debug|Win32
110-
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|Win32
110+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|x64
111111
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.ActiveCfg = Release|Win32
112-
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|Win32
112+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|x64
113113
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Debug|Win32.ActiveCfg = Debug|Win32
114114
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Debug|x64.ActiveCfg = Debug|x64
115115
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Release|Win32.ActiveCfg = Release|Win32
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// IdaHwndHelper.cpp
2+
3+
//for 64bit - p64
4+
#pragma comment(lib, "x64_win_qt/Qt5Core.lib")
5+
#pragma comment(lib, "x64_win_qt/Qt5Gui.lib")
6+
#pragma comment(lib, "x64_win_qt/Qt5Widgets.lib")
7+
8+
#include <ScyllaHideIDAProPlugin/IdaHwndHelper.h>
9+
#include <QtWidgets/QApplication>
10+
#include <QtWidgets/QWidget>
11+
12+
HWND WINAPI getIdaHwnd() {
13+
QWidget* topWidget = QApplication::topLevelAt(QCursor::pos()); // Assuming get_current_widget() is defined elsewhere
14+
return (HWND)topWidget->winId();
15+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
// IdaHwndHelper.h
4+
5+
#ifndef IDA_HWND_HELPER_H
6+
#define IDA_HWND_HELPER_H
7+
8+
#include <windows.h> // Make sure to include Windows.h for HWND
9+
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
HWND WINAPI getIdaHwnd();
15+
16+
#ifdef __cplusplus
17+
}
18+
#endif
19+
20+
#endif // IDA_HWND_HELPER_H

ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#define USE_STANDARD_FILE_FUNCTIONS
22
#pragma warning(disable : 4996 4512 4127 4201)
33

4-
54
//for 64bit - p64
65
#ifdef BUILD_IDA_64BIT
76
#define __EA64__
8-
#pragma comment(lib, "x86_win_vc_64/ida.lib")
7+
#pragma comment(lib, "x64_win_vc_64_pro/ida.lib")
98
#else
109
//for 32bit - plw
11-
#pragma comment(lib, "x86_win_vc_32/ida.lib")
10+
#pragma comment(lib, "x64_win_vc_32_pro/ida.lib")
1211
#endif
1312

1413
#include <Windows.h>
@@ -22,6 +21,7 @@
2221
#include <Scylla/Version.h>
2322
#include <Scylla/Util.h>
2423
#include <Scylla/OsInfo.h>
24+
#include <ScyllaHideIDAProPlugin/IdaHwndHelper.h>
2525

2626
#include "..\PluginGeneric\Injector.h"
2727
#include "..\PluginGeneric\OptionsDialog.h"
@@ -64,14 +64,14 @@ static void AttachProcess(DWORD dwPID)
6464
switch (res) {
6565
case -1:
6666
{
67-
MessageBoxA((HWND)callui(ui_get_hwnd).vptr,
67+
MessageBoxA(getIdaHwnd(),
6868
"Can't attach to that process !",
6969
"ScyllaHide Plugin", MB_OK | MB_ICONERROR);
7070
break;
7171
}
7272
case -2:
7373
{
74-
MessageBoxA((HWND)callui(ui_get_hwnd).vptr,
74+
MessageBoxA(getIdaHwnd(),
7575
"Can't find that PID !",
7676
"ScyllaHide Plugin", MB_OK | MB_ICONERROR);
7777
break;
@@ -102,7 +102,7 @@ static bool SetDebugPrivileges()
102102
}
103103

104104
//callback for various debug events
105-
static int idaapi debug_mainloop(void *user_data, int notif_code, va_list va)
105+
static ssize_t idaapi debug_mainloop(void *user_data, int notif_code, va_list va)
106106
{
107107
switch (notif_code)
108108
{
@@ -295,13 +295,14 @@ static void idaapi IDAP_term(void)
295295
}
296296

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

303304
//init the plugin
304-
static int idaapi IDAP_init(void)
305+
static plugmod_t* idaapi IDAP_init(void)
305306
{
306307
//ensure target is PE executable
307308
if (inf.filetype != f_PE) return PLUGIN_SKIP;

ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|x64">
5+
<Configuration>Debug</Configuration>
6+
<Platform>x64</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|x64">
9+
<Configuration>Release</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
412
<ProjectConfiguration Include="Debug|Win32">
513
<Configuration>Debug</Configuration>
614
<Platform>Win32</Platform>
@@ -18,6 +26,25 @@
1826
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1927
</PropertyGroup>
2028
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
30+
<ConfigurationType>DynamicLibrary</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<CharacterSet>Unicode</CharacterSet>
33+
<PlatformToolset>v142</PlatformToolset>
34+
<SpectreMitigation>false</SpectreMitigation>
35+
<VcpkgEnabled>false</VcpkgEnabled>
36+
<VCToolsVersion Condition="'$(USE_XP_TOOLCHAIN)'!=''">14.27.29110</VCToolsVersion>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
39+
<ConfigurationType>DynamicLibrary</ConfigurationType>
40+
<UseDebugLibraries>false</UseDebugLibraries>
41+
<WholeProgramOptimization>true</WholeProgramOptimization>
42+
<CharacterSet>Unicode</CharacterSet>
43+
<PlatformToolset>v142</PlatformToolset>
44+
<SpectreMitigation>false</SpectreMitigation>
45+
<VcpkgEnabled>false</VcpkgEnabled>
46+
<VCToolsVersion Condition="'$(USE_XP_TOOLCHAIN)'!=''">14.27.29110</VCToolsVersion>
47+
</PropertyGroup>
2148
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2249
<ConfigurationType>DynamicLibrary</ConfigurationType>
2350
<UseDebugLibraries>true</UseDebugLibraries>
@@ -42,6 +69,16 @@
4269
</ImportGroup>
4370
<ImportGroup Label="Shared">
4471
</ImportGroup>
72+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
73+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74+
<Import Project="$(SolutionDir)Scylla\scylla.props" />
75+
<Import Project="$(SolutionDir)Scylla\scylla.debug.props" />
76+
</ImportGroup>
77+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
78+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
79+
<Import Project="$(SolutionDir)Scylla\scylla.props" />
80+
<Import Project="$(SolutionDir)Scylla\scylla.release.props" />
81+
</ImportGroup>
4582
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
4683
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
4784
<Import Project="$(SolutionDir)Scylla\scylla.props" />
@@ -53,25 +90,58 @@
5390
<Import Project="$(SolutionDir)Scylla\scylla.release.props" />
5491
</ImportGroup>
5592
<PropertyGroup Label="UserMacros" />
93+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
94+
<LinkIncremental>false</LinkIncremental>
95+
<TargetExt>.dll</TargetExt>
96+
<TargetName>$(TargetName)x64</TargetName>
97+
</PropertyGroup>
98+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
99+
<LinkIncremental>false</LinkIncremental>
100+
<TargetExt>.dll</TargetExt>
101+
<TargetName>$(TargetName)x64</TargetName>
102+
</PropertyGroup>
56103
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
57104
<LinkIncremental>false</LinkIncremental>
58-
<TargetExt>.plw</TargetExt>
105+
<TargetExt>.dll</TargetExt>
106+
<TargetName>$(TargetName)x86</TargetName>
59107
</PropertyGroup>
60108
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
61109
<LinkIncremental>false</LinkIncremental>
62-
<TargetExt>.plw</TargetExt>
110+
<TargetExt>.dll</TargetExt>
111+
<TargetName>$(TargetName)x86</TargetName>
63112
</PropertyGroup>
113+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
114+
<ClCompile>
115+
<PreprocessorDefinitions>WIN64;__X64__;_DEBUG;__VC__;_WINDOWS;__NT__;__IDP__;QT_NO_DEBUG;QT_NAMESPACE=QT;QT_NO_UNICODE_LITERAL;%(PreprocessorDefinitions);BUILD_IDA_64BIT;</PreprocessorDefinitions>
116+
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)3rdparty;$(SolutionDir)3rdparty\idasdk\include;$(QTDIR)include;</AdditionalIncludeDirectories>
117+
</ClCompile>
118+
<Link>
119+
<SubSystem>Windows</SubSystem>
120+
</Link>
121+
</ItemDefinitionGroup>
122+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
123+
<ClCompile>
124+
<PreprocessorDefinitions>WIN64;__X64__;NDEBUG;__VC__;_WINDOWS;__NT__;__IDP__;QT_NO_DEBUG;QT_NAMESPACE=QT;QT_NO_UNICODE_LITERAL;%(PreprocessorDefinitions);BUILD_IDA_64BIT;</PreprocessorDefinitions>
125+
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)3rdparty;$(SolutionDir)3rdparty\idasdk\include;$(QTDIR)include;</AdditionalIncludeDirectories>
126+
</ClCompile>
127+
<Link>
128+
<SubSystem>Windows</SubSystem>
129+
<GenerateDebugInformation>false</GenerateDebugInformation>
130+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
131+
<OptimizeReferences>true</OptimizeReferences>
132+
</Link>
133+
</ItemDefinitionGroup>
64134
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
65135
<ClCompile>
66-
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136+
<PreprocessorDefinitions>WIN32;__X86__;_DEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);</PreprocessorDefinitions>
67137
</ClCompile>
68138
<Link>
69139
<SubSystem>Windows</SubSystem>
70140
</Link>
71141
</ItemDefinitionGroup>
72142
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
73143
<ClCompile>
74-
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
144+
<PreprocessorDefinitions>WIN32;__X86__;NDEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);</PreprocessorDefinitions>
75145
</ClCompile>
76146
<Link>
77147
<SubSystem>Windows</SubSystem>
@@ -88,6 +158,7 @@
88158
<ClCompile Include="..\PluginGeneric\Injector.cpp" />
89159
<ClCompile Include="..\PluginGeneric\OptionsDialog.cpp" />
90160
<ClCompile Include="..\Scylla\VersionPatch.cpp" />
161+
<ClCompile Include="IdaHwndHelper.cpp" />
91162
<ClCompile Include="IdaServerClient.cpp" />
92163
<ClCompile Include="ScyllaHideIDAProPlugin.cpp" />
93164
</ItemGroup>
@@ -102,6 +173,7 @@
102173
<ClInclude Include="..\PluginGeneric\Injector.h" />
103174
<ClInclude Include="..\PluginGeneric\OptionsDialog.h" />
104175
<ClInclude Include="..\Scylla\VersionPatch.h" />
176+
<ClInclude Include="IdaHwndHelper.h" />
105177
<ClInclude Include="IdaServerClient.h" />
106178
<ClInclude Include="resource.h" />
107179
</ItemGroup>

ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
<ClCompile Include="..\Scylla\VersionPatch.cpp">
4343
<Filter>Source Files</Filter>
4444
</ClCompile>
45+
<ClCompile Include="IdaHwndHelper.cpp">
46+
<Filter>Source Files</Filter>
47+
</ClCompile>
4548
</ItemGroup>
4649
<ItemGroup>
4750
<ResourceCompile Include="ScyllaHideIDAProPlugin.rc">
@@ -76,6 +79,9 @@
7679
<ClInclude Include="..\Scylla\VersionPatch.h">
7780
<Filter>Header Files</Filter>
7881
</ClInclude>
82+
<ClInclude Include="IdaHwndHelper.h">
83+
<Filter>Header Files</Filter>
84+
</ClInclude>
7985
</ItemGroup>
8086
<ItemGroup>
8187
<None Include="..\PluginGeneric\findere.bmp">

0 commit comments

Comments
 (0)