1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-12 12:14:29 +01:00

Finalise 'Release' build for both x86 and x64 _clean_

Still need to fix dependencies and whatnot as well.
This commit is contained in:
OJ 2020-04-14 13:18:25 +10:00
parent 1a6bb89845
commit 078a3e960f
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597
5 changed files with 27 additions and 21 deletions

View File

@ -54,32 +54,36 @@ char* variant_to_string(_variant_t& v, char* buffer, DWORD bufferSize)
strncpy_s(buffer, bufferSize, v.boolVal == VARIANT_TRUE ? "true" : "false", bufferSize - 1);
break;
case VT_I1:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRId8, (CHAR)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRId8, (CHAR)v);
break;
case VT_I2:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRId16, (SHORT)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRId16, (SHORT)v);
break;
case VT_INT:
case VT_I4:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRId32, (INT)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRId32, (INT)v);
break;
case VT_INT_PTR:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRIdPTR, (INT_PTR)v);
break;
case VT_I8:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRId64, (INT_PTR)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRId64, (__int64)v);
break;
case VT_UI1:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRIu8, (BYTE)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRIu8, (BYTE)v);
break;
case VT_UI2:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRIu16, (SHORT)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRIu16, (SHORT)v);
break;
case VT_UINT:
case VT_UI4:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRIu32, (UINT)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRIu32, (UINT)v);
break;
case VT_UINT_PTR:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRIuPTR, (UINT_PTR)v);
break;
case VT_UI8:
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%"PRIu64, (UINT_PTR)v);
_snprintf_s(buffer, bufferSize, bufferSize - 1, "%" PRIu64, (unsigned __int64)v);
break;
case VT_BSTR:
case VT_LPSTR:

View File

@ -119,7 +119,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
argp += z;
}
if (argp - stack > ecif->cif->bytes)
if ((unsigned int)(argp - stack) > ecif->cif->bytes)
{
Py_FatalError("FFI BUG: not enough stack space for arguments");
}

View File

@ -835,7 +835,7 @@ entrance:
if (ctx->pattern[0] == SRE_OP_INFO) {
/* optimization info block */
/* <INFO> <1=skip> <2=flags> <3=min> ... */
if (ctx->pattern[3] && (end - ctx->ptr) < ctx->pattern[3]) {
if (ctx->pattern[3] && (end - ctx->ptr) < (int)(INT_PTR)ctx->pattern[3]) {
TRACE(("reject (got %" PY_FORMAT_SIZE_T "d chars, "
"need %" PY_FORMAT_SIZE_T "d)\n",
(end - ctx->ptr), (Py_ssize_t) ctx->pattern[3]));
@ -2869,7 +2869,7 @@ _compile(PyObject* self_, PyObject* args)
skip = *code; \
VTRACE(("%lu (skip to %p)\n", \
(unsigned long)skip, code+skip)); \
if (skip-adj > end-code) \
if ((Py_UCS4)(skip-adj) > (Py_UCS4)(end-code)) \
FAIL; \
code++; \
} while (0)
@ -2902,7 +2902,7 @@ _validate_charset(SRE_CODE *code, SRE_CODE *end)
case SRE_OP_CHARSET:
offset = 32/sizeof(SRE_CODE); /* 32-byte bitmap */
if (offset > end-code)
if ((int)offset > end-code)
FAIL;
code += offset;
break;
@ -2910,7 +2910,7 @@ _validate_charset(SRE_CODE *code, SRE_CODE *end)
case SRE_OP_BIGCHARSET:
GET_ARG; /* Number of blocks */
offset = 256/sizeof(SRE_CODE); /* 256-byte table */
if (offset > end-code)
if ((int)offset > end-code)
FAIL;
/* Make sure that each byte points to a valid block */
for (i = 0; i < 256; i++) {
@ -2919,7 +2919,7 @@ _validate_charset(SRE_CODE *code, SRE_CODE *end)
}
code += offset;
offset = arg * 32/sizeof(SRE_CODE); /* 32-byte bitmap times arg */
if (offset > end-code)
if ((int)offset > end-code)
FAIL;
code += offset;
break;
@ -2982,7 +2982,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
sre_match() code is robust even if they don't, and the worst
you can get is nonsensical match results. */
GET_ARG;
if (arg > 2*groups+1) {
if ((int)arg > 2*groups+1) {
VTRACE(("arg=%d, groups=%d\n", (int)arg, (int)groups));
FAIL;
}
@ -3070,11 +3070,11 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
GET_ARG; prefix_len = arg;
GET_ARG; /* prefix skip */
/* Here comes the prefix string */
if (prefix_len > newcode-code)
if ((int)prefix_len > newcode-code)
FAIL;
code += prefix_len;
/* And here comes the overlap table */
if (prefix_len > newcode-code)
if ((int)prefix_len > newcode-code)
FAIL;
/* Each overlap value should be < prefix_len */
for (i = 0; i < prefix_len; i++) {
@ -3165,7 +3165,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
case SRE_OP_GROUPREF:
case SRE_OP_GROUPREF_IGNORE:
GET_ARG;
if (arg >= groups)
if (arg >= (Py_UCS4)groups)
FAIL;
break;
@ -3174,7 +3174,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
'group' is either an integer group number or a group name,
'then' and 'else' are sub-regexes, and 'else' is optional. */
GET_ARG;
if (arg >= groups)
if (arg >= (Py_UCS4)groups)
FAIL;
GET_SKIP_ADJ(1);
code--; /* The skip is relative to the first arg! */
@ -3203,7 +3203,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
to allow arbitrary jumps anywhere in the code; so we just look
for a JUMP opcode preceding our skip target.
*/
if (skip >= 3 && skip-3 < end-code &&
if (skip >= (Py_UCS4)3 && (Py_UCS4)(skip-3) < (Py_UCS4)(end-code) &&
code[skip-3] == SRE_OP_JUMP)
{
VTRACE(("both then and else parts present\n"));

View File

@ -479,7 +479,7 @@ save_unconsumed_input(compobject *self, int err)
Py_ssize_t old_size = PyString_GET_SIZE(self->unused_data);
Py_ssize_t new_size;
PyObject *new_data;
if (self->zst.avail_in > PY_SSIZE_T_MAX - old_size) {
if (self->zst.avail_in > (uInt)(PY_SSIZE_T_MAX - old_size)) {
PyErr_NoMemory();
return -1;
}

View File

@ -36,9 +36,11 @@
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\meterpreter.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='r7_release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\meterpreter.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>