Skip to content

Commit

Permalink
卷心菜投手加强
Browse files Browse the repository at this point in the history
  • Loading branch information
ze00 committed Aug 16, 2017
1 parent dccdf4e commit 8c63f8b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cheater
patcher
elfreader
1 change: 1 addition & 0 deletions cheater.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ int main(int argc,char **argv) {
int *base = getDynamicBase();
baseInfo.base = (char *)base;
removeColdDown();
increaseCabbageHurler();
return 0;
}
8 changes: 7 additions & 1 deletion cheater.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,19 @@ void removeColdDown() {
int *p = (int *)(base + getOffset("cannon")),val;
for(int i = 0;i < 48;++i) {
// sm_read_array(baseInfo.pid,p,&val,sizeof(int));
//.printf("%d\n",val);
// printf("%d\n",val);
sm_write_array(baseInfo.pid,p,&val,sizeof(int));
p -= 9;
}
}
void letZombiesFragile() {
//TODO:implement this
char *base = baseInfo.base;
int *p = (int *)(base + getOffset("gargantuar")),val;
}
void increaseCabbageHurler() {
char *p = baseInfo.base + getOffset("cabbage");
int v = 45;
sm_write_array(baseInfo.pid,p + 8,&v,sizeof(int));
}
#endif //__CHEATER__H
5 changes: 2 additions & 3 deletions pvz_offset.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ struct pvz_offset {
struct pvz_offset pvz_off_tbl[] = {
{ "coins", OFF_MISC, -0xfd2060 },
{ "gargantuar", OFF_ZOMBIES, 0xc4c6c4 },
{ "cannon", OFF_PLANTS, 0xc4367c },
{ "cabbage", OFF_PLANTS, 0xc44460 },
{ "cannon", OFF_PLANTS, 0xc4467c },
};
off_t getOffset(const char *name) {
off_t off = -1;
Expand All @@ -34,8 +35,6 @@ off_t getOffset(const char *name) {
pf = &pvz_off_tbl[i];
if(strcmp(name,pf->name) == 0) {
off = pf->offset;
if(pf->type == OFF_PLANTS)
off += 4096;
break;
}
}
Expand Down

0 comments on commit 8c63f8b

Please sign in to comment.