Version 5.14.6

This commit is contained in:
Ulf Frisk
2025-03-16 00:07:37 +01:00
parent d369578075
commit ca8a86e944
18 changed files with 54 additions and 36 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,8 +3,8 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 14
#define VERSION_REVISION 5
#define VERSION_BUILD 195
#define VERSION_REVISION 6
#define VERSION_BUILD 196
#define VER_FILE_DESCRIPTION_STR "MemProcFS : Plugin vmemd"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD

View File

@@ -3,8 +3,8 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 14
#define VERSION_REVISION 5
#define VERSION_BUILD 195
#define VERSION_REVISION 6
#define VERSION_BUILD 196
#define VER_FILE_DESCRIPTION_STR "MemProcFS"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD

View File

@@ -3,8 +3,8 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 14
#define VERSION_REVISION 5
#define VERSION_BUILD 195
#define VERSION_REVISION 6
#define VERSION_BUILD 196
#define VER_FILE_DESCRIPTION_STR "MemProcFS : Core"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD

View File

@@ -3,8 +3,8 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 14
#define VERSION_REVISION 5
#define VERSION_BUILD 195
#define VERSION_REVISION 6
#define VERSION_BUILD 196
#define VER_FILE_DESCRIPTION_STR "MemProcFS : Python API"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD

View File

