Jump to content
Eagle114th

Questions about DLL files modding (DLL - Dissassembled codes found!)

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

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

hello everyone!

I am on a short break from avonics project this week. I plan returning ot it by end of this week for more epic works on it.

However, today I decided to give ita try with Ghidra, to dig deep int Avionics60.dll, oh boy, I realize that the name of  files can not be searched nor found, unless you find it indirectly.  I just hit this function by looking into .inidll, then it led me to a function, then I saw this one function, named FUN_100153c0, then I went into that one, then I saw this:

 

Quote


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void __fastcall FUN_10013dc0(int param_1)

{
  float10 fVar1;
  void *local_c;
  int *local_8;
  
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441a8,&DAT_10057570);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441b0,&DAT_10057588);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441b8,&DAT_1005757c);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441c0,&DAT_10057574);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441c8,&DAT_10057584);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441d0,&DAT_1005758c);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441d8,&DAT_10057578);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441e0,&DAT_10057580);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441e8,&DAT_10057590);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441f0,&DAT_10057594);
  fVar1 = (float10)(**(code **)(*DAT_10057594 + 0xa4))();
  _DAT_10057568 = (float)fVar1;
  DAT_100547f0 = (**(code **)(*DAT_10057574 + 0x1c))(L"AircraftGroup");
  DAT_100547f4 = (**(code **)(*DAT_10057574 + 0x1c))(L"GroundObjectGroup");
  FUN_10010fc0();
  *(undefined4 *)(param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x3c) = 0;
  FUN_10013530(param_1);
  (**(code **)*DAT_10057584)(L"avionics60.str");
  local_8 = (int *)0x0;
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_10044274,&local_8);
  local_c = (void *)0x0;
  (**(code **)(*local_8 + 8))(&local_c);
  DAT_10057598 = FUN_10020f00(local_c,L"GameplayOptions",L"Avionics",0);
  (**(code **)(*local_8 + 0xc))(&local_c);
  (**(code **)(*DAT_1005a0c8 + 0xc))(&DAT_10044274,&local_8);
  return;
}

Avonics60.str???????  Now I am intersted, it makes me wonder.  (Thank you AI for assisting me going through SF2 DLL files).

I am NOT saying we are far nor close to finding the ways to edit dll, I am just sahring what I have found so far that might give us hints.

Like I said, if you search directly for key words, such as "sweep", "radar", etc, it iwll not be found.  However, if you go through functions and by luck, you land in one of fucntion, you will find the key words.   Like I found this by slucks.

I now rememberfrom the old ddays in programming cvlasses: Public vs Private variables

When writing codes, the public variables is can be shared among the classes, but private is preserved varaibles only locally in specific class.

So this must be it, why the variables can not be found from outside the class or functions.  Therefore, had to follow the brad cumbles to find what find the private varables.


Eagle114th

Edited by Eagle114th

Share this post


Link to post
Share on other sites

UPDATE:

From iniDLL funcitons, the ntoes are made here, as i think may lead to the codes that handles the avionics.  I am continuing to dig through the dll file.  For now I have collected what I find might be useful:

 

Quote


void __cdecl InitDLL(undefined4 param_1,int *param_2)

{
                    /* 0x16fa0  2  InitDLL */
  FUN_1001e4b0(L"AVN",param_2);
  FUN_10013dc0(0x10057620);
  (**(code **)*DAT_1005a0c8)(&DAT_100441f8,&DAT_10057620,param_1);
  FUN_1001ea00();
  FUN_1001ea40(3);
  return;
}

============================================================================
------------------------------- FUN_1001e4b0 -------------------------------
============================================================================

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void FUN_1001e4b0(undefined4 param_1,int *param_2)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  
  _DAT_1005a0c8 = param_2;
  FUN_1001f1b0(0x1005a098,param_1,8);
  _DAT_1005a0c0 = 0x1005a098;
  FUN_1001e9b0();
  FUN_1001e0e0();
  (**(code **)(*_DAT_1005a0c8 + 8))(&UNK_100446c4,&DAT_1005a0c4);
  (**(code **)(*_DAT_1005a0c8 + 8))(&UNK_100446bc,0x1005a0cc);
  (**(code **)(*_DAT_1005a0c8 + 8))(&UNK_100446b4,0x1005a0d0);
  (**(code **)(*_DAT_1005a0c8 + 8))(&UNK_100446ac,&DAT_1005a0d4);
  (**(code **)(*_DAT_1005a0c8 + 8))(&UNK_100446a4,&DAT_1005a0d8);
  _DAT_1005a0b8 = (**(code **)(*_DAT_1005a0c4 + 0x74))();
  _DAT_1005a0bc = (**(code **)(*_DAT_1005a0c4 + 0x70))();
  puVar1 = (undefined4 *)(**(code **)(*_DAT_1005a0c4 + 0x78))();
  if (puVar1 != (undefined4 *)0x0) {
    _DAT_1005a0a8 = *puVar1;
    _DAT_1005a0ac = puVar1[1];
    _DAT_1005a0b0 = puVar1[2];
    _DAT_1005a0b4 = puVar1[3];
  }
  uVar2 = FUN_1001eba0();
  _DAT_1005a0dc = FUN_1001f000(uVar2);
  uVar2 = FUN_1001ea70();
  _DAT_1005a0e0 = FUN_1001f000(uVar2);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001f1b0 -------------------------------
----------------------------------------------------------------------------

wchar_t * __cdecl FUN_1001f1b0(wchar_t *param_1,wchar_t *param_2,rsize_t param_3)

{
  if (param_1 != (wchar_t *)0x0) {
    if ((param_2 != (wchar_t *)0x0) && (*param_2 != L'\0')) {
      _wcsncpy_s(param_1,param_3,param_2,0xffffffff);
      param_1[param_3 - 1] = L'\0';
      return param_1;
    }
    *param_1 = L'\0';
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e9b0 -------------------------------
----------------------------------------------------------------------------

void FUN_1001e9b0(void)

{
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_10044734,&DAT_1005a0e4);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e0e0 -------------------------------
----------------------------------------------------------------------------

void FUN_1001e0e0(void)

{
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_1004469c,&DAT_1005a094);
  return;
}

============================================================================
------------------------------- FUN_10013dc0 -------------------------------
============================================================================

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void __fastcall FUN_10013dc0(int param_1)

{
  float10 fVar1;
  void *local_c;
  int *local_8;
  
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441a8,&DAT_10057570);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441b0,&DAT_10057588);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441b8,&DAT_1005757c);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441c0,&DAT_10057574);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441c8,&DAT_10057584);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441d0,&DAT_1005758c);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441d8,&DAT_10057578);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441e0,&DAT_10057580);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441e8,&DAT_10057590);
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_100441f0,&DAT_10057594);
  fVar1 = (float10)(**(code **)(*DAT_10057594 + 0xa4))();
  _DAT_10057568 = (float)fVar1;
  DAT_100547f0 = (**(code **)(*DAT_10057574 + 0x1c))(L"AircraftGroup");
  DAT_100547f4 = (**(code **)(*DAT_10057574 + 0x1c))(L"GroundObjectGroup");
  FUN_10010fc0();
  *(undefined4 *)(param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x3c) = 0;
  FUN_10013530(param_1);
  (**(code **)*DAT_10057584)(L"avionics60.str");
  local_8 = (int *)0x0;
  (**(code **)(*DAT_1005a0c8 + 8))(&DAT_10044274,&local_8);
  local_c = (void *)0x0;
  (**(code **)(*local_8 + 8))(&local_c);
  DAT_10057598 = FUN_10020f00(local_c,L"GameplayOptions",L"Avionics",0);
  (**(code **)(*local_8 + 0xc))(&local_c);
  (**(code **)(*DAT_1005a0c8 + 0xc))(&DAT_10044274,&local_8);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_10010fc0 -------------------------------
----------------------------------------------------------------------------

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void FUN_10010fc0(void)

