Jump to content

EXE editing & programming issues


Recommended Posts

And back on the The Demo EXE, its actually really easy to put in play mode

all that is required is adding *any* command line parameter to it when u start it up :)

dune2 dfgbdgdgsd  will work fine :)

will put it in play/record mode, automatically recording to DUNE.LOG.

To completely skip the intro, edit the exe and set the byte at 0x3A108 to 01

Link to comment
Share on other sites

And to be able to enter the construction yard/other structures to build items, copy the files




from Dune2 1.00 Dynasty (dune.pak), into the demo dir... all works well then ;)

Link to comment
Share on other sites

Thanks for more helpful info, segra! :)

Guys, please forgive me for my missing number of synapses, but does this mean "if" we can work on it some more, we can save our games replays and watch them afterwards using some kind of "demo.exe?" that would be.. wonderfull..

The "demo.exe" is the Dune 2 Demo EXE we discussed earlier in this thread.

I have played around with the "Special" blooms. Moving a unit of top on them would spawn Ordos Trikes (I was playing Atreides), Ordos Infantry Squads (much more seldom than Trikes), 'Thopters of unknown ownership (Mercenary, or, more likely, Fremen, judging by the color and the fact they did not attack me), and random amounts of credits (quite often, and immediately added to the player's credit cache). Attacking the Special blooms does nothing, and you don't lose your unit when stepping on them either.

Link to comment
Share on other sites

The point of them was that if you see a bloom, you have to choose to either move a unit on top of them or destroy them. You risk losing a unit or destroying a bonus depending on what kind of bloom it turns out to be.

Link to comment
Share on other sites

they must of never finished support for it then, using a trike to attack it didn't destroy it

as for the demo, the exe is slightly different. in the full version,

dseg:378E                  ; int gameDemoMode

dseg:378E 00 00            gameDemoMode    dw 0   

This variable is never written to, but in the demo it is (its set to 2 by default, but it changes it to 0 or 1 if there is cmd line parameters).

Link to comment
Share on other sites

shouldnt be too hard to find... should it? lol... never looked at the disassembly (had a quick peek at CnC sole survivor awhile back, but nothing deep)

find the filename, its the easiest method... for months i was wondering wtf dune.log was for, wasnt until i downed the demo did it make sense :P

Link to comment
Share on other sites

  • 2 weeks later...

I have tested the Special bloom some more, and got some quite different results. I used the first Atreides map, but made it large (full scale), and added some Harkonnen structures and units to it. This time the special blooms spawned Ordos carryalls, and also 'thopters and carryalls of unknown ownership (see screenshots below). Only once, an Ordos trike was spawned. And, of course, there were random sums of bonus credits.


Two Ordos carryalls, and a neutral carryall and a 'thopter


Lots of neutral 'thopters

I also tested this with an Ordos player, and the Ordos carryalls spawned from the blooms acted like normal carryalls (carried the Harvester to the refinery and back to the field). The neutral units do nothing, just fly around the map, but my Rocket Turret assumed the 'thopters as hostile and fired at them.

I think it is possible that the neutral units were supposed to belong to the player who "discovered" them, but the code for that was either unfinished or made inactive.

Link to comment
Share on other sites

  • 3 weeks later...

for all those interested, i havnt touched this in weeks... so i may as well post it now, my dune2 IDA database.

its from the exe im using, battle of arrakis 1.07 hitsquad (AU ver?, i havnt seen it anywhere else)

i also included the demo database, it hasnt got many changes.. but some of the main variables have been done.. u can get the idea about the differences in the versions from it


Link to comment
Share on other sites

its from the exe im using, battle of arrakis 1.07 hitsquad (AU ver?, i havnt seen it anywhere else)

I've also noticed from the code you posted that your version has to be different from those known to us here. It appears that the devs have released several trilingual versions before they finally polished everything. I might be wrong, but the German and French translations were made in the UK, so there were probably certain errors and other things, like they had to introduce the "next best key" option for the unit sidebar command shortcuts, as some command names start with the same letter in German and French.

Link to comment
Share on other sites

  • 1 month later...

Hey guys, perhaps a bit off-topic, I just discovered that you can center map view on the currently selected player-owned unit or building by clicking on its name on the sidebar. I don't know if it was mentioned in the manual or is common knowledge (until today, I'd thought that unit centering was only first possible in C&C via keyboard).

