项目作者: yuri-sevatz

项目描述 :
Cyberpunk 2077 - Breach Protocol Solver
高级语言: C++
项目地址: git://github.com/yuri-sevatz/cyber_breach.git
创建时间: 2020-12-22T20:40:25Z
项目社区:https://github.com/yuri-sevatz/cyber_breach

开源协议:BSD 2-Clause "Simplified" License

下载


Cyberpunk 2077 - Breach Protocol Auto-Solver

Description

The Cyberpunk 2077 “Breach Protocol Auto-Solver” is a Screen Capture + OCR + Solver + Auto-Clicker for Breaches in Cyberpunk 2077 on PC.

My goal was to try and make the Breach Protocol minigame as easy as possible for PC players.

I think the minigame is fun, but I felt it detracts from the explosive ascension in the rest of the game, especailly for completionists like myself!

(+ I hate Sudokus, and all brute-force problems :P)

Preview

Usage

cyber_breach works by taking a screenshot of a running game, parsing it, solving it, and then generating clicks on the running game.

  1. Usage: cyber_breach.exe [-h] [-l INPUT] [-s OUTPUT] [--interactive] [--no-autoclick]
  2. Cyberpunk 2077 - Breach Protocol Auto-Solver
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. --load INPUT, -l INPUT
  6. input file to load screenshot (default: capture)
  7. --save OUTPUT, -s OUTPUT
  8. output directory to save screenshot (default: disabled)
  9. --interactive, -i
  10. enable interactive prompts (default: disabled)
  11. --no-autoclick
  12. disable auto-clicking answer (default: autoclick, iff capture)
  13. By default cyber_breach.exe will capture and auto-click a running copy of CP2077

When you launch cyber_breach, it tries to detect from a running instance of CP2077 (or from a previously saved image):

  1. The buffer length
  2. The matrix length
  3. The sequence length(s)

It then performs:

  • Optical character recognition on the matrix and sequences
  • Calculates the highest scoring path through the matrix
  • Displays the result on-screen

Additionally, if a screenshot was captured from a live game, it can:

  • Generate mouse movements and clicks, to auto-solve most breaches in less than 1/2 a second.

It does all this without touching any of the in-game memory, so it’s safe to use without any long-term effects.

You can also launch cyber_breach on a previously saved image. Or you can instruct cyber_breach to save newly captured screenshots to a directory of your choosing. Saved screenshots might be useful if cyber_breach cannot solve a particular breach, or if you are afraid of it making mistakes (though you may be hard-pressed to ever find any =P). Saved images may be useful if filing Github Issues for new resolutions, and for developers to add expanding detection.

Requirements

  • The screenshot must be FROM A 1080P DISPLAY. (I am still working on support for different resolutions!)

  • The breach MUST NOT HAVE ALREADY BEEN STARTED with any boxes clicked, although pre-installed sequences are automatically skipped by the solver if detected. (i.e. You’ll be good as long as none of the boxes in the matrix have already been clicked)

Build Dependencies

Windows

  • Visual Studio 2019 (with “Desktop Development with C++”) or Build Tools for Visual Studio 2019 (with “MSVC142”)
  • Boost
  • CMake
  • OpenCV
  • OpenCV Contrib
  • TermColor
  • Tesseract

Linux

  • Boost
  • CMake
  • OpenCV
  • OpenCV Contrib
  • TermColor
  • Tesseract

Compiling

Windows

  1. cd C:\
  2. mkdir src && cd src
  3. git clone git@github.com:microsoft/vcpkg.git
  4. cd vcpkg
  5. bootstrap-vcpkg.bat
  6. vcpkg install boost:x64-windows opencv:x64-windows opencv[contrib]:x64-windows termcolor:x64-windows
  7. cd ..
  8. git clone git@github.com:yuri-sevatz/cyberpunk-cpp.git
  9. cd cyberpunk-cpp
  10. git submodule update --init
  11. mkdir build && cd build
  12. cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:\src\vcpkg\scripts\buildsystems\vcpkg.cmake" "-DBUILD_TESTING:BOOL=OFF" "-DCYBER_BUNDLE_TESSDATA:BOOL=ON"
  13. cmake --build . --config Release

Resulting binary is stored in C:\src\cyberpunk-cpp\build\bin\Release*

Linux

  1. cd ~
  2. git clone git@github.com:yuri-sevatz/cyberpunk-cpp.git
  3. cd cyberpunk-cpp
  4. mkdir build; cd build
  5. cmake ..
  6. cmake --build . --config Release

Resulting binary is stored in ~\cyberpunk-cpp\build\bin*

TODO

  • Support Resolutions > 1080P (Need lots of high-quality example images of different screens)