Skip to content

Commit 91d59ea

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

File tree

5 files changed

+49
-33
lines changed

5 files changed

+49
-33
lines changed

PluginGeneric/AttachDialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern HWND hwmain; // Handle of main OllyDbg window
2727
#elif OLLY2
2828
HWND hwmain = hwollymain;
2929
#elif __IDP__
30-
HWND hwmain = (HWND)callui(ui_get_hwnd).vptr;
30+
HWND hwmain = GetForegroundWindow();
3131
#elif X64DBG
3232
extern HWND hwndDlg;
3333
HWND hwmain;

PluginGeneric/OptionsDialog.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,11 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
646646
wstrNewProfileName.resize(lstrlenW(wstrNewProfileName.c_str()));
647647

648648
#elif defined(__IDP__)
649-
auto szNewProfileName = askstr(0, "", "New profile name?");
650-
if (!szNewProfileName)
649+
qstring qNewProfileName;
650+
bool success = ask_str(&qNewProfileName, 0, "New profile name?");
651+
if (!success)
651652
break;
652-
wstrNewProfileName = scl::wstr_conv().from_bytes(szNewProfileName);
653+
wstrNewProfileName = scl::wstr_conv().from_bytes(qNewProfileName.c_str());
653654

654655
#elif defined(X64DBG)
655656
std::string strNewProfileName;
@@ -874,7 +875,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
874875
break;
875876

876877
EndDialog(hDlg, NULL);
877-
DialogBoxW(hinst, MAKEINTRESOURCE(IDD_ATTACH), (HWND)callui(ui_get_hwnd).vptr, &AttachProc);
878+
DialogBoxW(hinst, MAKEINTRESOURCE(IDD_ATTACH), GetForegroundWindow(), &AttachProc);
878879
break;
879880
}
880881

@@ -883,7 +884,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
883884
if (HIWORD(wParam) != BN_CLICKED)
884885
break;
885886

886-
scl::ShowAboutBox((HWND)callui(ui_get_hwnd).vptr);
887+
scl::ShowAboutBox(GetForegroundWindow());
887888
break;
888889
}
889890
#endif

ScyllaHide.sln

+6-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ Global
106106
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|Win32.ActiveCfg = Release|Win32
107107
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|Win32.Build.0 = Release|Win32
108108
{9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|x64.ActiveCfg = Release|Win32
109-
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.ActiveCfg = Debug|Win32
110-
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|Win32
111-
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.ActiveCfg = Release|Win32
112-
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|Win32
109+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.ActiveCfg = Debug|x64
110+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.Build.0 = Debug|x64
111+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|x64
112+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.ActiveCfg = Release|x64
113+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.Build.0 = Release|x64
114+
{A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|x64
113115
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Debug|Win32.ActiveCfg = Debug|Win32
114116
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Debug|x64.ActiveCfg = Debug|x64
115117
{4506D672-19C3-439B-8E1B-F1BA8BE28844}.Release|Win32.ActiveCfg = Release|Win32

ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
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

13+
1414
#include <Windows.h>
1515
#include <ida.hpp>
1616
#include <idp.hpp>
@@ -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(GetForegroundWindow(),
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(GetForegroundWindow(),
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), GetForegroundWindow(), &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

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
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|Win32">
4+
<ProjectConfiguration Include="Debug|x64">
55
<Configuration>Debug</Configuration>
6-
<Platform>Win32</Platform>
6+
<Platform>x64</Platform>
77
</ProjectConfiguration>
8-
<ProjectConfiguration Include="Release|Win32">
8+
<ProjectConfiguration Include="Release|x64">
99
<Configuration>Release</Configuration>
10-
<Platform>Win32</Platform>
10+
<Platform>x64</Platform>
1111
</ProjectConfiguration>
1212
</ItemGroup>
1313
<PropertyGroup Label="Globals">
@@ -18,7 +18,7 @@
1818
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1919
</PropertyGroup>
2020
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
2222
<ConfigurationType>DynamicLibrary</ConfigurationType>
2323
<UseDebugLibraries>true</UseDebugLibraries>
2424
<CharacterSet>Unicode</CharacterSet>
@@ -27,7 +27,7 @@
2727
<VcpkgEnabled>false</VcpkgEnabled>
2828
<VCToolsVersion Condition="'$(USE_XP_TOOLCHAIN)'!=''">14.27.29110</VCToolsVersion>
2929
</PropertyGroup>
30-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
30+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
3131
<ConfigurationType>DynamicLibrary</ConfigurationType>
3232
<UseDebugLibraries>false</UseDebugLibraries>
3333
<WholeProgramOptimization>true</WholeProgramOptimization>
@@ -42,6 +42,16 @@
4242
</ImportGroup>
4343
<ImportGroup Label="Shared">
4444
</ImportGroup>
45+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
46+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
47+
<Import Project="$(SolutionDir)Scylla\scylla.props" />
48+
<Import Project="$(SolutionDir)Scylla\scylla.debug.props" />
49+
</ImportGroup>
50+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
51+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
52+
<Import Project="$(SolutionDir)Scylla\scylla.props" />
53+
<Import Project="$(SolutionDir)Scylla\scylla.release.props" />
54+
</ImportGroup>
4555
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
4656
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
4757
<Import Project="$(SolutionDir)Scylla\scylla.props" />
@@ -53,25 +63,27 @@
5363
<Import Project="$(SolutionDir)Scylla\scylla.release.props" />
5464
</ImportGroup>
5565
<PropertyGroup Label="UserMacros" />
56-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
66+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
5767
<LinkIncremental>false</LinkIncremental>
58-
<TargetExt>.plw</TargetExt>
68+
<TargetExt>.dll</TargetExt>
69+
<TargetName>$(TargetName)x64</TargetName>
5970
</PropertyGroup>
60-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
71+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
6172
<LinkIncremental>false</LinkIncremental>
62-
<TargetExt>.plw</TargetExt>
73+
<TargetExt>.dll</TargetExt>
74+
<TargetName>$(TargetName)x64</TargetName>
6375
</PropertyGroup>
64-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
76+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
6577
<ClCompile>
66-
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
<PreprocessorDefinitions>WIN64;__X64__;_DEBUG;__VC__;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);BUILD_IDA_64BIT;</PreprocessorDefinitions>
6779
</ClCompile>
6880
<Link>
6981
<SubSystem>Windows</SubSystem>
7082
</Link>
7183
</ItemDefinitionGroup>
72-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
84+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
7385
<ClCompile>
74-
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
86+
<PreprocessorDefinitions>WIN64;__X64__;NDEBUG;__VC__;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);BUILD_IDA_64BIT;</PreprocessorDefinitions>
7587
</ClCompile>
7688
<Link>
7789
<SubSystem>Windows</SubSystem>

0 commit comments

Comments
 (0)