{
  _DAT_10057524 = (**(code **)(*DAT_10057574 + 0x2c))(&DAT_10042894);
  _DAT_10057528 = (**(code **)(*DAT_10057574 + 0x2c))(L"GROUND");
  _DAT_1005752c = (**(code **)(*DAT_10057574 + 0x2c))(L"MISSILE");
  DAT_10057530 = (**(code **)(*DAT_10057574 + 0x2c))(L"DETECTED");
  _DAT_10057534 = (**(code **)(*DAT_10057574 + 0x2c))(L"IDENTIFIED");
  _DAT_10057538 = (**(code **)(*DAT_10057574 + 0x2c))(L"AWAKE");
  _DAT_1005753c = (**(code **)(*DAT_10057574 + 0x2c))(L"ASLEEP");
  _DAT_10057540 = (**(code **)(*DAT_10057574 + 0x2c))(L"LEAD");
  _DAT_10057544 = (**(code **)(*DAT_10057574 + 0x2c))(L"FORMATION");
  _DAT_10057548 = (**(code **)(*DAT_10057574 + 0x2c))(L"NETOBJECT");
  _DAT_1005754c = (**(code **)(*DAT_10057574 + 0x2c))(L"REMOTEOBJECT");
  DAT_10057550 = (**(code **)(*DAT_10057574 + 0x2c))(L"TARGETABLE");
  _DAT_10057554 = (**(code **)(*DAT_10057574 + 0x2c))(L"PLAYERLAUNCHED");
  _DAT_10057558 = (**(code **)(*DAT_10057574 + 0x2c))(L"PLAYERTARGET");
  _DAT_1005755c = (**(code **)(*DAT_10057574 + 0x2c))(L"PLAYEROBJECT");
  _DAT_10057560 = (**(code **)(*DAT_10057574 + 0x2c))(L"NOT_RENDERED");
  _DAT_10057564 = (**(code **)(*DAT_10057574 + 0x2c))(L"WEAPON_IN_FLIGHT");
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_10013530 -------------------------------
----------------------------------------------------------------------------

void __fastcall FUN_10013530(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  int *local_8;
  
  if (*(int *)(param_1 + 0x34) != 0) {
    local_8 = (int *)0x0;
    (**(code **)**(undefined4 **)(param_1 + 0x34))(0xc,&local_8);
    if (*(int *)(param_1 + 0x3c) == 0) {
      (**(code **)(*local_8 + 0x54))(0xffffffff);
    }
    else {
      iVar1 = *local_8;
      uVar2 = (**(code **)(**(int **)(param_1 + 0x3c) + 8))();
      (**(code **)(iVar1 + 0x54))(uVar2);
    }
    uVar2 = 1;
    switch(*(undefined2 *)(param_1 + 4)) {
    case 0:
      uVar2 = 0;
      break;
    case 2:
    case 4:
      (**(code **)(*local_8 + 0x50))(2);
      return;
    case 3:
      (**(code **)(*local_8 + 0x50))(3);
      return;
    }
    (**(code **)(*local_8 + 0x50))(uVar2);
  }
  return;
}

============================================================================
------------------------------- FUN_1001ea00 -------------------------------
============================================================================

void FUN_1001ea00(void)

{
  return;
}

============================================================================
------------------------------- FUN_1001ea40 -------------------------------
============================================================================

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void __cdecl FUN_1001ea40(undefined4 param_1)

{
  _DAT_1005a0e8 = param_1;
  return;
}

Notes on each of the functions:

Screenshot-2025-07-15-185416



Eagle114th

Edited by Eagle114th

Share this post


Link to post
Share on other sites

HOLY MOLY!!!!!!!!!!!!!!!!!!!  I found the goldmine, the pieces of the disassembled codess!

I was looking into this function:

FUN_10013dc0(0x10057620);

Then i notice the address 0x10057620, so I went into that, then I landed in the goldmine!

I found a large block of codes that handles the .ini, here is the codes:
 

Quote

============================================================================
------------------------------- FUN_10013f90 -------------------------------
============================================================================

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void __thiscall FUN_10013f90(void *this,wchar_t *param_1)

{
  ushort *puVar1;
  float fVar2;
  bool bVar3;
  byte bVar4;
  size_t sVar5;
  wchar_t *pwVar6;
  short sVar7;
  uint uVar8;
  int iVar9;
  undefined4 uVar10;
  void *pvVar11;
  int iVar12;
  float fVar13;
  float *pfVar14;
  undefined4 extraout_ECX;
  undefined4 extraout_ECX_00;
  uint uVar15;
  undefined4 extraout_ECX_01;
  undefined4 extraout_ECX_02;
  undefined4 extraout_ECX_03;
  undefined4 extraout_ECX_04;
  undefined4 extraout_ECX_05;
  undefined4 extraout_ECX_06;
  undefined4 extraout_ECX_07;
  undefined4 extraout_ECX_08;
  undefined4 extraout_ECX_09;
  undefined4 extraout_ECX_10;
  undefined4 extraout_ECX_11;
  undefined4 extraout_ECX_12;
  undefined4 extraout_ECX_13;
  undefined4 extraout_ECX_14;
  uint uVar16;
  undefined4 extraout_EDX;
  undefined4 extraout_EDX_00;
  undefined4 extraout_EDX_01;
  undefined4 extraout_EDX_02;
  undefined4 extraout_EDX_03;
  undefined4 extraout_EDX_04;
  undefined4 extraout_EDX_05;
  undefined4 extraout_EDX_06;
  undefined4 extraout_EDX_07;
  undefined4 extraout_EDX_08;
  undefined4 extraout_EDX_09;
  int *piVar17;
  float10 fVar18;
  float10 fVar19;
  ulonglong uVar20;
  wchar_t local_c94 [260];
  wchar_t local_a8c [260];
  wchar_t local_884 [260];
  wchar_t local_67c [260];
  wchar_t local_474 [260];
  float local_26c [3];
  int local_260 [144];
  undefined8 local_20;
  float local_18;
  float *local_14;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003f4db;
  local_10 = ExceptionList;
  puVar1 = (ushort *)((int)this + 0x40);
  ExceptionList = &local_10;
  _memset(puVar1,0,0x264);
  FUN_10020670(local_260,param_1,0,0,0xf000);
  *(undefined4 *)((int)this + 0xe78) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe7c) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe80) = 0xffffffff;
  *(undefined4 *)((int)this + 0xeb4) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe84) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe88) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe8c) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe90) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe94) = 0xffffffff;
  *(undefined4 *)((int)this + 0xe98) = 0xffffffff;
  *(undefined4 *)((int)this + 0xea0) = 0xffffffff;
  *(undefined4 *)((int)this + 0xea4) = 0xffffffff;
  *(undefined4 *)((int)this + 0xea8) = 0xffffffff;
  *(undefined4 *)((int)this + 0xeac) = 0xffffffff;
  *(undefined4 *)((int)this + 0xeb0) = 0xffffffff;
  *(undefined4 *)((int)this + 0xeb8) = 0;
  *(undefined4 *)((int)this + 0xebc) = 0;
  *(undefined4 *)((int)this + 0xec0) = 0x80;
  *(undefined4 *)((int)this + 0xec4) = 0x80;
  *(undefined2 *)((int)this + 0xee2) = 0xffff;
  *(undefined4 *)((int)this + 0x2a54) = 3;
  *(undefined2 *)((int)this + 0xee0) = 0;
  *(undefined2 *)((int)this + 0xee4) = 0;
  *(undefined2 *)((int)this + 0xeea) = 0;
  local_8 = 0;
  *(undefined4 *)((int)this + 0x84) = 0xffffffff;
  *(undefined4 *)((int)this + 0x88) = 0xffffffff;
  *(undefined4 *)((int)this + 0x8c) = 0xffffffff;
  *(undefined4 *)((int)this + 0x90) = 0xffffffff;
  *(undefined4 *)((int)this + 0x94) = 0xffffffff;
  *(undefined4 *)((int)this + 0x98) = 0xffffffff;
  *(undefined4 *)((int)this + 0x9c) = 0xffffffff;
  *(undefined4 *)((int)this + 0xa0) = 0xffffffff;
  uVar8 = FUN_100210c0(local_260,L"AvionicsData",L"GunsightRangingOnly",0);
  if (uVar8 == 0) {
    uVar8 = FUN_10012b90(L"AvailableModes",L"AvionicsData",local_260);
    *puVar1 = (ushort)uVar8;
    if ((ushort)uVar8 != 0) {
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"ViewportTextureSize",
                           *(int *)((int)this + 0xec0));
      uVar10 = FUN_10024470(iVar9);
      *(undefined4 *)((int)this + 0xe74) = uVar10;
      uVar10 = (**(code **)(*DAT_10057570 + 0xc0))(iVar9,iVar9,0x18);
      *(undefined4 *)((int)this + 0xe78) = uVar10;
      FUN_10021000(local_260,L"TextureData",L"RadarTexture",(wchar_t *)&PTR_10041850,local_474,0x104
                   ,0);
      iVar9 = FUN_1001efc0(local_474);
      if (iVar9 == 0) {
        uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,0,1,0);
        *(undefined4 *)((int)this + 0xe7c) = uVar10;
      }
      FUN_10021000(local_260,L"TextureData",L"RadarAGTexture",(wchar_t *)&PTR_10041850,local_474,
                   0x104,0);
      iVar9 = FUN_1001efc0(local_474);
      if (iVar9 == 0) {
        uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,0,1,0);
        *(undefined4 *)((int)this + 0xe80) = uVar10;
      }
      iVar9 = (**(code **)(*DAT_10057570 + 0x84))(*(undefined4 *)((int)this + 0xec0),0x20,1);
      *(int *)((int)this + 0xeb4) = iVar9;
      if (iVar9 != -1) {
        sVar5 = *(int *)((int)this + 0xec0) * *(int *)((int)this + 0xec4) * 4;
        pvVar11 = (void *)FUN_1001e160(sVar5);
        *(void **)((int)this + 0xeb8) = pvVar11;
        _memset(pvVar11,0,sVar5);
      }
      uVar8 = (uint)(*(int *)((int)this + 0xe78) != -1);
      *(uint *)((int)this + 0x2a58) = uVar8;
      if (uVar8 == 0) {
        *(undefined4 *)((int)this + 0xe78) = *(undefined4 *)((int)this + 0xeb4);
      }
      iVar9 = FUN_1001fc40(local_260,L"AvionicsData",L"RangeSetting[%d]");
      sVar7 = (short)iVar9;
      if (sVar7 < 1) {
        sVar7 = 0;
      }
      else if (7 < sVar7) {
        sVar7 = 8;
      }
      *(short *)((int)this + 0x42) = sVar7;
      FUN_10021000(local_260,L"AvionicsData",L"RangeUnit",(wchar_t *)&PTR_10041850,local_c94,0x104,0
                  );
      fVar18 = FUN_10022650(local_c94);
      fVar2 = (float)fVar18;
      if (0 < *(short *)((int)this + 0x42)) {
        pfVar14 = (float *)((int)this + 100);
        iVar9 = 1;
        do {
          _swprintf_s(local_a8c,0x104,L"RangeSetting[%d]",iVar9);
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",local_a8c,0.0);
          pfVar14[-8] = (float)(fVar18 * (float10)fVar2);
          _swprintf_s(local_a8c,0x104,L"MinimumRange[%d]",iVar9);
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",local_a8c,0.0);
          *pfVar14 = (float)(fVar18 * (float10)fVar2);
          _swprintf_s(local_a8c,0x104,L"RangeTexture[%d]",iVar9);
          FUN_10021000(local_260,L"TextureData",local_a8c,(wchar_t *)&PTR_10041850,local_474,0x104,0
                      );
          iVar12 = FUN_1001efc0(local_474);
          if (iVar12 == 0) {
            fVar13 = (float)(**(code **)(*DAT_10057570 + 0x7c))(local_474,0,1,0);
            pfVar14[8] = fVar13;
          }
          pfVar14 = pfVar14 + 1;
          bVar3 = iVar9 < *(short *)((int)this + 0x42);
          iVar9 = iVar9 + 1;
        } while (bVar3);
      }
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MaxElevationAngle",0.0);
      *(float *)((int)this + 0xa4) = (float)(fVar18 * (float10)0.01745329238474369);
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MinElevationAngle",0.0);
      *(float *)((int)this + 0xa8) = (float)(fVar18 * (float10)0.01745329238474369);
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MaxAzimuthAngle",0.0);
      *(float *)((int)this + 0xac) = (float)(fVar18 * (float10)0.01745329238474369);
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MinAltitude",_DAT_10054840);
      *(float *)((int)this + 0xb0) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MinReturn",0.1);
      *(float *)((int)this + 0xb4) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MinimumSpeed",_DAT_1005483c);
      *(float *)((int)this + 0xb8) = (float)fVar18;
      pfVar14 = FUN_100221d0(local_26c,local_260,L"AvionicsData",L"RadarPosition");
      *(float *)((int)this + 0xbc) = *pfVar14;
      *(float *)((int)this + 0xc0) = pfVar14[1];
      *(float *)((int)this + 0xc4) = pfVar14[2];
      _swprintf_s(local_884,0x104,L"%s[%%d].%s",L"ScanPattern",L"ScanArc");
      iVar9 = FUN_1001fc40(local_260,L"AvionicsData",local_884);
      sVar7 = (short)iVar9;
      if (sVar7 < 1) {
        sVar7 = 0;
      }
      else if (7 < sVar7) {
        sVar7 = 8;
      }
      *(short *)((int)this + 0xca) = sVar7;
      if (0 < sVar7) {
        local_18 = 1.4013e-45;
        piVar17 = (int *)((int)this + 0xd8);
        do {
          _swprintf_s(local_884,0x104,L"%s[%d].%s[%%d]",L"ScanPattern",local_18,L"BarElevation");
          iVar9 = FUN_1001fc40(local_260,L"AvionicsData",local_884);
          sVar7 = (short)iVar9;
          if (sVar7 < 1) {
            sVar7 = 0;
          }
          else if (7 < sVar7) {
            sVar7 = 8;
          }
          iVar9 = 0;
          *piVar17 = (int)sVar7;
          if (0 < sVar7) {
            local_14 = (float *)(piVar17 + 1);
            do {
              iVar9 = iVar9 + 1;
              _swprintf_s(local_67c,0x104,local_884,iVar9);
              fVar18 = FUN_10020f80(local_260,L"AvionicsData",local_67c,0.0);
              *local_14 = (float)(fVar18 * (float10)0.01745329238474369);
              local_14 = local_14 + 1;
            } while (iVar9 < *piVar17);
          }
          fVar13 = local_18;
          _swprintf_s(local_884,0x104,L"%s[%d].%%s",L"ScanPattern",local_18);
          _swprintf_s(local_67c,0x104,local_884,L"ScanRate");
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",local_67c,0.0);
          piVar17[9] = (int)(float)(fVar18 * (float10)0.01745329238474369);
          _swprintf_s(local_67c,0x104,local_884,L"ScanBeamAngle");
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",local_67c,0.0);
          local_14 = (float *)(float)(fVar18 * (float10)0.5 * (float10)0.01745329238474369);
          fVar18 = (float10)FUN_1002aa60(extraout_ECX);
          local_14 = (float *)(float)fVar18;
          piVar17[10] = (int)local_14;
          _swprintf_s(local_67c,0x104,local_884,L"ScanArc");
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",local_67c,0.0);
          local_18 = (float)((int)fVar13 + 1);
          piVar17[0xb] = (int)(float)(fVar18 * (float10)0.01745329238474369);
          piVar17 = piVar17 + 0xc;
        } while ((int)fVar13 < (int)*(short *)((int)this + 0xca));
      }
      *(undefined4 *)((int)this + 600) = 0;
      if ((*(byte *)((int)this + 0x40) & 2) != 0) {
        uVar8 = FUN_10012d90(L"SearchRangeSetting",L"AvionicsData",local_260,
                             (int)*(short *)((int)this + 0x42));
        *(short *)((int)this + 200) = (short)uVar8;
        iVar9 = FUN_1001f8a0(local_260,L"AvionicsData",L"SearchRange");
        if (iVar9 == 0) {
          uVar8 = (uint)*(short *)((int)this + 0x42);
          *(undefined4 *)((int)this + 600) = 0;
          iVar9 = uVar8 - 1;
          bVar4 = (byte)iVar9 & 0x1f;
          uVar15 = 1 << bVar4 | 1U >> 0x20 - bVar4;
          if (-1 < iVar9) {
            if (3 < (int)uVar8) {
              uVar16 = (uint)*(ushort *)((int)this + 200);
              local_14 = (float *)(uVar8 >> 2);
              pfVar14 = (float *)((int)this + iVar9 * 4 + 0x40);
              iVar9 = iVar9 + (int)local_14 * -4;
              do {
                if (((uVar15 & uVar16) != 0) &&
                   (*(float *)((int)this + 600) < pfVar14[1] !=
                    (NAN(*(float *)((int)this + 600)) || NAN(pfVar14[1])))) {
                  *(float *)((int)this + 600) = pfVar14[1];
                }
                uVar8 = uVar15 >> 1;
                if (((uVar8 & uVar16) != 0) &&
                   (*(float *)((int)this + 600) < *pfVar14 !=
                    (NAN(*(float *)((int)this + 600)) || NAN(*pfVar14)))) {
                  *(float *)((int)this + 600) = *pfVar14;
                }
                if (((uVar8 & uVar16 << 1) != 0) &&
                   (*(float *)((int)this + 600) < pfVar14[-1] !=
                    (NAN(*(float *)((int)this + 600)) || NAN(pfVar14[-1])))) {
                  *(float *)((int)this + 600) = pfVar14[-1];
                }
                if (((uVar8 & uVar16 << 2) != 0) &&
                   (*(float *)((int)this + 600) < pfVar14[-2] !=
                    (NAN(*(float *)((int)this + 600)) || NAN(pfVar14[-2])))) {
                  *(float *)((int)this + 600) = pfVar14[-2];
                }
                uVar15 = (((uVar8 | (uint)((uVar15 & 1) != 0) << 0x1f) >> 1 |
                          (uint)((uVar8 & 1) != 0) << 0x1f) >> 1 | (uint)((uVar8 & 2) != 0) << 0x1f)
                         >> 1 | (uint)((uVar8 & 4) != 0) << 0x1f;
                pfVar14 = pfVar14 + -4;
                local_14 = (float *)((int)local_14 + -1);
              } while (local_14 != (float *)0x0);
            }
            if (-1 < iVar9) {
              pfVar14 = (float *)((int)this + iVar9 * 4 + 0x44);
              do {
                if (((uVar15 & *(ushort *)((int)this + 200)) != 0) &&
                   (*(float *)((int)this + 600) < *pfVar14 !=
                    (NAN(*(float *)((int)this + 600)) || NAN(*pfVar14)))) {
                  *(float *)((int)this + 600) = *pfVar14;
                }
                uVar15 = uVar15 >> 1 | (uint)((uVar15 & 1) != 0) << 0x1f;
                pfVar14 = pfVar14 + -1;
                iVar9 = iVar9 + -1;
              } while (-1 < iVar9);
            }
          }
        }
        else {
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"SearchRange",0.0);
          *(float *)((int)this + 600) = (float)(fVar18 * (float10)fVar2);
        }
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"SearchStrength",0.0);
        local_14 = (float *)(float)fVar18;
        fVar18 = FUN_1001dc20(*(float *)((int)this + 600),(float)local_14);
        *(float *)((int)this + 0x25c) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"SearchTargetTime",0.0);
        *(float *)((int)this + 0x260) = (float)fVar18;
      }
      if ((*(ushort *)((int)this + 0x40) & 8) != 0) {
        *(ushort *)((int)this + 0x40) = *(ushort *)((int)this + 0x40) | 4;
      }
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"AcquisitionSymbolSpeed",0.0);
      *(float *)((int)this + 0x264) = (float)fVar18;
      if ((*(byte *)((int)this + 0x40) & 4) != 0) {
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"AcquisitionTime",1.0);
        local_14 = (float *)(float)fVar18;
        *(float **)((int)this + 0x270) = local_14;
        *(float *)((int)this + 0x274) = 1.0 / (float)local_14;
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"LostAquisitionTime",0.0);
        *(float *)((int)this + 0x278) = (float)fVar18;
      }
      *(undefined4 *)((int)this + 0x27c) = 0;
      if ((*(byte *)((int)this + 0x40) & 8) != 0) {
        uVar8 = FUN_10012d90(L"TrackRangeSetting",L"AvionicsData",local_260,
                             (int)*(short *)((int)this + 0x42));
        *(short *)((int)this + 0xcc) = (short)uVar8;
        iVar9 = FUN_1001f8a0(local_260,L"AvionicsData",L"TrackRange");
        if (iVar9 == 0) {
          uVar8 = (uint)*(short *)((int)this + 0x42);
          *(undefined4 *)((int)this + 0x27c) = 0;
          iVar9 = uVar8 - 1;
          bVar4 = (byte)iVar9 & 0x1f;
          uVar15 = 1 << bVar4 | 1U >> 0x20 - bVar4;
          if (-1 < iVar9) {
            if (3 < (int)uVar8) {
              uVar16 = (uint)*(ushort *)((int)this + 0xcc);
              param_1 = (wchar_t *)(uVar8 >> 2);
              pfVar14 = (float *)((int)this + iVar9 * 4 + 0x40);
              iVar9 = iVar9 + (int)param_1 * -4;
              do {
                if (((uVar15 & uVar16) != 0) &&
                   (*(float *)((int)this + 0x27c) < pfVar14[1] !=
                    (NAN(*(float *)((int)this + 0x27c)) || NAN(pfVar14[1])))) {
                  *(float *)((int)this + 0x27c) = pfVar14[1];
                }
                uVar8 = uVar15 >> 1;
                if (((uVar8 & uVar16) != 0) &&
                   (*(float *)((int)this + 0x27c) < *pfVar14 !=
                    (NAN(*(float *)((int)this + 0x27c)) || NAN(*pfVar14)))) {
                  *(float *)((int)this + 0x27c) = *pfVar14;
                }
                if (((uVar8 & uVar16 << 1) != 0) &&
                   (*(float *)((int)this + 0x27c) < pfVar14[-1] !=
                    (NAN(*(float *)((int)this + 0x27c)) || NAN(pfVar14[-1])))) {
                  *(float *)((int)this + 0x27c) = pfVar14[-1];
                }
                if (((uVar8 & uVar16 << 2) != 0) &&
                   (*(float *)((int)this + 0x27c) < pfVar14[-2] !=
                    (NAN(*(float *)((int)this + 0x27c)) || NAN(pfVar14[-2])))) {
                  *(float *)((int)this + 0x27c) = pfVar14[-2];
                }
                uVar15 = (((uVar8 | (uint)((uVar15 & 1) != 0) << 0x1f) >> 1 |
                          (uint)((uVar8 & 1) != 0) << 0x1f) >> 1 | (uint)((uVar8 & 2) != 0) << 0x1f)
                         >> 1 | (uint)((uVar8 & 4) != 0) << 0x1f;
                pfVar14 = pfVar14 + -4;
                param_1 = (wchar_t *)((int)param_1 + -1);
              } while (param_1 != (wchar_t *)0x0);
            }
            if (-1 < iVar9) {
              pfVar14 = (float *)((int)this + iVar9 * 4 + 0x44);
              do {
                if (((uVar15 & *(ushort *)((int)this + 0xcc)) != 0) &&
                   (*(float *)((int)this + 0x27c) < *pfVar14 !=
                    (NAN(*(float *)((int)this + 0x27c)) || NAN(*pfVar14)))) {
                  *(float *)((int)this + 0x27c) = *pfVar14;
                }
                uVar15 = uVar15 >> 1 | (uint)((uVar15 & 1) != 0) << 0x1f;
                pfVar14 = pfVar14 + -1;
                iVar9 = iVar9 + -1;
              } while (-1 < iVar9);
            }
          }
        }
        else {
          fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"TrackRange",0.0);
          *(float *)((int)this + 0x27c) = (float)(fVar18 * (float10)fVar2);
        }
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"TrackStrength",0.0);
        fVar18 = FUN_1001dc20(*(float *)((int)this + 0x27c),(float)fVar18);
        *(float *)((int)this + 0x280) = (float)fVar18;
        uVar8 = FUN_10012c90(L"TrackCapabilities",L"AvionicsData",local_260);
        *(short *)((int)this + 0xce) = (short)uVar8;
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"TrackMemroyTime",0.0);
        *(float *)((int)this + 0x284) = (float)fVar18;
      }
      if ((*(byte *)((int)this + 0x40) & 0x10) != 0) {
        uVar8 = FUN_10012d90(L"BoresightRangeSetting",L"AvionicsData",local_260,
                             (int)*(short *)((int)this + 0x42));
        *(short *)((int)this + 0xd0) = (short)uVar8;
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"BoresightElevation",0.0);
        *(float *)((int)this + 0x28c) = (float)(fVar18 * (float10)0.01745329238474369);
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"BoresightAzimuth",0.0);
        *(float *)((int)this + 0x290) = (float)(fVar18 * (float10)0.01745329238474369);
        FUN_10020f80(local_260,L"AvionicsData",L"BoresightBeamAngle",0.0);
        fVar18 = (float10)FUN_1002aa60(extraout_ECX_00);
        *(float *)((int)this + 0x294) = (float)fVar18;
      }
      if ((*(byte *)((int)this + 0x40) & 0x20) != 0) {
        uVar8 = FUN_10012d90(L"GroundMapRangeSetting",L"AvionicsData",local_260,
                             (int)*(short *)((int)this + 0x42));
        uVar15 = (uint)*(short *)((int)this + 0x42);
        param_1 = *(wchar_t **)((int)this + 600);
        iVar9 = uVar15 - 1;
        bVar4 = (byte)iVar9 & 0x1f;
        uVar16 = 1 << bVar4 | 1U >> 0x20 - bVar4;
        *(short *)((int)this + 0xd2) = (short)uVar8;
        if (-1 < iVar9) {
          if (3 < (int)uVar15) {
            local_18 = (float)(uVar8 & 0xffff);
            uVar15 = uVar15 >> 2;
            pfVar14 = (float *)((int)this + iVar9 * 4 + 0x40);
            iVar9 = iVar9 + uVar15 * -4;
            do {
              if ((((uint)local_18 & uVar16) != 0) &&
                 ((float)param_1 < pfVar14[1] != (NAN((float)param_1) || NAN(pfVar14[1])))) {
                param_1 = (wchar_t *)pfVar14[1];
              }
              uVar8 = uVar16 >> 1;
              if (((uVar8 & (uint)local_18) != 0) &&
                 ((float)param_1 < *pfVar14 != (NAN((float)param_1) || NAN(*pfVar14)))) {
                param_1 = (wchar_t *)*pfVar14;
              }
              if (((uVar8 & (int)local_18 << 1) != 0) &&
                 ((float)param_1 < pfVar14[-1] != (NAN((float)param_1) || NAN(pfVar14[-1])))) {
                param_1 = (wchar_t *)pfVar14[-1];
              }
              if (((uVar8 & (int)local_18 << 2) != 0) &&
                 ((float)param_1 < pfVar14[-2] != (NAN((float)param_1) || NAN(pfVar14[-2])))) {
                param_1 = (wchar_t *)pfVar14[-2];
              }
              uVar16 = (((uVar8 | (uint)((uVar16 & 1) != 0) << 0x1f) >> 1 |
                        (uint)((uVar8 & 1) != 0) << 0x1f) >> 1 | (uint)((uVar8 & 2) != 0) << 0x1f)
                       >> 1 | (uint)((uVar8 & 4) != 0) << 0x1f;
              pfVar14 = pfVar14 + -4;
              uVar15 = uVar15 - 1;
            } while (uVar15 != 0);
          }
          if (-1 < iVar9) {
            pfVar14 = (float *)((int)this + iVar9 * 4 + 0x44);
            do {
              if (((uVar16 & *(ushort *)((int)this + 0xd2)) != 0) &&
                 ((float)param_1 < *pfVar14 != (NAN((float)param_1) || NAN(*pfVar14)))) {
                param_1 = (wchar_t *)*pfVar14;
              }
              uVar16 = uVar16 >> 1 | (uint)((uVar16 & 1) != 0) << 0x1f;
              pfVar14 = pfVar14 + -1;
              iVar9 = iVar9 + -1;
            } while (-1 < iVar9);
          }
        }
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"GroundSearchStrength",
                              *(float *)((int)this + 0x25c));
        local_14 = (float *)(float)fVar18;
        fVar18 = FUN_1001dc20((float)param_1,(float)local_14);
        *(float *)((int)this + 0x298) = (float)fVar18;
      }
      puVar1 = (ushort *)((int)this + 0x40);
      if ((*(byte *)((int)this + 0x40) & 0x40) != 0) {
        uVar8 = FUN_10012d90(L"TerrainAvoidanceRangeSetting",L"AvionicsData",local_260,
                             (int)*(short *)((int)this + 0x42));
        *(short *)((int)this + 0xd4) = (short)uVar8;
        fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"ClearanceDistance",152.4);
        *(float *)((int)this + 0x29c) = (float)fVar18;
      }
      if ((*puVar1 & 0x60) != 0) {
        sVar5 = *(int *)((int)this + 0xec0) * *(int *)((int)this + 0xec4) * 4;
        pvVar11 = (void *)FUN_1001e160(sVar5);
        *(void **)((int)this + 0xebc) = pvVar11;
        _memset(pvVar11,0,sVar5);
      }
      _DAT_100575f8 = puVar1;
      _DAT_1005761c = puVar1;
      _memset((float *)((int)this + 0x2a4),0,0x594);
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"FadeImageIntensity",0.0);
      *(float *)((int)this + 0x2a4) = (float)fVar18;
      local_20 = (double)(float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"ImageFadeTime",1.0);
      *(float *)((int)this + 0x2ac) = (float)((float10)local_20 / fVar18);
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"TargetFadeTime",1.0);
      *(float *)((int)this + 0x2a8) = (float)((float10)1 / fVar18);
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"SweepIntensity",0.7);
      *(float *)((int)this + 0x2b0) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"StrobeIntensity",0.7);
      *(float *)((int)this + 0x2b4) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"ElevationScale",0.0);
      *(float *)((int)this + 0x2b8) = (float)(fVar18 * (float10)0.01745329238474369);
      FUN_10020f80(local_260,L"RadarDisplay",L"ElevationStrobeSize",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_01,extraout_EDX);
      *(int *)((int)this + 0x324) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"TargetStrobeSize",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_02,extraout_EDX_00);
      *(int *)((int)this + 0x330) = (int)uVar20;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"TargetShadowIntensity",0.0);
      *(float *)((int)this + 700) = (float)fVar18;
      FUN_10020f80(local_260,L"RadarDisplay",L"AcquisitionSymbolHeight",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_03,extraout_EDX_01);
      *(int *)((int)this + 0x334) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"AcquisitionSymbolSize",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_04,extraout_EDX_02);
      *(int *)((int)this + 0x338) = (int)uVar20;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"NoiseLevel",0.2);
      *(float *)((int)this + 0x2c0) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"DitheredSweepIntensity",0.0);
      *(float *)((int)this + 0x2c4) = (float)fVar18;
      FUN_10020f80(local_260,L"RadarDisplay",L"DitheredSweepWidth",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_05,extraout_EDX_03);
      *(int *)((int)this + 0x33c) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"RangeStrobeWidth",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_06,extraout_EDX_04);
      *(int *)((int)this + 0x340) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"RangeStrobeHeight",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_07,extraout_EDX_05);
      *(int *)((int)this + 0x344) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"RangeGateWidth",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_08,extraout_EDX_06);
      *(int *)((int)this + 0x348) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"RangeGateHeight",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_09,extraout_EDX_07);
      *(int *)((int)this + 0x34c) = (int)uVar20;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"RangeGateIntensity",0.0);
      *(float *)((int)this + 0x2c8) = (float)fVar18;
      FUN_10020f80(local_260,L"RadarDisplay",L"MissileRStrobeWidth",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_10,extraout_EDX_08);
      *(int *)((int)this + 0x350) = (int)uVar20;
      FUN_10020f80(local_260,L"RadarDisplay",L"BreakXSize",0.0);
      uVar20 = FUN_1002af10(extraout_ECX_11,extraout_EDX_09);
      *(int *)((int)this + 0x354) = (int)uVar20;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"BreakXIntensity",0.0);
      *(float *)((int)this + 0x2cc) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"AltitudeIntensity",
                            *(float *)((int)this + 0x2b4));
      *(float *)((int)this + 0x2d0) = (float)fVar18;
      param_1 = (wchar_t *)((int)this + 0x3fc);
      local_18 = 1.4013e-45;
      local_14 = (float *)0x10043928;
      do {
        _swprintf_s(local_67c,0x104,L"%s%s",L"RadarDisplay",local_14);
        uVar8 = 0;
        if ((local_18 == 7.00649e-45) || (local_18 == 8.40779e-45)) {
          uVar8 = 1;
        }
        uVar8 = FUN_100210c0(local_260,local_67c,L"PPI",uVar8);
        *(uint *)(param_1 + -2) = uVar8;
        iVar9 = FUN_1001fc40(local_260,local_67c,L"Symbol[%02d]");
        if (iVar9 < 1) {
          iVar12 = 0;
        }
        else {
          iVar12 = 0x20;
          if (iVar9 < 0x20) {
            iVar12 = iVar9;
          }
        }
        iVar9 = 0;
        *(int *)param_1 = iVar12;
        pwVar6 = param_1;
        if (0 < iVar12) {
          do {
            iVar9 = iVar9 + 1;
            _swprintf_s(local_c94,0x104,L"Symbol[%02d]",iVar9);
            iVar12 = FUN_10012e90(local_c94,local_67c,local_260);
            *(int *)(pwVar6 + 2) = iVar12;
            pwVar6 = pwVar6 + 2;
          } while (iVar9 < *(int *)param_1);
        }
        local_18 = (float)((int)local_18 + 1);
        param_1 = param_1 + 0x44;
        local_14 = (float *)((int)local_14 + 0x40);
      } while ((int)local_14 < 0x10043a69);
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"PPIArc",50.0);
      *(float *)((int)this + 0x2d4) = (float)(fVar18 * (float10)0.01745329238474369);
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"AzimuthCursorIntensity",0.0);
      *(float *)((int)this + 0x2d8) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"GroundReturnFadeTime",1.0);
      *(float *)((int)this + 0x2dc) = (float)((float10)1 / fVar18);
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"GroundClutter",0.0);
      *(float *)((int)this + 0x2e0) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"MapBackgroundLevel",0.2);
      *(float *)((int)this + 0x2e4) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"MapHighlightLevel",0.6);
      *(float *)((int)this + 0x2e8) = (float)fVar18;
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"DisplayLimitLeft",1);
      iVar12 = *(int *)((int)this + 0xec0) + -2;
      if (iVar9 < 2) {
        iVar9 = 1;
      }
      else if (iVar12 <= iVar9) {
        iVar9 = iVar12;
      }
      *(short *)((int)this + 0x360) = (short)iVar9;
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"DisplayLimitRight",iVar12);
      iVar12 = *(int *)((int)this + 0xec0) + -2;
      if (iVar9 < 2) {
        iVar9 = 1;
      }
      else if (iVar12 <= iVar9) {
        iVar9 = iVar12;
      }
      *(short *)((int)this + 0x362) = (short)iVar9;
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"DisplayLimitTop",1);
      iVar12 = *(int *)((int)this + 0xec4) + -2;
      if (iVar9 < 2) {
        iVar9 = 1;
      }
      else if (iVar12 <= iVar9) {
        iVar9 = iVar12;
      }
      *(short *)((int)this + 0x364) = (short)iVar9;
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"DisplayLimitBottom",iVar12);
      iVar12 = *(int *)((int)this + 0xec4) + -2;
      if (iVar9 < 2) {
        iVar9 = 1;
      }
      else if (iVar12 <= iVar9) {
        iVar9 = iVar12;
      }
      local_14 = (float *)(int)*(short *)((int)this + 0x362);
      local_18 = (float)*(int *)((int)this + 0xec0) * 0.5;
      sVar7 = (short)iVar9;
      iVar9 = (int)local_14 - *(int *)((int)this + 0x324);
      *(short *)((int)this + 0x366) = sVar7;
      *(int *)((int)this + 0x328) = iVar9;
      *(float *)((int)this + 0x368) =
           (((((float)(int)local_14 + 1.0) - (float)(int)*(short *)((int)this + 0x360)) * 0.5 +
            (float)(int)*(short *)((int)this + 0x360)) - local_18) / local_18;
      fVar2 = (float)*(int *)((int)this + 0xec4) * 0.5;
      local_20 = (double)CONCAT44(fVar2,(undefined4)local_20);
      fVar13 = (float)(int)*(short *)((int)this + 0x364);
      *(float *)((int)this + 0x36c) =
           (((((float)(int)sVar7 + 1.0) - fVar13) * 0.5 + fVar13) - fVar2) / fVar2;
      uVar20 = FUN_1002af10((int)*(short *)((int)this + 0x364),(int)sVar7);
      *(int *)((int)this + 0x32c) = (int)uVar20;
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"ElevationStrobeX",iVar9);
      *(int *)((int)this + 0x328) = iVar9;
      iVar9 = FUN_10020f00(local_260,L"RadarDisplay",L"ElevationStrobeY",*(int *)((int)this + 0x32c)
                          );
      *(int *)((int)this + 0x32c) = iVar9;
      if (*(int *)((int)this + 0xe78) != -1) {
        FUN_10021000(local_260,L"RadarDisplay",L"STraceTexture",(wchar_t *)&PTR_10041850,local_474,
                     0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xea8) = uVar10;
        }
        FUN_10021000(local_260,L"RadarDisplay",L"PPISweepTexture",(wchar_t *)&PTR_10041850,local_474
                     ,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xea4) = uVar10;
        }
        FUN_10021000(local_260,L"RadarDisplay",L"BreakXTexture",(wchar_t *)&PTR_10041850,local_474,
                     0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xea0) = uVar10;
        }
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"RangeRateCircleSize",0.0);
        *(float *)((int)this + 0x2f4) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"RangeRateCircleScale",1.0);
        *(float *)((int)this + 0x2f8) = (float)((float10)3.1415927410125732 / fVar18);
        FUN_10021000(local_260,L"RadarDisplay",L"RangeRateCircleTexture",(wchar_t *)&PTR_10041850,
                     local_474,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe84) = uVar10;
        }
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"RangeRateCircleMinRate",-231.4998);
        *(float *)((int)this + 0x2fc) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"RangeRateCircleMaxRate",1388.9988);
        *(float *)((int)this + 0x300) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"RangeRateCircleZeroAngle",0.0);
        *(float *)((int)this + 0x304) = (float)(fVar18 * (float10)0.01745329238474369);
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"HorizonBarSize",0.0);
        *(float *)((int)this + 0x2ec) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"HorizonBarScale",
                              *(float *)((int)this + 0x2b8) * 57.29578);
        *(float *)((int)this + 0x2f0) = (float)(fVar18 * (float10)0.01745329238474369);
        FUN_10021000(local_260,L"RadarDisplay",L"HorizonBarTexture",(wchar_t *)&PTR_10041850,
                     local_474,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe88) = uVar10;
        }
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"ASERadarCircleMinSize",0.0);
        *(float *)((int)this + 0x308) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"ASERadarCircleMaxSize",0.0);
        *(float *)((int)this + 0x30c) = (float)fVar18;
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"ASERadarCircleMaxSizeRange",0.0);
        *(float *)((int)this + 0x310) = (float)fVar18;
        FUN_10021000(local_260,L"RadarDisplay",L"ASERadarCircleTexture",(wchar_t *)&PTR_10041850,
                     local_474,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe8c) = uVar10;
        }
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"ASEHeatCircleSize",0.0);
        *(float *)((int)this + 0x314) = (float)fVar18;
        FUN_10021000(local_260,L"RadarDisplay",L"ASEHeatCircleTexture",(wchar_t *)&PTR_10041850,
                     local_474,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe90) = uVar10;
        }
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"AimDotSize",0.0);
        *(float *)((int)this + 0x31c) = (float)fVar18;
        FUN_10021000(local_260,L"RadarDisplay",L"AimDotTexture",(wchar_t *)&PTR_10041850,local_474,
                     0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe94) = uVar10;
        }
        fVar18 = FUN_10020f80(local_260,L"RadarDisplay",L"SteeringCircleSize",0.0);
        *(float *)((int)this + 800) = (float)fVar18;
        FUN_10021000(local_260,L"RadarDisplay",L"SteeringCircleTexture",(wchar_t *)&PTR_10041850,
                     local_474,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        uVar10 = extraout_ECX_12;
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe98) = uVar10;
          uVar10 = extraout_ECX_13;
        }
        *(undefined4 *)((int)this + 0x318) = 0x3f800000;
        if (0.0 < *(float *)((int)this + 0xac) != NAN(*(float *)((int)this + 0xac))) {
          fVar18 = (float10)FUN_1002ab90(uVar10);
          *(float *)((int)this + 0x318) = *(float *)((int)this + 0x318) / (float)fVar18;
        }
        FUN_10021000(local_260,L"RadarDisplay",L"AcquisitionSymbolTexture",(wchar_t *)&PTR_10041850,
                     local_474,0x104,0);
        iVar9 = FUN_1001efc0(local_474);
        if (iVar9 == 0) {
          uVar10 = (**(code **)(*DAT_10057570 + 0x7c))(local_474,1,1,0);
          *(undefined4 *)((int)this + 0xe9c) = uVar10;
        }
        uVar8 = FUN_100210c0(local_260,L"RadarDisplay",L"BreakXRemovesRangeRate",0);
        *(short *)((int)this + 0x358) = (short)uVar8;
        uVar8 = FUN_100210c0(local_260,L"RadarDisplay",L"BreakXRemovesASECircle",0);
        *(short *)((int)this + 0x35a) = (short)uVar8;
        uVar8 = FUN_100210c0(local_260,L"RadarDisplay",L"BreakXRemovesSteeringCircle",0);
        *(short *)((int)this + 0x35c) = (short)uVar8;
      }
      iVar12 = *(int *)((int)this + 0x334);
      fVar2 = (float)(*(int *)((int)this + 0x338) + 1) / (float)*(int *)((int)this + 0xec0);
      local_20 = (double)CONCAT44(fVar2,(undefined4)local_20);
      iVar9 = *(int *)((int)this + 0xec4);
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"AcquisitionResetPosX",fVar2);
      *(float *)((int)this + 0x268) = (float)fVar18;
      fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"AcquisitionResetPosY",
                            ((float)(iVar12 + 1) * 1.5) / (float)iVar9);
      *(float *)((int)this + 0x26c) = (float)fVar18;
      iVar9 = FUN_10012b10(L"StartMode",L"AvionicsData",local_260);
      *(short *)((int)this + 0xee2) = (short)iVar9;
      iVar9 = FUN_10020f00(local_260,L"AvionicsData",L"StartRangeSetting",1);
      *(short *)((int)this + 0xee4) = (short)iVar9 + -1;
      *(undefined2 *)((int)this + 0xee0) = 1;
    }
  }
  else {
    *puVar1 = 0x10;
    *(undefined2 *)((int)this + 0xee2) = 4;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"ScanBeamAngle",0.0);
    fVar2 = (float)(fVar18 * (float10)0.01745329238474369);
    *(undefined2 *)((int)this + 0xd0) = 1;
    *(float *)((int)this + 0xa4) = fVar2;
    *(float *)((int)this + 0xa8) = -fVar2;
    *(float *)((int)this + 0xac) = fVar2;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"BoresightElevation",0.0);
    *(float *)((int)this + 0x28c) = (float)(fVar18 * (float10)0.01745329238474369);
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"BoresightAzimuth",0.0);
    *(float *)((int)this + 0x290) = (float)(fVar18 * (float10)0.01745329238474369);
    fVar18 = (float10)FUN_1002aa60(extraout_ECX_14);
    *(float *)((int)this + 0x294) = (float)fVar18;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MinAltitude",_DAT_10054840);
    *(float *)((int)this + 0xb0) = (float)fVar18;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"MinReturn",0.1);
    *(float *)((int)this + 0xb4) = (float)fVar18;
    FUN_10021000(local_260,L"AvionicsData",L"RangeUnit",(wchar_t *)&PTR_10041850,local_c94,0x104,0);
    fVar18 = FUN_10022650(local_c94);
    fVar19 = FUN_10020f80(local_260,L"AvionicsData",L"TrackRange",2000.0);
    *(undefined2 *)((int)this + 0x42) = 1;
    fVar2 = (float)(fVar19 * (float10)(float)fVar18);
    *(float *)((int)this + 0x44) = fVar2;
    *(float *)((int)this + 600) = fVar2;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"SearchStrength",100.0);
    local_20 = (double)CONCAT44((float)fVar18,(undefined4)local_20);
    fVar18 = FUN_1001dc20(*(float *)((int)this + 600),(float)fVar18);
    *(float *)((int)this + 0x25c) = (float)fVar18;
    *(float *)((int)this + 0x27c) = fVar2;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"TrackStrength",100.0);
    fVar18 = FUN_1001dc20(*(float *)((int)this + 0x27c),(float)fVar18);
    *(float *)((int)this + 0x280) = (float)fVar18;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"AcquisitionTime",0.5);
    *(float *)((int)this + 0x270) = (float)fVar18;
    *(float *)((int)this + 0x274) = 1.0 / (float)fVar18;
    fVar18 = FUN_10020f80(local_260,L"AvionicsData",L"LostAquisitionTime",0.0);
    *(float *)((int)this + 0x278) = (float)fVar18;
    _DAT_1005761c = puVar1;
    *(undefined2 *)((int)this + 0xeea) = 1;
    *(undefined2 *)((int)this + 0xee0) = 1;
  }
  FUN_1000d120((void *)((int)this + 0xf10),local_260);
  FUN_1000edb0((void *)((int)this + 0x1040),local_260,*(int *)((int)this + 0xe78),0);
  FUN_10009920((void *)((int)this + 0x29a0),local_260,(wchar_t *)0x0);
  FUN_1000c1f0(local_260);
  DAT_1005756c = &DAT_10057620;
  local_8 = 0xffffffff;
  FUN_10020790((int)local_260);
  ExceptionList = local_10;
  return;
}

