Jump to content

Help needed - compile a .cpp file into a .dll


Recommended Posts

1. I'm pretty sure I didn't delete anything, if there was something in there to start with, I would have asked you for instructions or added your option to the list.

2. There was a checkbox at the bottom of the tab labelled "Inherit from parent or project defaults" that was automatically checked. I unchecked it and the ";%(ForcedIncludeFiles)" part vanished.

3. Done.

4. Done.

DLL compiled and tested - invalid Fallout 4 version reported.

New files here.

Link to comment
Share on other sites

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Looks good.

Now all you have to do is to fix the code that verifies the run-time version (starting from line 3237):

if (f4se->runtimeVersion != RUNTIME_VERSION_1_10_98) {
    UInt32 runtimeVersion = RUNTIME_VERSION_1_10_98;
    char buf[512];
    sprintf_s(buf, "Clipboard\nExpected Version: %d.%d.%d.%d\nFound Version: %d.%d.%d.%d",
        GET_EXE_VERSION_MAJOR(runtimeVersion),
        GET_EXE_VERSION_MINOR(runtimeVersion),
        GET_EXE_VERSION_BUILD(runtimeVersion),
        GET_EXE_VERSION_SUB(runtimeVersion),
        GET_EXE_VERSION_MAJOR(f4se->runtimeVersion),
        GET_EXE_VERSION_MINOR(f4se->runtimeVersion),
        GET_EXE_VERSION_BUILD(f4se->runtimeVersion),
        GET_EXE_VERSION_SUB(f4se->runtimeVersion));
    MessageBox(NULL, buf, "Game Version Error", MB_OK | MB_ICONEXCLAMATION);
    _FATALERROR("unsupported runtime version %08X", f4se->runtimeVersion);
    return false;
}

Replace RUNTIME_VERSION_1_10_98 (2 occurrences) with CURRENT_RELEASE_RUNTIME (which in F4SE 0.6.17 is RUNTIME_VERSION_1_10_138).

Compile and test again. Should work (if the original version used to work).

Link to comment
Share on other sites

IT WORKS IT WORKS IT WORKS IT WORKS

 

iT FEKKING WELL WORKS!!!!!!!!!!!

 

CLIPBOARD IS RISEN FROM THE ASHES

 

iT BLOODY WELL WORKS :dance: :cool: :dance: :yes: :woot: :woot: :woot:

 

 

WOLFMARK YOU ARE MY NEW HERO! SEND ME A PICTURE OF YOURSELF SO I CAN PIN IT ON MY WALL AND WORSHIP YOU EVERY DAY :dance:

 

I'LL RENAME ALL MY CHILDREN WOLFMARK

 

 

 

I tested pasting, selecting, moving, rotating, copying to file - all seems just as it should be. The only thing I did notice is that it seems to pause the game slightly when placing the clipboard tool and exiting/entering workshop mode - but maybe it was always that way and I never noticed. It's no big deal because - IT WORKS IT WORKS IT WORKS IT WORKS

 

EDIT: The pause was just my current save, I tried it on a new character and there is no pause, all's good.

Link to comment
Share on other sites

A million thanks for giving me your valuable time and sticking with it through all the headaches, not many people would do that.

 

I guess the next step is to work out what's going to happen when the FO4 exe changes again, I'm sure you don't have the time/patience to go through all this again!

 

I also need to work out how to release clipboard on the Nexus - I have permission from Struckur but I guess I have to contact a moderator or something to get permission, and as you know I'm no programmer so I couldn't answer any questions or fix any bugs!

Link to comment
Share on other sites

I did notice a warning WolfMark -

 

3>Utilities.cpp
3>C:\Users\Kev\Downloads\build\src\f4se\f4se_common\Utilities.cpp(105,1): warning C4996: 'GetVersionExA': was declared deprecated
3>Generating Code...
3>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\sysinfoapi.h(387): message : see declaration of 'GetVersionExA'

 

 

 

...is that anything to worry about?

Link to comment
Share on other sites

Finally :smile:

 

Ignore that warning, has nothing to do with Clipboard extension. Probably the code that generates that warning is not even included in the final DLL.

 

Ask Struckur to make you admin on existing project, so you can upload new files. Or ask permission to upload a patch that contains only the updated DLL, so the users will have to download first the original mod. Remember to always release the source code too.

 

When Fallout 4 updates you don't need to do again all the changes:

 

1. First you must compile the new F4SE as a static library (see my first message in this thread).

2. Then you must update the GameReferences.h file from the new F4SE to include the changes required by clipboard extension. Don't copy the old file, edit the new one, because it may contain other changes, modified addresses etc...

3. Then copy the clipboard project from old F4SE to the new F4SE (you don't have to create it again). Copy the folder, but only with vcxproj files + main.cpp and then use Add => Existing Project option to add the project (the copy, not the one from old F4SE) to the new solution.

4. Build the project.

 

You also have to verify the addresses, but for this you'll need:

 

1. A tool named Steamless to remove the changes made by Steam to Fallout 4 executable.

2. The IDA Disassembler to disassemble the unpacked executable.

Edited by Wolfmark
Link to comment
Share on other sites

I'll keep everything as it is now, I'm not going to change anything so that recompiling will be a lot easier from now on.

 

Thanks for the links to the hack tools, that's going to be one hell of a wild ride figuring out how to use them. I went to that link that Niston provided and tried to download their tutorial stuff but Firefox refused saying that it contained a virus :(. So any other advice you have or links to other tutorials you approve of would be super.

 

And once again, thanks for sticking with it and not giving in.

 

Kind regards, Kev :).

Link to comment
Share on other sites

I don't know any tutorials.

 

You don't really need to understand the assembler to verify that an address hasn't change (or to find the new address).

I can give you more details, but this if you already unpacked the executable and created the IDA Project. It takes a lot of time to parse a 60MB executable.

Is better to copy the EXE first in a separate folder, so all other files created by IDA will be placed there.

Also is a smart idea to save the current F4 executable, so you can compare it with the new one (if the game will be updated again).

But think if this is worth it, because it takes time, you don't know if the game will be updated again, maybe the signatures won't change etc...

Link to comment
Share on other sites

Hi WolfMark.

 

I've come this far, I'd like to see it through to the end :wink:. If you could give me a clue as to what to look for I'd like to give it a go.

 

I downloaded Steamless and after a lot of head scratching I finally got it to compile the Steamless interface (I finally figured out I had to download & install the developer version of .net framework).

 

De-steamed the fallout4.exe file and loaded it into IDA - it took over 5 minutes to load!

 

I looked through the code and tried searching for 145907F18 and 58CEE98 (from - RelocPtr <void*> qword_145907F18(0x058CEE98); // updated for 1.10.138), but found nothing and gave up. I did save the database so I assume that means that it will reload quicker next time?

 

I also sent Struckur an email asking for his permission for admin rights but haven't heard from him yet.

 

EDIT: Ah, I just realised I needed to reverse those address numbers!! I should have searched for 187f904501 and 98ee8c05 - DOH! :dry:

 

EDIT2: Still found nothing :(

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...