Topic: Hex Editing of Starfleet executables  (Read 182680 times)

0 Members and 1 Guest are viewing this topic.

Offline Corbomite

  • Commander
  • *
  • Posts: 2939
Re: Hex Editing of Starfleet executables
« Reply #420 on: November 10, 2015, 10:51:50 pm »
Size, just like SFC.

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #421 on: November 11, 2015, 03:56:39 pm »
Oh My Goodness!  Wow!  You guys are freaking unbelievable! 

I've been gone from this sight for a while (I'd guess a bit more than a year), and I come back and it looks like you've cracked the code!  Wow oh wow!  It's Christmas in November!

Thanks guys!  We still have 6 + computers using Windows XP loaded with our modified version of SFC2OP.  We so LAN battles with our modified version (as work team building of course).  I'm so excited I can't even think.

I need some help.  When I try to run the editor, it keeps saying it can't find the file.  TAnimal's notes seem to suggest that I copy 2 lines of text, but I can't figure out where to put the text.  Any ideas what i'm doing wrong.

Thanks again guys.  This is just SO UNREAL!

Kid Carrson

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #422 on: November 11, 2015, 05:27:50 pm »
Still can't quite figure out how to get it to work.  I'm guessing I'm putting the files in the wrong spot somehow.

KC 

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #423 on: November 11, 2015, 05:52:41 pm »
SFC2OP Standard Phaser Max Ranges

My apologies TAnimal, I found the phaser range limitations after I sent you my notes hence you didn't have them. My fault.

Ph4:
Using IDA Address: 4E3B12 (D8 1D 08 D5 79 00)
flt_79D508: dd 1.0e3 or 1000.0f represented as 00 00 7A 44 (Which is the Ph4 Max Range 100.0)

Using HexEdit Address: E3B12 (D8 1D 08 D5 79 00)
flt_79D508: Same as above but located at 39D508

Ph3/PhG:Using IDA Address: 4E3B1A (D8 1D 8C E2 79 00)
flt_79E28C: dd 1.5e2 or 150.0f represented as 00 00 16 43 (Which is the Ph3/G Max Range 15.0)

Using HexEdit Address: E3B1A (D8 1D 8C E2 79 00)
flt_79E28C: Same as above but located at 39E28C

Ph2/PhG2: Using IDA Address: 4E3B22 (D8 1D 84 7C 79 00)
flt_797C84: dd 5.0e2 or 500.0f represented as 00 00 FA 43 (Which is the Ph2/PhG2 Max Range 50.0)

Using HexEdit Address: E3B22 (D8 1D 84 7C 79 00)
flt_797C84: Same as above but located at 397C84

Ph1/X:  Using IDA Address: 4E3B2A (D8 1D 18 82 7A 00)
flt_7A8218: dd 7.5e2 or 750.0f represented as 00 00 3B 44 (Which is the Ph1/PhX Max Range 75.0)

Using HexEdit Address: E3B2A (D8 1D 18 82 7A 00)
flt_7A8218: Same as above but located at 3A8218

Any Questions?

Adam

Unfortunately, these variables are shared with unrelated functions. To overcome this problem, I have isolated the Ph3 and Ph2 maximum ranges.

Just after the variable (150.0f) for the max range of Ph3 (and other stuff) is one of hundreds of 8-byte representations of pi. We can use this "pi filler" to create two new 4-byte floats. One for the max range of Ph3, the other for the max range of Ph2. Then we change the address in the function to read these new variables.

