Author Topic: SMAC Movie and other Upscaling Improvements  (Read 5365 times)

0 Members and 1 Guest are viewing this topic.

Offline Yitzi

Re: SMAC Movie and other Upscaling Improvements
« Reply #15 on: May 08, 2014, 02:50:00 PM »
Re: unused writable memory,
Thanks for the suggestion, I may use that for a "which film interface" type switch.

That sort of thing is what it's for; just make sure that you don't overwrite something being used, and it should be fine.

Quote
Re: unused executable memory,
I'll just dump everything at the end of the executable section for now, then.

There isn't that much room there.  I'd probably be the one to put it in the program, so you could just give the code to me and let me find a long enough string of NOPs (I think the longest ones are close to 1000 bytes; while I don't like to use that area because it's where the new alphax variables are loaded, it can be done if necessary, and the subroutine doesn't sound likely to be that large.)

Quote
That's contradictory. Have you ever seen SMAC use any of the writable memory around 9B86A0?

I haven't really checked before it, but it and right after (for over 64 bytes) I checked as being used for holding and concatenating strings, and have used it myself for the same purpose.

Quote
Thanks for the offer. The code isn't ready yet (not feature complete, not tested), but when it is I'll be sure to send you what you need with addresses based off your latest patch.

Ok, thanks.

Quote
strcat and strcpy are standard C functions that have been rendered in the main body of the code. The call to WinExec goes into Kernel32.dll. I find them all with IDA Pro, but I can give you exact addresses to use once the code is ready to include.

Ok.  strcat is at 645470 (I found that the old-fashioned way); where is strcpy?

Offline DrazharLn

Re: SMAC Movie and other Upscaling Improvements
« Reply #16 on: May 08, 2014, 09:04:53 PM »
I'm looking in IDA at (I believe) scient modded terranx.exe. I have strcat at 644C60 and strcpy at 644C50

strcat starts:
Code: [Select]
mov     ecx, [esp+arg_0]
push    edi
test    ecx, 3
jz      short loc_644C7C

strcpy starts:
Code: [Select]
push    edi
mov     edi, [esp+arg_0]
jmp     short loc_644CC1

I have 645470 as possibly in the middle of a function. 645460 looks to be the start of that function, but I don't know what it does.

Offline Yitzi

Re: SMAC Movie and other Upscaling Improvements
« Reply #17 on: May 08, 2014, 09:30:45 PM »
I'm looking in IDA at (I believe) scient modded terranx.exe. I have strcat at 644C60 and strcpy at 644C50

strcat starts:
Code: [Select]
mov     ecx, [esp+arg_0]
push    edi
test    ecx, 3
jz      short loc_644C7C

strcpy starts:
Code: [Select]
push    edi
mov     edi, [esp+arg_0]
jmp     short loc_644CC1

I have 645470 as possibly in the middle of a function. 645460 looks to be the start of that function, but I don't know what it does.

Maybe Kyrub's (which mine is based off of) is different?  Because for me, 644C50/60 is the middle of a function...

EDIT: Scient's does seem to be different, but doesn't match yours either...

Offline DrazharLn

Re: SMAC Movie and other Upscaling Improvements
« Reply #18 on: May 08, 2014, 11:14:38 PM »
I'm using the gog default. Thought that was scient's. I'll run IDA on yours tomorrow and get the offsets for you.

Offline DrazharLn

Re: SMAC Movie and other Upscaling Improvements
« Reply #19 on: May 09, 2014, 12:23:04 PM »
IDA finds strcat at 645470 in 2.5j, as you say. strcpy is at 645460. The content is the same as in the gog version, just a different offset.

strlen is at 6453e0.

There are a bunch of other potentially useful C functions baked in, too. You might want to consider getting the freeware version of IDA Pro and perusing the Functions and Imports windows; it's quite good at working out what functions are.

If you're running out of runtime memory, for instance, you could use the malloc function and move all your stuff into there. Should be safer, too, if you can't guarantee that various parts of the standard memory aren't writable. (I think malloc gets more memory off the heap, which should mean it doesn't interfere with the existing memory).

Offline Yitzi

Re: SMAC Movie and other Upscaling Improvements
« Reply #20 on: May 09, 2014, 08:47:57 PM »
IDA finds strcat at 645470 in 2.5j, as you say. strcpy is at 645460. The content is the same as in the gog version, just a different offset.

strlen is at 6453e0.

There are a bunch of other potentially useful C functions baked in, too. You might want to consider getting the freeware version of IDA Pro and perusing the Functions and Imports windows; it's quite good at working out what functions are.

If you're running out of runtime memory, for instance, you could use the malloc function and move all your stuff into there. Should be safer, too, if you can't guarantee that various parts of the standard memory aren't writable. (I think malloc gets more memory off the heap, which should mean it doesn't interfere with the existing memory).

It's worth keeping in mind...though I could always track the pointer to any of the things that are stored on the heap and find malloc that way.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Therefore a wise prince will seek means by which his subjects will always and in every possible condition of things have need of his government, and then they will always be faithful to him.
~Niccolo Machiavelli 'The Prince'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 39.

[Show Queries]