WooHoo A civ2 Forum!!!!

Status
Not open for further replies.

PaPaRoGuE

Chieftain
Joined
Jul 16, 2003
Messages
12
this is one of my favorite games still -- however I am a big cheater. I submitted a trainer I made but i don't know if it will be hosted here so i will just let everyone know. the trainer will max your gold to 30000 without effecting your final score the way cheat mode does.
i use it on test of time but based on the memory locations i am pretty sure it works on all versions.
if anyone wants this I sure would love to share it with people. ***EDIT*** download from the post a few down from here***

anyways great forum and i think i am going to stay for awhile:goodjob:
 
You can upload it right here. Scroll down to the bottom of the page and click the "Upload File" link.

I find the cheating aspect a bit puzzling. I mean, I am no stranger to cheating myself, but that's what the cheat menu is for. Who are you trying to fool by cheating, and not getting the "cheat notice" in your score. Does it make you feel better?
If you pretend to have an infinite amount of cash, why don't you just use the "Cheat!" button in the city screen, for instance.

On the other hand, I'd be interested to know how you did it, for scenario making purposes.
I very much doubt it would work on all civ2 versions, by the way. MGE maybe, but I don't think it would work for any earlier versions.

There are a few other things for ToT you might be interested in, by the way.
The "no-limits patch" (increases the maximum gold limit to about 2 billion, rather than 30,000, among other things), and CSPL. That's a program that also edits the game memory, except not for cheating purposes, but for use as an advanced scenario events language.
 
Originally posted by Mercator
You can upload it right here. Scroll down to the bottom of the page and click the "Upload File" link.

I find the cheating aspect a bit puzzling. I mean, I am no stranger to cheating myself, but that's what the cheat menu is for. Who are you trying to fool by cheating, and not getting the "cheat notice" in your score. Does it make you feel better?

no i can't upload it (read the rules on file size - i am 52 kb too big).as for "does it make you feel better?- it is not about the cheating my friend it is about being able to look at something in a hex editor mark the memory spots and then use vb to to put it to a form and make it work. does it make you feel better patching a game to it 's gold edition instead of paying money for it?-
ahhh- your answer will be it is not about that it is being able to mod a game. please see this in the same light - :goodjob:

and i just tried it with a modded gold and it did work so that's two versions. I suspect it will ork on all versions as the location they write to memory is pretty propietary in a game.


as for the no limits patch -yes i could make it unlimited as well however Too big of a number in memory causes other weird anomalies so i kept it at thirty thousand - I also want to try to do it for city resources - by the way it doesn't need to be a cheater you know-- ever occur to you that you could give all your opponents 30000 gold infusions and not yourself????
also you can look at this post:
http://forums.civfanatics.com/showthread.php?s=&threadid=56651
to see why i made it 30000 gold . anything above will start to hoop your game
 
ever occur to you that you could give all your opponents 30000 gold infusions and not yourself????

Now That's a new GOTM idea that I haven't seen...of course best play would find a way to get some of that for the player but would it affect wonder races?
 
Tribute is usually about half of their current treasury, so build a pile of Warriors and you'll get 15,000, then 7,500, then 3,750, then...

From many games watching how the AI uses its gold I'd say they would hoard it, not buy up every Wonder they had tech for. Be worth trying, though...
 
Originally posted by PaPaRoGuE
no i can't upload it (read the rules on file size - i am 52 kb too big).

:o

as for "does it make you feel better?- it is not about the cheating my friend it is about being able to look at something in a hex editor mark the memory spots and then use vb to to put it to a form and make it work. does it make you feel better patching a game to it 's gold edition instead of paying money for it?

But I actually find that patch much more disturbing. :p
Sorry for questioning your motivation though, I know all about civ2 programming, so... :goodjob:

and i just tried it with a modded gold and it did work so that's two versions. I suspect it will ork on all versions as the location they write to memory is pretty propietary in a game.

I don't think so. MGE and ToT are both 32-bit applications,and ToT was based on the MGE source. On the other hand, the earlier versions are 16-bit applications, and they use different parts of the memory.


as for the no limits patch -yes i could make it unlimited as well however Too big of a number in memory causes other weird anomalies so i kept it at thirty thousand

Those two things I mentioned already exist. I think they can both be downloaded from The Cradle of Civilization.

[...]also you can look at this post:
http://forums.civfanatics.com/showthread.php?s=&threadid=56651
to see why i made it 30000 gold . anything above will start to hoop your game

Yes, but that's without the no-limits patch... Anyway, since the money always stays at 30,000 that's enough to buy anything.
 