(In IDA, you will find the Phasers' Maximum Range function at .text:004E3ACD)

Using HexEdit, make these changes in brackets:

E3B1A: D8 1D [8C E2 79 00] -> [90 E2 79 00] to segregate Ph-3 max range ; .rdata:0079E290
E3B22: D8 1D [84 7C 79 00] -> [94 E2 79 00] to segregate Ph-2 max range ; .rdata:0079E294

39E290: 29.9f // New! Ph-3 max range; 29.9f = 41EF3333 = [33 33 EF 41]
39E294: 89.9f // New! Ph-2 max range; 89.9f = 42B3CCCD = [CD CC B3 42]

You can choose 160.0f and 510.0f, instead, to keep the SFB max ranges for these weapons. I modified the Ph3 and Ph2 brackets and long-range damage so the combat estimator will be accurate and ECM shifts will continue to be honored.

I've attached what I call "2.5.5.3". It also fixes the combat estimator's computation for the Phaser-G2's maximum damage. HexEdit E2813: 0F B6 80 [A4] 6B 85 00 -> [7C]

Fighters are lethal - they cannot waste Ph3/G shots. And forget about killing a H-DE with drones from far away -- which is something silly you can do in 2.5.5.2.
« Last Edit: November 11, 2015, 06:56:07 pm by TarMinyatur »

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #424 on: November 11, 2015, 06:06:38 pm »
Damn it! I keep getting the Editor cannot find the file. 

Well, I've waited nearly 15 years, I guess a little longer can't hurt.

Thanks for all of your work guys.  This is incredible.

I'm so looking to tweaking weapons to make the game work cleaner and the AI work smarter. 

Any help would be greatly appreciated.  It feels like Christmas and Santa's sled just keeps circling the house.  Maybe kinda like the Santa in Futurama.

Thanks for any help.

KC

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #425 on: November 11, 2015, 06:09:15 pm »
Still can't quite figure out how to get it to work.  I'm guessing I'm putting the files in the wrong spot somehow.

KC

The batch file may be blocked by your security. Right click the file called "SFC_Editor4OP.bat" and look at its "Properties" on the general tab. Unblock it. Unblock the "offsets.txt", too. These files must be in the same folder as your StarfleetOP.exe.

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #426 on: November 11, 2015, 07:05:11 pm »
Tar,

Thanks so much.  That worked.  Woow who!  It's Christmas in November. 

Thanks and thanks to everyone whose worked on this thread over the past year. 

KC

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #427 on: November 11, 2015, 08:14:26 pm »
EEEEEH!!!!   I'm so HAPPY ! 

Unbelievable!  This is so AWESOME! 

I can't even comprehend it!

Thanks SO MUCH!

KC

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #428 on: November 12, 2015, 07:39:32 am »
The SFC Hex Editing tool is awesome.  Just excellent!

I did see one odd chart that it might be wise to have someone check:  the default numbers for the Fusion Beam OL Damage chart for OP seems odd.  Something just doesn't look quite right on that one damage chart, like maybe the numbers are reversed or something. 

Please take a look and pass along any thoughts.

Thanks!

Also, is there a reference to the EGL Lance anywhere?

KC

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #429 on: November 12, 2015, 09:07:20 am »
Thanks Captain.  My understanding is the ESG Lance currently does 16 points of damage, costing 4 points to charge, out to range 6.99  I believe.  I just didn't see it in the editor for possible modification.  I'd maybe like to change range and damage.

The Fusion Beam OL damage chart seems odd, like maybe some numbers are reversed.

Thanks

KC

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #430 on: November 12, 2015, 09:57:48 am »
Well, there you go.  That makes sense.

Any thoughts on that Fusion OL damage chart?

Offline Kid Carrson

  • D.Net VIP
  • Lt. Junior Grade
  • *
  • Posts: 254
Re: Hex Editing of Starfleet executables
« Reply #431 on: November 12, 2015, 10:15:53 am »
Good deal.  I'm still in utter awe of what you all have done with this task.  The options available are just amazing.

Just incredible!

Thanks

KC

Offline TAnimaL

  • Lt.
  • *
  • Posts: 770
  • Gender: Male
    • Combat Logs from the Cold Depths of Space
Re: Hex Editing of Starfleet executables
« Reply #432 on: November 12, 2015, 01:07:05 pm »
Remember that the editor is for SFC CE and not for OP. ESGL is an OP weapon and therefore would not be in the current editor.

Adam

Went away for a few days and there's a few things I want to respond to, but first and foremost, that is incorrect Adam. The offsets I released work with the SFC Editor 1.3.3 if you use the "SFC_Editor4OP.bat" I mention in the offset. Sorry if that wasn't clear. I have a zip that includes the whole shebang, editor, offset and bat, but it is bigger than can be attached to a post. I'll put somewhere to host and link it.

The Fusion charts are correct on my box, let me double check the version uploaded


Offline TAnimaL

  • Lt.
  • *
  • Posts: 770
  • Gender: Male
    • Combat Logs from the Cold Depths of Space
Re: Hex Editing of Starfleet executables
« Reply #433 on: November 12, 2015, 03:36:31 pm »
Thanks for pointing out my OP cloak error Tar, I should have been more upfront in admitting I haven't tested all of those offsets and the cloaking formula was one such place. I did assume that OP used the same 60.0 that CE uses but hadn't tested. So the value you found at 438522is teh correct one? I will then update the offset file (as with any other additions/errors).

As Corbo points out, NSMs do 35 in SFB. Call me a purist but that feels right to me, but if that does live in the exe we can add that to the offset list.

Tar, you bring up something important but I believe you are in error about ship explosions. In SFB, there was a formula that one would use to find out how big an explosion a ship would make (based on warp, weapons including mines, etc), BUT, it was complicated (like many things in SFB) and it could be manipulated (add extra mines and tbombs, missiles). This became a HUGE argument (and when you say huge by SFB rule standards, it was an epic fight across bulletin boards and chat sites) and in the new edition of the rules, the formula was thrown out and every ship got an explosion value of x. There is a similar "Explosion Strength" number for each unit in the shiplist so I've assume that this is used "as-is," but can't remember the last time I would have tested that. I can't imagine that Taldren would have gone back to the "old SFB" way, unless of course someone among them was one of those involved in the fight, back in the day... Maybe I'll test that tonite.

For a bit more detail -  Adam, in SFB there was an Annex that gave the cloak power cost that was used in SFC. Romulan ships always paid a point or two or three little less than other ships in that class.

I'm still a little confused about the P2/3 range limiting (and someone is going to have to walk me thru using IDA one day, still can't get a grasp on it). As I understand the above - the limitations values CaptAdam found can't be used with the offsets & Editor and exe 2.5.5.2 (because those variables are shared). Using IDA, Tar has made a exe 2.5.5.3 that can put a limitation entry in SFC_Editor; or, the 2.5.5.2 exe can be tweaked by altering the upper range brackets for those weapons. Am I correct?

