Widescreen Gaming Forum

[-noun] Web community dedicated to ensuring PC games run properly on your tablet, netbook, personal computer, HDTV and multi-monitor gaming rig.
It is currently 26 Jun 2024, 11:18

All times are UTC [ DST ]




Post new topic Reply to topic  [ 152 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 16  Next
Author Message
PostPosted: 19 Aug 2010, 16:28 
Offline
Insiders
Insiders
User avatar

Joined: 14 Feb 2010, 13:39
Posts: 761
Code:

   Imports System.Diagnostics
   Imports System.Runtime.InteropServices
   Imports Microsoft.Win32
   
   Public Class Form1
       Dim Processes() As System.Diagnostics.Process
       Dim baseAddress As IntPtr
       Dim ResolutionPointerOffsets() As IntPtr = {&H8C}
       Dim ResolutionPointer As IntPtr = &HECC4B0
   
       Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer() As Byte, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As IntPtr
       Private Declare Function ReadIntegerMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
       Private Declare Function WriteIntegerMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
   
       Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
           Processes = System.Diagnostics.Process.GetProcessesByName("sc2")
       End Sub
   
       Public Function FollowPointer(ByVal BaseAddress As IntPtr, ByVal StartAddrress As IntPtr, ByVal offsets() As IntPtr) As IntPtr
           If Processes.Length > 0 Then
               If Processes(0).HasExited = False Then
                   Dim NextAddress As IntPtr = -1
                   Dim i As Integer
                   For i = 0 To UBound(offsets)
                       Dim output(3) As Byte
                       If NextAddress = -1 Then
                           ReadProcessMemory(Processes(0).Handle, (BaseAddress + StartAddrress), output, 4, 0)
                       ElseIf NextAddress = 0 Then
                       Else
                           ReadProcessMemory(Processes(0).Handle, (NextAddress), output, 4, 0)
                       End If
                       NextAddress = BitConverter.ToInt32(output, 0) + offsets(i)
                   Next
                   FollowPointer = NextAddress
               Else
               End If
           End If
       End Function
   
       Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
           If Processes.Length = 0 Then
               Processes = System.Diagnostics.Process.GetProcessesByName("sc2")
               Label5.Text = "Searching for SC2 Process!"
           ElseIf Processes.Length > 0 Then
               If Processes(0).HasExited = True Then
                   Array.Resize(Processes, 0)
               Else
                   Label5.Text = "SC2 Process Found!"
                   baseAddress = Processes(0).MainModule.BaseAddress
                   Dim targetAddress As IntPtr = FollowPointer(baseAddress, ResolutionPointer, ResolutionPointerOffsets)
                   Dim tHor, tVer As Integer
                   ReadIntegerMemory(Processes(0).Handle, targetAddress, tHor, 4, 4)
                   ReadIntegerMemory(Processes(0).Handle, targetAddress + 4, tVer, 4, 4)
                   If tHor = TextBox1.Text And tVer = TextBox2.Text Then
                       Label6.Text = "Found Resolution, Rewriting"
                       tHor = TextBox3.Text
                       tVer = TextBox4.Text
                       WriteIntegerMemory(Processes(0).Handle, targetAddress, tHor, 4, 4)
                       WriteIntegerMemory(Processes(0).Handle, targetAddress + 4, tVer, 4, 4)
                   ElseIf tHor = TextBox3.Text And tVer = TextBox4.Text Then
                       Label6.Text = "Rewrite Successful"
                   Else
                       Label6.Text = "Cant Find Resolution"
                   End If
               End If
           End If
       End Sub
   End Class
   


modified the address to support new patch - http://theinterwebs.doesntexist.org/CustomRes.exe

_________________
Resident Jester - Flawless Widescreen - Widescreen gaming the way it should be.
[Steam Profile]

Want to keep Flawless Widescreen alive? Donate Here


Top
 Profile  
 


PostPosted: 19 Aug 2010, 16:50 
Offline

Joined: 31 Jul 2010, 10:42
Posts: 34
works a treat.

hayden you are simply awesome mate :)

if you ever come to the uk, i owe you a beer :)


:cheers


Top
 Profile  
 
PostPosted: 21 Aug 2010, 14:44 
Offline

Joined: 25 Jun 2010, 21:35
Posts: 12
The link is not working for me. Can you repost it please?


Top
 Profile  
 
PostPosted: 21 Aug 2010, 17:34 
Offline

Joined: 21 Aug 2010, 17:32
Posts: 2
yep the link is down can you fix it please :)


Top
 Profile  
 
PostPosted: 22 Aug 2010, 18:26 
Offline
Founder
Founder
User avatar

Joined: 13 Oct 2003, 05:00
Posts: 7358
Can someone reupload the file please, my mobo died so I lost all my files and had to reinstall OS,
and the link doesn't work any more.


Top
 Profile  
 
PostPosted: 23 Aug 2010, 03:45 
Offline
Insiders
Insiders
User avatar

Joined: 14 Feb 2010, 13:39
Posts: 761
Sorry its pointing at my apache server and I've had to change gateway a few times recently which doesnt have the port forwarding.

Put it on mediafire - http://www.mediafire.com/?egmlh8xevsh2ri6

_________________
Resident Jester - Flawless Widescreen - Widescreen gaming the way it should be.
[Steam Profile]

Want to keep Flawless Widescreen alive? Donate Here


Top
 Profile  
 
PostPosted: 23 Aug 2010, 10:42 
Offline

Joined: 23 Aug 2010, 10:34
Posts: 2
First of all i really want to thank mister Hayden for his work and mostly for sharing it with us. I used it and it works great. Maybe blizzard should hire u to fix there games :).

I m a bit worried though blizzard might consider it cheating. But hey everyone decide for himself. Thanks again to mister hayden for his work.


Top
 Profile  
 
PostPosted: 24 Aug 2010, 00:33 
Offline
Founder
Founder
User avatar

Joined: 13 Oct 2003, 05:00
Posts: 7358
nvm just downloaded some .NET 4.0 thingie from Microsoft and it works again! Hayden FTW :rockout


Top
 Profile  
 
PostPosted: 24 Aug 2010, 13:30 
Offline
Insiders
Insiders
User avatar

Joined: 21 Mar 2006, 05:01
Posts: 1993
Well damn ,I cannot get Haydens' fix to work. The fix just says "Can't find resolution".

Launch game, set resolution to 1920x1200, exit. Run fix, set current and desired resolutions, start game and... i get 3x individual 1920x1200 screens. Win7-64, .NET 4.0, everything up-to-date. I thought perhaps it was the Bezel Comp I'm using, so i also tried the fix without and BC and still a no-go.


Top
 Profile  
 
PostPosted: 24 Aug 2010, 23:33 
Offline

Joined: 06 Mar 2006, 06:55
Posts: 191
Hi I had trouble understanding the procedure you used. On mine, first set SC2 to 10x7 in fullscreen, then close the program. Start CustomRes, enter 1024x768 in the first field, and your desired res in the second, and then start SC2.

The "cannot find resolution" was happening to be after the patch with the old utility. Is your CustomRes updated?

Sorry if is already what you are doing. Hayden seemed to indicate the using a resolution the utility can recognize is important. Make sure the initial setting one of those recognized by the program.

Let us know what works for you in the end.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 152 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  




Powered by phpBB® Forum Software © phpBB Group