Jump to content
Eagle114th

Questions about DLL files editing / modding

Recommended Posts

The ethical way is making the EXEs mandatory, so any modding patch requires the original EXE.

  • Like 1

Share this post


Link to post
Share on other sites

On 10/18/2023 at 4:13 AM, Stratos said:

The ethical way is making the EXEs mandatory, so any modding patch requires the original EXE.

That is noted and thank you for the advice.


Eagle114th

Share this post


Link to post
Share on other sites

Hey guys

I'm telling these points to share some ideas of mine for things we can improve. ( I might be wrong at some points ) 

There are 2 factors that will make a flight sim to have a high populated community:

1.Graphics

2.Multiplayer

At the first stage I think we should work on high res - high detail textures to bring HDR feeling and also some more creativity to bring some better lightings to the game.

then we should make little changes to some .LOD models under license of original developers because for example for cockpit shadows we need to make the models to have no holes AND we should add some better reflections to some models and etc.

right now, with editing only .ini files, the game is better than ever + having reshade will give you some fun times flyin' but that's not enough!

then we should modernize the user interface of some parts like mission editor and etc.

For multiplayer, there are some disabled stuff within the .ini files that makes you to ask " Why? " and I know y'all know about them.

but with lot of coooo0o0odings and  developing some 3rd party stuff we can just try. I mean there are some games like Skyrim or whatever which they don't have any multiplayer functionality but there are some mods to let players, play the game online with friends. and yes, it's very hard to do it for this game but I thinks it's not impossible or as I said before ,maybe I'm wrong.

we should spend lot of times for the game and yes, I know that most of the mod makers which they have some cool and nice information about the game engine and other details, they're all offline since many years ago. 

I think we can revive the game and the community with these 2.

Share this post


Link to post
Share on other sites

I fully agree with Eagle's sentiment.

SF2 has a great potential, there are so many mods for it, so many stuff...

Yet, the quality of simulation is simply depressing. Yes, semi-casual sims are a thing but simulation of many aspects in SF2 is way too simplified.

There is, of course, neither the need neither the capabilities to make SF2 into a hardcore sim like DCS or BMS. What should be the level of simulation to strive for, in my opinion, is Lock On Flaming Cliffs 2.

Lock On is a casual sim too, and it is as old as SF. Likewise, you start the plane with one - two buttons max, but the simulation of the main systems is simply better. Just download Lock On 2 and play around with it if you haven't already, it is quite easy to get into yet is more pleasant if you care about how the stuff actually works.

Share this post


Link to post
Share on other sites

it is not going to be any easy journey down this road.

For someone who has explored the raw code, you will quickly noticed most of the DLLs and EXEs are shelled. and they are shelled using a propriatary program probably held by 3W...

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hello everyone,

(To Mods, please let me know if I am doing anything wrong here. I intend to respect the rules while sharing how to open or view the files.)

It have been a while since I posted, it can't be helped.  The world rather have become more crazier as yaers have gone by, keeping all of busy for sure. However, our hobbies are always here for us when we come back to it.  There have been requests asking me to sahre how I managed to view the core files.
 

I will share what tools I ujse and I can not promise that you will see the sources.  From what I can understand is that, if anyone have an access to the source codes, it is where you can see all codes with comments that tells you what code do. It is what is used by programmer to create the program.  

However, if you use tools to view the codes from the core, you are not really looking at the sources codes;  Rather, you are only seeing codes without the comments.  Therefore, messing with it can be 'hit and miss' and if you do not know what you are doing, you can break the whole files.

Please make sure you make copies of back up before doing any experiments with the files.

Two tools I use and please note, I am still newbie when it come to using the tools. 


1) CFF Explorer - this is a vital tools that help you figuring out what type of file and kind of language the file is written in.  This will be needed when using the 2nd tool.  I consdier this tool as gem.  I do not know how reiable this is, but I thave helped me a lot understanding what the type of file it is and what language it is written in.

2) Ghidra - this is most popular tools to view the codes inside the file.  It is also where you can edit the codes by making patches for it or another methods.

Alternatively, you can also use tool known as OllyDbg

3) Using Ghidra

I will give you basic step-by-step so you can get familiar with quickly.  It is all what I am familiar with so far;

When running it, click on FILE -> New Project