============================================================================
------------------------------- NOTES -------------------------------
============================================================================

FUNCTION OVERVIEW: FUN_10013f90(void *this, wchar_t *param_1)
This function:

- Initializes avionics parameters for a plane.
- Loads .INI settings (like AvionicsData, RadarDisplay, etc.).
- Sets up display ranges, beam angles, scan patterns, acquisition timings, and HUD textures.


STEP-BY-STEP NOTES (Simplified)

1. Clear Data and Setup Memory
    - Clears memory in this + 0x40 area.
    - Initializes config array local_260 using param_1 and flags.
    - Prepares a bunch of default values (0xFFFFFFFF, 0, etc.) in key fields of this.

2. Load Gunsight and Radar Modes
    - Checks if "GunsightRangingOnly" is set.
    - Loads available radar modes: AvailableModes.

3. Setup Radar Texture & Size
    - Reads ViewportTextureSize from [RadarDisplay].
    - Loads RadarTexture and RadarAGTexture.
    - If valid, creates texture resources and stores them.

4. Allocates Radar Pixel Buffer
    - Calls memory allocation based on texture resolution.

5. Loads Range Settings
    - Loads RangeSetting, MinimumRange, and RangeTexture from [AvionicsData].
    - Also reads RangeUnit multiplier (e.g., meters or NM).

