How to force non-windowed games into Windowed mode

Upload *YOUR* gamehacking tools/helpers here
Post Reply
Paul44
Expert Cheater
Expert Cheater
Posts: 117
Joined: Thu Jul 27, 2017 9:02 am
Reputation: 31

How to force non-windowed games into Windowed mode

Post by Paul44 » Mon Mar 16, 2020 6:57 pm

I have been using - pretty successfully - [DxWnd] so far, to get the job done. Recently, I had to move to Win10 (unfortunately), and currently [DxWnd] no longer gets the job done for AC Black Flag (and probably other games as well). I'm sure I'll get it running eventually...

In the mean time, a quick google brought me here: 'How to run Assassin's Creed IV: Black Flag in Windowed Mode youtube'. [Nirsoft's WinExp](lorer) also seems do this job well (be it far less limited in options)...

ps: I recall #Sunbeam posting an article on the subject for AC 4 specifically; but couldn't find the post anymore. #mgr.inz.Player made/posted a small hack (based on that article) @CE, but his hack_tool did not work for me either...

ps2: if you know of other similar tools, feel free to post them here. Preferably verify that these do work on Win 10 (per definition now the "standard" OS... ahum by choice)

User avatar
fantomas
Table Makers
Table Makers
Posts: 1267
Joined: Sat Mar 25, 2017 7:13 pm
Reputation: 524

Re: How to force non-windowed games into Windowed mode

Post by fantomas » Mon Mar 16, 2020 7:32 pm

Paul44 wrote:
Mon Mar 16, 2020 6:57 pm
ps: I recall #Sunbeam posting an article on the subject for AC 4 specifically; but couldn't find the post anymore.
viewtopic.php?t=686

User avatar
SunBeam
Administration
Administration
Posts: 3339
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 1736

Re: How to force non-windowed games into Windowed mode

Post by SunBeam » Tue Mar 17, 2020 12:18 pm

Generally speaking, you'll have to learn a bit more WinAPI to understand the whole concept behind windowed mode. First-up, as with any software, you want to catch where the software creates its main window. Games too are software, so there will be a call to CreateWindowExA/W before you even get to see the main window. After it's created, it's initialized and then using ShowWindow you get to actually see the frame of it. Past this, you want to intercept the DX init call. In most games using d3d9.dll, Direct3D is invoked via the Direct3DCreate9() API. The return value is a pointer to a Direct3D interface, IDirect3D9. From that you want to get to CreateDevice() API and fiddle with the D3DPRESENT_PARAMETERS. That structure contains the bWindowed BOOL that can be set from 0x0 to 0x1 to start in windowed mode. You can do this via x64dbg or CE, for that matter, without DxWnd.

Here's a quick PDF to get you through it all: https://download846.mediafire.com/n5zif ... lonial.pdf

If I remember correctly, I used it in figuring out the Black Flag windowed mode (and all other old ACs'). The same applies to any DX10, DX11 or DX12 games that don't feature a "windowed" option (either setting in-game -OR- Alt+Enter or whatnot).

BR,
Sun

P.S.: Think I have the CrackeMe as well; here's the link: http://www.woodmann.com/forum/showthrea ... tX-crackme. CrackMe itself is on page 2 here.

Paul44
Expert Cheater
Expert Cheater
Posts: 117
Joined: Thu Jul 27, 2017 9:02 am
Reputation: 31

Direct3D intercept...

Post by Paul44 » Wed Mar 18, 2020 8:19 am

Just to be clear gents, I only needed it to allow me to debug AC 4 (or similar games); not because I wanted to know how to hack such feature. In the mean time, I've placed a request @DxWnd: time permitting, some suggestion/update might come along...

@fantomas: while it is for Rogue, it is (probably) helpful. (sorry, can not really spare the time atm to figure this all out)
@Sunbeam: I should NOT ask this question (since I really can not follow this up), but logically that would/could mean that this call can also me made from - let's say - the main game menu (rather then hacking the exe directly)? Again: it's an open Q, and this kind of stuff honestly does not lay within my 'boundaries of interest' :oops:
ps: did download pdf/crackme, and will give it a go one of these weekends... (and thx for feedback ofc)

User avatar
SunBeam
Administration
Administration
Posts: 3339
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 1736

Re: How to force non-windowed games into Windowed mode

Post by SunBeam » Sat Mar 21, 2020 6:02 pm

^ Regardless of the game, the method is UNIVERSAL. That's how DX games are conceived, that's the loading logic and order. That's how you should debug the game and that's how you should find the D3DPRESENT_PARAMETERS structure. Once found, it's a matter of taste how you patch the executable. And no, you can't do it AFTER the game has loaded, as changing the flag won't reset the device. It always has to be done between creation of game's window (CreateWindowExA/W) and ShowWindow. Why.. because the D3D initialization happens in-between. By the time ShowWindow API is called (you can easily get what this does), the D3D device should already be initialized and mode already established (full-screen, windowed, etc.).

Post Reply

Who is online

Users browsing this forum: zfn