yeah however it doesn't stay at thirty thousand so to speak I didn't lock the memory I "poke" it so to speak so if you spend a 1000 you will only have 29000. I didn't want to lock it as i didn't want to play a whole game to test what effects locking would have. i might perhaps try to do this with civ III but i don't know i had a look and it rights the money to 5 or 6 different spots for each civ. could be a challenge though. anyways thanks for your input mercator i apreciate it.
 
Oh I see... But you can't really "lock" a variable, right? Only rewrite the same value regularly.

And I wouldn't be interested in anything for CivIII, but that shouldn't stop you from doing it, of course.

But by the way, are you sure you checked the file upload thing? It says the maximum filesize is 3000K, well over the 158 you'd need.
 
Originally posted by Mercator
Oh I see... But you can't really "lock" a variable, right? Only rewrite the same value regularly.
no you are locking it in the manner of speaking that you still are just using one line of code to keep the money at 30000 without fluctuation all the time - sorry maybe i did not explain it properly



"Attach file:
Maximum size: 102400 bytes"

that's what i got but i am in the middle of trying to stremline the other one anyways so by morning i will be able to upload it.
 
You might want to change the Gazpichi, Brr'til and Treg to what their names are in the original game. The other civ2 versions don't have any aliens, and for those who DO have ToT it's not too hard to find out which is which.

But anyway, the version you sent me earlier doesn't work for me. Not with FW or ToT.
 
Originally posted by Mercator

But anyway, the version you sent me earlier doesn't work for me. Not with FW or ToT.

first start the game then start the trainer then push the apropriate button - that older version has now had 39 people give me feedback and it works for all of them - don't know why it wouldn't work for you except maybe PEBKAC

as for changing the names -- I don't think so -- However feel free to code one yourself - you defintiely have enough opinions of how it should be done that I bet it would be great. let me know when it's finished okay.
 
Originally posted by atawa
This is just another version of cheatomatic

no actually it is far from it. cheat -o-matic stores keyboard events (cheat codes) and executes them for you. this alters the block of memory where the money information is .
very,very different as you can see cheat o matic relies on keyb_events and this relies on Writebyte .

really if you don't know what it is don't comment to make yourself look less than knowledgeable you insult yourself
 
Originally posted by PaPaRoGuE
PEBKAC

:confused:

as for changing the names -- I don't think so -- However feel free to code one yourself - you defintiely have enough opinions of how it should be done that I bet it would be great. let me know when it's finished okay.

I'm not interested in creating or using anything like this, I'm only interested in editing memory.

And apart from that, I was just giving a few suggestions on how you could make it a bit more user-friendly. Including a little more info on how it works would also be nice.
 
I'm only interested in editing memory.


Code:
http://www.winhex.com/

try there for winhex or for ram cheat pending on if you are trying to indentify what is where in memory

or if you use vb6
Code:
Private Sub cmdReadByte_Click()
    
    'Dimension the variable to store the value that the read function returns.
    Dim Value As Byte

    'Call the function to read a byte value from the specified memory offset and
    'store the returned value to the Value variable.
    Value = ReadByte(txtRbOffset.Text, txtRbWindowName.Text)
    
    'Add the returned value to the Read Byte value field.
    txtRbValue.Text = Value
    
End Sub


Private Sub cmdWriteByte_Click()
    
    'The variable must be a byte datatype here to match the WriteByte function arguments.
    Dim Value As Byte
    
    Value = txtWbValue.Text
    
    'Call the function that will write the specified value to the specified memory offset.
    WriteByte txtWbOffset.Text, txtWbWindowName.Text, Value
       
End Sub

Private Sub cmdReadInteger_Click()

    'Dimension a variable to store the value that the read function returns.
    Dim Value As Integer
    
    'Call the function to read an integer value from the specified memory offset and
    'store the returned value in Value variable.
    Value = ReadInteger(txtRiOffset.Text, txtRiWindowName)
    
    'Add the returned value to the Read Integer value field.
    txtRiValue.Text = Value

End Sub

Private Sub cmdWriteInteger_Click()

    'The value must be an integer here to match the WriteInteger function arguments.
    Dim Value As Integer
    
    Value = txtWiValue.Text
    
    'Call the function that will write the specified value to the specified memory offset.
    WriteInteger txtWiOffset.Text, txtWiWindowName.Text, Value

End Sub


