A question on declaring variables and constants.

Need Help With an Existing Feature in Memory Hacking Software? Ask Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

A question on declaring variables and constants.

Postby esco » Tue May 17, 2011 6:00 am

Hey Spiro, hope everything is going good for you out there in Japan. The last I heard from you, you were literally living like a millionaire out there! 8)

I had a few quick questions for you about memhack:

1)Is there a way to declare a variable, constant, structure, or a function in a manner that it can be used by SEVERAL LOCKED SCRIPTS? For example if I put some scripts into 0x1ffff0, then put more into 0x1ffff2, and I want them both to be able to access STRUCT Spiro which is in 0x1ffff4, can this be done?

2)Is there a way to save my bookmarks in the hex editor when I close the program?

3)You mentioned putting out a release of memhack that could encrypt scripts, and possibly compile them quicker.... do you have any idea when you might be putting this out? I only ask because I was thinking of putting out another demo, but I might wait until the next release comes out instead just so someone doesn't rip off my work (since it would have to contain a TON of scripts for the main character to work right).
Esco.... the name says it all. New Yorikan for life.
User avatar
esco
NULL
 
Posts: 148
Joined: Mon Sep 18, 2006 2:25 am
Location: Florida, a.k.a. the US's version of hell!

Re: A question on declaring variables and constants.

Postby L. Spiro » Tue May 17, 2011 8:39 am

Life in Japan is always exciting, even if not always on the ups.


#1: From one script you can use Malloc() which will return an address on the heap, which can be accessed by all scripts as long as they know the address.
Put the address into a temporary file. The other scripts can load the file and get the address.
This should be made simpler and more streamlined, but maybe some day.

#2: Not that I recall.

#3: Not for a long time. It is not worth your time to wait.
I have a new game engine to make for next-gen consoles and that takes priority until it is functional and can be used for showcasing.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: A question on declaring variables and constants.

Postby esco » Tue May 17, 2011 11:02 am

It's good to hear that you are focusing on your engine so much and it is working out... but in the meantime do you have any advice for me on how I could encode the files on my own so that people can't just rip out my code? Other than the obvious removing of all notes, and obvious variable names I mean?

Also I looked up Malloc but I don't see what you mean by using it? Can you give me a quick example? I basically have several variables, structures, scripts and constant that are used by several scripts, and it would save a lot of space if I didn't have to keep copy and pasting them into each area's scripts. It's just too much of a waste, and the way I am going I might just end up dying cold and lonely under a bridge like you mentioned. Lol

Here are just a few examples of what I have:

Code: Select all
const LONG flamepuffs = -2145601996;
extern SHORT stagenum = { "", 0x0974a0+exe};       //0x9e34c0
struct MONSTER {
   LONG text;
   SHORT hp;
   SHORT dmg;
   SHORT element;
   SHORT def;
   SHORT canbehit;
   SHORT weakto;
   SHORT strongto;
   SHORT immuneto;
   SHORT absorbs;
   SHORT level;
   SHORT exp;
   SHORT commondrop;
   SHORT raredrop;
   SHORT commonrate;
   SHORT rarerate;
   BYTE hsize;
   BYTE vsize;
   BYTE unknown1;
   BYTE special;
   BYTE showsdmg;
   BYTE showsname;
};
Esco.... the name says it all. New Yorikan for life.
User avatar
esco
NULL
 
Posts: 148
Joined: Mon Sep 18, 2006 2:25 am
Location: Florida, a.k.a. the US's version of hell!

Re: A question on declaring variables and constants.

Postby L. Spiro » Tue May 17, 2011 3:04 pm

If you are not talking about real-time sharing of data, you can simply put the values/constants/structure definitions into a single file and #include the file in each script.

There is no automated way to compile scripts, so unfortunately there is no way to encrypt them.
You can however modify the MHS source code to unzip or unencrypt them when compiling.
This is actually a very easy edit with the public source.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: A question on declaring variables and constants.

Postby esco » Tue May 17, 2011 5:42 pm

Actually, what I am doing would be in real time with reading of the constants, vars, etc. It would be done as the game is running on the fly with stuff that would have to be correct even down to the tick. But I will research #include some and try to figure it out, and see if it works fast enough to still be of use.

As for modifying your source code.... yeah, that will end REEEEEAAALLY good for me. I wouldn't even know where to start.... but thanks anyway for the vote of confidence. 8)
Esco.... the name says it all. New Yorikan for life.
User avatar
esco
NULL
 
Posts: 148
Joined: Mon Sep 18, 2006 2:25 am
Location: Florida, a.k.a. the US's version of hell!

Re: A question on declaring variables and constants.

Postby esco » Fri May 20, 2011 3:01 pm

Just want to say thanks for the advice on including a txt file in my scripts.... it worked like a charm, and you just helped me shrink down the mhs file, which makes it load faster, and this little tip also saves me a LOT of work! Thanks bro.

I also released a video demonstrating some of the changes I did to the game thus far, if you feel like taking a look. I made a blog for my project for conveniences sake: http://sotnhacked.wordpress.com/
Esco.... the name says it all. New Yorikan for life.
User avatar
esco
NULL
 
Posts: 148
Joined: Mon Sep 18, 2006 2:25 am
Location: Florida, a.k.a. the US's version of hell!


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron