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 


Global Variables in Delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Wed Jul 31, 2013 12:04 pm    Post subject: Global Variables in Delphi Reply with quote

in C++ we simply add variables under the includes if we'd like.

If we added for example this:

Code:
BYTE myBytes [] = { 0xC8, 0xC4, 0xCC };


when I open my app in hex viewer I can find that signature.

In delphi it seems that when I do this:

Code:
myBytes:Array [0..2] of Byte ( $C8, $C4, $CC );


(^I know thats probably wrong)

I won't be able to find my array of bytes in hex viewer like I could in C++.

Is delphi like that or must I do something specific to get it visible in memory?
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25823
Location: The netherlands

PostPosted: Wed Jul 31, 2013 12:26 pm    Post subject: Reply with quote

Do you use myBytes ? If not, it may have been optimized away (and even then if it's a const array it might get optimized away as well)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Thu Aug 01, 2013 9:30 pm    Post subject: Reply with quote

so I do myBytes [0] = 0xC8; in a function will it stop it from optimizing?

i'm not familiar with Delphi so I would I make it a unchangeable array?
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25823
Location: The netherlands

PostPosted: Fri Aug 02, 2013 2:21 am    Post subject: Reply with quote

You need to create a dynamic array that gets initialized at runtime and used in another function. Else it replaces code that accesses that array element with a const value

Perhaps you can use asm db 0,1,2,3,4.... end

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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