x64dbg / x64dbgpy

Automating x64dbg using Python, Snapshots:
https://ci.appveyor.com/project/mrexodia/x64dbg-python/build/artifacts
MIT License
1.47k stars 70 forks source link

Problems setting up project #54

Closed m155p1nk closed 4 years ago

m155p1nk commented 4 years ago

I am currently struggeling with the setup of this project on a current Windows 10 64bit VM. I already performed the following steps:

  1. recursive clone of the project
  2. installed VS 2015
  3. installed Python2.7 32 bit and 64 bit version and added both to PATH (used setenv.bat)

Via VS2015 Developer command prompt I tried to run the script install32.bat. At least, that what I think I should do, according to your instructions in README. Unfortunately, I get the following error message:

c:\x64dbgpy>.\install32.bat
A subdirectory or file c:\x64dbgpy\release\x32\plugins already exists.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
Could Not Find c:\x64dbgpy\swig\x64dbg_wrap.cpp
Could Not Find c:\x64dbgpy\swig\x64dbgpy\pluginsdk\x64dbg.py
The system cannot find the file specified.

SUCCESS: Specified value was saved.

SUCCESS: Specified value was saved.

c:\x64dbgpy\swig>call "C:\Users\Master\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86
The system cannot find the path specified.

c:\x64dbgpy\swig>set PYTHONHOME=C:\Python27\

c:\x64dbgpy\swig>"C:\Python27\\python.exe" setup.py  install --install-lib="c:\x64dbgpy\release\x32\plugins"\x64dbgpy
running install
running build
running build_ext
building 'x64dbgpy.pluginsdk._x64dbg' extension
swigging x64dbg.i to x64dbg_wrap.cpp
swig.exe -python -Wall -c++ -outputtuple -outdir x64dbgpy\pluginsdk  -o x64dbg_wrap.cpp x64dbg.i
error: command 'swig.exe' failed: No such file or directory

c:\x64dbgpy>copy bin\x32\scriptapi.pyd "c:\x64dbgpy\release\x32\plugins"\x64dbgpy\
The system cannot find the path specified.
        0 file(s) copied.

I already tried to build the project in VS 2015 and it looks like it worked. Output from VS:

1>------ Rebuild All started: Project: x64dbgpy, Configuration: Release Win32 ------
2>------ Rebuild All started: Project: scriptapi, Configuration: Release Win32 ------
1>  pluginmain.cpp
1>  py.cpp
1>  stringutils.cpp
1>  Generating Code...
1>     Creating library C:\x64dbgpy\bin\x32\x64dbgpy.lib and object C:\x64dbgpy\bin\x32\x64dbgpy.exp
2>  scriptapi.cpp
1>  x64dbgpy.vcxproj -> C:\x64dbgpy\bin\x32\x64dbgpy.dp32
1>  x64dbgpy.vcxproj -> C:\x64dbgpy\bin\x32\x64dbgpy.pdb (Full PDB)
2>     Creating library C:\x64dbgpy\bin\x32\scriptapi.lib and object C:\x64dbgpy\bin\x32\scriptapi.exp
2>  Generating code
2>  All 6550 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
2>  Finished generating code
2>  scriptapi.vcxproj -> C:\x64dbgpy\bin\x32\scriptapi.pyd
2>  scriptapi.vcxproj -> C:\x64dbgpy\bin\x32\scriptapi.pdb (Full PDB)
========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========

Could you please assist here? Thanks in advance.

mrexodia commented 4 years ago

You probably missed to install http://www.microsoft.com/en-us/download/details.aspx?id=44266

Additionally you need some old version of swig in your PATH.

However to actually use the plugin you don’t need to compile it, you can just take the artifacts from appveyor or from a release :)

This is the appveyor script:

version: 1.0.{build}
image: Visual Studio 2015
build_script:
- cmd: >-
    git submodule update --init --recursive

    choco install -y swig --version 3.0.12

    setenv.bat

    msbuild.exe x64dbgpy.sln /verbosity:minimal /t:Build /p:Configuration=Release;Platform=Win32

    msbuild.exe x64dbgpy.sln /verbosity:minimal /t:Build /p:Configuration=Release;Platform=x64

    call install32.bat

    call install64.bat
artifacts:
- path: release
m155p1nk commented 4 years ago

Hi,

thanks a lot for your help. I somehow did not understand that building the project is not necessary for using the plugin. I just managed to get it going by using the latest x64dbg snapshot and the x64dbg plugin artefacts provided via appveyor.