Link to comment
Share on other sites

  • 1 month later...

another interesting var

dseg:37A4 00 00             objectsNoDamage dw 0     

when set, nothing appears to take damage. Unless its a sonic tank attacking

That's because sonic damage is handled separately. If I try replicating the sonic missile using Nyerguds' editor (turn a bullet into a sonic missile) it will do no damage, as that portion of code (actually damaging) is somewhere else and is restricted to the ORIGINAL sonic missile. Missiles are quite pissing me off as a matter of fact, as only some properties seem to be found into the executable (atleast in the "units" sector). I will make a list of what can be found there and post it in Nyerguds' editor thread. :)


Link to comment
Share on other sites

yeah the code is located here, it checks for sonic immunity first

this code is from "unitMoveMapTileCheck", it checks for various things in the unitdata fields, as well as checks if you just landed on a spicebloom/specialbloom

most of these fields are checked in here...

seg031:00A4 26 F7 47 36 80 00                test    es:[bx+_unitData.optsFitW], _unitOptsFitW_ExistOutsideMap

seg031:017F 26 F7 47 36 20 00                test    es:[bx+_unitData.optsFitW], _unitOptsFitW_SandTracks

onto sonic,


seg031:02CF 26 80 7F 02 18                    cmp    es:[bx+_unitGame.typeIndex], 18h    ; Sonic Blast

seg031:02D4 74 03                            jz      short SonicBlast


seg031:0316 26 F7 87 36 00 08+                test    es:[bx+_unitData.optsFitW], _unitOptsFitW_SonicImmunity

seg031:031D 75 14                            jnz    short loc_28693

seg031:031F 33 C0                            xor    ax, ax

seg031:0321 50                                push    ax                                  ; int

seg031:0322 FF 76 E2                          push    [bp+HitPointDamage]                ; int

seg031:0325 FF 76 EA                          push    word ptr [bp+unitGamePtr+2]        ; int

seg031:0328 FF 76 E8                          push    word ptr [bp+unitGamePtr]          ; unitGamePtr

seg031:032B 90                                nop

seg031:032C 0E                                push    cs

seg031:032D E8 48 08                          call    near ptr objectTakeDamage

Link to comment
Share on other sites

With you guys dissecting DUNE2.EXE and all, you wouldn't happen to figure out where information about playback of cutscenes are stored?

Since framerate isn't stored in the WSA files, I have to manually time this for Doon Lunacy, which *REALLY* sucks!

I did it in the past, I was pretty satisfied and thought that I had it near perfect, then I discovered that our

midi synth had bugs resulting in midi playback speed not always being the same, resulting in video and music being out of


So yeah.. I need to fix that bug and get timing correct again, but this time I don't want the same pain and also to be

sure about what's the correct timing or not!

Sooo, anyone know about this? Or could help me finding out?

PS: I plan making the very first release of Doon Lunacy by the end of the month!

This will be a non-playable tech preview release, but it's at least something! :)

Link to comment
Share on other sites

Since framerate isn't stored in the WSA files, I have to manually time this for Doon Lunacy, which *REALLY* sucks!

Correct me if I'm wrong, but isn't it possible to calculate framerate from the delta given in the WSA file header:

WSA header {
  Int16 NumFrames; // Number of frames in the sequence
  Int16 Width;    // Width and height of the images
  Int16 Height;
  Int32 Delta;    // Frames per Sec = Delta /(2^10).

  Int32[0..NumFrames + 1] Offsets; // Image offsets

The above was adapted from Vladan Bato's documentation and serves me fine for Dune 2 v1.07 files (although I haven't actually used the calculated framerate for anything yet) - I am aware that there are differences between the C&C, Dune 2 v1.0 and Dune 2 v1.07 WSA formats, but I can't find any other use mentioned anywhere for these bytes :/

Link to comment
Share on other sites

Have a look at the Ultraq's tools. Dune 2 WSA's definitely have a frame rate parameter, but I don't know to what extent it affects actual playback.

Ultraq's description of the Dune 2 WSA format seems to match my one. I modified my WSA library slightly to output calculated framerates and got the following:

File FPS















Some of these seem very slow though (4 FPS for one of the Harkonnen troopers scenes?), at the moment I would have to agree with MrFlibble - I don't know whether these are actually used by Dune 2 for playback.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.