I'm also confused by your mention of a PG2 computation - there is a separate table for the P-G2 than the P-3

Kid, I think Adam found the range limitations for the ESG Lance, maybe I'll try again to find  more about the Lance. (So many things to play with!)

Offline [UFP]Exeter

  • SFC4 Dev
  • Lt. Commander
  • *
  • Posts: 1080
  • SFC4 Lead Developer
Re: Hex Editing of Starfleet executables
« Reply #434 on: November 12, 2015, 04:06:40 pm »
is there  a chart that shows range/damage for weapons.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #435 on: November 12, 2015, 04:17:15 pm »
A weapons wiki thing was made for OP. You can download the .html from Dynaverse.net.
http://www.dynaverse.net/forum/index.php?action=dlattach;topic=163350834.0;attach=18573

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #436 on: November 12, 2015, 04:49:54 pm »
I'm still a little confused about the P2/3 range limiting...the values CaptAdam found can't be used with the offsets & Editor and exe 2.5.5.2 (because those variables are shared). Tar has made 2.5.5.3 that can put a limitation entry in SFC_Editor; or, the 2.5.5.2 exe can be tweaked by altering the upper range brackets for those weapons. Am I correct?

The offsets.txt for OP needs to be updated for the SFC_Editor to modify the new variables that I defined in 2.553. 

