User:AF/ClassExtrapolation: Difference between revisions

From sc2k-reverse
Jump to navigationJump to search
AF (talk | contribs)
AF (talk | contribs)
Line 116: Line 116:
this[67]  -> 0x4C711C - Foreground palette
this[67]  -> 0x4C711C - Foreground palette
this[68]  -> 0x4C7120 - Background palette
this[68]  -> 0x4C7120 - Background palette
this[69]  -> 0x4C7124 - CString One (marked as data but not with any initial name)
this[69]  -> 0x4C7124 - CString One (marked as data but not with any name or reference)
this[72]  -> 0x4C7130 - CString Two
this[72]  -> 0x4C7130 - CString Two
this[75]  -> 0x4C713C - CString Three
this[75]  -> 0x4C713C - CString Three
Line 122: Line 122:
this[122] -> 0x4C71F8 - CString Array One (new alloc of 12)
this[122] -> 0x4C71F8 - CString Array One (new alloc of 12)
this[158] -> 0x4C7288 - CString Array Two (new alloc of 12)
this[158] -> 0x4C7288 - CString Array Two (new alloc of 12)
this[200] -> 0x4C7330 - GetTickCount() result (unmarked area - no name or reference)
this[201] -> 0x4C7334 - Program Step
</pre>
</pre>



Revision as of 19:03, 31 May 2025

The purposes of this page is to list the extrapolated classes during the reconstruction phase of the 1996 Special Edition.

For the most part this is a brute-force approach. As the classes are refined/trimmed they'll be adjusted over time.