@@ -173,7 +173,7 @@ DWORD VmmPyc_MemReadType_TypeCheck(_In_ PyObject* pyUnicodeTp, _Out_ PDWORD pcbT
DWORD dw;
BYTE b4[4];
} tp = { 0 };
SIZE_T cch;
Py_ssize_t cch;
char *sz;
if((pyBytes = PyUnicode_AsUTF8String(pyUnicodeTp))) {
PyBytes_AsStringAndSize(pyBytes, &sz, &cch);
@@ -210,20 +210,28 @@ DWORD VmmPyc_MemReadType_TypeCheck(_In_ PyObject* pyUnicodeTp, _Out_ PDWORD pcbT
PyObject* VmmPyc_MemReadType_TypeGet(_In_ DWORD tp, _In_ PBYTE pb, _In_ DWORD cbRead)
{
long l;
DWORD dw = 0;
BYTE pbZERO[8] = { 0 };
switch(tp) {
case 'i8 ':
return PyLong_FromLong(*(BYTE*)((cbRead >= 1) ? pb : pbZERO)); break;
if(cbRead >= 1) { dw = *(BYTE*)pb; }
l = (long)((dw & 0x80) ? (0 - dw) : dw);
return PyLong_FromLong(l); break;
case 'u8 ':
return PyLong_FromUnsignedLong(*(BYTE*)((cbRead >= 1) ? pb : pbZERO)); break;
case 'i16 ':
return PyLong_FromLong(*(WORD*)((cbRead >= 2) ? pb : pbZERO)); break;
if(cbRead >= 2) { dw = *(WORD*)pb; }
l = (long)((dw & 0x8000) ? (0 - dw) : dw);
return PyLong_FromLong(l); break;
case 'u16 ':
return PyLong_FromUnsignedLong(*(WORD*)((cbRead >= 2) ? pb : pbZERO)); break;
case 'f32 ':
return PyFloat_FromDouble(*(float*)((cbRead >= 4) ? pb : pbZERO)); break;
case 'i32 ':
return PyLong_FromLong(*(DWORD*)((cbRead >= 4) ? pb : pbZERO)); break;
if(cbRead >= 4) { dw = *(DWORD*)pb; }
l = (long)((dw & 0x80000000) ? (0 - dw) : dw);
return PyLong_FromLong(l); break;
case 'u32 ':
return PyLong_FromUnsignedLong(*(DWORD*)((cbRead >= 4) ? pb : pbZERO)); break;
case 'f64 ':

View File

@@ -285,7 +285,7 @@ BOOL PY2C_Exec(_In_ VMM_HANDLE H, _In_ LPSTR uszPythonCodeToExec, _Out_ LPSTR *p
if(!pyStrResultOfExec || !PyUnicode_Check(pyStrResultOfExec)) { goto pyfail; }
pyBytesResultOfExec = PyUnicode_AsUTF8String(pyStrResultOfExec);
if(!pyBytesResultOfExec || !PyBytes_Check(pyBytesResultOfExec)) { goto pyfail; }
PyBytes_AsStringAndSize(pyBytesResultOfExec, &uszResultOfExec, &cuszResultOfExec);
PyBytes_AsStringAndSize(pyBytesResultOfExec, &uszResultOfExec, (Py_ssize_t*)&cuszResultOfExec);
if(!uszResultOfExec) { goto pyfail; }
*puszResultOfExec = LocalAlloc(0, cuszResultOfExec + 1);
if(!*puszResultOfExec) { goto pyfail; }
@@ -438,7 +438,9 @@ BOOL VmmPyPlugin_PythonInitializeEmbedded(_In_ VMM_HANDLE H, _In_ HMODULE hDllPy
Py_SetPath(wszPathPython);
VMMDLL_Log(H, VMMDLL_MID_PYTHON, VMMDLL_LOGLEVEL_DEBUG, "PythonPath: %S", wszPathPython);
Py_Initialize();
PyEval_InitThreads();
#if PY_VERSION_HEX <= 0x03060000
PyEval_InitThreads(); // Required for Python 3.6
#endif
// 4: Import VmmPyPlugin library/file to start the python part of the plugin manager.
pyName = PyUnicode_DecodeFSDefault("vmmpyplugin");
if(!pyName) { goto fail; }
@@ -474,13 +476,24 @@ VOID Util_GetPathDllA(_Out_writes_(MAX_PATH) LPSTR szPath, _In_opt_ HMODULE hMod
}
}
#define PYTHON_IMPORT_PRE "import sys\nsys.path.append(\""
#define PYTHON_IMPORT_POST "\")"
VOID Util_PyAddSysPath(LPCSTR szPath)
{
PyObject *pySysPath, *pyPath;
pySysPath = PySys_GetObject("path");
if(pySysPath && PyList_Check(pySysPath)) {
pyPath = PyUnicode_FromString(szPath);
if(pyPath) {
PyList_Append(pySysPath, pyPath);
Py_DECREF(pyPath);
}
}
}
BOOL VmmPyPlugin_PythonInitializeEmbedded(_In_ VMM_HANDLE H, _In_ HMODULE hDllPython, _In_ HMODULE hDllModule)
{
DWORD i;
PyObject *pyName = NULL, *pyModule = NULL;
CHAR szPathBaseExe[MAX_PATH] = { 0 }, szImportBase[MAX_PATH] = { 0 } , szImportLibs[MAX_PATH] = { 0 };
CHAR szPathBaseExe[MAX_PATH] = { 0 }, szImportLibs[MAX_PATH] = { 0 };
// 1: Allocate context (if required) and fetch verbosity settings
if(!ctxPY2C && !(ctxPY2C = LocalAlloc(LMEM_ZEROINIT, sizeof(PY2C_CONTEXT)))) {
return FALSE;
@@ -488,21 +501,18 @@ BOOL VmmPyPlugin_PythonInitializeEmbedded(_In_ VMM_HANDLE H, _In_ HMODULE hDllPy
VmmPyPlugin_UpdateVerbosity();
// 2: Construct Python Path
Util_GetPathDllA(szPathBaseExe, NULL);
// 2.1: .exe location of this process
strcat_s(szImportBase, MAX_PATH, PYTHON_IMPORT_PRE);
strcat_s(szImportBase, MAX_PATH, szPathBaseExe);
strcat_s(szImportBase, MAX_PATH, PYTHON_IMPORT_POST);
// 2.2: plugins relative to this process
strcat_s(szImportLibs, MAX_PATH, PYTHON_IMPORT_PRE);
// 2.1: plugins relative to this process
strcat_s(szImportLibs, MAX_PATH, szPathBaseExe);
strcat_s(szImportLibs, MAX_PATH, "pylib/");
strcat_s(szImportLibs, MAX_PATH, PYTHON_IMPORT_POST);
// 3: Initialize (Embedded) Python.
Py_SetProgramName(L"VmmPyPluginManager");
Py_Initialize();
PyEval_InitThreads();
PyRun_SimpleString(szImportBase);
PyRun_SimpleString(szImportLibs);
#if PY_VERSION_HEX <= 0x030A0000
Py_SetProgramName(L"VmmPyPluginManager");
#endif
#if PY_VERSION_HEX <= 0x03060000
PyEval_InitThreads(); // Required for Python 3.6
#endif
Util_PyAddSysPath(szPathBaseExe);
Util_PyAddSysPath(szImportLibs);
// 4: Import VmmPyPlugin library/file to start the python part of the plugin manager.
pyName = PyUnicode_DecodeFSDefault("vmmpyplugin");
if(!pyName) { goto fail; }

View File

@@ -1,6 +1,6 @@
[package]
name = "leechcore_example"
version = "5.14.5"
version = "5.14.6"
edition = "2021"
publish = false

View File

@@ -1,6 +1,6 @@
[package]
name = "m_example_plugin"
version = "5.14.5"
version = "5.14.6"
edition = "2021"
publish = false

View File

@@ -1,6 +1,6 @@
[package]
name = "memprocfs"
version = "5.14.5"
version = "5.14.6"
edition = "2021"
description = "MemProcFS - Physical Memory Analysis Framework"
documentation = "https://docs.rs/memprocfs"

View File

@@ -1,6 +1,6 @@
[package]
name = "memprocfs_example"
version = "5.14.5"
version = "5.14.6"
edition = "2021"
publish = false

View File

@@ -32,5 +32,5 @@ using System.Runtime.Versioning;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.14.5.195")]
[assembly: AssemblyFileVersion("5.14.5.195")]
[assembly: AssemblyVersion("5.14.6.196")]
[assembly: AssemblyFileVersion("5.14.6.196")]

View File

@@ -109,7 +109,7 @@
<None Include="logo.png" Pack="true" Visible="true" PackagePath="" />
</ItemGroup>
<PropertyGroup>
<Version>5.14.5</Version>
<Version>5.14.6</Version>
<RepositoryUrl>https://github.com/ufrisk/MemProcFS</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseFile>LICENSE</PackageLicenseFile>