Make a new project, and when you finish with it, you will see a project folder in left sectino of the program. you can make a new folder within that project folder for organizing purpose.

Then run CFF viewer, you need to know what type of file and what language it is written in:

Then back to Ghidra, go to file then click on IMPORT FILE

go to the file you want to import, and import it.

New window will pop asking you what type of file and what language it is written in.  use the information you learned from CFF viewer.

Then, click on OK.   You wil see import file summary, click on OK again.

You should see a fil ebeing importd into project folder

Next, double click on the file you want for program to analyze, then click on OK

Then you will have Analysis Options window coming up, click on Analyze".

You will see the list of assembly language with C++ on the right section.  Sometime when you click on the group of assemlby codes, the right section will change to show what you are viewing in C++. That is what I figured so far.  I do not know what to do next.  If anyone know how to make patches or how to make changes to any files, let
us know.

Cheers

 

Edited by Eagle114th
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello everyone!

NOTE TO MOD: If there is anything taht is not okay to post here, please infor me and I'll fix the post.  I ntend to do this ethtically. 

It have been a logn time since I started checking adn analyzing dll files.  I have learned a lota bout analyzing the files.   I think I might have found the way to read DLL file and make the list of functions that is used by each DLL.  I created the long list of each functions that is called or used in each DLL files. It is inthe file knwn as 

DLL FILE INFORMATION.txt

You will notice most of DLL have teh same function.  However, even though they do have asme fucntion, does not mean they always have the same codes or methods within each functions, theortically. 

And to confirm this if this is actual function, HxD HEX tools aws used to open one of DLL file, then I realized the fucntion, shows up in 'hex dump' part.

For example, for dll file: vionics60.dll    

Inside the note, you'll see:

 

Quote

IMPORT - KERNEL32.dll (85 Functions)
    CloseHandle
    CompareStringW
    CopyFileW
    CreateDirectoryW
    CreateFileW
    DecodePointer
    DeleteCriticalSection
    DeleteFileW
    EncodePointer
    EnterCriticalSection
    ExitProcess
    FileTimeToLocalFileTime
    FileTimeToSystemTime
    FindClose
    FindFirstFileExW
    FindNextFileW
    FlushFileBuffers
    FreeEnvironmentStringsW
    GetACP
    GetCPInfo
    GetCommandLineA
    GetConsoleCP
    GetConsoleMode
    GetCurrentDirectoryW
    GetCurrentProcess
    GetCurrentProcessId
    GetCurrentThreadId
    GetDriveTypeW
    GetEnvironmentStringsW
    GetFileType
    GetFullPathNameW
    GetLastError
    GetModuleFileNameA
    GetModuleFileNameW
    GetModuleHandleW
    GetOEMCP
    GetProcAddress
    GetProcessHeap
    GetStartupInfoW
    GetStdHandle
    GetStringTypeW
    GetSystemTimeAsFileTime
    GetTickCount
    GetTimeZoneInformation
    HeapAlloc
    HeapCreate
    HeapDestroy
    HeapFree
    HeapReAlloc
    HeapSize
    InitializeCriticalSectionAndSpinCount
    InterlockedDecrement
    InterlockedIncrement
    IsDebuggerPresent
    IsProcessorFeaturePresent
    IsValidCodePage
    LCMapStringW
    LeaveCriticalSection
    LoadLibraryW
    MoveFileW
    MultiByteToWideChar
    QueryPerformanceCounter
    RaiseException
    ReadFile
    RemoveDirectoryW
    RtlUnwind
    SetCurrentDirectoryW
    SetEndOfFile
    SetEnvironmentVariableA
    SetEnvironmentVariableW
    SetFilePointer
    SetHandleCount
    SetLastError
    SetStdHandle
    SetUnhandledExceptionFilter
    Sleep
    TerminateProcess
    TlsAlloc
    TlsFree
    TlsGetValue
    TlsSetValue
    UnhandledExceptionFilter
    WideCharToMultiByte
    WriteConsoleW
    WriteFile


