rdbo / libmem

Advanced Game Hacking Library for C, Modern C++, Rust and Python (Windows/Linux/FreeBSD) (Process/Memory Hacking) (Hooking/Detouring) (Cross Platform) (x86/x64) (DLL/SO Injection) (Internal/External) (Assembler/Disassembler)
GNU Affero General Public License v3.0
819 stars 99 forks source link

python Installation failed #254

Closed Jai-wei closed 2 months ago

Jai-wei commented 2 months ago

I use this command: pip install --upgrade libmem python Ver: 3.11 The following error occurred during automatic compilation:

Collecting libmem
  Using cached libmem-5.0.1.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: libmem
  Building wheel for libmem (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for libmem (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [96 lines of output]
      libmem-py sources: ['src\\libmem\\_libmem\\libmem-py.c']
      Library dirs: []
      Unable to find installed libmem
      Downloading libmem binary release...
      Download archive name: libmem-5.0.1-x86_64-windows-msvc-static-mt.tar.gz
      Archive already downloaded, skipping...
      Archive already extracted, skipping...
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\libmem
      copying src\libmem\__init__.py -> build\lib.win-amd64-cpython-311\libmem
      running build_ext
      building '_libmem' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\src
      creating build\temp.win-amd64-cpython-311\Release\src\libmem
      creating build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem
      I:\VS2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ibuild/libmem-release\libmem-5.0.1-x86_64-windows-msvc-static-mt/include -IJ:\Anaconda\envs\gwbuddy\include -IJ:\Anaconda\envs\gwbuddy\Include -II:\VS2022\Community\VC\Tools\MSVC\14.41.34120\include -II:\VS2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include -II:\VS2022\Community\VC\Auxiliary\VS\include "-II:\Windows Kits\10\include\10.0.22621.0\ucrt" "-II:\Windows Kits\10\\include\10.0.22621.0\\um" "-II:\Windows Kits\10\\include\10.0.22621.0\\shared" "-II:\Windows Kits\10\\include\10.0.22621.0\\winrt" "-II:\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcsrc\libmem\_libmem\libmem-py.c /Fobuild\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\libmem-py.obj
      libmem-py.c
      C:\Users\jaiwei\AppData\Local\Temp\pip-install-yb47qfb5\libmem_a8637103503f449d9bd93d4d63a86117\src\libmem\_libmem\types.h(455): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
      I:\VS2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:build/libmem-release\libmem-5.0.1-x86_64-windows-msvc-static-mt/lib/release /LIBPATH:J:\Anaconda\envs\gwbuddy\libs /LIBPATH:J:\Anaconda\envs\gwbuddy /LIBPATH:J:\Anaconda\envs\gwbuddy\PCbuild\amd64 /LIBPATH:I:\VS2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64 /LIBPATH:I:\VS2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64 "/LIBPATH:I:\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:I:\Windows Kits\10\\lib\10.0.22621.0\\um\x64" libmem.lib user32.lib psapi.lib shell32.lib ntdll.lib /EXPORT:PyInit__libmem build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\libmem-py.obj /OUT:build\lib.win-amd64-cpython-311\libmem\_libmem.cp311-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\_libmem.cp311-win_amd64.lib
        正在创建库 build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\_libmem.cp311-win_amd64.lib 和对象 build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\_libmem.cp311-win_amd64.exp
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_UnloadModule
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetProcess
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumModules
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetProcessEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_PatternScanEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FreePayload
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_DeepPointerEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_AllocMemoryEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_AssembleEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_UnhookCodeEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_HookCode
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumThreads
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_SigScanEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumSymbols
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_SetMemoryEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_Assemble
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetArchitecture
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_LoadModule
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_DisassembleEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_AllocMemory
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FreeMemoryEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetThreadProcess
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_CodeLength
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_DataScan
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_WriteMemoryEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumModulesEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindModuleEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindSymbolAddressDemangled
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumSegmentsEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_UnhookCode
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetBits
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_PatternScan
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_ReadMemoryEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_DemangleSymbol
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindSegmentEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_VmtHook
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_SigScan
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_VmtFree
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_DataScanEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_SetMemory
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_WriteMemory
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_DeepPointer
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindProcess
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindSymbolAddress
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_VmtGetOriginal
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_ProtMemoryEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_IsProcessAlive
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_VmtUnhook
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_VmtReset
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindSegment
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetSystemBits
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_CodeLengthEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumSymbolsDemangled
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumSegments
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_LoadModuleEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_Disassemble
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FreeInstructions
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumThreadsEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_UnloadModuleEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_VmtNew
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FreeDemangledSymbol
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_EnumProcesses
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_HookCodeEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FindModule
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetThreadEx
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_ReadMemory
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_GetThread
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_ProtMemory
      libmem-py.obj : error LNK2001: 无法解析的外部符号 __imp_LM_FreeMemory
      build\lib.win-amd64-cpython-311\libmem\_libmem.cp311-win_amd64.pyd : fatal error LNK1120: 69 个无法解析的外部命令
      error: command 'I:\\VS2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for libmem
Failed to build libmem
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (libmem)
luadebug commented 2 months ago

Hi I have tried to repair this issue. Here is my current log. Fix is over pull request #255

E:\debug\libmem\bindings\python>python setup.py build --verbose
libmem-py sources: ['src\\libmem\\_libmem\\libmem-py.c']
Library dirs: []
Unable to find installed libmem
Downloading libmem binary release...
Download archive name: libmem-5.0.1-x86_64-windows-msvc-static-mt.tar.gz
Fetching libmem archive...
Extracting archive...
Include directories: ['E:\\debug\\libmem\\bindings\\python\\build\\libmem-release\\libmem-5.0.1-x86_64-windows-msvc-static-mt\\include']
Library directories: ['E:\\debug\\libmem\\bindings\\python\\build\\libmem-release\\libmem-5.0.1-x86_64-windows-msvc-static-mt\\lib\\release']
running build
running build_py
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\libmem
copying src\libmem\__init__.py -> build\lib.win-amd64-cpython-311\libmem
running build_ext
building '_libmem' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\src
creating build\temp.win-amd64-cpython-311\Release\src\libmem
creating build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem
"E:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33030\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IE:\debug\libmem\bindings\python\build\libmem-release\libmem-5.0.1-x86_64-windows-msvc-static-mt\include -IC:\Python311\include -IC:\Python311\Include "-IE:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33030\include" "-IE:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33030\ATLMFC\include" "-IE:\Microsoft Visual Studio\2022\Preview\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc\libmem\_libmem\libmem-py.c /Fobuild\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\libmem-py.obj /MT
cl : Command line warning D9025 : overriding '/MD' with '/MT'
libmem-py.c
E:\debug\libmem\bindings\python\src\libmem\_libmem\types.h(455): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
"E:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33030\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:E:\debug\libmem\bindings\python\build\libmem-release\libmem-5.0.1-x86_64-windows-msvc-static-mt\lib\release /LIBPATH:C:\Python311\libs /LIBPATH:C:\Python311 /LIBPATH:C:\Python311\PCbuild\amd64 "/LIBPATH:E:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33030\ATLMFC\lib\x64" "/LIBPATH:E:\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.38.33030\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" libmem.lib user32.lib psapi.lib shell32.lib ntdll.lib /EXPORT:PyInit__libmem build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\libmem-py.obj /OUT:build\lib.win-amd64-cpython-311\libmem\_libmem.cp311-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\_libmem.cp311-win_amd64.lib /EXPORT:LM_FreeMemory /EXPORT:LM_ProtMemory /EXPORT:LM_GetThread /EXPORT:LM_ReadMemory /EXPORT:LM_GetThreadEx /EXPORT:LM_FindModule /EXPORT:LM_HookCodeEx /EXPORT:LM_EnumProcesses /EXPORT:LM_FreeDemangledSymbol /EXPORT:LM_VmtNew /EXPORT:LM_UnloadModuleEx /EXPORT:LM_EnumThreadsEx /EXPORT:LM_FreeInstructions /EXPORT:LM_Disassemble /EXPORT:LM_LoadModuleEx /EXPORT:LM_EnumSegments /EXPORT:LM_EnumSymbolsDemangled /EXPORT:LM_CodeLengthEx /EXPORT:LM_GetSystemBits /EXPORT:LM_FindSegment /EXPORT:LM_VmtReset /EXPORT:LM_VmtUnhook /EXPORT:LM_IsProcessAlive /EXPORT:LM_ProtMemoryEx /EXPORT:LM_VmtGetOriginal /EXPORT:LM_FindSymbolAddress /EXPORT:LM_FindProcess /EXPORT:LM_DeepPointer /EXPORT:LM_WriteMemory /EXPORT:LM_SetMemory /EXPORT:LM_DataScanEx /EXPORT:LM_VmtFree /EXPORT:LM_SigScan /EXPORT:LM_VmtHook /EXPORT:LM_FindSegmentEx /EXPORT:LM_DemangleSymbol /EXPORT:LM_ReadMemoryEx /EXPORT:LM_PatternScan /EXPORT:LM_GetBits /EXPORT:LM_UnhookCode /EXPORT:LM_CodeLength /EXPORT:LM_GetThreadProcess /EXPORT:LM_FreeMemoryEx /EXPORT:LM_AllocMemory /EXPORT:LM_DisassembleEx /EXPORT:LM_LoadModule /EXPORT:LM_GetArchitecture /EXPORT:LM_Assemble /EXPORT:LM_SetMemoryEx /EXPORT:LM_EnumSymbols /EXPORT:LM_SigScanEx /EXPORT:LM_EnumThreads /EXPORT:LM_HookCode /EXPORT:LM_UnhookCodeEx /EXPORT:LM_AssembleEx /EXPORT:LM_AllocMemoryEx /EXPORT:LM_DeepPointerEx /EXPORT:LM_FreePayload /EXPORT:LM_PatternScanEx /EXPORT:LM_GetProcessEx /EXPORT:LM_EnumModules /EXPORT:LM_GetProcess /EXPORT:LM_UnloadModule
   Creating library build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\_libmem.cp311-win_amd64.lib and object build\temp.win-amd64-cpython-311\Release\src\libmem\_libmem\_libmem.cp311-win_amd64.exp
Generating code
Finished generating code
LINK : warning LNK4286: symbol 'LM_FreeMemory' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_ProtMemory' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetThread' defined in 'libmem.lib(thread.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_ReadMemory' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetThreadEx' defined in 'libmem.lib(thread.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindModule' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_HookCodeEx' defined in 'libmem.lib(hook.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumProcesses' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FreeDemangledSymbol' defined in 'libmem.lib(symbol.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_VmtNew' defined in 'libmem.lib(vmt.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_UnloadModuleEx' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumThreadsEx' defined in 'libmem.lib(thread.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FreeInstructions' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_Disassemble' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_LoadModuleEx' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumSegments' defined in 'libmem.lib(segment.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumSymbolsDemangled' defined in 'libmem.lib(symbol.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_CodeLengthEx' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetSystemBits' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindSegment' defined in 'libmem.lib(segment.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_VmtReset' defined in 'libmem.lib(vmt.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_VmtUnhook' defined in 'libmem.lib(vmt.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_IsProcessAlive' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_ProtMemoryEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_VmtGetOriginal' defined in 'libmem.lib(vmt.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindSymbolAddress' defined in 'libmem.lib(symbol.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindProcess' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_DeepPointer' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_WriteMemory' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_SetMemory' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_DataScanEx' defined in 'libmem.lib(scan.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_VmtFree' defined in 'libmem.lib(vmt.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_SigScan' defined in 'libmem.lib(scan.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_VmtHook' defined in 'libmem.lib(vmt.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindSegmentEx' defined in 'libmem.lib(segment.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_DemangleSymbol' defined in 'libmem.lib(symbol.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_ReadMemoryEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_PatternScan' defined in 'libmem.lib(scan.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetBits' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_UnhookCode' defined in 'libmem.lib(hook.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumSegmentsEx' defined in 'libmem.lib(segment.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindSymbolAddressDemangled' defined in 'libmem.lib(symbol.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FindModuleEx' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumModulesEx' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_WriteMemoryEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_DataScan' defined in 'libmem.lib(scan.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_CodeLength' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetThreadProcess' defined in 'libmem.lib(thread.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FreeMemoryEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_AllocMemory' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_DisassembleEx' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_LoadModule' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetArchitecture' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_Assemble' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_SetMemoryEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumSymbols' defined in 'libmem.lib(symbol.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_SigScanEx' defined in 'libmem.lib(scan.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumThreads' defined in 'libmem.lib(thread.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_HookCode' defined in 'libmem.lib(hook.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_UnhookCodeEx' defined in 'libmem.lib(hook.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_AssembleEx' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_AllocMemoryEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_DeepPointerEx' defined in 'libmem.lib(memory.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_FreePayload' defined in 'libmem.lib(asm.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_PatternScanEx' defined in 'libmem.lib(scan.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetProcessEx' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_EnumModules' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_GetProcess' defined in 'libmem.lib(process.c.obj)' is imported by 'libmem-py.obj'
LINK : warning LNK4286: symbol 'LM_UnloadModule' defined in 'libmem.lib(module.c.obj)' is imported by 'libmem-py.obj'

E:\debug\libmem\bindings\python>python setup.py install --verbose
libmem-py sources: ['src\\libmem\\_libmem\\libmem-py.c']
Library dirs: []
Unable to find installed libmem
Downloading libmem binary release...
Download archive name: libmem-5.0.1-x86_64-windows-msvc-static-mt.tar.gz
Archive already downloaded, skipping...
Archive already extracted, skipping...
Include directories: ['E:\\debug\\libmem\\bindings\\python\\build\\libmem-release\\libmem-5.0.1-x86_64-windows-msvc-static-mt\\include']
Library directories: ['E:\\debug\\libmem\\bindings\\python\\build\\libmem-release\\libmem-5.0.1-x86_64-windows-msvc-static-mt\\lib\\release']
running install
C:\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
C:\Python311\Lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating src\libmem.egg-info
writing src\libmem.egg-info\PKG-INFO
writing dependency_links to src\libmem.egg-info\dependency_links.txt
writing top-level names to src\libmem.egg-info\top_level.txt
writing manifest file 'src\libmem.egg-info\SOURCES.txt'
reading manifest file 'src\libmem.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'src\libmem.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\libmem
copying build\lib.win-amd64-cpython-311\libmem\_libmem.cp311-win_amd64.pyd -> build\bdist.win-amd64\egg\libmem
copying build\lib.win-amd64-cpython-311\libmem\__init__.py -> build\bdist.win-amd64\egg\libmem
byte-compiling build\bdist.win-amd64\egg\libmem\__init__.py to __init__.cpython-311.pyc
creating stub loader for libmem\_libmem.cp311-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\libmem\_libmem.py to _libmem.cpython-311.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying src\libmem.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying src\libmem.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying src\libmem.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying src\libmem.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
libmem.__pycache__._libmem.cpython-311: module references __file__
creating 'dist\libmem-5.0.1-py3.11-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing libmem-5.0.1-py3.11-win-amd64.egg
creating c:\python311\lib\site-packages\libmem-5.0.1-py3.11-win-amd64.egg
Extracting libmem-5.0.1-py3.11-win-amd64.egg to c:\python311\lib\site-packages
Adding libmem 5.0.1 to easy-install.pth file

Installed c:\python311\lib\site-packages\libmem-5.0.1-py3.11-win-amd64.egg
Processing dependencies for libmem==5.0.1
Finished processing dependencies for libmem==5.0.1

E:\debug\libmem\bindings\python>python
Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import _libmem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named '_libmem'
>>> import libmem
>>> libmem.LM_EnumProcesses()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'libmem' has no attribute 'LM_EnumProcesses'. Did you mean: 'enum_processes'?
>>> libmem.enum_processes()
[lm_process_t(pid = 1520, ppid = 4, arch = LM_ARCH_X64, bits = 64, start_time = 87018194779032, path = "C:\Windows\System32\smss.exe", name = "smss.exe"), lm_process_t(pid = 1780, ppid = 1588, arch = LM_ARCH_X64, bits = 64, start_time = 268277190320612, 
...
Jai-wei commented 2 months ago

Thank you, the installation has been completed successfully.

luadebug commented 1 month ago

python -m pip install git+https://github.com/rdbo/libmem.git@master#subdirectory=bindings/python --verbose is solution for now. If you have issues with installation like:

PS C:\Users\Admin> python -m pip install git+https://github.com/rdbo/libmem.git@master#subdirectory=bindings/python --verbose
Using pip 24.0 from E:\pypy3.10-v7.3.13-win64\lib\site-packages\pip (python 3.10)
Collecting git+https://github.com/rdbo/libmem.git@master#subdirectory=bindings/python
  Cloning https://github.com/rdbo/libmem.git (to revision master) to c:\users\admin\appdata\local\temp\pip-req-build-8jvklc4g
  Running command git version
  git version 2.33.0.windows.2
  Running command git clone --filter=blob:none https://github.com/rdbo/libmem.git 'C:\Users\Admin\AppData\Local\Temp\pip-req-build-8jvklc4g'
  Cloning into 'C:\Users\Admin\AppData\Local\Temp\pip-req-build-8jvklc4g'...
  fatal: unable to access 'https://github.com/rdbo/libmem.git/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
  error: subprocess-exited-with-error

  × git clone --filter=blob:none https://github.com/rdbo/libmem.git 'C:\Users\Admin\AppData\Local\Temp\pip-req-build-8jvklc4g' did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: git clone --filter=blob:none https://github.com/rdbo/libmem.git 'C:\Users\Admin\AppData\Local\Temp\pip-req-build-8jvklc4g'
  cwd: [inherit]
error: subprocess-exited-with-error

× git clone --filter=blob:none https://github.com/rdbo/libmem.git 'C:\Users\Admin\AppData\Local\Temp\pip-req-build-8jvklc4g' did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip

You should consider remove certifi python package and install it back again like:

python -m pip uninstall certifi
python -m pip install certifi

If it uses x86 MSVC Linker instead of x64 you could try to switch from pwsh.exe to cmd.exe so it could auto-choose proper linker correctly.