ivellioscolin / pykd

A pykd maintenance fork
MIT License
28 stars 16 forks source link

Can't install pykd #3

Open EveryOtherUsernameWasAlreadyTaken opened 4 months ago

EveryOtherUsernameWasAlreadyTaken commented 4 months ago

I can't install pykd. What am I doing wrong?

B:\x64\38>python --version
Python 3.8.10

B:\x64\38>pip install pykd
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement pykd (from versions: none)
ERROR: No matching distribution found for pykd
smaudet commented 4 months ago

I think it doesn't work anymore, the dependent libraries don't build properly, I tried building and opened another ticket, some people have forked some of the sub-projects and tried getting them building again...however they haven't shown all their work (and so it won't build for you).

I can't get it building at present. I've tried VS2017 build tools and VS2019, both crash and burn (the nested git repo is a problem).

arizvisa commented 4 months ago

I'm able to build my fork of it at https://github.com/arizvisa/pykd-pykd and https://github.com/arizvisa/pykd-kdlibcpp using VS2022 build tools (I think that shit is here: https://aka.ms/vs/17/release/vs_BuildTools.exe). As there isn't much difference between mine and this one, it should pretty much be the same.

I had to junction the kdlibcpp repo over pykd/kdlibcpp, use nuget's crap to nuget restore the deps, and then it should msbuild ok.


C> nuget restore
MSBuild auto-detection: using msbuild version '17.7.2.37605' from 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin'.
Restoring NuGet package boost_date_time-src.1.67.0.
Restoring NuGet package boost.1.67.0.
Restoring NuGet package boost_thread-src.1.67.0.
Restoring NuGet package boost_regex-src.1.67.0.
Restoring NuGet package Python27.2.7.6.
...

C> msbuild pykd.sln -p:Configuration=Release_2.7 -p:Platform=Win32
...

C> dir /s /b out
C:\...\out\Win32
C:\...\out\Win32\Debug
C:\...\out\Win32\Release_2.7
C:\...\out\Win32\Release_Static
C:\...\out\Win32\Debug\targetapp.exe
C:\...\out\Win32\Debug\targetapp.exp
C:\...\out\Win32\Debug\targetapp.lib
C:\...\out\Win32\Debug\targetapp.pdb
C:\...\out\Win32\Release_2.7\pykd.exp
C:\...\out\Win32\Release_2.7\pykd.lib
C:\...\out\Win32\Release_2.7\pykd.pdb
C:\...\out\Win32\Release_2.7\pykd.pyd
C:\...\out\Win32\Release_2.7\targetapp.exe
C:\...\out\Win32\Release_Static\kdlib.lib
C:\...\out\Win32\Release_Static\kdlib.pdb
`
unpWn4bl3 commented 2 months ago

I'm able to build my fork of it at https://github.com/arizvisa/pykd-pykd and https://github.com/arizvisa/pykd-kdlibcpp using VS2022 build tools (I think that shit is here: https://aka.ms/vs/17/release/vs_BuildTools.exe). As there isn't much difference between mine and this one, it should pretty much be the same.

I had to junction the kdlibcpp repo over pykd/kdlibcpp, use nuget's crap to nuget restore the deps, and then it should msbuild ok.

C> nuget restore
MSBuild auto-detection: using msbuild version '17.7.2.37605' from 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin'.
Restoring NuGet package boost_date_time-src.1.67.0.
Restoring NuGet package boost.1.67.0.
Restoring NuGet package boost_thread-src.1.67.0.
Restoring NuGet package boost_regex-src.1.67.0.
Restoring NuGet package Python27.2.7.6.
...

C> msbuild pykd.sln -p:Configuration=Release_2.7 -p:Platform=Win32
...

C> dir /s /b out
C:\...\out\Win32
C:\...\out\Win32\Debug
C:\...\out\Win32\Release_2.7
C:\...\out\Win32\Release_Static
C:\...\out\Win32\Debug\targetapp.exe
C:\...\out\Win32\Debug\targetapp.exp
C:\...\out\Win32\Debug\targetapp.lib
C:\...\out\Win32\Debug\targetapp.pdb
C:\...\out\Win32\Release_2.7\pykd.exp
C:\...\out\Win32\Release_2.7\pykd.lib
C:\...\out\Win32\Release_2.7\pykd.pdb
C:\...\out\Win32\Release_2.7\pykd.pyd
C:\...\out\Win32\Release_2.7\targetapp.exe
C:\...\out\Win32\Release_Static\kdlib.lib
C:\...\out\Win32\Release_Static\kdlib.pdb
`