<<Maximum Range
39E290: 1f // New in 2.553! Ph-3 & Ph-G max range x10 // 29.9
39E294: 1f // New in 2.553! Ph-2 & Ph-G2 max range x10// 89.9

Changing these values in 2.552 will do nothing useful. (It would modify data that the application never reads.)

I see no way to properly modify these phasers' maximum ranges in stock 2.552 without contaminating other functions that share the default values at default offsets. You can indeed adjust the Ph-3's range brackets to have a max range of 2.99k (30.0f) in the chart, but a player can still fire a Ph-3 at range 15.0k (150.0f), and never do any damage. The effect on the AI is unknown, but I assume it won't fire if the entire column is full of zeroes. 

The charts don't affect the "z" key -- to manually fire a weapon. The max range variables, however, do. They essentially send a signal to the UI, to enable the fire button.

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #437 on: November 12, 2015, 05:47:51 pm »
Adam, if you adjust the maximum range of a Ph-3, you are affecting a function that modifies planet "PL6" (as well as several other unknown aspects of the game!). There should be only one external reference to a customized variable, otherwise unintended side-effects will be generated.

Control-X in IDA will show all the functions that refer to a specific variable. If there is more than one x-ref, the variable must be left alone. The function should look for a newly created variable instead.

Look at this float:

Ph3/PhG:Using IDA Address: 4E3B1A (D8 1D 8C E2 79 00)
flt_79E28C: dd 1.5e2 or 150.0f represented as 00 00 16 43 (Which is the Ph3/G Max Range 15.0)

It is shared across many subroutines. Only one of them has anything to do with max range. But if you create a new one at .rdata:0079E290, and modify the function to look there, you'll be ok.

HexEdit E3B1A: D8 1D [8C E2 79 00] -> [90 E2 79 00] to segregate Ph-3 max range ; .rdata:0079E290

It used to read IDA 79E28C (the address of the variable that has a value of 150.0f). Now it reads 4 bytes after.

I've attached an image of the shared 1000.0f variable. Many functions read this data. We want to modify only one of them that determines the limit for Phaser-4's. We need to create a new float. Then change the place the Maximum Phaser Range function looks so it can find our new float, of say, 1500.0f, for a new max range of 150k.

I'll post more pictures of the isolation process. I've got to quit tonight though...
« Last Edit: November 16, 2015, 02:14:17 pm by TarMinyatur »

Offline TAnimaL

  • Lt.
  • *
  • Posts: 770
  • Gender: Male
    • Combat Logs from the Cold Depths of Space
Re: Hex Editing of Starfleet executables
« Reply #438 on: November 12, 2015, 06:30:09 pm »
So, I was correct then Tar, right?  :D

If we want to have a) an EXE that can be edited by b) players using SFC_Editor that includes c)phaser 2/3 range limitations for AI, we have to use 2.5.5.3


I did a short test - explosion strength in game uses the value found in the shiplist. For NSM - There is only one float of 350.0 (35x10) and it is not the variable for a NSM. There are 4 floats of 35.0 that I have to test

Offline TarMinyatur

  • Lt.
  • *
  • Posts: 938
  • Gender: Male
Re: Hex Editing of Starfleet executables
« Reply #439 on: November 12, 2015, 07:06:28 pm »
So, I was correct then Tar, right?  :D

If we want to have a) an EXE that can be edited by b) players using SFC_Editor that includes c)phaser 2/3 range limitations for AI, we have to use 2.5.5.3


I did a short test - explosion strength in game uses the value found in the shiplist. For NSM - There is only one float of 350.0 (35x10) and it is not the variable for a NSM. There are 4 floats of 35.0 that I have to test

You may use my 2.5.5.3 or create your own 2.5.5.X. I think we need to create a vanilla StarfleetOP.exe with bug fixes, and then we can customize it as we see fit. I've already done this for Community Edition, but it has been largely ignored.

Thanks for the test on explosion strength. My self-destruction comment was about a Romulan that runs into his own NSM and thence pops, adding 35 to the damage caused to any nearby ships.