From 8c63f8b71a203176e819fa65b84e50220b561988 Mon Sep 17 00:00:00 2001 From: ze00 Date: Wed, 16 Aug 2017 18:42:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=B7=E5=BF=83=E8=8F=9C=E6=8A=95=E6=89=8B?= =?UTF-8?q?=E5=8A=A0=E5=BC=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ cheater.c | 1 + cheater.h | 8 +++++++- pvz_offset.h | 5 ++--- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e69de29..6d7240e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +cheater +patcher +elfreader diff --git a/cheater.c b/cheater.c index 662981f..241f61d 100644 --- a/cheater.c +++ b/cheater.c @@ -19,5 +19,6 @@ int main(int argc,char **argv) { int *base = getDynamicBase(); baseInfo.base = (char *)base; removeColdDown(); + increaseCabbageHurler(); return 0; } diff --git a/cheater.h b/cheater.h index 96a070e..e894bfa 100644 --- a/cheater.h +++ b/cheater.h @@ -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 diff --git a/pvz_offset.h b/pvz_offset.h index 1d77c15..0e2b60a 100644 --- a/pvz_offset.h +++ b/pvz_offset.h @@ -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; @@ -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; } }