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
IF EXIST "output\" (
del output\ /S /Q
del workspace\build\ /S /Q
)
GOTO END

View File

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

View File

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

View File

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

View File

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

View File

@ -120,7 +120,7 @@
<Culture>0x0409</Culture>
</ResourceCompile>
<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>
<AdditionalLibraryDirectories>..\backcompat\$(Configuration);..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>
@ -187,7 +187,7 @@ copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\..\output\"</Command>
<Culture>0x0409</Culture>
</ResourceCompile>
<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>
<AdditionalLibraryDirectories>..\backcompat\$(Configuration);..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>
@ -253,7 +253,7 @@ copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\..\output\"</Command>
<Culture>0x0409</Culture>
</ResourceCompile>
<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>
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>
@ -319,7 +319,7 @@ copy /y "$(TargetDir)$(TargetFileName)" "$(ProjectDir)..\..\output\"</Command>
<Culture>0x0409</Culture>
</ResourceCompile>
<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>
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>