ogurets / popcnt_emulator

Pintool library for running Quantum Break on pre-SSE4.2 CPUs
23 stars 5 forks source link

How to use popcnt emulator? #1

Open lolroflmywaffle opened 6 years ago

lolroflmywaffle commented 6 years ago

Hi There,

Thanks in advance for your time. I read through your description for the popcnt emulator and downloaded the zip file in the page, but I do not see any bin files?

I am also having a hard time figuring out how to get this to actually work with Quantum Break, any way to explain the process to us less savvy folk?

More specifically, please elaborate on your statement here: "so everything I had to do so far is patching cpuid to enable popcnt feature flag!"

ogurets commented 6 years ago

Hi!

I've added the binaries into "Releases" section. Pick one of them, unpack both DLLs near your first "QuantumBreak.exe" file (not that one inside dx11 folder) and use the command line from "Usage" section of the readme. You should run cmd.exe in the same directory where you've unpacked the DLLs.

About my statement: during my testing I haven't seen the game actually using popcnt instruction not even once. This means I didn't have to emulate the instruction itself, only had to trick the game into thinking that CPU supports it (by patching "cpuid" instruction). This allowed me to stop the tracing routine (which slows down the game drastically when left running) shortly after the loading screen and play the game at full performance.

Please note that this software is very raw and could require some tweaking to work with your version of the game. And I haven't got the resources to develop it into a fully portable and well-tested product. That is why I shared the source code and encourage people to build it themselves.

lolroflmywaffle commented 6 years ago

Hi ogurets,

Thank you again for your assistance.

First a couple clarifications as I am still confused about file location paths.

My Quantum Break is installed via "F:/Applications/Games/QuantumBreak"

In my QB install folder there is NO 'QuantumBreak.exe', there is only a 'QuantumBreakLauncher.exe' (Steam version). Is this the file you actually meant? Because I'm only seeing 'QuantumBreak.exe' in the dx11 folder as you mentioned.

I have the file contents of the pin tool extracted to both C: and game folder located on drive F: (was not sure if it was required in a certain location)

I found the instructionhook.dll files and extracted them into the main install folder as you mentioned, but running a command line from there doesn't seem to initiate anything.

I suspect the command line you suggested doesn't work for me because of these variables.

lolroflmywaffle commented 6 years ago

Would it be possible for you to show me step by step where you installed each component of this mod? I/Others can then just have that on hand as a FAQ if you will. I think that would be the easiest way to go on about this, for future reference of others as well.

Thanks again in advance.

ogurets commented 6 years ago

Sorry, it's been a busy week. Where exactly is your pin tool at? Which command line do you run and from where? You could copy and paste the contents of entire cmd.exe window here using code fencing (https://guides.github.com/features/mastering-markdown/) or https://pastebin.com/ . Also different launcher is not a good news, since it could require some modifications to the code, which I would have to make blindly, without testing, because my gaming PC has blown up a PSU (this is one of the reasons for a "busy week").

Step by step:

  1. Download pin tool archive http://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-msvc11-windows.zip
  2. Make sure instruction_hook64.dll and instruction_hook32.dll are in F:/Applications/Games/QuantumBreak folder.
  3. Extract into some folder like c:\bin\pin-2.14-71313-msvc11-windows\ Check if you're able to run pin in cmd.exe (don't close cmd.exe, you'll need to run more commands in it):
    C:\bin\pin-2.14-71313-msvc11-windows>pin --version
    E: Missing application name
    Usage: pin [Pin Args] [-t <Tool DLL> [Tool Args]] -- <App EXE> [App args]
  4. Change directory to where your launcher is at by these commands:
    cd F:/Applications/Games/QuantumBreak
    F:
  5. Run your launcher with this command:
    c:\bin\pin-2.14-71313-msvc11-windows\pin.exe -follow-execv -t64 instruction_hook64.dll -t instruction_hook32.dll -- QuantumBreakLauncher.exe
donwombo commented 5 years ago

hi, sorry for my english, I can not compile it

schwarzrotes commented 4 years ago

how to compile "instruction_hook64.dll" and "instruction_hook32.dll"?

mirh commented 4 years ago

With the pin kit/sdk and visual studio. Though since this was compiled for an older version (and includes didn't go through the proper PIN_ROOT referencing) you'll probably need to do some tinkering.

mirh commented 4 years ago

See #7

AyushKumar-Codes commented 4 years ago

It doesn't work for Marvel Avengers.. Any solution please??