6. Radar Sweep Geometry
    - Loads MaxElevationAngle, MinElevationAngle, MaxAzimuthAngle.
    - Sets limits for detection: MinAltitude, MinReturn, MinimumSpeed.

7. Radar Physical Location
    - Loads [RadarPosition] vector (3 floats).

8. Scan Patterns
    - Loops over ScanPattern entries:
        > Reads BarElevation, ScanRate, ScanBeamAngle, and ScanArc.

9. Search Mode Parameters
    - If bitmask includes Search, loads:
        > Search range, strength, target acquisition time, and selection logic.

10. Acquisition Settings
    - Loads acquisition symbol speed, time, and lost acquisition timeout.

11. Tracking Mode
    - If tracking enabled:
        > Loads TrackRange, TrackStrength, TrackCapabilities, and TrackMemroyTime.

12. Boresight Mode
    - Loads boresight elevation, azimuth, and beam angle.

13. Ground Map Mode
    - Loads ground map range, and calculates GroundSearchStrength.

14. Terrain Avoidance
    - If enabled, loads clearance distance and TA range setting.

15. Display and Buffers
    - Allocates memory for elevation strobe and other buffers.

16. Radar Display Settings
    - Loads various radar display tunings:
        > FadeImageIntensity, ImageFadeTime, TargetFadeTime, SweepIntensity, etc.