Private Sub cmdReadLong_Click()
    
    'Dimension a variable to store the value the the read function returns.
    Dim Value As Long
    
    'Call the function to read a long value from the specified memory offset and
    'store the returned value in Value variable.
    Value = ReadLong(txtRlOffset.Text, txtRlWindowName.Text)
    
    'Add the returned value to the Read Long value field.
    txtRlValue.Text = Value

End Sub

Private Sub cmdWriteLong_Click()

    'Dimension the variable as long here to match the WriteLong function arguments.
    Dim Value As Long
    
    'Add the Write Long value field's value to the Value variable.
    Value = txtWlValue.Text
    
    'Call the function that will write the specified value to the specified memory offset.
    WriteLong txtWlOffset.Text, txtWlWindowName.Text, Value
    
End Sub
and the module(which is not mine )
Code:
'|--------------------------------------------------------------------
'| These functions are written by Cola-kattn (opersvik@hotmail.com)



'//All API declarations we will need to make these functions useful:

'Thanks to Robert Meffe for pointing out this API line because he didn't get it
'to work properly in his Win XP. Greets!
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF

Private Declare Function GetWindowThreadProcessId Lib "User32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long

'||-------------------------------------------------------------------------------------------------||
'|| The two next functions read\write BYTE values.                                                  ||
'|| BYTE is an 8-bit datatype that can store values from 0 to 255.                                  ||
'||-------------------------------------------------------------------------------------------------||

Public Function ReadByte(Offset As Long, WindowName As String) As Byte

    Dim hwnd As Long
    Dim ProcessID As Long
    Dim ProcessHandle As Long
    Dim Value As Byte
    
    'Try to find the window that was passed in the variable WindowName to this function.
    hwnd = FindWindow(vbNullString, WindowName)
    
    If hwnd = 0 Then
        
        'This is executed if the window cannot be found.
        'You can add or write own code here to customize your program.
        
        MsgBox "Could not find process window!", vbCritical, "Read error"
        
        Exit Function
    
    End If
    
    'Get the window's process ID.
    GetWindowThreadProcessId hwnd, ProcessID
    
    'Get a process handle.
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
    
    If ProcessHandle = 0 Then
        
        'This is executed if a process handle cannot be found.
        'You can add or write your own code here to customize your program.
        
        MsgBox "Could not get a process handle!", vbCritical, "Read error"
        
        Exit Function
    
    End If

    
    'Read a BYTE value from the specified memory offset.
    ReadProcessMem ProcessHandle, Offset, Value, 1, 0&
    
    'Return the found memory value.
    ReadByte = Value
    
    'It is important to close the current process handle.
    CloseHandle ProcessHandle
           
End Function

Public Function WriteByte(Offset As Long, WindowName As String, Value As Byte) As Boolean

    Dim hwnd As Long
    Dim ProcessID As Long
    Dim ProcessHandle As Long
    
    'Try to find the window that was passed in the variable WindowName to this function.
    hwnd = FindWindow(vbNullString, WindowName)
    
    If hwnd = 0 Then
        
        'This is executed if the window cannot be found.
        'You can add or write own code here to customize your program.
        
        MsgBox "Could not find process window!", vbCritical, "Write error"
        
        Exit Function
    
    End If
    
    'Get the window's process ID.
    GetWindowThreadProcessId hwnd, ProcessID
    
    'Get a process handle.
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
    
    If ProcessHandle = 0 Then
        
        'This is executed if a process handle cannot be found.
        'You can add or write your own code here to customize your program.
        
        MsgBox "Could not get a process handle!", vbCritical, "Write error"
        
        Exit Function
    
    End If
    
    'Write a specified BYTE value to the specified memory offset.
    WriteProcessMemory ProcessHandle, Offset, Value, 1, 0&
    
    'It is important to close the current process handle.
    CloseHandle ProcessHandle
    
End Function


'||-------------------------------------------------------------------------------------------------||
'|| The two next functions read\write INTEGER values.                                               ||
'|| INTEGER is a 16-bit(2 byte) datatype and can store values from -32768 to 32767                  ||
'||-------------------------------------------------------------------------------------------------||

Public Function ReadInteger(Offset As Long, WindowName As String) As Integer

    Dim hwnd As Long
    Dim ProcessID As Long
    Dim ProcessHandle As Long
    Dim Value As Integer
    
    'Try to find the window that was passed in the variable WindowName to this function.
    hwnd = FindWindow(vbNullString, WindowName)
    
    If hwnd = 0 Then
        
        'This is executed if the window cannot be found.
        'You can add or write your own code here to customize your program.
        
        MsgBox "Could not find process window!", vbCritical, "Read error"
            
        Exit Function
    
    End If
    
    'Get the window's process ID.
    GetWindowThreadProcessId hwnd, ProcessID
    
    'Get a process handle.
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
    
    If ProcessHandle = 0 Then

        'This is executed if a process handle cannot be found.
        'You can add or write your own code here to customize your program.

        MsgBox "Could not get a process handle!", vbCritical, "Read error"
        
        Exit Function
        
    End If
    
    'Read an INTEGER value from the specified memory offset.
    ReadProcessMem ProcessHandle, Offset, Value, 2, 0&
    
    'Return the found memory value.
    ReadInteger = Value
    
    'It is important to close the current process handle.
    CloseHandle ProcessHandle
    