@arizvisa Hi, does this build process needs any extra step? I'm using Windows 7 Ultimate SP1, Visual Studio 2017, installed Python and C++ workloads, but nuget returned these error: image

arizvisa commented 2 months ago

@arizvisa Hi, does this build process needs any extra step? I'm using Windows 7 Ultimate SP1, Visual Studio 2017, installed Python and C++ workloads, but nuget returned these error:

@unpWn4bl3: I'm guessing on this (because my example demonstrates with VS2022 build tools), but i'm willing to bet that it's because you're using W7. You might not remember this, but the whole internet deprecated things like ssl3 and such. There's a KB for W7, but I'm not even sure whether nuget uses those APIs or not.

Does the version of nuget that you installed download anything successfully on your W7 instance? Try it with some other known package in a custom project so that you're 100% sure it should work. If you're still unsure about what nuget is doing, check a packet capture to verify that nuget is actually completing the connection w/o failing the negotiation.

Also, I think the boost packages maintained by sergey-shandar/getboost were done with W8..but I'm unsure whether that's a thing that nuget verifies since I'm not a windoze person and only the CPRT should really matter. So, if you absolutely require W7, you're probably stuck having to build boost 1.67.0 yourself since his packages might be constrained.

If nuget turns out to be the issue, you could also try downloading the packages manually and preparing the cache directory yourself. Try using the same system as other people have tried successfully to see what the directory layout actually looks like.

(btw, your throwaway username is offensive)

unpWn4bl3 commented 1 month ago

@arizvisa What I'm trying todo is debug an IE 10 CVE following the the guide Modern Windows Exploit Development which would requires Windows 7 64bit SP1 virtual machine. (I guess) the pykd compiled on my host Windows 11 won't work in the VM... anyway I would try to solve this, your solution gives me a good direction. And what does " your throwaway username is offensive" mean? Is it a rude name? I'm trying not to be an a**hole.

arizvisa commented 1 month ago

What I'm trying todo is debug an IE 10 CVE following the the guide Modern Windows Exploit Development which would requires Windows 7 64bit SP1 virtual machine. (I guess) the pykd compiled on my host Windows 11 won't work in the VM...

Ah, tru. Perhaps some of the older versions of pykd on pypi might suffice and you might not need to actually build it. The only reason why I have it in a repo is because I have patches to it that weren't merged when codeplex was still around.

Alternatively, there's also flierlu's pydbgext/pydbgeng which was the defacto windbg-python bridge before ussrhero and izmmish published pykd. PyDbgEng might actually be better oriented for W7 and probably easier to build against that platform. I was maintaining a fork of it for W7 and W8 back then (until learning about pykd). PyDbgEng's API might also be more preferrable because it better correlates to the DbgEng API (so the debugger engine api documentation in msdn actually applies.. and you can ConnectProcessServer from your scripts directly). It's worth a shot so that you can get started at the very least.

And what does " your throwaway username is offensive" mean? Is it a rude name? I'm trying not to be an a**hole.

don't worry, you're not coming across as an a**hole. i just heavily discriminate against leetspeak/gamerspeak or usernames that self-label (like being unownable). hence, i'm the asshole and you're ok.

0xv1n commented 1 month ago

I installed the package fine via below steps.

pyenv install 3.9 rye pin 3.9.13 rye sync rye add pykd

Platform: Windows 11, 64-bit, intel