The general methodology in this case is to generate a struct with N number of contained variables (this number can be rather high at times - it doesn't account for internal sub-structs and the like mind you, but there must be a starting place).

Structure Extrapolation

Whether the structural class format is entirely correct based on what was originally present is unclear.

However in order to ease the RE process some of these subclasses have created to reasonably allow for alignment.

NOTE: THIS LIST IS HEAVILY SUBJECT TO CHANGE

CWinApp -> CSimcityApp
CFrameWnd -> CMainFrame
CView -> CSimcityView
CWnd -> CSimcityWnd (This one appears to deal with some general sub-classing, this one needs more investigating and clarification)
CScrollView -> CSimcityScrollViewOne
CScrollView -> CSimcityScrollViewTwo
CScrollView -> CSimcityScrollViewThree
CDocument -> CSimcityDoc
CDocument -> CEngine
CDocument -> CSimGraphData
CMDIChildWnd -> CMyMDIChildWnd
CControlBar -> CMyToolBar
CMyToolBar -> CCityToolBar
CMyToolBar -> CMapToolBar
CDialog -> CAboutDialog
CDialog -> CMovieDialog
CDialog -> CGameDialog
CGameDialog -> CBridgeSelectDialog
CGameDialog -> CBudgetAdvisorDialog
CGameDialog -> CBudgetEducationDialog
CGameDialog -> CBudgetFireDialog
CGameDialog -> CBudgetFundDialog
CGameDialog -> CBudgetHealthDialog
CGameDialog -> CBudgetInformationDialog
CGameDialog -> CBudgetMainDialog
CGameDialog -> CBudgetOrdinanceDialog
CGameDialog -> CBudgetPoliceDialog
CGameDialog -> CBudgetTransportDialog
CGameDialog -> CBudgetZoneTaxSubDialog
CGameDialog -> CCityIndustryDialog
CGameDialog -> CCityMapDialog
CGameDialog -> CEventDialog
CGameDialog -> CGeneralInfoDialog
CGameDialog -> CInflightDialog
CGameDialog -> CInitialDialog
CGameDialog -> CNeighbourDialog
CGameDialog -> CNewGameDialog
CGameDialog -> CNewspaperDialog
CGameDialog -> COwnerInfoDialog
CGameDialog -> CPopulationDialog
CGameDialog -> CPowerPlantDialog
CGameDialog -> CQueryGeneralDialog
CGameDialog -> CQuerySpecificDialog
CGameDialog -> CScenarioDialog
CGameDialog -> CSelectArcologyDialog
CGameDialog -> CSimGraphDialog
CDockBar -> CStatusControlBar
CGraphics
CSound

CGraphics

struct CGraphics
{
  HBITMAP dwGRBitmap;
  HBITMAP dwGRBitmapLoColor;
  DWORD dwGRthree;
  CPalette *dwGRPalette;
  tagRECT dwGRRect;
  void *dwGRRGB;
  void *dwGRRGBLoColor;
  BITMAPINFO *dwGRBitmapInfo;
};

CSound

This deals with both the Music and Sound.

struct __unaligned __declspec(align(2)) CSound
{
  HWND *dwSNDhWnd;
  BOOL bSNDPlaySound;
  int iSNDCurrSoundID;
  CString dwSNDSoundString;
  void *dwSNDBufferOne;
  int iSNDCurrentSound;
  void *dwSNDBufferTwo;
  BOOL bSNDWasPlaying;
  int iSNDSoundID;
  void *dwSNDBufferThree;
  void *dwSNDBufferFour;
  void *dwSNDBufferFive;
  int iSNDNextSoundID;
  DWORD dwSNDUnknownOne;
  WORD wSNDMCIDevID;
  DWORD dwSNDMCIError;
  DWORD dwSNDUnknownTwo;
  CString dwSNDMusicString;
};

CSimcityApp

Struct to address reference:

this[59]  -> 0x4C70FC - Boolean var for selecting the background or foreground palette (toggled via CMainFrame::OnActivateApp)
this[67]  -> 0x4C711C - Foreground palette
this[68]  -> 0x4C7120 - Background palette
this[69]  -> 0x4C7124 - CString One (marked as data but not with any name or reference)
this[72]  -> 0x4C7130 - CString Two
this[75]  -> 0x4C713C - CString Three
this[78]  -> 0x4C7148 - CString Four (the global has the type LPCSTR during initial detection here)
this[122] -> 0x4C71F8 - CString Array One (new alloc of 12)
this[158] -> 0x4C7288 - CString Array Two (new alloc of 12)
this[200] -> 0x4C7330 - GetTickCount() result (unmarked area - no name or reference)
this[201] -> 0x4C7334 - Program Step

CSimcityView

struct __cppobj __unaligned __declspec(align(2)) CSimcityView : CView
{
  CGraphics *dwSCVCGraphics;
  DWORD dwSCVTwo;
  DWORD dwSCVThree;
  BITMAPINFO *dwSCVBitmapInfo;
  LONG dwSCVWidth;
  LONG dwSCVHeight;
  CScrollView *dwSCVScrollViewOne;
  CScrollView *dwSCVScrollViewTwo;
  CScrollView *dwSCVScrollViewThree;
  tagRECT dwSCVRectSeven;
  tagRECT dwSCVRectFour;
  tagRECT dwSCVRectFive;
  tagRECT dwSCVRectOne;
  tagRECT dwSCVRectEight;
  tagRECT dwSCVRectNine;
  tagRECT dwSCVRectTen;
  tagRECT dwSCVRectEleven;
  tagRECT dwSCVRectTwelve;
  tagRECT dwSCVRectThirteen;
  DWORD dwSCVFiftyThree;
  DWORD dwSCVFiftyFour;
  DWORD dwSCVFiftyFive;
  tagPOINT dwSCVScrollPointOne;
  DWORD dwSCVFiftyEight;
  tagPOINT dwSCVScrollPointTwo;
  DWORD dwSCVSixtyOne;
  DWORD dwSCVSixtyTwo;
  DWORD dwSCVSixtyThree;
  RECT dwSCVRECTOne;
  DWORD dwSCVSixtySix;
  tagPOINT dwSCVScrollPointThree;
  WORD wSCVZoomLevel;
  DWORD dwSCVAdditionalZoomPerhaps;
};