[Release] Resolution fix/trick + source

05/06/2013 21:03 Linoskoczek#1
Idk if it works on anyother server than LCGenericName01 and LCGenericName02 so feedback would be nice.

With this script you can change resolution of your LastChaos to other than ones in options.

[Only registered and activated users can see links. Click Here To Register...]

SCAN:
[Only registered and activated users can see links. Click Here To Register...]

DOWNLOAD:
EP1: [Only registered and activated users can see links. Click Here To Register...]
EP2: [Only registered and activated users can see links. Click Here To Register...]

SOURCE [Au3]:
PHP Code:
#include <NomadMemory.au3>
#include <Console.au3>
Func _WinGetPath($Title="",$strComputer='localhost')
    
$win WinGetTitle($Title)
    
$pid WinGetProcess($win)
   
$wbemFlagReturnImmediately 0x10
   $wbemFlagForwardOnly 
0x20
   $colItems 
""
   
$objWMIService ObjGet("winmgmts:\\" $strComputer "\root\CIMV2")
   
$colItems $objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE ProcessId = " $pid"WQL"_
         $wbemFlagReturnImmediately 
$wbemFlagForwardOnly)
   If 
IsObj($colItemsThen
      
For $objItem In $colItems
         
If $objItem.ExecutablePath Then Return $objItem.ExecutablePath;StringRegExpReplace ($objItem.ExecutablePath"\A*.exe""")
      
Next
   
EndIf
EndFunc

Global $width$height

Cout
(".------.------.------.------.------.------.------.------.------.------.------."&@CRLF&"|L.--. |I.--. |N.--. |O.--. |S.--. |K.--. |O.--. |C.--. |Z.--. |E.--. |K.--. |"&@CRLF&"| :/\: | (\/) | :(): | :/\: | :/\: | :/\: | :/\: | :/\: | :(): | (\/) | :/\: |"&@CRLF&"| (__) | :\/: | ()() | :\/: | :\/: | :\/: | :\/: | :\/: | ()() | :\/: | :\/: |"&@CRLF&"| '--'L| '--'I| '--'N| '--'O| '--'S| '--'K| '--'O| '--'C| '--'Z| '--'E| '--'K|"&@CRLF&"`------`------`------`------`------`------`------`------`------`------`------.EU"&@CRLF&@CRLF&@CRLF&@CRLF)

$pid ProcessExists("Nksp.exe")

If 
$pid Then
    $mo 
_MemoryOpen($pid)
        If 
_MemoryRead(0x105DA00C$mo) > And _MemoryRead(0x105DA010$mo) > 0 Then
            
;WIDTH
                
While 1
                    Cout
("Enter width which you want to have: ")
                    
Cin($width128)
                    If 
$width And $width < @DesktopWidth Then
                        _MemoryWrite
(0x105DA00C$mo$width)
                        
Cout("Width setted to "&$width&@CRLF)
                        
ExitLoop
                    
Else
                        
Cout("You can't set width to 0 and also to a higher than your desktop's..."&@CRLF)
                    EndIf
                
WEnd
            
;HEIGHT
                
While 1
                    Cout
("Enter height which you want to have: ")
                    
Cin($height128)
                    If 
$height And $height < @DesktopHeight Then
                        _MemoryWrite
(0x105DA010$mo$height)
                        
Cout("Height setted to "&$height&@CRLF)
                        
ExitLoop
                    
Else
                        
Cout("You can't set height to 0 and also to a higher than your desktop's..."&@CRLF)
                    EndIf
                
WEnd
        
Else
            
Cout("Something is wrong... I couldn't read memory of client..."&@CRLF)
            
Cout("Checking if you've got administrator rights..."&@CRLF)
            If 
IsAdmin() Then
                Cout
("You are, sorry, but I don't know the reason why I couldn't read memory. Maybe you are not using the script on LCGN01?"&@CRLF)
            Else
                
Cout("You are not admin, it may be a reason why the script isn't working!"&@CRLF)
            EndIf
        EndIf
        
Cout("Now restarting the client..."&@CRLF)
        
$path _WinGetPath("[CLASS:Nksp]")
        
WinClose("[CLASS:Nksp]""")
        
Sleep(500)
        
ShellExecute($path"6574")
        Do
            
Sleep(500)
        
Until ProcessExists("Nksp.exe")
        
Cout("Done! You can close this shell..."&@CRLF&@CRLF)
        
Cout("Pssssssss, visit http://linoskoczek.eu!")

Else
    
Cout("Nksp.exe not found... Make sure your client is opened."&@CRLF)
EndIf

While 
1
    Sleep
(100)
WEnd 
Not really a big tool but maybe you would like to know how to do it, so source is for that.
Functions/UDFs can be found on autoitscript.com

Be cool and visit [Only registered and activated users can see links. Click Here To Register...] ;)