End Function

Public Function WriteInteger(Offset As Long, WindowName As String, Value As Integer) As Boolean

    Dim hwnd As Long
    Dim ProcessID As Long
    Dim ProcessHandle As Long
    
    'Try to find the window that was passed in the variable WindowName to this function.
    hwnd = FindWindow(vbNullString, WindowName)
    
    If hwnd = 0 Then
    
        'This is executed if the window cannot be found.
        'You can add or write your own code here to customize your program.
        
        MsgBox "Could not find process window!", vbCritical, "Write error"
        
        Exit Function
    
    End If
    
    'Get the window's process ID.
    GetWindowThreadProcessId hwnd, ProcessID
    
    'Get a process handle.
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
    
    If ProcessHandle = 0 Then
    
        'This is executed if a process handle cannot be found.
        'You can add or write your own code here to customize your program.
    
        MsgBox "Could not get a process handle!", vbCritical, "Write error"
        
        Exit Function
        
    End If
    
    'Write a specified INTEGER value to the specified memory offset.
    WriteProcessMemory ProcessHandle, Offset, Value, 2, 0&
    
    'It is important to close the current process handle.
    CloseHandle ProcessHandle
    
End Function


'||-------------------------------------------------------------------------------------------------||
'|| The two next functions read\write LONG values.                                                  ||
'|| LONG is a 32-bit(4 byte) datatype and can store values from -2,147,483,648 to 2,147,483,647     ||
'||-------------------------------------------------------------------------------------------------||

Public Function ReadLong(Offset As Long, WindowName As String) As Long

    Dim hwnd As Long
    Dim ProcessID As Long
    Dim ProcessHandle As Long
    Dim Value As Long
    
    'Try to find the window that was passed in the variable WindowName to this function.
    hwnd = FindWindow(vbNullString, WindowName)
    
    If hwnd = 0 Then
    
            'This is executed if the window cannot be found.
            'You can add or write your own code here to customize your program.
                        
            MsgBox "Could not find process window!", vbCritical, "Read error"
            
            Exit Function
        
    End If
    
    'Get the window's process ID.
    GetWindowThreadProcessId hwnd, ProcessID
    
    'Get a process handle
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
    
    If ProcessHandle = 0 Then
    
        'This is executed if a process handle cannot be found.
        'You can add or write your own code here to customize your program.
    
        MsgBox "Could not get a process handle!", vbCritical, "Read error"
        
        Exit Function
        
    End If
    
    'Read a LONG from the specified memory offset.
    ReadProcessMem ProcessHandle, Offset, Value, 4, 0&
    
    'Return the found memory value.
    ReadLong = Value
    
    'It is important to close the current process handle.
    CloseHandle ProcessHandle
    
End Function

Public Function WriteLong(Offset As Long, WindowName As String, Value As Long) As Boolean

    Dim hwnd As Long
    Dim ProcessID As Long
    Dim ProcessHandle As Long
    
    'Try to find the window that was passed in the variable WindowName to this function.
    hwnd = FindWindow(vbNullString, WindowName)
    
    If hwnd = 0 Then
    
            'This is executed if the window cannot be found.
            'You can add or write your own code here to customize your program.
                        
            MsgBox "Could not find process window!", vbCritical, "Write error"
            
            Exit Function
        
    End If
    
    'Get the window's process ID.
    GetWindowThreadProcessId hwnd, ProcessID
    
    'Get a process handle
    ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
    
    If ProcessHandle = 0 Then
    
        'This is executed if a process handle cannot be found.
        'You can add or write your own code here to customize your program.
    
        MsgBox "Could not get a process handle!", vbCritical, "Write error"
        
        Exit Function
        
    End If
    
    'Read a LONG from the specified memory offset.
    WriteProcessMemory ProcessHandle, Offset, Value, 4, 0&

    'It is important to close the current process handle.
    CloseHandle ProcessHandle

End Function
 
Status
Not open for further replies.
Back
Top Bottom