17. Symbol Tables
    - Builds symbol table (e.g., Symbol[00] to Symbol[31]) for different radar symbologies.

18. Display Limits & Geometry
    - Sets pixel boundaries: left/right/top/bottom.
    - Calculates visual offsets for strobe, elevation bar, radar arcs, etc.

19. Load Additional Radar Display Textures
    - Loads:
        > STraceTexture, PPISweepTexture, BreakXTexture, RangeRateCircleTexture
        > ASE (ASEHeat/AimDot/SteeringCircle) radar symbols
 

 

Edited by Eagle114th
  • Like 1

Share this post


Link to post
Share on other sites

Hello everyone!

I am currenlty digging through Avionics70.DLL and found some of goldenmine.  It turns out that Avionics70.DLL is class based, rather than function when handling the avionics. It makes sense, consdieirng how Avionics70.DLL ini works differenlty from Avionics60.DLL. 

Here is what I found so far:

 

Quote


============================================================================
------------------------------- FUN_10013f90 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013f90(void *this,void *param_1,wchar_t *param_2)

{
  FUN_10013940(this,param_1,param_2);
  *(undefined ***)this = RadarTargetRangeTextClass::vftable;
  return (undefined4 *)this;
}

============================================================================
------------------------------- FUN_1001d750 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013940(void *this,void *param_1,wchar_t *param_2)

{
  undefined4 uVar1;
  wchar_t *pwVar2;
  uint uVar3;
  int iVar4;
  float10 fVar5;
  wchar_t local_21c [260];
  void *local_14;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ea16;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  local_14 = this;
  FUN_100135f0(this,param_1,param_2);
  local_8 = 0;
  *(undefined ***)this = RadarTextClass::vftable;
  FUN_100204d0(param_1,param_2,L"Text",L"",(wchar_t *)((int)this + 0x18),0x40,0);
  FUN_10023470((uint *)((int)this + 0x98),param_1,param_2);
  local_8 = 1;
  *(undefined ***)this = RadarTargetTextClass::vftable;
  *(undefined4 *)((int)this + 0x1a4) = 0;
  pwVar2 = FUN_100208c0(param_1,param_2,L"TextFormat",0);
  *(wchar_t **)((int)this + 0x1a4) = pwVar2;
  FUN_100204d0(param_1,param_2,L"NoTargetText",L"",(wchar_t *)((int)this + 0xa4),0x40,0);
  FUN_100204d0(param_1,param_2,L"DisplayUnit",L"",local_21c,0x104,0);
  fVar5 = FUN_10021aa0(local_21c);
  *(float *)((int)this + 0x9c) = (float)((float10)1 / fVar5);
  *(undefined4 *)((int)this + 0xa0) = 0x3f800000;
  uVar3 = FUN_10020590(param_1,param_2,L"ShowOnlyTens",0);
  if (uVar3 == 0) {
    uVar3 = FUN_10020590(param_1,param_2,L"ShowOnlyHundreds",0);
    if (uVar3 == 0) {
      uVar3 = FUN_10020590(param_1,param_2,L"ShowOnlyThousands",0);
      if (uVar3 == 0) goto LAB_10013a9e;
      *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x400000;
      uVar1 = 0x3a83126f;
    }
    else {
      *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x200000;
      uVar1 = 0x3c23d70a;
    }
  }
  else {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x100000;
    uVar1 = 0x3dcccccd;
  }
  *(undefined4 *)((int)this + 0xa0) = uVar1;
LAB_10013a9e:
  iVar4 = FUN_1001ed70(param_1,param_2,L"ThousandsSeparator");
  if (iVar4 != 0) {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x800000;
    FUN_100204d0(param_1,param_2,L"ThousandsSeparator",L"",(wchar_t *)((int)this + 0x124),0x40,0);
  }
  ExceptionList = local_10;
  return (undefined4 *)this;
}




Eagle114th

Share this post


Link to post
Share on other sites

Blimey !!!! It's way too complicated for my simple mind......:stars:

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Sundowner said:

Blimey !!!! It's way too complicated for my simple mind......:stars:

My exact thoughts...

But if it adds value, it will certainly be very welcome!

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello everyone!

I have put togehter chains of the classes and functions from Avionics70.DLL. It have taken me a while to dig through the DLL file.  WHew!

 


============================================================================
------------------------------- FUN_10013f90 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013f90(void *this,void *param_1,wchar_t *param_2)

{
  FUN_10013940(this,param_1,param_2);
  *(undefined ***)this = RadarTargetRangeTextClass::vftable;
  return (undefined4 *)this;
}

============================================================================
------------------------------- FUN_1001d750 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013940(void *this,void *param_1,wchar_t *param_2)