and i don't allow to copy->paste it to other forum without backlink to this topic
05/06/2013 21:38 -STORM-#2
I once built a tool like this which, provided with current offsets, still works on every server.

[Only registered and activated users can see links. Click Here To Register...]


Edit: I just saw you asked for a translation in the said thread. Is there still something you would like me to explain? Most of the post is just redundant stuff to make it idiot-proof.


Edit2: To me it seems like your tool only changes one part of the resolution. Actually there are two parts, one of which is to change the resolution immediately while the other one sets the resolution for the next start of LC so you don't need to set it again whenever you start the game.

The addresse of those are easy to find by the following function names:
HTML Code:
X-OnChange: CUIMultiEditBox::s_nRefCount+A4
Y-OnChange: CUIMultiEditBox::s_nRefCount+A0
X-StartUp: sam_iscreensizei
Y-StartUp: sam_iscreensizej
Lately the official servers and some private servers updated there client so that it does not provide function names anymore. For these servers, the addresses shouldn't be too difficult to find by pattern scan, either.
05/06/2013 22:01 Linoskoczek#3
1. I never got your tool to work to be honest, maybe I'm to dumb for 6 buttons and 2 imputs lol.
2. The reason of that is what I just wrote above - I didn't know what to do to make it working so I asked for translation cos I don't understand german very well.
3. Ty for these adresses, in free time I will have fun with them ;)
05/06/2013 22:16 -STORM-#4
Most likely you just did not insert the addresses for the specific server in the ResolutionAddresses.ini.

In case of right addresses you just use the tool as follows:
1. If one Nksp.exe is open, it is selected automatically. Otherwise you first have to click "Select" and next click at the open window of the LC you want to resize.
2. Insert the desired size into the inputs "Width" and "Height".
3. Click the buttons button "Freeze OnChange" to resize LC without restarting and click "Set StartUp" to save the size for the next start of LC.
4. To apply the changes, change the resolution to another size in the settings of LC and click OK. Instead your desired resolution will be applied.
(5.) After applieing a new OnChange-resolution, you can click "Unreeze OnChange" to save redundant computing power.

Regarding the OnChange-addresses, they can be different on some servers. In that case you can either scroll up/down in CE Memory Viewer to find the right one, or just scan for the current resolution, change it, scan for the new one, and repeat until you only get a few ones, two of which (X and Y) are in the range of CUIMultiEditBox::s_nRefCount+A4 +/- about 0x50.

Edit: I'm off for now, watching Circus Halligalli which is one of the few really good shows on German TV. One reason more to learn German since unfortunately there is no compareable show in English. ;) :D
If there are still questions left, feel free to ask. I'll answer them tomorrow. :)
05/06/2013 22:42 Linoskoczek#5
Quote:
Originally Posted by -STORM- View Post
Most likely you just did not insert the addresses for the specific server in the ResolutionAddresses.ini.
Probably yeah, I even didn't know it's needed and I don't remember what I was doing with it since it was some time ago.

Quote:
Originally Posted by -STORM- View Post

In case of right addresses you just use the tool as follows:
1. If one Nksp.exe is open, it is selected automatically. Otherwise you first have to click "Select" and next click at the open window of the LC you want to resize.
2. Insert the desired size into the inputs "Width" and "Height".
3. Click the buttons button "Freeze OnChange" to resize LC without restarting and click "Set StartUp" to save the size for the next start of LC.
4. To apply the changes, change the resolution to another size in the settings of LC and click OK. Instead your desired resolution will be applied.
(5.) After applieing a new OnChange-resolution, you can click "Unreeze OnChange" to save redundant computing power.
Ty, I will try it when I log on windows.

And btw all the adresses which I found was from cheat engine and it's possible to change it easy there, but I coppied them, pasted and added to small code which changes it with few clicks, so even newbie can't have any problem. I will use your source to find out more about it, but not now and in close future since I'm not playing LC and I'm too lazy for that now :P

Quote:
Originally Posted by -STORM- View Post

Edit: I'm off for now, watching Circus Halligalli which is one of the few really good shows on German TV. One reason more to learn German since unfortunately there is no compareable show in English. ;) :D
I'm learning English, German and Polish (native) so maybe in future I will be able to watch German TV haha :P
05/07/2013 17:24 destro1#6
Thx for the source.