Using your code I was able to find and figure out the skill entries, which of course can let the labor assigner assign based on skill.
Also note the way the pointer arrays are read. Add a
to keep things from blowing up.
I wonder how bad this will look. I'm used to clicking on preview a dozen times before posting.
code:
#define ADDRESS_SKILLS 1076
#define ADDRESS_SKILLS_END (ADDRESS_SKILLS + 4)typedef struct {
WORD id;
WORD level;
DWORD exp;
DWORD unknown[2];
} skill_entry;
const char *skill_levels[16] = {
"Dabbling ",
"Novice ",
"",
"Competent ",
"Skilled ",
"Proficient ",
"Talented ",
"Adept ",
"Expert ",
"Professional ",
"Accomplished ",
"Great ",
"Master ",
"High Master ",
"Grand Master ",
"Legendary "
};
const char *skill_names[68] = {
"Miner",
"Wood Cutter",
"Carpenter",
"Engraver",
"Mason",
"Animal Trainer",
"Animal Caretaker",
"Fish Dissector",
"Animal Dissector",
"Fish Cleaner",
"Butcher",
"Trapper",
"Tanner",
"Weaver",
"Brewer",
"Alchemist",
"Clothes Maker",
"Miller",
"Thresher",
"Cheese Maker",
"Milker",
"Cook",
"Grower",
"Herbalist",
"Fisherdwarf",
"Furnace Operator",
"Adamantine Extractor",
"Weaponsmith",
"Armorsmith",
"Metalcrafter",
"Gem Cutter",
"Jeweler",
"Wood Crafter",
"Stone Crafter",
"Metal Crafter",
"Glassmaker",
"Adamantine Worker",
"Adamantine Smelter",
"Adamantine Weaver",
"Leatherworker",
"Bone Carver",
"Wrestler",
"Axedwarf",
"Swordsdwarf",
"Knife User",
"Macedwarf",
"Hammerdwarf",
"Speardwarf",
"Marksdwarf",
"Shield User",
"Armor User",
"Siege Engineer",
"Siege Operator",
"Bowyer",
"Pikedwarf",
"Lasher",
"Bowdwarf",
"Blowgunner",
"Thrower",
"Mechanic",
"Druid",
"Ambusher",
"Building Designer",
"Wood Burner",
"Lye Maker",
"Soaper",
"Potash Maker",
"Dyer"
};
code:
{
DWORD arraySkills, arraySkillsEnd, addressSkill;
int compSkill=0;
skill_entry skill; ReadProcessMemory(h_process, (VOID*) (addressUnit+ADDRESS_SKILLS), &arraySkills, 4, &bytes);
ReadProcessMemory(h_process, (VOID*) (addressUnit+ADDRESS_SKILLS_END), &arraySkillsEnd, 4, &bytes);
//if(arraySkills) printf("%08x %08x\n", arraySkills, arraySkillsEnd);
while ((arraySkills + UNIT_ARRAY_NEXT * compSkill) < arraySkillsEnd) {
ReadProcessMemory(h_process, (VOID*) (arraySkills + UNIT_ARRAY_NEXT * compSkill), &addressSkill, 4, &bytes);
ReadProcessMemory(h_process, (VOID*) addressSkill, &skill, sizeof(skill), &bytes);
printf("\t%s%s %d/%d\n",
skill_levels[skill.level > 14 ? 15 : skill.level],
skill_names[skill.id],
skill.exp, (skill.level+5)*100);
compSkill++;
}
}