Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help in get total amount of gold [ShadowFlare]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
yoelgama
How do I cheat?
Reputation: 0

Joined: 16 Jun 2017
Posts: 4

PostPosted: Fri Sep 06, 2019 12:42 pm    Post subject: Help in get total amount of gold [ShadowFlare] Reply with quote

Hello Smile
I've tried get the total amount of gold in shadowflare (Singleplayer game) but I can't do this.

The gold is separete by amounts of 10000 in the bag and show the total in the top of the bag.

So far I could only get the pointer (because the address is DMA) that's the last item on the bag and values separeted of gold (1 address for each amount of gold).

I also tried to get all items of the bag (for so get all amounts of gold and then sum all values), but no success.

And finally I tried every way I know get de total of gold what shows for me in the bag (Find for 4 btes, float, double, strings, all values in the same time, find for unknows values and "decreased" and "increased"), but nothing Sad

I want do this for build a mod for this game. The game is good but there are things that can improve. My mod will help but will cost gold and MP(this way will not be so easy).

Any tutorial or helping for how can I do this? Thanks.



goldSF.png
 Description:
 Filesize:  115.19 KB
 Viewed:  134 Time(s)

goldSF.png


Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 149

Joined: 25 Jan 2006
Posts: 7729
Location: 127.0.0.1

PostPosted: Fri Sep 06, 2019 5:23 pm    Post subject: Reply with quote

- Get a single stack of gold in your inventory.
- Search for the exact amount (4 bytes).
- Right-click the stack, take out 1 piece of the stack and put it in another spot in your inventory.
- Research for the original amount - 1.
- Place the single piece of gold back in the stack.
- Research for the original amount.

For example:
- Get a stack of 11 gold.
- Search for 11.
- Remove 1 piece of gold from the stack into a new spot in the inventory.
- Research for 10.
- Put the 1 gold back into the stack.
- Research for 11.

You should be able to find the value easily then.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
yoelgama
How do I cheat?
Reputation: 0

Joined: 16 Jun 2017
Posts: 4

PostPosted: Fri Sep 06, 2019 6:19 pm    Post subject: Help in get total amount of gold [ShadowFlare] Reply with quote

I tried it but what I get is address only for an stackof gold, not for total of gold in bag.

Example:
1)(Steps that you suggested)
2) add more 10000 of gold on stack of 11 gold, the game will make 2 stacks, 1 = 10 000 gold(Limit per stack) an 2 = 11 gold(what I had before).

the addresses that i found ever is just for stack of 11 gold or 10 000 gold, never for 10 011, the total in bag.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 149

Joined: 25 Jan 2006
Posts: 7729
Location: 127.0.0.1

PostPosted: Fri Sep 06, 2019 8:30 pm    Post subject: Reply with quote

The total is calculated from each entry in the bag that is found and added up.

This is the function that handles that:
Code:

int __thiscall sub_466D70(void *this)
{
  int v1; // [email protected]
  int result; // [email protected]

  v1 = *(_DWORD *)this;
  for ( result = 0; v1; v1 = *(_DWORD *)(v1 + 140) )
  {
    if ( *(_DWORD *)(v1 + 12) == 4 && !*(_DWORD *)(v1 + 20) )
      result += *(_DWORD *)(v1 + 64);
  }
  return result;
}

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
yoelgama
How do I cheat?
Reputation: 0

Joined: 16 Jun 2017
Posts: 4

PostPosted: Fri Sep 06, 2019 8:35 pm    Post subject: Help in get total amount of gold [ShadowFlare] Reply with quote

So thanks. How can Iintercept de return value of this function in CE?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 149

Joined: 25 Jan 2006
Posts: 7729
Location: 127.0.0.1

PostPosted: Fri Sep 06, 2019 8:53 pm    Post subject: Reply with quote

This will fake the return value to show whatever you want, but keep in mind this may not have the results you are looking for. Also not sure what version of the game mine is, it's super old that I had on an old drive so dunno if the addresses and stuff will line up the same for you.

Code:

{ Game   : ShadowFlare.exe
  Version: ???
  Date   : 2019-09-06
  Author : atom0s

  Fakes the return value shown as total gold in game.
}

[ENABLE]
aobscanmodule(totalgold,ShadowFlare.exe,68 E8 03 00 00 6A 01 6A 00 6A 00 8B 7C 24 34)
alloc(newmem,$1000)
label(return)

newmem:
    // EAX holds the total gold value currently..
    mov eax, (int)999999

    // Restore original code..
    push 000003E8
    jmp return

totalgold:
    jmp newmem
return:

registersymbol(totalgold)

[DISABLE]
totalgold:
    db 68 E8 03 00 00 6A 01 6A 00 6A 00 8B 7C 24 34

unregistersymbol(totalgold)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: "ShadowFlare.exe"+8ABB

"ShadowFlare.exe"+8A90: 0F 84 DD 02 00 00  -  je ShadowFlare.exe+8D73
"ShadowFlare.exe"+8A96: 8B 8B 18 A0 00 00  -  mov ecx,[ebx+0000A018]
"ShadowFlare.exe"+8A9C: E8 0F C2 02 00     -  call ShadowFlare.exe+34CB0
"ShadowFlare.exe"+8AA1: 8B F0              -  mov esi,eax
"ShadowFlare.exe"+8AA3: 85 F6              -  test esi,esi
"ShadowFlare.exe"+8AA5: 0F 84 C8 02 00 00  -  je ShadowFlare.exe+8D73
"ShadowFlare.exe"+8AAB: 8D 8E 14 05 00 00  -  lea ecx,[esi+00000514]
"ShadowFlare.exe"+8AB1: 55                 -  push ebp
"ShadowFlare.exe"+8AB2: 89 4C 24 1C        -  mov [esp+1C],ecx
"ShadowFlare.exe"+8AB6: E8 B5 E2 05 00     -  call ShadowFlare.exe+66D70
// ---------- INJECTING HERE ----------
"ShadowFlare.exe"+8ABB: 68 E8 03 00 00     -  push 000003E8
// ---------- DONE INJECTING  ----------
"ShadowFlare.exe"+8AC0: 6A 01              -  push 01
"ShadowFlare.exe"+8AC2: 6A 00              -  push 00
"ShadowFlare.exe"+8AC4: 6A 00              -  push 00
"ShadowFlare.exe"+8AC6: 8B 7C 24 34        -  mov edi,[esp+34]
"ShadowFlare.exe"+8ACA: 6A 04              -  push 04
"ShadowFlare.exe"+8ACC: 6A 00              -  push 00
"ShadowFlare.exe"+8ACE: 8B 0D 10 2D 48 00  -  mov ecx,[ShadowFlare.exe+82D10]
"ShadowFlare.exe"+8AD4: 8B 2D 6C 35 47 00  -  mov ebp,[ShadowFlare.exe+7356C]
"ShadowFlare.exe"+8ADA: 6A 00              -  push 00
"ShadowFlare.exe"+8ADC: 6A 00              -  push 00
}

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
yoelgama
How do I cheat?
Reputation: 0

Joined: 16 Jun 2017
Posts: 4

PostPosted: Fri Sep 06, 2019 8:55 pm    Post subject: Help in get total amount of gold [ShadowFlare] Reply with quote

So very thanksss. I'll do tests in case of fail i'll study. Thanks bro <3 Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites