Mar 20, 2017 at 10:05 PM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 23
Hey, so Discord servers crashed right as I was about to ask my question so I guess I gotta retype here:

I don't really know what I'm doing because I'm not at all used to OllyDbg / ASM logic
Say I wanted to have a duplicate of an entity, so that I could point the graphics elsewhere and make a minor edit of it while still having the original.

I copied the binary/hex in its entirety from the entity I wanted duplicated, and pasted it over a boss entity with more room that I have no intention of using. I NOP'd the rest of the code even though from my logic the RTN should end that loop and never execute it. I didn't expect this to work but it mostly does.

After saving as a new executable, editing NPC.tbl to point to the original graphic sheet, and adding in the new entity to my test map, it seems to work for about 20 seconds after it spawned in.
Going through it in Olly shows that it crashes at 42B53E, which isn't even entity code I believe, with "Access violation when writing to 7E4D1DED".
For kicks I NOP'd this entire function and it started to work for an additional 30 seconds, acting completely like the original NPC, before crashing again elsewhere with a similar error (the address was different).

Something I missed when trying a technique like this for entity duplication? Do I need to be more specific with which entities I'm using?
Alright so
Instead of copying the actual AI, if it's the graphics you want to change, go to an entity you're replacing and do this:
PUSH EBP
MOV EBP, ESP
MOV EDI, DWORD [EBP+8]
PUSH EDI
CALL (AI of the entity you want to copy)
#Then set your sprites. The pointer should hopefully (Unless you've modified the other entity as well) still be in EDI.
The reason your code crashed was because it didn't have the proper pointer, and crashed trying to access an invalid instruction. It could also have been a CALL going to an invalid address due to being binary copied. This could happen 20 ~ 30 seconds after it is initialised if the entity has a timer.
This technique also allows you to do nifty things like copying a boss AI into a much smaller space, as well as make entities move/attack twice as fast by CALLing their AI twice a frame.
 
Last edited:
Mar 21, 2017 at 6:02 AM
Giving it my all and shooting for the moon.
Modding Community Discord Admin
"What're YOU lookin' at?"
Join Date: Apr 23, 2013
Location: In a cave above the surface.
Posts: 1070
Age: 26
Alright so
Instead of copying the actual AI, if it's the graphics you want to change, go to an entity you're replacing and do this:
PUSH EBP
MOV EBP, ESP
MOV EDI, DWORD [EBP+8]
PUSH EDI
CALL (AI of the entity you want to copy)
#Then set your sprites. The pointer should hopefully (Unless you've modified the other entity as well) still be in EDI.
The reason your code crashed was because it didn't have the proper pointer, and crashed trying to access an invalid instruction. It could also have been a CALL going to an invalid address due to being binary copied. This could happen 20 ~ 30 seconds after it is initialised if the entity has a timer.
This technique also allows you to do nifty things like copying a boss AI into a much smaller space, as well as make entities move/attack twice as fast by CALLing their AI twice a frame.
Yeah, it was the binary copy/paste that screwed up the addresses. Got it working like a charm, so thanks!
 
Apr 13, 2017 at 12:24 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Apr 13, 2017
Location: ...away from...him...
Posts: 2
Age: 8
...is there a way i could remove an NPC?...

...say there was ones...i have no intention to use...could i feasibly take them out of the table?...

...i dont want any balrog for example...it takes up space in editor...at least a way to hide it maybe?...
 
Apr 13, 2017 at 12:50 PM
Catz R cool
Modding Community Discord Moderator
"..."
Join Date: Nov 23, 2015
Location: Somewhere within a world far away from reality...
Posts: 381
Age: 23
...is there a way i could remove an NPC?...

...say there was ones...i have no intention to use...could i feasibly take them out of the table?...

...i dont want any balrog for example...it takes up space in editor...at least a way to hide it maybe?...
Well even if you removed both its AI and pointer table, it'd still show up in map/npc.tbl editors. You'd have to mod the editors to fix this problem.
 
Apr 13, 2017 at 1:23 PM
Based Member
"Life begins and ends with Nu."
Join Date: Dec 31, 2011
Location: United States
Posts: 2317
Age: 27
...is there a way i could remove an NPC?...

...say there was ones...i have no intention to use...could i feasibly take them out of the table?...

...i dont want any balrog for example...it takes up space in editor...at least a way to hide it maybe?...
You can actually do this rather easily in Booster's Lab. There's a text file called "entityInfo.txt" that lists all the entities. If you delete from that list any NPCs you won't be using, then this will shorten the list of NPCs shown on the map editor. Be sure to make a copy of this text file just in case you mess something up.

From my experience, you can't do this in Cave Editor; whenever I try to remove or simplify a line on the list of entities in "CaveEditor.txt," it can no longer load up a mod.
 
Apr 13, 2017 at 2:14 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
I don't know if that will mess up the ID's when they get loaded by the game though.
The entity view has filters you can use to find specific types of NPC by double-clicking the lists above the map if too much scrolling is your issue.
 
Apr 14, 2017 at 6:58 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Apr 13, 2017
Location: ...away from...him...
Posts: 2
Age: 8
Well even if you removed both its AI and pointer table, it'd still show up in map/npc.tbl editors. You'd have to mod the editors to fix this problem.
I don't know if that will mess up the ID's when they get loaded by the game though.
The entity view has filters you can use to find specific types of NPC by double-clicking the lists above the map if too much scrolling is your issue.
You can actually do this rather easily in Booster's Lab. There's a text file called "entityInfo.txt" that lists all the entities. If you delete from that list any NPCs you won't be using, then this will shorten the list of NPCs shown on the map editor. Be sure to make a copy of this text file just in case you mess something up.

...thanks...with these suggestions i found a solution...to the entities i wished to be purged...
 
May 5, 2017 at 5:04 AM
Junior Member
CSE Discord Admin
"Fresh from the Bakery"
Join Date: Dec 6, 2015
Location: Behind You
Posts: 19
Age: 23
At offset 0x47B984 there is a cmp 4BBA98, 118. Change 118 to the number you desire. Keep in mind that in decimal 118 is 280, and vanilla omega's hp is 400 (190 in hex). I am pretty positive this is how you'd change it but not sure.
 
May 7, 2017 at 8:55 PM
Junior Member
CSE Discord Admin
"Fresh from the Bakery"
Join Date: Dec 6, 2015
Location: Behind You
Posts: 19
Age: 23
This one's a bit trickier. From what I found you have to change 3 values.
0x475851 CMP [EDX+40], 0C8
0x475884 CMP [ECX+40], 0C8
0x475C9E CMP [EAX+40], 0C8
Change 0C8 to the number you want. In decimal this is 200.

Also
0x4754C0 MOV [EAX+40], 2BC
Here you can change the max hp. 2BC in decimal is 700.

Out of curiosity, what are you trying to with this?
 
May 7, 2017 at 9:50 PM
Junior Member
CSE Discord Admin
"Fresh from the Bakery"
Join Date: Dec 6, 2015
Location: Behind You
Posts: 19
Age: 23
Your welcome. I am working on one myself, but I was hoping for more in depth explanation. Anyways, hope your mod works out well. :)
 
May 8, 2017 at 10:42 PM
Junior Member
"Fresh from the Bakery"
Join Date: Sep 23, 2016
Location:
Posts: 12
Age: 22
Okay, it's quite possible someone's made a guide for this or something, but how the heck does the hackinator in Booster's lab work? As I understand it, it's pretty key to doing anything really unique in booster's lab, but I can't quite figure out how to actually make a hack? It seems to have something to do with hexadecimal, but that's something I've never had a strong grasp on either. If someone could provide some info, link me to a guide, give some advice on learning it, or something along those lines, it would be much appreciated.
 
May 8, 2017 at 10:46 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
There's two things, the hacking tool (which just blindly applies hex patches to offsets) and the hackinator which is a gui for applying premade hacks.
The hackinator comes with a list, select an item to see details about the hack and adjust any parameters, then just press the button to apply it.
 
May 9, 2017 at 2:13 AM
Junior Member
CSE Discord Admin
"Fresh from the Bakery"
Join Date: Dec 6, 2015
Location: Behind You
Posts: 19
Age: 23
Does anyone know where the hitrects for bullets are stored?
 
May 9, 2017 at 2:37 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
they're in a struct with other bullet initialization data.
check the weapon hacks in booster's lab for some pointers, they're just xml files in the "hacks" folder.
 
May 9, 2017 at 2:42 AM
Junior Member
CSE Discord Admin
"Fresh from the Bakery"
Join Date: Dec 6, 2015
Location: Behind You
Posts: 19
Age: 23
they're in a struct with other bullet initialization data.
check the weapon hacks in booster's lab for some pointers, they're just xml files in the "hacks" folder.
Ok thanks :)
 
May 9, 2017 at 3:23 PM
Junior Member
"Fresh from the Bakery"
Join Date: Sep 23, 2016
Location:
Posts: 12
Age: 22
There's two things, the hacking tool (which just blindly applies hex patches to offsets) and the hackinator which is a gui for applying premade hacks.
The hackinator comes with a list, select an item to see details about the hack and adjust any parameters, then just press the button to apply it.

Thanks for the response, but how does one make a hack? I'm familiar with the workings of the hackinator, but it's how to make a functioning hack that's got me confused. I'm fairly inexperienced in regards to the coding/hacking part of cave story modding, so maybe there's some obvious fact I'm missing.
 
May 9, 2017 at 3:28 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Thanks for the response, but how does one make a hack? I'm familiar with the workings of the hackinator, but it's how to make a functioning hack that's got me confused. I'm fairly inexperienced in regards to the coding/hacking part of cave story modding, so maybe there's some obvious fact I'm missing.
you don't *make* hacks with booster's lab, it's more a way of distributing them to the unwashed masses. If you wanted to write your own custom assembly hacks you'd use a combination of tools like ollydbg, doukutsu assembler, the reference documentation available around the forums, and a strong knowledge of x86 assembly.
 
Top