1
mirror of https://github.com/rapid7/metasploit-payloads synced 2024-11-20 14:39:22 +01:00

Few more build fix ups and removal of warnings

This commit is contained in:
OJ 2020-05-22 12:42:27 +10:00
parent effe6b9827
commit fdb785dcee
No known key found for this signature in database
GPG Key ID: 10D3B9A154E6DF61
6 changed files with 11 additions and 14 deletions

View File

@ -110,6 +110,7 @@ GOTO END
:CLEAN :CLEAN
IF EXIST "output\" ( IF EXIST "output\" (
del output\ /S /Q del output\ /S /Q
del workspace\build\ /S /Q
) )
GOTO END GOTO END

View File

@ -222,21 +222,18 @@ DWORD request_sys_process_image_get_images(Remote *remote, Packet *packet)
break; break;
} }
// Try to resolve the address of EnumProcessModules
if (!(enumProcessModules = (PEnumProcessModules)GetProcAddress(psapi, "EnumProcessModules"))) if (!(enumProcessModules = (PEnumProcessModules)GetProcAddress(psapi, "EnumProcessModules")))
{ {
result = GetLastError(); result = GetLastError();
break; break;
} }
// Try to resolve the address of GetModuleBaseNameA
if (!(getModuleBaseName = (PGetModuleBaseName)GetProcAddress(psapi, "GetModuleBaseNameA"))) if (!(getModuleBaseName = (PGetModuleBaseName)GetProcAddress(psapi, "GetModuleBaseNameA")))
{ {
result = GetLastError(); result = GetLastError();
break; break;
} }
// Try to resolve the address of GetModuleFileNameExA
if (!(getModuleFileNameEx = (PGetModuleFileNameEx)GetProcAddress(psapi, "GetModuleFileNameExA"))) if (!(getModuleFileNameEx = (PGetModuleFileNameEx)GetProcAddress(psapi, "GetModuleFileNameExA")))
{ {
result = GetLastError(); result = GetLastError();

View File

@ -6,8 +6,8 @@
#include "in-mem-exe.h" /* include skapetastic in-mem exe exec */ #include "in-mem-exe.h" /* include skapetastic in-mem exe exec */
typedef BOOL (WINAPI *PEnumProcessModules)(HANDLE p, HMODULE *mod, DWORD cb, LPDWORD needed); typedef BOOL (WINAPI *PEnumProcessModules)(HANDLE p, HMODULE *mod, DWORD cb, LPDWORD needed);
typedef DWORD (WINAPI *PGetModuleBaseName)(HANDLE p, HMODULE mod, LPTSTR base, DWORD baseSize); typedef DWORD (WINAPI *PGetModuleBaseName)(HANDLE p, HMODULE mod, LPWSTR base, DWORD baseSize);
typedef DWORD (WINAPI *PGetModuleFileNameEx)(HANDLE p, HMODULE mod, LPTSTR path, DWORD pathSize); typedef DWORD (WINAPI *PGetModuleFileNameEx)(HANDLE p, HMODULE mod, LPWSTR path, DWORD pathSize);
typedef BOOL (STDMETHODCALLTYPE FAR * LPFNCREATEENVIRONMENTBLOCK)( LPVOID *lpEnvironment, HANDLE hToken, BOOL bInherit ); typedef BOOL (STDMETHODCALLTYPE FAR * LPFNCREATEENVIRONMENTBLOCK)( LPVOID *lpEnvironment, HANDLE hToken, BOOL bInherit );
typedef BOOL (STDMETHODCALLTYPE FAR * LPFNDESTROYENVIRONMENTBLOCK) ( LPVOID lpEnvironment ); typedef BOOL (STDMETHODCALLTYPE FAR * LPFNDESTROYENVIRONMENTBLOCK) ( LPVOID lpEnvironment );
@ -775,14 +775,14 @@ DWORD request_sys_process_get_info(Remote *remote, Packet *packet)
} }
// Try to resolve the address of GetModuleBaseNameA // Try to resolve the address of GetModuleBaseNameA
if (!(getModuleBaseName = (PGetModuleBaseName)GetProcAddress(psapi, "GetModuleBaseNameA"))) if (!(getModuleBaseName = (PGetModuleBaseName)GetProcAddress(psapi, "GetModuleBaseNameW")))
{ {
result = GetLastError(); result = GetLastError();
break; break;
} }
// Try to resolve the address of GetModuleFileNameExA // Try to resolve the address of GetModuleFileNameExA
if (!(getModuleFileNameEx = (PGetModuleFileNameEx)GetProcAddress(psapi, "GetModuleFileNameExA"))) if (!(getModuleFileNameEx = (PGetModuleFileNameEx)GetProcAddress(psapi, "GetModuleFileNameExW")))
{ {
result = GetLastError(); result = GetLastError();
break; break;

View File

@ -14,7 +14,7 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <dshow.h> #include <dshow.h>
#pragma comment(lib, "strmiids")
extern "C" { extern "C" {
#include "common.h" #include "common.h"
#include "webcam.h" #include "webcam.h"

View File

@ -49,12 +49,11 @@ set(LINK_LIBS
iphlpapi iphlpapi
shlwapi shlwapi
ws2_32 ws2_32
strmiids
) )
if(MSVC) if(MSVC)
target_link_options(${PROJECT_NAME} PUBLIC "/ignore:4070") target_link_options(${PROJECT_NAME} PUBLIC "/ignore:4070")
else()
set(LINK_LIBS ${LINK_LIBS} strmiids)
endif() endif()
target_link_libraries(${PROJECT_NAME} ${LINK_LIBS}) target_link_libraries(${PROJECT_NAME} ${LINK_LIBS})

View File

@ -120,7 +120,7 @@
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
<Link> <Link>
<AdditionalDependencies>mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>strmiids.lib;mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\backcompat\$(Configuration);..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>..\backcompat\$(Configuration);..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs> <DelayLoadDLLs>
@ -187,7 +187,7 @@ copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\..\output\"</Command>
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
<Link> <Link>
<AdditionalDependencies>mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>strmiids.lib;mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\backcompat\$(Configuration);..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>..\backcompat\$(Configuration);..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs> <DelayLoadDLLs>
@ -253,7 +253,7 @@ copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\..\output\"</Command>
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
<Link> <Link>
<AdditionalDependencies>mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>strmiids.lib;mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs> <DelayLoadDLLs>
@ -319,7 +319,7 @@ copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\..\output\"</Command>
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
<Link> <Link>
<AdditionalDependencies>mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>strmiids.lib;mpr.lib;netapi32.lib;psapi.lib;winmm.lib;iphlpapi.lib;shlwapi.lib;ws2_32.lib;odbc32.lib;odbccp32.lib;jpeg.$(PlatformShortName).lib;%(AdditionalDependencies)</AdditionalDependencies>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs> <DelayLoadDLLs>