Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use popcnt emulator? #1

Open
lolroflmywaffle opened this issue May 30, 2018 · 9 comments
Open

How to use popcnt emulator? #1

lolroflmywaffle opened this issue May 30, 2018 · 9 comments

Comments

@lolroflmywaffle
Copy link

lolroflmywaffle commented May 30, 2018

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
Copy link
Owner

ogurets commented Jun 1, 2018

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

ogurets commented Jun 10, 2018

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]
  1. Change directory to where your launcher is at by these commands:
cd F:/Applications/Games/QuantumBreak
F:
  1. 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
Copy link

donwombo commented Mar 14, 2019

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

@schwarzrotes
Copy link

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

@mirh
Copy link
Contributor

mirh commented Mar 26, 2020

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
Copy link
Contributor

mirh commented Apr 11, 2020

See #7

@AyushKumar-Codes
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants