Author Topic: Editing the in game menu  (Read 7033 times)

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #25 on: 2016-03-05 18:25:16 »
Yeah but I still don't exactly know how to do it. I don't think I know enough to so this project but I don't wanna give up

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #26 on: 2016-05-27 00:05:25 »
Working on this again, got it all figured out now

Does anyone know how to resolve an issue i have with this, i am able to completely design the menu to a state where it looks awesome and im happy but everything i move ie hp bar mp bar level etc also moves on every other menu like item magic and such resulting in everything not fitting. i need to only move in the 1 menu at a time.
« Last Edit: 2016-05-28 15:11:48 by Tsunamix »

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #27 on: 2016-05-30 15:49:31 »
Sorry for the triple post here but i dont think my edit re-bumps the topic. In addition to my previous comment im also having trouble saving my edits, i have all my numbers written down so i can copy/paste easily but i need to save it back into an exe so i dont have to do this every time. Im using cheat engine to do it

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #28 on: 2016-05-30 17:01:32 »
Use HextLaunch in DLPB Tools.  After you are done, you can use the same text file with HextEdit.  This will save you a LOT of time.

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #29 on: 2016-05-30 17:56:16 »
Ill try that, thanks. You were right this is a long process, i was using cheat engine because it allows me to see whats moving as i do it. Does yours do the same?

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #30 on: 2016-05-30 19:40:15 »
No, but it will allow you to instantly end up back where you were every time you load the game. You still use cheat engine.

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #31 on: 2016-05-30 20:15:29 »
So whenever i change a number and crash it it'll save, if so thats so handy, thanks DLPB. Did you happen to know if i can change the location of things on the menu without also moving in all other menus too or will i have to redesign every menu to fit around it?

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #32 on: 2016-05-30 21:00:20 »
It depends what menu you are trying to change and what the code is.  You can always recode things.

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #33 on: 2016-06-01 15:38:37 »
Ok ive got all that sorted, its saving now which saves soooo much time, i can put it in IRO and everything. Only problem im having without introducing my item menu magic etc issues is im trying to move the HP/MP values along the X-axis, i can move them but it'll only go to like 73 then it vanish's. Ive tried editing the adjacent values but it still vanishes. Are there rules in this that im missing?

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #34 on: 2016-06-01 15:44:11 »
Yeah - you need to understand that there are signed byte values....  7f is the maximum you can have with a signed byte. To extend it, you need to look in to making the value range larger.

This will obviously mean at least one more byte of space is needed, which you don't have.  You have to make that extra byte by editing code - or when that's not possible - moving to a blank area of code, replicating the piece you needed as the jump or call opcode - and the  jumping back.

Depending on situation you can use call - ret, rather than jump jump.

But it's best to edit code rather than jump or call where possible.

Show me the exact address and I will give you an example.
« Last Edit: 2016-06-01 15:45:54 by DLPB »

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #35 on: 2016-06-01 15:51:01 »
Yeah i havent got a grasp of the move, add push stuff. Ive just been messing with numbers and found patterns to help me out. Uhh the code i have is 006C64C5 =28 i altered the address so the 1st number was the one i could change cuz it kept crashing. Right now it's an xor

Also with some like the word HP/MP and LV when the values goes above something it changes from say HP to MP. It's confusing me

2nd edit, i dunno if this example is the easiest to understand. when its 28, its says HP i can alter it to 30 which will move it left, but if i alter it to 31 The H the sorta dissapears behind something and im left with just the P

AHH another edit, this is probably better 006C6518 = 7B i guess i can take it 7F but i need it further to the Right. Use this one its more like what your asking

What do you use to change the coding, ive tried a few decompilers but it never gets me  anywhere
« Last Edit: 2016-06-01 16:35:33 by Tsunamix »

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #36 on: 2016-06-01 18:50:01 »
You use cheat engine to edit code... it is a full debugger.  You need to get the basics of assembly down (for example, you don't need to enter "68" to create a push.  Just highlight the instruction and type in "Push 10" to push 10 onto the stack.  Also... learn all about the stack.)  Learn the opcodes.  It doesn't take that long - assembly is logical  and has good syntax despite being time consuming.  Unlike C and C++ that I want to bomb out of existence and refuse to learn.

I will take a look at your example soon and show you.  It's much easier being shown.
« Last Edit: 2016-06-01 18:53:08 by DLPB »

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #37 on: 2016-06-01 19:42:30 »
Sounds good, thanks for the help

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #38 on: 2016-06-01 20:12:47 »
To move that value, a quicker way is to move all values across and then adjust, unless you can't do that?

mov edx,[ebp+08]

You can see here that the starting value is being taken from ebp +8 (which is the first argument of the current function you are in).  You can edit that argument to move it across  - or you can remove that entry entirely which will save 3 bytes.  Let's take the latter example:

While not on the screen you are editing (so game doesn't crash)

 Change mov edx,[ebp+08] to  "push 100"

And then delete the "push edx" below. Either right click and replace with code that does nothing or left click and enter "nop"  which is opcode 90 and means "no operation".  If you don't delete the push edx, you will have TWO pushes which completely wrecks the stack and will likely cause a crash.

But I have a feeling you actually want to move the whole lot right before you make a tweak to the add instruction - in which case, you need to find what placed a value at [ebp+08] in the first place.  Easy to do.

Simply search for the current function:

The current function starts at 6C62A2 (these usually follow a "ret" instruction - which is the function before it returning).

So search for 6C62A2 in "find assembly code" 

You'll end up seeing that there are many of them - this is because that function is called for all the different menus.... The PHS menu etc all call that same function.

The first one returned in my list is 6CAC02. Go into it and you can see that the first argument is added to at 6CABFB - so change from 9D to maybe 100  and you'll see that the main menu has been altered.... ALL entries have been moved right.  And also notice that this value is already past 7F and uses more bytes... so you can go as far as you want. If you want to move left, you need to use FF FF FF 10 etc to use negative numbers or... better yet... change the add to a sub (I am not sure if that add opcode allows negative add... I'd need to look at documentation.  But remember this for a 4 byte push value.).

You will need to do this for all functions that call 6C62A2  if you want to make the change on all menus...  OR you can do it the other way as my first example - and change THAT function.  The change will then be reflected on all menus.  It all depends how you want to do it.
« Last Edit: 2016-06-01 20:20:56 by DLPB »

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #39 on: 2016-06-01 23:50:40 »
Okay, thats very helpful. Assuming i get the same numbers. I did notice that altering some would change the type and also change the numbers that corresponded to that type. If i can work this out properly i may go back to the beginning and start with this new idea. The only thing on the menu this far i haven't been able to move is the players name. Only way i could do it was using the status line i got from the notes you sent me. But that required everything to move which knocked it all out of place. If i can extend the reach of each component i can use the status to move everything but only focus on the name, leave it there and rearrange everything around it i guess. If a value goes too far the the left and appears like its behind something im guessing its a box placed for the form position. Or just the same situation as my 1st example where it reaches the end of its acceptable area. There are a few lines i didnt understand where if i changed it from C2 to C1 or 50 to 51 (This occurred alot with these specific numbers) It would alter the player names separately for instance cloud would move left and barret would move right. This confused me but it also made me think that if i can access these and move each players stats independently i could even have them going vertically rather than horizontal. Kinda like FF13 (Hated it but i though the menu was pretty cool)

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #40 on: 2016-06-02 00:05:48 »
With practice and research you'll become more adept and wonder why you ever did it the way you did when you started.  I restarted the menu project 3 times - one of those times was to redo all the hex changes. And now I'm happy with it :)

If the string goes outside the box, then you need to move the box.  It's not difficult, as I showed you above.  It's all about looking at what is causing the offset in the first place. When a value is truly 0, it will be at position 0 - the furthest left coordinate on screen.  When you see ebp + 8 or whatever, and then add, edx 2D - push edx (for example), chances are that it is inside a box and is being fed the start box X or Y pos. 

Also, there are times when you will need to adjust the Z value.  This is a floating point push value usually... so you'll see things like Push 3F x x x  or whatever the numbers are. It will be near the x y pushes obviously.  Sometimes it's not there because a register is being pushed in its place.  I had to add one or two of them manually.
« Last Edit: 2016-06-02 00:13:14 by DLPB »

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #41 on: 2016-06-02 00:19:30 »
Alright ill do all this research now anyway. Yeah i never understood how a Z could be in, Pushing on a Z should be no different unless its a 3d space which its not so? Meh. After i do have this im gonna need to figure out out how to disconnect the main menu from all the others. When i get it perfect on the main window the others look ridiculous cuz its just copy and pasted basically.

Also ive been using your BC as a basis to edit so my changes will also have yours in if thats okay

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #42 on: 2016-06-02 00:28:40 »
It's fine - just remember to give credit :)

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #43 on: 2016-06-02 00:30:42 »
No problem, when i first opened this thread and seen what you sent me i felt like i was looking at ancient Egyptian rocket science but it's not bad after a little trial and error

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #44 on: 2016-06-03 01:35:48 »
Nah im lost again, i couldn't really work out how your programs help so what i ended up doing was opening your because IRO and looking in the hext folder to see what you did. I coppied your style and that's how i was able to save it with repacking. For some reason some values arent changing. Im thinking maybe im doing something completely wrong, ive been wreaking my head and getting nowhere, starting to get stressfull. Can i send you a copy of my notepad instructions so you can put them in your because mod and see what i have and help me that way?

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #45 on: 2016-06-03 02:06:33 »
did you check the hextlaunch log?  It tells you if something hasn't changed.  Also, I don't use iro (that's 7th heaven?)... I use my own installer :)

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #46 on: 2016-06-03 02:30:18 »
So how am i doing this? Alot of the values on this list dont have any new changes there just listed so i dont forget them. Heres what i have right now if you google ff7 remake menu images will give you a rough picture of what im attempting. You'll see the max Hp problem im having among others. If you figure this out and send it back perhaps with a list of what you did i would learn it better

https://www.mediafire.com/?oamxu671vb14tu7

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #47 on: 2016-06-03 02:54:35 »
I don't see any issue there.  The syntax is correct - and the values you have stated will be changed.  Check hextlaunch.log.

What's the problem?

Tsunamix

  • Freak
  • *
  • Posts: 657
  • Karma: 11
  • Check out my work - https://goo.gl/m4NFlm
    • View Profile
    • The home of Tsunamods
Re: Editing the in game menu
« Reply #48 on: 2016-06-03 12:08:07 »
The problem was moving the current HP further to the right without it sisapearing among similar issues with the others too

DLPB

  • No life
  • *
  • Posts: 8794
  • Karma: 251
  • My love is as sharp as a needle in your eye.
    • View Profile
Re: Editing the in game menu
« Reply #49 on: 2016-06-03 19:20:43 »
Remember to do as I did above.  Trace what pushes the values onto the stack for that function.  Head up until you find the start of the function (usually after a ret) and then search for it. Or edit the current function how I did.