After doing some research, made the notes (They can be incorrect. I have basic experiecnes with C / C++ / C# and several another programming languages.)

 

Quote

This structure can help clarify how each set of functions works together for different simulation tasks.

    File and Handle Operations
        CloseHandle
        CreateFileW
        FlushFileBuffers
        DeleteFileW
        RemoveDirectoryW
        CopyFileW
        FindClose
        FindFirstFileExW
        FindNextFileW
        MoveFileW

--------------------------------------------------------------------------
        
These functions manage file creation, deletion, copying, and searching. They also handle directories and ensure proper closure of file handles, preventing memory leaks or file access issues.

    String and Encoding Functions
        CompareStringW
        MultiByteToWideChar
        WideCharToMultiByte
        LCMapStringW
        GetStringTypeW
        EncodePointer
        DecodePointer

--------------------------------------------------------------------------

These functions manage encoding conversions between multi-byte and wide characters, especially important for handling strings in different languages. EncodePointer and DecodePointer add security to pointers, making it harder for malicious code to exploit memory.

    Memory Management
        HeapAlloc
        HeapFree
        HeapReAlloc
        HeapSize
        HeapCreate
        HeapDestroy

--------------------------------------------------------------------------

These functions allocate, resize, and free memory on the heap. Proper management of these operations is crucial in simulations, especially with complex data structures like radar data, which may require frequent memory updates.

    Threading and Synchronization
        InitializeCriticalSectionAndSpinCount
        EnterCriticalSection
        LeaveCriticalSection
        InterlockedIncrement
        InterlockedDecrement
        DeleteCriticalSection

--------------------------------------------------------------------------

These functions handle synchronization in multi-threaded scenarios, such as when multiple components (e.g., radar systems, weapons) need to access shared resources. Critical sections ensure that only one thread accesses a resource at a time.

    Process and Environment Management
        GetCurrentProcess
        GetCurrentProcessId
        GetCurrentThreadId
        GetEnvironmentStringsW
        SetEnvironmentVariableA
        SetEnvironmentVariableW
        TerminateProcess
        ExitProcess
        RaiseException
        RtlUnwind

--------------------------------------------------------------------------

These functions manage processes and their environments, which could be useful for initializing or terminating complex simulations or handling crashes gracefully.

    Timing and Performance
        QueryPerformanceCounter
        GetTickCount
        GetSystemTimeAsFileTime
        FileTimeToLocalFileTime
        FileTimeToSystemTime

--------------------------------------------------------------------------
        
These functions track performance metrics and system time. QueryPerformanceCounter is especially important for high-precision timing in simulation scenarios, where response accuracy (like radar ping) is critical.

    Error Handling and Debugging
        GetLastError
        IsDebuggerPresent
        SetUnhandledExceptionFilter
        UnhandledExceptionFilter

--------------------------------------------------------------------------

These functions manage errors and provide debugging support. They allow the simulation to detect issues, handle unhandled exceptions, and determine if it’s running under a debugger, which helps in error reporting and stability.

    Console and Standard I/O
        ReadFile
        WriteFile
        WriteConsoleW
        GetStdHandle

Let's pick this fucntion
QueryPerformanceCounter

By opening Avionics60.dll with hex editor, found this:

 

Quote

00052380  51 75 65 72 79 50 65 72 66 6F 72 6D 61 6E 63 65  QueryPerformance
00052390  43 6F 75 6E 74 65 72 00 93 02 47 65 74 54 69 63  Counter.“.GetTic

According to hex, the fucntion do exist in "HEX DUMP" section, which tells me I am probably on the right path.  I am going to attempt to find more information on each functions using Ghidra.

(Crosses my fingers)


Eagle114th

DLL FILE INFORMATION.txt

Edited by Eagle114th
  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

I still remember that a lot of ini content was found from dll.

Hopefully we can know more in this thread.

  • Like 1

Share this post


Link to post
Share on other sites

From what I understand, those are low level functions that process the raw data generated by the game's engine

This data is called by scripts which govern the actual functioning of the game, avionics, flight model, etc. Scripts, in return, are set up by .ini files

So we have two levels here, with the higher one being accessible to tuning, but not modding.

Thus, we know that the low level is contained in binaries. The scripts themselves, the higher level, I assume hidden in the binaries too

Low level itself may seem not that important to modding the engine as it's just a set of tools to get and process raw data. But it could open the way into the actual meat of the code, the scripts, and help understand how they actually work

Speaking of which, do we know in what language the game is written? C++ I presume

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and 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..