This thread will be a place for myself and T.C. to document our progress on our ETW/NTW memory hook and documentation on the memory locations and structure of the running processes memory, as well as discuss its theory and implementation. If you have anything to input, please do.The thread may look bleak, but progress is actually quite astounding, theoretical implementation of what we can already do/know could mean quite astounding things. We will no doubt update everyone at a later point.
BETA POINTER:
Originally Posted by T.C.
I've confirmed another pointer at the Primary Address. This one seems to relate to units_tables, and we've named it Beta pointer for now. It's structure is a little harder to understand than the Alpha pointer (unit_stats_land). The Beta pointer begins at byte 72 in the primary pointer. As usual, four byte little-endian.
There doesn't seem to be a header in these files, which is understandable as there is no difference between a naval entry and a land entry in units_tables.
From the beginning of the memory at the Beta Address:
Byte 36 - Four byte int, recruit time
Byte 40 - Four byte int, unit upkeep cost
Byte 72 - four byte int, unit limit
There's also a lot more pointers here, probably to the string based data you see in units_tables in PFM.
Want to help?
Spoiler Alert, click show to read:
Originally Posted by T.C.
Documentation Tutorial
Once you have copied the Primary pointer into a new file, you can compare it with other Primary pointers quite easily. It also makes it easy to work your way through the bytes and find the values we have identified (list kept in first post of this thread).
What you then need to do, is open Cheat Engine. Follow the tutorial presented the first time you run it, though as far as the step 3 (that's all you need that is relevant to this task).
Once you know how, you can then scan for values - use the "Memory Scan Options" to scan between the start and end of a specific Primary pointer. If you begin with an "unknown initial value scan", then proceed onto an "unchanged value" scan, you should get a good list of results. Using this method, change any values that you think represent in-game stats, and check in game to see if the change has registered. If you verify an unknown value, make a post here and let us know! If you see the OP you will also find out where the Alpha Address/Pointer is located (see my last post on the previous page for info on this). We don't know much about the data stored at the Alpha Address, but we do know some of the interesting stats (such as ammo) are stored there.
Last edited by .Mitch.; July 18, 2012 at 01:21 PM.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Topcats LUA outputs the base address of a units location in memory. For example: 0x040ffbef0. So memory scanning isn't necessary.
We then read the following bytes after the base address to give us the position of certain attributes of the unit, for example 76 bytes after a units base address is the units size.
I've been using my own program that reads the following 1000 bytes after a base address and cross references similarities to the unit. Topcat has been using cheatengine to read the memory in hex and more tediously comparing them manually.
Now I know that 76 bytes after a base address is a units size, I can do things like match a units location on the campaign map to a colourmap of europe or w/e and based on its location (if its in snow/desert) we can effect the unit. So basically from what we know it would be extremely easy to implement NTW's attrition feature into ETW.
That's just one example of a million possibilities. We can do exactly this for cities, etc, etc.
Topcats LUA outputs the base address of a units location in memory. For example: 0x040ffbef0. So memory scanning isn't necessary.
We then read the following bytes after the base address to give us the position of certain attributes of the unit, for example 76 bytes after a units base address is the units size.
I've been using my own program that reads the following 1000 bytes after a base address and cross references similarities to the unit. Topcat has been using cheatengine to read the memory in hex and more tediously comparing them manually.
Now I know that 76 bytes after a base address is a units size, I can do things like match a units location on the campaign map to a colourmap of europe or w/e and based on its location (if its in snow/desert) we can effect the unit. So basically from what we know it would be extremely easy to implement NTW's attrition feature into ETW.
That's just one example of a million possibilities. We can do exactly this for cities, etc, etc.
Given what we've achieved so far I can confidently say it's possible to design an attrition system like Napoleon's, and also a replenishment system like Napoleons. Expect both of them in the coming months
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Given what we've achieved so far I can confidently say it's possible to design an attrition system like Napoleon's, and also a replenishment system like Napoleons. Expect both of them in the coming months
It would be great. In my dream campaign map there's a supply chain. But I also think that this system should be linked to groundtypes in campaign map. So our researches should go in parallel.
It would be great. In my dream campaign map there's a supply chain. But I also think that this system should be linked to groundtypes in campaign map. So our researches should go in parallel.
What's your ideas relating to ground types?
I've confirmed another pointer at the Primary Address. This one seems to relate to units_tables, and we've named it Beta pointer for now. It's structure is a little harder to understand than the Alpha pointer (unit_stats_land). The Beta pointer begins at byte 72 in the primary pointer. As usual, four byte little-endian.
There doesn't seem to be a header in these files, which is understandable as there is no difference between a naval entry and a land entry in units_tables.
From the beginning of the memory at the Beta Address:
Byte 36 - Four byte int, recruit time
Byte 40 - Four byte int, unit upkeep cost
Byte 72 - four byte int, unit limit
There's also a lot more pointers here, probably to the string based data you see in units_tables in PFM.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Yeah I'm a huge fan of this stuff, though I've only ever made simple trainers (infinite lives, etc.) I'll be following your progress, this is some nice stuff. The real challenge is going to be creating functions that modders can reference.
Yeah I'm a huge fan of this stuff, though I've only ever made simple trainers (infinite lives, etc.) I'll be following your progress, this is some nice stuff. The real challenge is going to be creating functions that modders can reference.
That's going to be easy on our behalf; the problem for other modders is acquiring the memory pointers, which takes a bit of scripting knowledge to do. In fact I'd say I'm one of very few poeple who knows how to access these pointers, at least I haven't seen of any other active modders utilising them for scripting. I'll have to get writing tutorials again
If you want to help out with this Bolk we can get you off the ground quite easily.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
The real challenge is going to be creating functions that modders can reference.
I've already got the concept in my head of how we'll make this available to others.
The main application of this will be implementation of extra game mechanics and so without sounding greedy anything 'amazing' will likely be done natively in the executable (sort of like a second game engine) instead of via any secondary functionality.
I don't know if LUA is capable of working with an executable (infact I know it is.. I just have no experience of LUA implementation into C/C++/C#), if I do then I'll likely make an API of sorts to interface with it and call the functions available to the executable. Via the scripting.lua of the game you can do literally just about anything you want, you just can't make any effects into the game. So for instance you can find out alot of information, make a million if statements have a really l33t system in place, but you cant make it effect the campaign. That was our whole idea here really, to make the possibilites of what LUA can do actually do something.
I know TC has programming experience so I'll likely just make my source code available to him at some point so he can implement his own functionality without having to bother with the shite I've gone through.
Nomatter what though people will need LUA experience (at the very least) to make use of this, I'll likely make TC write some LUA functions that output text command lines to a file, my program will read the file and take the commands from the stack and implement them. Sort of a very very crap API.
If I implement a modding API into warscape can I haz opifex pl0x?
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Ok so a little theory, most of which will probably only be relevant to Mitch and I until I write more background tutorials.
Note that I'm not used to working with data structures this low level, apologies for any incorrect terminology.
The memory chunks which unit pointers point at have the following format:
First four bytes [0 - 3] are some sort of header; they seem to take the format 68 45 4A 01.
The next four bytes is [4 - 7] are an index of sorts - possibly linked into the "unitXX" ID that is assigned to unit card components, though I doubt it.
Next four unknown, however the next four after that [12 - 15] seem to always take the form D8 45 4A 01 (notice the bytes 45 4A 01, they repeat frequently throughout the memory sector)
Apart from that we know very little, except that each unit pointer ends in 00 00 00 8C when there is another pointer following it.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
But I think we need a DLL code-injector first to make any decent usage of them.
I'm waiting for a Craig's statement on this "burning issue" because it's legally very borderline (although ethically more questionable, as it's just memory patching and no copyrighted material is shared). Crossing fingers.
Bye.