diff --git a/PluginGeneric/AttachDialog.cpp b/PluginGeneric/AttachDialog.cpp index f364d42f..f99967fb 100644 --- a/PluginGeneric/AttachDialog.cpp +++ b/PluginGeneric/AttachDialog.cpp @@ -27,7 +27,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 = GetForegroundWindow(); #elif X64DBG extern HWND hwndDlg; HWND hwmain; diff --git a/PluginGeneric/OptionsDialog.cpp b/PluginGeneric/OptionsDialog.cpp index 1eb0937d..609413e8 100644 --- a/PluginGeneric/OptionsDialog.cpp +++ b/PluginGeneric/OptionsDialog.cpp @@ -646,10 +646,11 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l wstrNewProfileName.resize(lstrlenW(wstrNewProfileName.c_str())); #elif defined(__IDP__) - auto szNewProfileName = askstr(0, "", "New profile name?"); - if (!szNewProfileName) + qstring qNewProfileName; + bool success = ask_str(&qNewProfileName, 0, "New profile name?"); + if (!success) break; - wstrNewProfileName = scl::wstr_conv().from_bytes(szNewProfileName); + wstrNewProfileName = scl::wstr_conv().from_bytes(qNewProfileName.c_str()); #elif defined(X64DBG) std::string strNewProfileName; @@ -874,7 +875,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l break; EndDialog(hDlg, NULL); - DialogBoxW(hinst, MAKEINTRESOURCE(IDD_ATTACH), (HWND)callui(ui_get_hwnd).vptr, &AttachProc); + DialogBoxW(hinst, MAKEINTRESOURCE(IDD_ATTACH), GetForegroundWindow(), &AttachProc); break; } @@ -883,7 +884,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l if (HIWORD(wParam) != BN_CLICKED) break; - scl::ShowAboutBox((HWND)callui(ui_get_hwnd).vptr); + scl::ShowAboutBox(GetForegroundWindow()); break; } #endif diff --git a/ScyllaHide.sln b/ScyllaHide.sln index 99fef206..06eb69c6 100644 --- a/ScyllaHide.sln +++ b/ScyllaHide.sln @@ -106,10 +106,12 @@ Global {9EEA6D78-4E74-47B9-8746-B8754B15525D}.Release|Win32.ActiveCfg = Release|Win32 {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}.Release|Win32.ActiveCfg = Release|Win32 - {A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|x64.ActiveCfg = Release|Win32 + {A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.ActiveCfg = Debug|x64 + {A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|Win32.Build.0 = Debug|x64 + {A94B6222-ABEF-41A0-BE48-06801157AAA5}.Debug|x64.ActiveCfg = Debug|x64 + {A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.ActiveCfg = Release|x64 + {A94B6222-ABEF-41A0-BE48-06801157AAA5}.Release|Win32.Build.0 = Release|x64 + {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 diff --git a/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp b/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp index 8d35662a..83e85671 100644 --- a/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp +++ b/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.cpp @@ -1,16 +1,16 @@ #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 #include #include @@ -64,14 +64,14 @@ static void AttachProcess(DWORD dwPID) switch (res) { case -1: { - MessageBoxA((HWND)callui(ui_get_hwnd).vptr, + MessageBoxA(GetForegroundWindow(), "Can't attach to that process !", "ScyllaHide Plugin", MB_OK | MB_ICONERROR); break; } case -2: { - MessageBoxA((HWND)callui(ui_get_hwnd).vptr, + MessageBoxA(GetForegroundWindow(), "Can't find that PID !", "ScyllaHide Plugin", MB_OK | MB_ICONERROR); break; @@ -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) { @@ -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), GetForegroundWindow(), &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; diff --git a/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj b/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj index c5b44603..8df94511 100644 --- a/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj +++ b/ScyllaHideIDAProPlugin/ScyllaHideIDAProPlugin.vcxproj @@ -1,13 +1,13 @@ - + Debug - Win32 + x64 - + Release - Win32 + x64 @@ -18,7 +18,7 @@ 10.0 - + DynamicLibrary true Unicode @@ -27,7 +27,7 @@ false 14.27.29110 - + DynamicLibrary false true @@ -42,6 +42,16 @@ + + + + + + + + + + @@ -53,25 +63,27 @@ - + false - .plw + .dll + $(TargetName)x64 - + false - .plw + .dll + $(TargetName)x64 - + - WIN32;_DEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions) + WIN64;__X64__;_DEBUG;__VC__;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);BUILD_IDA_64BIT; Windows - + - WIN32;NDEBUG;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions) + WIN64;__X64__;NDEBUG;__VC__;_WINDOWS;__NT__;__IDP__;%(PreprocessorDefinitions);BUILD_IDA_64BIT; Windows