{
  undefined4 uVar1;
  wchar_t *pwVar2;
  uint uVar3;
  int iVar4;
  float10 fVar5;
  wchar_t local_21c [260];
  void *local_14;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ea16;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  local_14 = this;
  FUN_100135f0(this,param_1,param_2);
  local_8 = 0;
  *(undefined ***)this = RadarTextClass::vftable;
  FUN_100204d0(param_1,param_2,L"Text",L"",(wchar_t *)((int)this + 0x18),0x40,0);
  FUN_10023470((uint *)((int)this + 0x98),param_1,param_2);
  local_8 = 1;
  *(undefined ***)this = RadarTargetTextClass::vftable;
  *(undefined4 *)((int)this + 0x1a4) = 0;
  pwVar2 = FUN_100208c0(param_1,param_2,L"TextFormat",0);
  *(wchar_t **)((int)this + 0x1a4) = pwVar2;
  FUN_100204d0(param_1,param_2,L"NoTargetText",L"",(wchar_t *)((int)this + 0xa4),0x40,0);
  FUN_100204d0(param_1,param_2,L"DisplayUnit",L"",local_21c,0x104,0);
  fVar5 = FUN_10021aa0(local_21c);
  *(float *)((int)this + 0x9c) = (float)((float10)1 / fVar5);
  *(undefined4 *)((int)this + 0xa0) = 0x3f800000;
  uVar3 = FUN_10020590(param_1,param_2,L"ShowOnlyTens",0);
  if (uVar3 == 0) {
    uVar3 = FUN_10020590(param_1,param_2,L"ShowOnlyHundreds",0);
    if (uVar3 == 0) {
      uVar3 = FUN_10020590(param_1,param_2,L"ShowOnlyThousands",0);
      if (uVar3 == 0) goto LAB_10013a9e;
      *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x400000;
      uVar1 = 0x3a83126f;
    }
    else {
      *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x200000;
      uVar1 = 0x3c23d70a;
    }
  }
  else {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x100000;
    uVar1 = 0x3dcccccd;
  }
  *(undefined4 *)((int)this + 0xa0) = uVar1;
LAB_10013a9e:
  iVar4 = FUN_1001ed70(param_1,param_2,L"ThousandsSeparator");
  if (iVar4 != 0) {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x800000;
    FUN_100204d0(param_1,param_2,L"ThousandsSeparator",L"",(wchar_t *)((int)this + 0x124),0x40,0);
  }
  ExceptionList = local_10;
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUN_100135f0 -------------------------------
----------------------------------------------------------------------------


undefined4 * __thiscall FUN_100135f0(void *this,void *param_1,wchar_t *param_2)

{
  float *pfVar1;
  uint uVar2;
  float local_c [2];
  
  *(undefined ***)this = RadarElementClass::vftable;
  *(undefined4 *)((int)this + 4) = 0;
  pfVar1 = FUN_10021520(local_c,param_1,param_2,L"Position");
  *(float *)((int)this + 8) = *pfVar1;
  *(float *)((int)this + 0xc) = pfVar1[1];
  *(float *)((int)this + 0x10) = *pfVar1;
  *(float *)((int)this + 0x14) = pfVar1[1];
  uVar2 = FUN_10020590(param_1,param_2,L"XOffsetTarget",0);
  if (uVar2 == 0) {
    uVar2 = FUN_10020590(param_1,param_2,L"XOffsetAzimuth",0);
    if (uVar2 != 0) {
      *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 2;
    }
  }
  else {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 1;
  }
  uVar2 = FUN_10020590(param_1,param_2,L"YOffsetTarget",0);
  if (uVar2 != 0) {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x10;
    return (undefined4 *)this;
  }
  uVar2 = FUN_10020590(param_1,param_2,L"YOffsetRange",0);
  if (uVar2 != 0) {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x20;
    return (undefined4 *)this;
  }
  uVar2 = FUN_10020590(param_1,param_2,L"YOffsetElevation",0);
  if (uVar2 != 0) {
    *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x40;
  }
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUN_10021520 -------------------------------
----------------------------------------------------------------------------

float * __cdecl FUN_10021520(float *param_1,void *param_2,wchar_t *param_3,wchar_t *param_4)

{
  wchar_t *pwVar1;
  float10 fVar2;
  wchar_t local_20c [260];
  
  *param_1 = 0.0;
  param_1[1] = 0.0;
  FUN_100204d0(param_2,param_3,param_4,L"",local_20c,0x104,0);
  pwVar1 = _wcschr(local_20c,L',');
  if (pwVar1 != (wchar_t *)0x0) {
    *pwVar1 = L'\0';
    fVar2 = (float10)FUN_1002bef0(local_20c,(int *)0x0);
    *param_1 = (float)fVar2;
    fVar2 = (float10)FUN_1002bef0(pwVar1 + 1,(int *)0x0);
    param_1[1] = (float)fVar2;
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_10020590 -------------------------------
----------------------------------------------------------------------------

uint __thiscall FUN_10020590(void *this,wchar_t *param_1,wchar_t *param_2,uint param_3)

{
  bool bVar1;
  int iVar2;
  int iVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  wchar_t *pwVar4;
  wchar_t local_20c [260];
  
  iVar2 = FUN_10020740((void *)((int)this + 0x208),param_1);
  if (iVar2 != 0) {
    iVar2 = *(int *)(*(int *)((int)this + 0x208) + 8);
    iVar3 = FUN_10020740((void *)(iVar2 + 4),param_2);
    if (iVar3 != 0) {
      iVar2 = *(int *)(*(int *)(iVar2 + 4) + 8);
      goto LAB_100205d4;
    }
  }
  iVar2 = 0;
LAB_100205d4:
  if (iVar2 != 0) {
    *(undefined4 *)(iVar2 + 4) = 0;
    FUN_1001e680(local_20c,*(wchar_t **)(iVar2 + 8),0x104);
    bVar1 = FUN_1001e560(local_20c,*(wchar_t **)((int)this + 0x238),0);
    if (CONCAT31(extraout_var,bVar1) != 0) {
      return 1;
    }
    bVar1 = FUN_1001e560(local_20c,*(wchar_t **)((int)this + 0x23c),0);
    if (CONCAT31(extraout_var_00,bVar1) != 0) {
      return 0;
    }
    *(undefined4 *)(iVar2 + 4) = 1;
    param_3 = (uint)(*(int *)(iVar2 + 0xc) != 0);
  }
  if (*(int *)((int)this + 0x22c) != 0) {
    if (param_3 == 0) {
      pwVar4 = *(wchar_t **)((int)this + 0x23c);
    }
    else {
      pwVar4 = *(wchar_t **)((int)this + 0x238);
    }
    FUN_1001ff80(this,param_1,param_2,pwVar4);
  }
  return param_3;
}

----------------------------------------------------------------------------
------------------------------- FUN_10020740 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_10020740(void *this,wchar_t *param_1)

{
  int iVar1;
  bool bVar2;
  int iVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  
  if ((0 < *(int *)((int)this + 0xc)) && (iVar3 = FUN_1001e490(param_1), iVar3 == 0)) {
                    /* WARNING: Load size is inaccurate */
    if (*this == 0) {
      *(undefined4 *)this = *(undefined4 *)((int)this + 4);
      *(undefined4 *)((int)this + 0x10) = 0;
    }
                    /* WARNING: Load size is inaccurate */
    iVar1 = *this;
    iVar3 = *(int *)((int)this + 0x10);
    while (iVar1 != 0) {
                    /* WARNING: Load size is inaccurate */
      if ((*(undefined4 **)(*this + 8) != (undefined4 *)0x0) &&
         (bVar2 = FUN_1001e560((wchar_t *)**(undefined4 **)(*this + 8),param_1,0),
         CONCAT31(extraout_var,bVar2) != 0)) {
        return 1;
      }
                    /* WARNING: Load size is inaccurate */
      *(int *)((int)this + 0x10) = *(int *)((int)this + 0x10) + 1;
      iVar1 = **this;
      *(int *)this = iVar1;
    }
    *(undefined4 *)((int)this + 0x10) = 0;
    *(undefined4 *)this = *(undefined4 *)((int)this + 4);
    if (0 < iVar3) {
      do {
                    /* WARNING: Load size is inaccurate */
        if ((*(undefined4 **)(*this + 8) != (undefined4 *)0x0) &&
           (bVar2 = FUN_1001e560((wchar_t *)**(undefined4 **)(*this + 8),param_1,0),
           CONCAT31(extraout_var_00,bVar2) != 0)) {
          return 1;
        }
                    /* WARNING: Load size is inaccurate */
        *(int *)((int)this + 0x10) = *(int *)((int)this + 0x10) + 1;
        *(undefined4 *)this = **this;
      } while (*(int *)((int)this + 0x10) < iVar3);
    }
    *(undefined4 *)this = 0;
    *(undefined4 *)((int)this + 0x10) = 0xffffffff;
  }
  return 0;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e490 -------------------------------
----------------------------------------------------------------------------

undefined4 __cdecl FUN_1001e490(short *param_1)

{
  if ((param_1 != (short *)0x0) && (*param_1 != 0)) {
    return 0;
  }
  return 1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e560 -------------------------------
----------------------------------------------------------------------------

bool __cdecl FUN_1001e560(wchar_t *param_1,wchar_t *param_2,int param_3)

{
  wchar_t wVar1;
  bool bVar2;
  int iVar3;
  bool bVar4;
  
  if ((param_1 == (wchar_t *)0x0) || (*param_1 == L'\0')) {
    bVar4 = true;
  }
  else {
    bVar4 = false;
  }
  if ((param_2 == (wchar_t *)0x0) || (*param_2 == L'\0')) {
    bVar2 = true;
  }
  else {
    bVar2 = false;
  }
  if (bVar4) {
    if (bVar2) {
      return true;
    }
  }
  else if (!bVar2) {
    if (param_3 == 0) {
      iVar3 = __wcsicmp(param_1,param_2);
      return (bool)('\x01' - (iVar3 != 0));
    }
    while( true ) {
      wVar1 = *param_1;
      bVar4 = (ushort)wVar1 < (ushort)*param_2;
      if (wVar1 != *param_2) break;
      if (wVar1 == L'\0') {
        return true;
      }
      wVar1 = param_1[1];
      bVar4 = (ushort)wVar1 < (ushort)param_2[1];
      if (wVar1 != param_2[1]) break;
      param_1 = param_1 + 2;
      param_2 = param_2 + 2;
      if (wVar1 == L'\0') {
        return true;
      }
    }
    return 1 - bVar4 == (uint)(bVar4 != 0);
  }
  return false;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e680 -------------------------------
----------------------------------------------------------------------------

wchar_t * __cdecl FUN_1001e680(wchar_t *param_1,wchar_t *param_2,rsize_t param_3)

{
  if (param_1 != (wchar_t *)0x0) {
    if ((param_2 != (wchar_t *)0x0) && (*param_2 != L'\0')) {
      _wcsncpy_s(param_1,param_3,param_2,0xffffffff);
      param_1[param_3 - 1] = L'\0';
      return param_1;
    }
    *param_1 = L'\0';
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001ff80 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_1001ff80(void *this,wchar_t *param_1,wchar_t *param_2,wchar_t *param_3)

{
  int iVar1;
  int iVar2;
  wint_t *pwVar3;
  void *this_00;
  undefined4 *puVar4;
  undefined4 uVar5;
  wchar_t *local_14;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ee1d;
  local_10 = ExceptionList;
  local_14 = *(wchar_t **)((int)this + 0x234);
  ExceptionList = &local_10;
  iVar1 = FUN_1001e490(param_3);
  if (iVar1 == 0) {
    iVar1 = FUN_10025810((void *)((int)this + 0x21c),param_3);
    if (iVar1 == 0) goto LAB_100200a9;
    local_14 = (wchar_t *)FUN_10025790((int)this + 0x21c);
  }
  iVar1 = FUN_10020740((void *)((int)this + 0x208),param_1);
  if (iVar1 != 0) {
    iVar1 = *(int *)(*(int *)((int)this + 0x208) + 8);
    iVar2 = FUN_10020740((void *)(iVar1 + 4),param_2);
    if ((iVar2 != 0) && (iVar1 = *(int *)(*(int *)(iVar1 + 4) + 8), iVar1 != 0)) {
      *(undefined4 *)(iVar1 + 4) = 0;
      *(wchar_t **)(iVar1 + 8) = local_14;
      ExceptionList = local_10;
      return 1;
    }
  }
  iVar1 = FUN_10025810((void *)((int)this + 0x21c),param_2);
  if (iVar1 != 0) {
    pwVar3 = (wint_t *)FUN_10025790((int)this + 0x21c);
    this_00 = (void *)FUN_1001ddc0(0x14);
    local_8 = 0;
    if (this_00 == (void *)0x0) {
      puVar4 = (undefined4 *)0x0;
    }
    else {
      puVar4 = FUN_1001e9a0(this_00,pwVar3,local_14);
    }
    local_8 = 0xffffffff;
    uVar5 = FUN_1001f5f0(this,param_1,puVar4);
    ExceptionList = local_10;
    return uVar5;
  }
LAB_100200a9:
  FUN_1001df00();
  ExceptionList = local_10;
  return 0;
}

----------------------------------------------------------------------------
------------------------------- FUN_10025810 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_10025810(void *this,wchar_t *param_1)

{
  rsize_t _SizeInWords;
  wchar_t wVar1;
  wchar_t *pwVar2;
  
  pwVar2 = param_1;
  do {
    wVar1 = *pwVar2;
    pwVar2 = pwVar2 + 1;
  } while (wVar1 != L'\0');
  _SizeInWords = ((int)pwVar2 - (int)(param_1 + 1) >> 1) + 1;
  pwVar2 = *(wchar_t **)((int)this + 4);
                    /* WARNING: Load size is inaccurate */
  if ((int)(((int)pwVar2 - *this >> 1) + _SizeInWords) <= *(int *)((int)this + 0xc)) {
    *(wchar_t **)((int)this + 8) = pwVar2;
    _wcscpy_s(pwVar2,_SizeInWords,param_1);
    *(int *)((int)this + 4) = *(int *)((int)this + 4) + _SizeInWords * 2;
    return 1;
  }
  return 0;
}

----------------------------------------------------------------------------
------------------------------- FUN_10025790 -------------------------------
----------------------------------------------------------------------------

undefined4 __fastcall FUN_10025790(int param_1)

{
  return *(undefined4 *)(param_1 + 8);
}

----------------------------------------------------------------------------
------------------------------- FUN_1001ddc0 -------------------------------
----------------------------------------------------------------------------

void __cdecl FUN_1001ddc0(size_t param_1)

{
  if (DAT_1005b548 != (undefined4 *)0x0) {
    (**(code **)*DAT_1005b548)(param_1,0,0,DAT_1005b524);
    return;
  }
  _malloc(param_1);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e9a0 -------------------------------
----------------------------------------------------------------------------

undefined4 * __thiscall FUN_1001e9a0(void *this,wint_t *param_1,wchar_t *param_2)

{
  int iVar1;
  long lVar2;
  float10 fVar3;
  
  *(wint_t **)this = param_1;
  *(undefined4 *)((int)this + 4) = 0;
  FUN_1001e8f0(param_1);
  iVar1 = FUN_1001e490(param_2);
  if (iVar1 == 0) {
    *(wchar_t **)((int)this + 8) = param_2;
    lVar2 = __wtol(param_2);
    *(long *)((int)this + 0xc) = lVar2;
    fVar3 = (float10)FUN_1002bef0(param_2,(int *)0x0);
    *(float *)((int)this + 0x10) = (float)fVar3;
    FUN_1001e8f0(*(wint_t **)((int)this + 8));
    return (undefined4 *)this;
  }
  *(undefined4 *)((int)this + 0x10) = 0;
  *(undefined4 *)((int)this + 8) = 0;
  *(undefined4 *)((int)this + 0xc) = 0;
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e8f0 -------------------------------
----------------------------------------------------------------------------

wint_t * __cdecl FUN_1001e8f0(wint_t *param_1)

{
  if ((param_1 != (wint_t *)0x0) && (*param_1 != 0)) {
    FUN_1001e820(param_1);
    FUN_1001e890(param_1);
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e820 -------------------------------
----------------------------------------------------------------------------

wint_t * __cdecl FUN_1001e820(wint_t *param_1)

{
  wint_t wVar1;
  int iVar2;
  wint_t *pwVar3;
  _locale_t unaff_ESI;
  wint_t *pwVar4;
  
  if ((param_1 == (wint_t *)0x0) || (pwVar4 = param_1, *param_1 == 0)) {
    return param_1;
  }
  do {
    iVar2 = FID_conflict:__iswspace_l(*pwVar4,unaff_ESI);
    if (iVar2 == 0) break;
    pwVar4 = pwVar4 + 1;
  } while (*pwVar4 != 0);
  if (pwVar4 != param_1) {
    pwVar3 = param_1;
    do {
      wVar1 = *pwVar3;
      pwVar3 = pwVar3 + 1;
    } while (wVar1 != 0);
    iVar2 = (((int)pwVar3 - (int)(param_1 + 1) >> 1) - ((int)pwVar4 - (int)param_1 >> 1)) + 1;
    pwVar3 = param_1;
    if (0 < iVar2) {
      do {
        *pwVar3 = *(wint_t *)(((int)pwVar4 - (int)param_1) + (int)pwVar3);
        pwVar3 = pwVar3 + 1;
        iVar2 = iVar2 + -1;
      } while (iVar2 != 0);
    }
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e890 -------------------------------
----------------------------------------------------------------------------

wint_t * __cdecl FUN_1001e890(wint_t *param_1)

{
  int iVar1;
  wint_t *pwVar2;
  _locale_t unaff_ESI;
  wint_t *pwVar3;
  
  if ((param_1 != (wint_t *)0x0) && (*param_1 != 0)) {
    pwVar2 = (wint_t *)0x0;
    pwVar3 = param_1;
    if (*param_1 != 0) {
      do {
        iVar1 = FID_conflict:__iswspace_l(*pwVar3,unaff_ESI);
        if (iVar1 == 0) {
          pwVar2 = pwVar3;
        }
        pwVar3 = pwVar3 + 1;
      } while (*pwVar3 != 0);
      if (pwVar2 != (wint_t *)0x0) {
        pwVar2[1] = 0;
        return param_1;
      }
    }
    *param_1 = 0;
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1002bef0 -------------------------------
----------------------------------------------------------------------------

void __cdecl FUN_1002bef0(wchar_t *param_1,int *param_2)

{
  FUN_1002bde8(param_1,param_2,(localeinfo_struct *)0x0);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1002bde8 -------------------------------
----------------------------------------------------------------------------

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void __cdecl FUN_1002bde8(wchar_t *param_1,int *param_2,localeinfo_struct *param_3)

{
  wchar_t _C;
  uint uVar1;
  int *piVar2;
  int iVar3;
  FLT p_Var4;
  wchar_t *_Str;
  localeinfo_struct local_38;
  int local_30;
  char local_2c;
  double local_28;
  _flt local_20;
  uint local_8;
  
  local_8 = DAT_10057e04 ^ (uint)&stack0xfffffffc;
  _LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)&local_38,param_3);
  if (param_2 != (int *)0x0) {
    *param_2 = (int)param_1;
  }
  if (param_1 == (wchar_t *)0x0) {
    piVar2 = __errno();
    *piVar2 = 0x16;
    FUN_1002fef0();
    if (local_2c != '\0') {
      *(uint *)(local_30 + 0x70) = *(uint *)(local_30 + 0x70) & 0xfffffffd;
    }
    goto LAB_1002bee1;
  }
  _C = *param_1;
  _Str = param_1;
  while (iVar3 = _iswctype(_C,8), iVar3 != 0) {
    _Str = _Str + 1;
    _C = *_Str;
  }
  p_Var4 = __wfltin2(&local_20,_Str,&local_38);
  if (param_2 != (int *)0x0) {
    *param_2 = (int)(_Str + p_Var4->nbytes);
  }
  uVar1 = p_Var4->flags;
  if ((uVar1 & 0x240) == 0) {
    if ((uVar1 & 0x81) == 0) {
      if (((uVar1 & 0x100) == 0) || (local_28 = 0.0, NAN(p_Var4->dval) == (p_Var4->dval == 0.0))) {
        local_28 = p_Var4->dval;
        goto LAB_1002bed1;
      }
    }
    else {
      local_28 = _DAT_100585d0;
      if (*_Str == L'-') {
        local_28 = -_DAT_100585d0;
      }
    }
    piVar2 = __errno();
    *piVar2 = 0x22;
  }
  else {
    local_28 = 0.0;
    if (param_2 != (int *)0x0) {
      *param_2 = (int)param_1;
    }
  }
LAB_1002bed1:
  if (local_2c != '\0') {
    *(uint *)(local_30 + 0x70) = *(uint *)(local_30 + 0x70) & 0xfffffffd;
  }
LAB_1002bee1:
  @__security_check_cookie@4(local_8 ^ (uint)&stack0xfffffffc);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1002fef0 -------------------------------
----------------------------------------------------------------------------

void FUN_1002fef0(void)

{
  __invalid_parameter((wchar_t *)0x0,(wchar_t *)0x0,(wchar_t *)0x0,0,0);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001f5f0 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_1001f5f0(void *this,wchar_t *param_1,undefined4 *param_2)

{
  int *this_00;
  int iVar1;
  undefined4 uVar2;
  void *this_01;
  undefined4 *puVar3;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ed6a;
  local_10 = ExceptionList;
  if (param_2 != (undefined4 *)0x0) {
    this_00 = (int *)((int)this + 0x208);
    ExceptionList = &local_10;
    iVar1 = FUN_10020740(this_00,param_1);
    if (iVar1 == 0) {
      iVar1 = FUN_10025810((void *)((int)this + 0x21c),param_1);
      if (iVar1 == 0) {
        FUN_1001df00();
        ExceptionList = local_10;
        return 0;
      }
      uVar2 = FUN_10025790((int)this + 0x21c);
      this_01 = (void *)FUN_1001ddc0(0x18);
      local_8 = 0;
      if (this_01 == (void *)0x0) {
        puVar3 = (undefined4 *)0x0;
      }
      else {
        puVar3 = FUN_1001f4f0(this_01,uVar2);
      }
      local_8 = 0xffffffff;
      iVar1 = FUN_10020860(this_00,puVar3);
      if (iVar1 == 0) {
        FUN_1001df00();
        if (puVar3 == (undefined4 *)0x0) {
          ExceptionList = local_10;
          return 0;
        }
        FUN_1001f550(puVar3);
        FUN_1001de20(puVar3);
      }
    }
    else {
      puVar3 = *(undefined4 **)(*this_00 + 8);
    }
    if (puVar3 != (undefined4 *)0x0) {
      iVar1 = FUN_10020740(puVar3 + 1,(wchar_t *)*param_2);
      if (iVar1 == 0) {
        FUN_10020860(puVar3 + 1,param_2);
      }
      ExceptionList = local_10;
      return 1;
    }
  }
  ExceptionList = local_10;
  return 0;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001f4f0 -------------------------------
----------------------------------------------------------------------------

undefined4 * __thiscall FUN_1001f4f0(void *this,undefined4 param_1)

{
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  puStack_c = &LAB_1003ed40;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  *(int *)((int)this + 4) = 0;
  *(undefined4 *)((int)this + 8) = 0;
  *(undefined4 *)((int)this + 0xc) = 0;
  *(undefined4 *)((int)this + 0x10) = 0;
  *(undefined4 *)((int)this + 0x14) = 0xffffffff;
  local_8 = 0;
  *(undefined4 *)this = param_1;
  FUN_10018c50((int *)((int)this + 4));
  ExceptionList = local_10;
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUN_10018c50 -------------------------------
----------------------------------------------------------------------------

void __fastcall FUN_10018c50(int *param_1)

{
  int *piVar1;
  int *piVar2;
  int iVar3;
  
  *param_1 = param_1[1];
  if (param_1[1] == 0) {
    param_1[4] = -1;
    return;
  }
  do {
    piVar1 = (int *)*param_1;
    if (piVar1 == (int *)param_1[1]) {
      param_1[1] = *piVar1;
    }
    else {
      *(int *)piVar1[1] = *piVar1;
    }
    piVar2 = (int *)*param_1;
    if (piVar2 == (int *)param_1[2]) {
      iVar3 = piVar2[1];
      param_1[4] = param_1[4] + -1;
      param_1[2] = iVar3;
    }
    else {
      *(int *)(*piVar2 + 4) = piVar2[1];
      iVar3 = *(int *)*param_1;
    }
    *param_1 = iVar3;
    if (piVar1 != (int *)0x0) {
      FUN_1001de20(piVar1);
      param_1[3] = param_1[3] + -1;
    }
  } while (*param_1 != 0);
  param_1[4] = -1;
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_10020860 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_10020860(void *this,undefined4 param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_1001ddc0(0xc);
  if (puVar1 != (undefined4 *)0x0) {
    *puVar1 = 0;
    puVar1[1] = 0;
    puVar1[2] = param_1;
    *(int *)((int)this + 0xc) = *(int *)((int)this + 0xc) + 1;
    if (*(int *)((int)this + 4) == 0) {
      *(undefined4 **)((int)this + 4) = puVar1;
    }
    else {
      **(undefined4 **)((int)this + 8) = puVar1;
      puVar1[1] = *(undefined4 *)((int)this + 8);
    }
    *(undefined4 **)((int)this + 8) = puVar1;
    *(undefined4 **)this = puVar1;
    *(int *)((int)this + 0x10) = *(int *)((int)this + 0xc) + -1;
    return 1;
  }
  return 0;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001f550 -------------------------------
----------------------------------------------------------------------------

void __fastcall FUN_1001f550(undefined4 *param_1)

{
  undefined4 uVar1;
  int iVar2;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_10 = ExceptionList;
  puStack_c = &LAB_1003ed55;
  ExceptionList = &local_10;
  param_1[1] = param_1[2];
  param_1[5] = (param_1[2] != 0) - 1;
  iVar2 = param_1[1];
  local_8 = 0;
  while (iVar2 != 0) {
    if (*(int *)(param_1[1] + 8) != 0) {
      FUN_1001de20(*(int *)(param_1[1] + 8));
    }
    if ((undefined4 *)param_1[1] != (undefined4 *)0x0) {
      uVar1 = *(undefined4 *)param_1[1];
      param_1[5] = param_1[5] + 1;
      param_1[1] = uVar1;
    }
    iVar2 = param_1[1];
  }
  FUN_10018c50(param_1 + 1);
  *param_1 = 0;
  local_8 = 0xffffffff;
  FUN_10018c50(param_1 + 1);
  ExceptionList = local_10;
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001de20 -------------------------------
----------------------------------------------------------------------------

void __cdecl FUN_1001de20(undefined4 param_1)

{
  if (DAT_1005b548 != (int *)0x0) {
    (**(code **)(*DAT_1005b548 + 4))(param_1);
  }
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001df00 -------------------------------
----------------------------------------------------------------------------

void FUN_1001df00(void)

{
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_100204d0 -------------------------------
----------------------------------------------------------------------------

void __thiscall
FUN_100204d0(void *this,wchar_t *param_1,wchar_t *param_2,wchar_t *param_3,wchar_t *param_4,
            rsize_t param_5,int param_6)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_10020740((void *)((int)this + 0x208),param_1);
  if (iVar1 != 0) {
    iVar1 = *(int *)(*(int *)((int)this + 0x208) + 8);
    iVar2 = FUN_10020740((void *)(iVar1 + 4),param_2);
    if (iVar2 != 0) {
      iVar1 = *(int *)(*(int *)(iVar1 + 4) + 8);
      goto LAB_1002050e;
    }
  }
  iVar1 = 0;
LAB_1002050e:
  if (param_4 != (wchar_t *)0x0) {
    if (iVar1 == 0) {
      if (*(int *)((int)this + 0x22c) != 0) {
        FUN_1001ff80(this,param_1,param_2,param_3);
      }
      FUN_1001e680(param_4,param_3,param_5);
    }
    else {
      *(undefined4 *)(iVar1 + 4) = 0;
      FUN_1001e680(param_4,*(wchar_t **)(iVar1 + 8),param_5);
      if (param_6 == 1) {
        FUN_1001e750((wint_t *)param_4);
        return;
      }
      if (param_6 == 2) {
        FUN_1001e7c0((wint_t *)param_4);
        return;
      }
    }
  }
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e750 -------------------------------
----------------------------------------------------------------------------

wint_t * __cdecl FUN_1001e750(wint_t *param_1)

{
  byte bVar1;
  wint_t wVar2;
  int iVar3;
  _locale_t unaff_ESI;
  wint_t *pwVar4;
  
  if ((param_1 != (wint_t *)0x0) && (pwVar4 = param_1, *param_1 != 0)) {
    do {
      iVar3 = FID_conflict:_iswlower(*pwVar4,unaff_ESI);
      if (iVar3 == 0) {
        bVar1 = *(byte *)pwVar4;
        if (((0xdf < bVar1) && (bVar1 < 0xf7)) || ((0xf7 < bVar1 && (bVar1 < 0xfe)))) {
          *pwVar4 = *pwVar4 - 0x20;
        }
      }
      else {
        wVar2 = _towupper(*pwVar4);
        *pwVar4 = wVar2;
      }
      pwVar4 = pwVar4 + 1;
    } while (*pwVar4 != 0);
    return param_1;
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e7c0 -------------------------------
----------------------------------------------------------------------------

wint_t * __cdecl FUN_1001e7c0(wint_t *param_1)

{
  byte bVar1;
  wint_t wVar2;
  int iVar3;
  wint_t *pwVar4;
  
  if ((param_1 != (wint_t *)0x0) && (pwVar4 = param_1, *param_1 != 0)) {
    do {
      iVar3 = FID_conflict:__iswupper_l(*pwVar4);
      if (iVar3 == 0) {
        bVar1 = *(byte *)pwVar4;
        if (((0xbf < bVar1) && (bVar1 < 0xd7)) || ((0xd7 < bVar1 && (bVar1 < 0xde)))) {
          *pwVar4 = *pwVar4 + 0x20;
        }
      }
      else {
        wVar2 = _towlower(*pwVar4);
        *pwVar4 = wVar2;
      }
      pwVar4 = pwVar4 + 1;
    } while (*pwVar4 != 0);
    return param_1;
  }
  return param_1;
}

----------------------------------------------------------------------------
------------------------------- FUN_10023470 -------------------------------
----------------------------------------------------------------------------

undefined4 __cdecl FUN_10023470(uint *param_1,void *param_2,wchar_t *param_3)

{
  bool bVar1;
  int iVar2;
  undefined3 extraout_var;
  uint uVar3;
  undefined3 extraout_var_00;
  undefined3 extraout_var_01;
  undefined3 extraout_var_02;
  wchar_t local_20c [260];
  
  *param_1 = 0;
  FUN_100204d0(param_2,param_3,L"HorizontalAlignment",L"",local_20c,0x104,0);
  iVar2 = FUN_1001e490(local_20c);
  if (iVar2 == 0) {
    bVar1 = FUN_1001e560(local_20c,L"CENTER",0);
    if (CONCAT31(extraout_var,bVar1) == 0) {
      bVar1 = FUN_1001e560(local_20c,L"RIGHT",0);
      uVar3 = 4;
      if (CONCAT31(extraout_var_00,bVar1) == 0) goto LAB_100234fd;
    }
    else {
      uVar3 = 1;
    }
  }
  else {
LAB_100234fd:
    uVar3 = 2;
  }
  *param_1 = *param_1 | uVar3;
  FUN_100204d0(param_2,param_3,L"VerticalAlignment",L"",local_20c,0x104,0);
  iVar2 = FUN_1001e490(local_20c);
  if (iVar2 == 0) {
    bVar1 = FUN_1001e560(local_20c,L"CENTER",0);
    if (CONCAT31(extraout_var_01,bVar1) != 0) {
      *param_1 = *param_1 | 0x10;
      return 1;
    }
    bVar1 = FUN_1001e560(local_20c,L"BOTTOM",0);
    uVar3 = 0x40;
    if (CONCAT31(extraout_var_02,bVar1) != 0) goto LAB_10023587;
  }
  uVar3 = 0x20;
LAB_10023587:
  *param_1 = *param_1 | uVar3;
  return 1;
}

----------------------------------------------------------------------------
------------------------------- FUN_100208c0 -------------------------------
----------------------------------------------------------------------------

wchar_t * __cdecl FUN_100208c0(void *param_1,wchar_t *param_2,wchar_t *param_3,int param_4)

{
  int iVar1;
  wchar_t *pwVar2;
  wchar_t local_20c [260];
  
  FUN_100204d0(param_1,param_2,param_3,L"",local_20c,0x104,0);
  iVar1 = FUN_1001e490(local_20c);
  if (iVar1 != 0) {
    return (wchar_t *)0x0;
  }
  if (param_4 == 1) {
    FUN_1001e750((wint_t *)local_20c);
    pwVar2 = FUN_1001e4d0(local_20c);
    return pwVar2;
  }
  if (param_4 == 2) {
    FUN_1001e7c0((wint_t *)local_20c);
  }
  pwVar2 = FUN_1001e4d0(local_20c);
  return pwVar2;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001e4d0 -------------------------------
----------------------------------------------------------------------------

wchar_t * __cdecl FUN_1001e4d0(wchar_t *param_1)

{
  rsize_t _SizeInWords;
  wchar_t wVar1;
  wchar_t *pwVar2;
  
  pwVar2 = (wchar_t *)0x0;
  if (param_1 != (wchar_t *)0x0) {
    if (*param_1 == L'\0') {
      pwVar2 = (wchar_t *)FUN_1001dcd0(2);
      if (pwVar2 != (wchar_t *)0x0) {
        *pwVar2 = L'\0';
        return pwVar2;
      }
    }
    else {
      pwVar2 = param_1;
      do {
        wVar1 = *pwVar2;
        pwVar2 = pwVar2 + 1;
      } while (wVar1 != L'\0');
      _SizeInWords = ((int)pwVar2 - (int)(param_1 + 1) >> 1) + 1;
      
      if (pwVar2 != (wchar_t *)0x0) {
        _wcscpy_s(pwVar2,_SizeInWords,param_1);
      }
    }
  }
  return pwVar2;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001dcd0 -------------------------------
----------------------------------------------------------------------------

void __cdecl FUN_1001dcd0(undefined4 param_1)

{
  (**(code **)*DAT_1005b548)(param_1,0,0,DAT_1005b524);
  return;
}

----------------------------------------------------------------------------
------------------------------- FUN_10021aa0 -------------------------------
----------------------------------------------------------------------------

float10 __cdecl FUN_10021aa0(wchar_t *param_1)

{
  bool bVar1;
  int iVar2;
  undefined3 extraout_var;
  wchar_t *pwVar3;
  float *pfVar4;
  float10 fVar5;
  
  iVar2 = FUN_1001e490(param_1);
  if (iVar2 == 0) {
    pfVar4 = (float *)&DAT_100579a0;
    iVar2 = FUN_1001e490(u_FEET_100579a4);
    if (iVar2 == 0) {
      pwVar3 = u_FEET_100579a4;
      do {
        bVar1 = FUN_1001e560(pwVar3,param_1,0);
        if (CONCAT31(extraout_var,bVar1) != 0) {
          return (float10)*pfVar4;
        }
        pwVar3 = pwVar3 + 10;
        pfVar4 = pfVar4 + 5;
        iVar2 = FUN_1001e490(pwVar3);
      } while (iVar2 == 0);
    }
    fVar5 = (float10)FUN_1002bef0(param_1,(int *)0x0);
    fVar5 = (float10)(float)fVar5;
    if ((NAN((float10)0) || NAN(fVar5)) == ((float10)0 == fVar5)) {
      return fVar5;
    }
  }
  return (float10)1;
}

----------------------------------------------------------------------------
------------------------------- FUN_10020590 -------------------------------
----------------------------------------------------------------------------

uint __thiscall FUN_10020590(void *this,wchar_t *param_1,wchar_t *param_2,uint param_3)

{
  bool bVar1;
  int iVar2;
  int iVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  wchar_t *pwVar4;
  wchar_t local_20c [260];
  
  iVar2 = FUN_10020740((void *)((int)this + 0x208),param_1);
  if (iVar2 != 0) {
    iVar2 = *(int *)(*(int *)((int)this + 0x208) + 8);
    iVar3 = FUN_10020740((void *)(iVar2 + 4),param_2);
    if (iVar3 != 0) {
      iVar2 = *(int *)(*(int *)(iVar2 + 4) + 8);
      goto LAB_100205d4;
    }
  }
  iVar2 = 0;
LAB_100205d4:
  if (iVar2 != 0) {
    *(undefined4 *)(iVar2 + 4) = 0;
    FUN_1001e680(local_20c,*(wchar_t **)(iVar2 + 8),0x104);
    bVar1 = FUN_1001e560(local_20c,*(wchar_t **)((int)this + 0x238),0);
    if (CONCAT31(extraout_var,bVar1) != 0) {
      return 1;
    }
    bVar1 = FUN_1001e560(local_20c,*(wchar_t **)((int)this + 0x23c),0);
    if (CONCAT31(extraout_var_00,bVar1) != 0) {
      return 0;
    }
    *(undefined4 *)(iVar2 + 4) = 1;
    param_3 = (uint)(*(int *)(iVar2 + 0xc) != 0);
  }
  if (*(int *)((int)this + 0x22c) != 0) {
    if (param_3 == 0) {
      pwVar4 = *(wchar_t **)((int)this + 0x23c);
    }
    else {
      pwVar4 = *(wchar_t **)((int)this + 0x238);
    }
    FUN_1001ff80(this,param_1,param_2,pwVar4);
  }
  return param_3;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001ed70 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_1001ed70(void *this,wchar_t *param_1,wchar_t *param_2)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = FUN_10020740((int *)((int)this + 0x208),param_1);
  if (iVar1 != 0) {
    uVar2 = FUN_10020740((void *)(*(int *)(*(int *)((int)this + 0x208) + 8) + 4),param_2);
    return uVar2;
  }
  return 0;
}

============================================================================
------------------------------- FUN_10013b50 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013b50(void *this,void *param_1,wchar_t *param_2)

{
  float10 fVar1;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ea3a;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  FUN_100136d0(this,param_1,param_2);
  *(undefined ***)this = RadarHorizonClass::vftable;
  local_8 = 0;
  fVar1 = FUN_10020450(param_1,param_2,L"ElevationScale",*(float *)(DAT_10059e28 + 0x50));
  *(float *)((int)this + 0x24) = 1.0 / (float)(fVar1 * (float10)0.01745329238474369);
  ExceptionList = local_10;
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUNCTION -------------------------------
----------------------------------------------------------------------------

FUN_100136d0
FUN_10020450

============================================================================
------------------------------- FUN_10013bd0 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013bd0(void *this,void *param_1,wchar_t *param_2)

{
  float fVar1;
  float10 fVar2;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ea4c;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  FUN_100136d0(this,param_1,param_2);
  *(undefined ***)this = RadarElevationClass::vftable;
  local_8 = 0;
  fVar2 = FUN_10020450(param_1,param_2,L"ElevationScale",*(float *)(DAT_10059e28 + 0x50));
  fVar1 = 1.0 / (float)(fVar2 * (float10)0.01745329238474369);
  *(float *)((int)this + 0x24) = fVar1;
  *(float *)(DAT_10059e28 + 0x50) = fVar1;
  ExceptionList = local_10;
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUN_100136d0 -------------------------------
----------------------------------------------------------------------------

undefined4 * __thiscall FUN_100136d0(void *this,void *param_1,wchar_t *param_2)

{
  float fVar1;
  int iVar2;
  undefined4 uVar3;
  float10 fVar4;
  wchar_t local_21c [260];
  void *local_14;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003e9d8;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  local_14 = this;
  FUN_100135f0(this,param_1,param_2);
  local_8 = 0;
  *(undefined ***)this = RadarImageClass::vftable;
  *(undefined4 *)((int)this + 0x18) = 0xffffffff;
  fVar4 = FUN_10020450(param_1,param_2,L"ImageSize",0.0);
  fVar1 = (float)fVar4;
  *(float *)((int)this + 0x1c) = fVar1;
  *(undefined4 *)((int)this + 0x20) = 0;
  if (0.0 < fVar1 != NAN(fVar1)) {
    FUN_100204d0(param_1,param_2,L"TextureName",L"",local_21c,0x104,0);
    iVar2 = FUN_1001e490(local_21c);
    if (iVar2 == 0) {
      uVar3 = (**(code **)(*DAT_10059068 + 0x7c))(local_21c,1,1,0);
      *(undefined4 *)((int)this + 0x18) = uVar3;
    }
    iVar2 = FUN_1001ed70(param_1,param_2,L"RotationAngle");
    if (iVar2 != 0) {
      fVar4 = FUN_10020450(param_1,param_2,L"RotationAngle",0.0);
      *(float *)((int)this + 0x20) = (float)fVar4;
      if (1.1920929e-07 < ABS((float)fVar4)) {
        *(uint *)((int)this + 4) = *(uint *)((int)this + 4) | 0x10000;
        ExceptionList = local_10;
        return (undefined4 *)this;
      }
    }
  }
  ExceptionList = local_10;
  return (undefined4 *)this;
}

----------------------------------------------------------------------------
------------------------------- FUN_10020450 -------------------------------
----------------------------------------------------------------------------

float10 __thiscall FUN_10020450(void *param_1,wchar_t *param_2,wchar_t *param_3,float param_4)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_10020740((void *)((int)param_1 + 0x208),param_2);
  if (iVar1 != 0) {
    iVar1 = *(int *)(*(int *)((int)param_1 + 0x208) + 8);
    iVar2 = FUN_10020740((void *)(iVar1 + 4),param_3);
    if ((iVar2 != 0) && (iVar1 = *(int *)(*(int *)(iVar1 + 4) + 8), iVar1 != 0)) {
      *(undefined4 *)(iVar1 + 4) = 2;
      return (float10)*(float *)(iVar1 + 0x10);
    }
  }
  if (*(int *)((int)param_1 + 0x22c) != 0) {
    FUN_1001fe50(param_1,param_2,param_3,param_4);
  }
  return (float10)param_4;
}

----------------------------------------------------------------------------
------------------------------- FUN_1001fe50 -------------------------------
----------------------------------------------------------------------------

undefined4 __thiscall FUN_1001fe50(void *this,wchar_t *param_1,wchar_t *param_2,undefined4 param_3)

{
  int iVar1;
  int iVar2;
  wint_t *pwVar3;
  undefined4 *puVar4;
  undefined4 uVar5;
  undefined4 extraout_ECX;
  undefined4 extraout_EDX;
  float10 extraout_ST0;
  ulonglong uVar6;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ee08;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  iVar1 = FUN_10020740((void *)((int)this + 0x208),param_1);
  if (iVar1 != 0) {
    iVar1 = *(int *)(*(int *)((int)this + 0x208) + 8);
    iVar2 = FUN_10020740((void *)(iVar1 + 4),param_2);
    if ((iVar2 != 0) && (iVar1 = *(int *)(*(int *)(iVar1 + 4) + 8), iVar1 != 0)) {
      *(undefined4 *)(iVar1 + 4) = 2;
      *(undefined4 *)(iVar1 + 0x10) = param_3;
      ExceptionList = local_10;
      return 1;
    }
  }
  iVar1 = FUN_10025810((void *)((int)this + 0x21c),param_2);
  if (iVar1 != 0) {
    pwVar3 = (wint_t *)FUN_10025790((int)this + 0x21c);
    puVar4 = (undefined4 *)FUN_1001ddc0(0x14);
    local_8 = 0;
    if (puVar4 == (undefined4 *)0x0) {
      puVar4 = (undefined4 *)0x0;
    }
    else {
      *puVar4 = pwVar3;
      puVar4[1] = 2;
      FUN_1001e8f0(pwVar3);
      puVar4[2] = 0;
      uVar6 = FUN_1002a7b0(extraout_ECX,extraout_EDX);
      puVar4[4] = (float)extraout_ST0;
      puVar4[3] = (int)uVar6;
    }
    local_8 = 0xffffffff;
    uVar5 = FUN_1001f5f0(this,param_1,puVar4);
    ExceptionList = local_10;
    return uVar5;
  }
  FUN_1001df00();
  ExceptionList = local_10;
  return 0;
}

----------------------------------------------------------------------------
------------------------------- FUN_1002a7b0 -------------------------------
----------------------------------------------------------------------------

ulonglong __fastcall FUN_1002a7b0(undefined4 param_1,undefined4 param_2)

{
  ulonglong uVar1;
  uint uVar2;
  float fVar3;
  float10 in_ST0;
  uint local_20;
  float fStack_1c;
  
  if (DAT_1005d4f4 == 0) {
    uVar1 = (ulonglong)ROUND(in_ST0);
    local_20 = (uint)uVar1;
    fStack_1c = (float)(uVar1 >> 0x20);
    fVar3 = (float)in_ST0;
    if ((local_20 != 0) || (fVar3 = fStack_1c, (uVar1 & 0x7fffffff00000000) != 0)) {
      if ((int)fVar3 < 0) {
        uVar1 = uVar1 + (0x80000000 < (uint)-(float)(in_ST0 - (float10)(longlong)uVar1));
      }
      else {
        uVar2 = (uint)(0x80000000 < (uint)(float)(in_ST0 - (float10)(longlong)uVar1));
        uVar1 = CONCAT44((int)fStack_1c - (uint)(local_20 < uVar2),local_20 - uVar2);
      }
    }
    return uVar1;
  }
  return CONCAT44(param_2,(int)in_ST0);
}

============================================================================
------------------------------- FUN_10013c60 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013c60(void *this,void *param_1,wchar_t *param_2)

{
  FUN_100136d0(this,param_1,param_2);
  *(undefined ***)this = RadarAzimuthClass::vftable;
  *(uint *)((int)this + 4) = *(uint *)((int)this + 4) & 0xfffffffe | 2;
  return (undefined4 *)this;
}

============================================================================
------------------------------- FUN_10013c90 -------------------------------
============================================================================

undefined4 * __thiscall FUN_10013c90(void *this,void *param_1,wchar_t *param_2)

{
  float10 fVar1;
  wchar_t local_21c [260];
  void *local_14;
  void *local_10;
  undefined *puStack_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  puStack_c = &LAB_1003ea66;
  local_10 = ExceptionList;
  ExceptionList = &local_10;
  local_14 = this;
  FUN_100135f0(this,param_1,param_2);
  local_8 = 0;
  *(undefined ***)this = RadarTextClass::vftable;
  FUN_100204d0(param_1,param_2,L"Text",L"",(wchar_t *)((int)this + 0x18),0x40,0);
  FUN_10023470((uint *)((int)this + 0x98),param_1,param_2);
  local_8 = 1;
  *(undefined ***)this = RadarRangeScaleClass::vftable;
  FUN_100204d0(param_1,param_2,L"DisplayUnit",L"",local_21c,0x104,0);
  fVar1 = FUN_10021aa0(local_21c);
  *(float *)((int)this + 0x9c) = (float)((float10)1 / fVar1);
  ExceptionList = local_10;
  return (undefined4 *)this;
}

=====================================================================
=====================================================================
------------------------------- NOTES -------------------------------
=====================================================================
=====================================================================

| -------------------- | ----------------------------------------------------------------------- |
| **Function**         | **What It Creates / Does**                                              |
| -------------------- | ----------------------------------------------------------------------- |

| `FUN_10013bd0`       | Creates **RadarElevationClass** → handles elevation bar drawing         |

| `FUN_10013f90`       | Creates **RadarTargetRangeTextClass** → handles range text like “10 nm” |

| `FUN_10013940`       | Initializes **RadarTextClass**, then upgrades to `RadarTargetTextClass` |

| `FUN_100136d0`       | Base class initializer for visual radar components                      |

| `FUN_10020450`, etc. | Load values from INI → `[RadarDisplay]`, `[AvionicsData]`, etc.         |

| `DAT_10059e28`       | Likely a **central render config structure** used across radar visuals  |

 

Edited by Eagle114th
  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, Eagle114th said:

I found the goldmine, the pieces of the source codes!

Amazing findings through Ghidra disassembling with AI!

Please consider changing the title of the topic, it is misleading. People may think these are found original source codes, while they actually are codes reconstructed by a disassembler.

  • Thanks 1

Share this post


Link to post
Share on other sites

It's like the 2 scientists in "Close Encounters of the 3rd (wire) Kind", when the Mother Ship (tm) and the computer are talking - "They're talking way above my head"

Don't understand what it is, but hey, it's gotta be a help to someone that knows!!!

  • Thanks 1

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..