Fog Ordinals

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Fog Ordinals

Post by kidpaddle94 » Sun Jan 05, 2014 9:50 pm

I thought it could be a nice idea to start a topic and list known Fog ordinals. Since those don't change with patch versions (or at least they didn't change since 1.10 as far as I know), this would be useful and universal information for everyone. Guess the post could be merged into the function list sticky.

Fog.#10000 - Close Socket
Fog.#10001 - WSAStartup
Fog.#10002 - WSACleanup
Fog.#10003 - Fog.#10004 Wrapper
Fog.#10004 - Alloc Net Data
Fog.#10005 - Free Net Data
Fog.#10006 - Receive Packet From Net Data
Fog.#10007 - Send Packet via Net Data
Fog.#10008 - Select Net Data Socket
Fog.#10009 - Send Packet Via Net Data (Quick)
Fog.#10010 - Enter Net Data Critical Section
Fog.#10011 - Leave Net Data Critical Section
Fog.#10012 - Get Peer Name From Net Data
Fog.#10013 - Get Local IP Address
Fog.#10014 - Set IP Address
Fog.#10015 - Get IP Address
Fog.#10016 - Get Socket Error
Fog.#10017 - Socket IOCTL
Fog.#10020 - Sets the Unhandled Exception Filter
Fog.#10021 - Initialize the log files manager
Fog.#10023 - Pop Assertion Error
Fog.#10024 - Pop Assertion Error (Packets)
Fog.#10025 - Set Window State
Fog.#10029 - Write Log File
Fog.#10030 - Write Hack Log File
Fog.#10041 - Set Memory Pool Override
Fog.#10042 - Allocate Client Memory
Fog.#10043 - Free Client Memory
Fog.#10044 - Reallocate Client Memory
Fog.#10045 - Allocate Server Memory
Fog.#10046 - Free Server Memory
Fog.#10047 - Reallocate Server Memory
Fog.#10050 - Enter Critical Section
Fog.#10051 - Leave Critical Section
Fog.#10059 - Get Tick Count
Fog.#10102 - Open file from MPQ archive
Fog.#10103 - Close a file opened from a MPQ archive
Fog.#10104 - Read a file opened from a MPQ archive into the specified buffer
Fog.#10105 - Get size of a file contained within a MPQ archive
Fog.#10108 - Delete File
Fog.#10109 - Close Handle
Fog.#10115 - Get Save Directory
Fog.#10116 - Get Installation Directory
Fog.#10126 - Initialize a Bit Stream
Fog.#10127 - Get Next Available Bit Position From Bit Stream
Fog.#10128 - Write Bits in Bit Stream
Fog.#10129 - Read Signed Value From Bit Stream
Fog.#10130 - Read Unsigned Value From Bit Stream
Fog.#10142 - Initialize Memory Manager
Fog.#10143 - Delete Memory Manager
Fog.#10144 - Flush Memory Manager
Fog.#10145 - Set Memory Allocation Mode
Fog.#10147 - Get Memory Usage
Fog.#10211 - Allocate a Data Table Linking Table
Fog.#10212 - Free a Data Table Linking Table
Fog.#10213 - Get Index From Code in Linking Table
Fog.#10214 - Get String From Index in Linking Table
Fog.#10216 - Add Record in Linking Table
Fog.#10217 - Get Index From String in Linking Table
Fog.#10227 - To Check Whether Game is Expansion or Not
Fog.#10229 - Calculate d2s Save File Checksum
Fog.#10251 - Validate Critical Section
Fog.#10252 - Get Memory Bit
Fog.#10265 (1.11+ Only) - Just Puts The Value at [ESP] Into The Return Value (get address of caller)

Fog.#10082 - This function does absolutely nothing, however it's worth mentioning since it's one of the very first calls in Game.exe, making it a nice place to patch in order to load your own external library
Last edited by kidpaddle94 on Thu Sep 08, 2016 2:16 am, edited 15 times in total.

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Fog Ordinals

Post by kidpaddle94 » Thu Mar 24, 2016 11:38 pm

Code: Select all

Function: Fog.#10000
Wrapper for winsock closesocket function

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms737582(v=vs.85).aspx

int __fastcall FOG_CloseSocket(SOCKET pSocket)

Code: Select all

Function: Fog.#10001
Wrapper for winsock WSAStartup function

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213(v=vs.85).aspx

int __fastcall FOG_WSAStartup(void)

Code: Select all

Function: Fog.#10002
Wrapper for winsock WSACleanup function

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms741549(v=vs.85).aspx

int __stdcall FOG_WSACleanup(void)

Code: Select all

Function: Fog.#10003
Wrapper for Fog.#10004, takes less arguments

Notes:

struct D2NetDataStrc
{
	BOOL bConnected;							//0x00
	BOOL bInit;									//0x04
	SOCKET Socket;								//0x08
	CRITICAL_SECTION CriticalSection;			//0x0C
	HANDLE hThread;								//0x24
	DWORD dwThreadId;							//0x28
	BOOL bBlocked;								//0x2C
	int nError;									//0x30
	int nWSALastError;							//0x34
	char szDesc[64];							//0x38
};

D2NetDataStrc* __fastcall FOG_AllocNetDataEx(char* szAddress, int nPort, LPTHREAD_START_ROUTINE lpThreadFunction, int nA4, char* szDesc)

Code: Select all

Function: Fog.#10004
Allocates a NetData structure

Notes:

struct D2NetDataStrc
{
	BOOL bConnected;							//0x00
	BOOL bInit;									//0x04
	SOCKET Socket;								//0x08
	CRITICAL_SECTION CriticalSection;			//0x0C
	HANDLE hThread;								//0x24
	DWORD dwThreadId;							//0x28
	BOOL bBlocked;								//0x2C
	int nError;									//0x30
	int nWSALastError;							//0x34
	char szDesc[64];							//0x38
};

D2NetDataStrc* __fastcall FOG_AllocNetData(char* szAddress, int nPort, LPTHREAD_START_ROUTINE lpThreadFunction, int nA4, char* szDesc, int nA6)

Code: Select all

Function: Fog.#10005
Frees a NetData structure allocated with Fog.#10003 or Fog.#10004

Notes:
none

void __fastcall FOG_FreeNetData(D2NetDataStrc* pNetData)

Code: Select all

Function: Fog.#10006
Receive data from an allocated NetData structure

Notes:
none

int __fastcall FOG_RecvPacketFromNetData(D2NetDataStrc* pNetData, void* pPacket, size_t nSize)

Code: Select all

Function: Fog.#10007
Send data to an allocated NetData structure

Notes:
none

int __fastcall FOG_SendPacketToNetData(D2NetDataStrc* pNetData, void* pPacket, size_t nSize)

Code: Select all

Function: Fog.#10010
Enters critical section of the passed Net Data structure

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682608(v=vs.85).aspx

void __fastcall FOG_EnterNetDataCS(D2NetDataStrc* pNetData)

Code: Select all

Function: Fog.#10011
Leaves critical section of the passed Net Data structure

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684169(v=vs.85).aspx

void __fastcall FOG_LeaveNetDataCS(D2NetDataStrc* pNetData)

Code: Select all

Function: Fog.#10012
Get peer name from provided net data

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms738533(v=vs.85).aspx

BOOL __fastcall FOG_GetNetDataPeerName(D2NetDataStrc* pNetData, void* sockaddr, int* addrlen)

Code: Select all

Function: Fog.#10013
Get your local IP Address (used to display your IP adress in tcp/ip menu)

Notes:
none

const char* __fastcall FOG_GetLocalIpAddress(void)

Code: Select all

Function: Fog.#10020
Sets the unhandled exception filter

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680634(v=vs.85).aspx

LPTOP_LEVEL_EXCEPTION_FILTER __stdcall FOG_SetUnhandledExceptionFilter(void)

Code: Select all

Function: Fog.#10021
Initializes the log files manager

Notes:
Argument isn't really a path, but just the string that's appended before the YYMMDD suffix

void __fastcall FOG_InitLogManager(char* szPath)

Code: Select all

Function: Fog.#10029
Write a line in the current debug log

Notes:
none

void __cdecl FOG_WriteLogFile(char* szFormat, ...)

Code: Select all

Function: Fog.#10030
Write a line in the current hack log

Notes:
Not exclusively reserved to hack logs, as it allows you to specify the filename suffix, but Blizzard used it for this

void __cdecl FOG_WriteHackLog(char* szFilenamePrefix, char* szFormat, ...)

Code: Select all

Function: Fog.#10042
Allocates client memory block

Notes:
Memory allocated with this function must be free'd with Fog.#10043

void* __fastcall FOG_AllocClientMemory(size_t nAllocSize, char* szFile, int nLine, int nNull)

Code: Select all

Function: Fog.#10043
Free memory allocated with Fog.#10042

Notes:
none

void __fastcall FOG_FreeClientMemory(void* pMemoryToFree, char* szFile, int nLine, int nNull)

Code: Select all

Function: Fog.#10045
Allocates server memory block

Notes:
Memory allocated with this function must be free'd with Fog.#10046

void* __fastcall FOG_AllocServerMemory(void* pMemoryPool, size_t nAllocSize, char* szFile, int nLine, int nNull)

Code: Select all

Function: Fog.#10046
Free memory allocated with Fog.#10045

Notes:
none

void __fastcall FOG_FreeServerMemory(void* pMemoryPool, void* pMemoryToFree, char* szFile, int nLine, int nNull)

Code: Select all

Function: Fog.#10059
Just calls GetTickCount

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx

DWORD __stdcall FOG_GetTickCount(void)

Code: Select all

Function: Fog.#10102
Opens and gets an handle to a file from a MPQ archive

Notes:
handle to the file is returned into pHandle. Return value defines success/fail

BOOL __fastcall FOG_MPQFileOpen(char* szFileName, void** pHandle)

Code: Select all

Function: Fog.#10103
Close handle to a MPQ archive file (opened with Fog.#10102)

Notes:
none

void __fastcall FOG_MPQFileClose(void* pHandle)

Code: Select all

Function: Fog.#10104
Reads a file opened with Fog.#10102 into the specified buffer

Notes:
last three args seem to be unused

BOOL __fastcall FOG_MPQFileRead(void* pHandle, void* pBuffer, size_t nBufferSize, int* nBytesRead, DWORD dw1, DWORD dw2, DWORD d3)

Code: Select all

Function: Fog.#10105
Gets the filesize of a file retrieved with Fog.#10104

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364955(v=vs.85).aspx

size_t __fastcall FOG_GetMPQFileSize(void* pFile, DWORD* lpFileSizeHigh)

Code: Select all

Function: Fog.#10108
Wrapper for DeleteFileA

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363915(v=vs.85).aspx

BOOL __fastcall FOG_DeleteFileA(char* szFile)

Code: Select all

Function: Fog.#10109
Wrapper for CloseHandle

Notes:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211(v=vs.85).aspx

BOOL __fastcall FOG_CloseHandle(HANDLE hObject)

Code: Select all

Function: Fog.#10115
Get the save directory path

Notes:
path is returned into the passed buffer. return defines success/fail

BOOL __fastcall FOG_GetSaveDirectory(char* szBuffer)

Code: Select all

Function: Fog.#10116
Get the Diablo II installation directory path

Notes:
path is returned into the passed buffer. return defines success/fail

BOOL __fastcall FOG_GetInstallDirectory(char* szBuffer)

Code: Select all

Function: Fog.#10126
Initializes a bit stream

Notes:

struct D2BitStreamStrc
{
	BYTE* pBuffer;			//0x00
	size_t nBits;			//0x04
	size_t nPos;			//0x08
	size_t nPosBits;		//0x0C
	BOOL bFull;				//0x10
};

void __fastcall FOG_InitBitStream(D2BitStreamStrc* pStream, void* pBuffer, size_t nSize)

Code: Select all

Function: Fog.#10127
Gets the next available bit position from provided bit stream

Notes:
none

size_t __stdcall FOG_GetNextFreeStreamBitPos(D2BitStreamStrc* pStream)

Code: Select all

Function: Fog.#10128
Writes bits in provided bit stream

Notes:
none

void __stdcall FOG_WriteBitStream(D2BitStreamStrc* pStream, int nValue, int nBits)

Code: Select all

Function: Fog.#10129
Reads a signed value from provided bit stream

Notes:
none

int __stdcall FOG_ReadSignedBitStream(D2BitStreamStrc* pStream, int nBits)

Code: Select all

Function: Fog.#10130
Reads an unsigned value from provided bit stream

Notes:
none

DWORD __stdcall FOG_ReadBitStream(D2BitStreamStrc* pStream, int nBits)

Code: Select all

Function: Fog.#10211
Allocates a data table linking table

Notes:

struct D2TxtLinkNodeStrc
{
	char szText[32];				//0x00
	int nLinkIndex;					//0x20
	D2TxtLinkNodeStrc* pPrevious;	//0x24
	D2TxtLinkNodeStrc* pNext;		//0x28
};

struct D2TxtLinkStrc
{
	int nRecords;					//0x00
	DWORD dw1;						//0x04
	DWORD dw2;						//0x08
	D2TxtLinkNodeStrc* pFirstNode;	//0x0C
};

D2TxtLinkStrc* __stdcall FOG_AllocLinker(__FILE__, __LINE__)

Code: Select all

Function: Fog.#10212
Frees a data table linking table

Notes:
none

void __stdcall FOG_FreeLinker(D2TxtLinkStrc* pLinker)

Code: Select all

Function: Fog.#10213
Gets index from code (usually item codes) from the provided linking table

Notes:
Not sure about the last argument

int __stdcall FOG_GetIndexFromCode(D2TxtLinkStrc* pLinks, DWORD dwCode, BOOL bLogError)

Code: Select all

Function: Fog.#10214
Gets link string from index, in provided linking table

Notes:
Found string is returned in szBuffer

BOOL __stdcall FOG_GetStringFromIndex(D2TxtLinkStrc* pLinks, int nIndex, char* szBuffer)

Code: Select all

Function: Fog.#10216
Adds a record to the provided linking table

Notes:
none

void __stdcall FOG_AddRecordToLinkingTable(D2TxtLinkStrc* pLinks, char* szName)

Code: Select all

Function: Fog.#10217
Gets an index from a name string, in the provided linking table

Notes:
Not sure about last argument

int __stdcall FOG_GetIndexFromString(D2TxtLinkStrc* pLinks, char* szName, BOOL bLogError)

Code: Select all

Function: Fog.#10227
Returns whether game is expansion or not

Notes:
none

BOOL __fastcall FOG_IsExpansion(void)

Code: Select all

Function: Fog.#10229
Calculates the checksum for a d2s save file

Notes:
note that you need to NULL the current checksum of the save file before calling this in order to generate a valid checksum

DWORD __stdcall FOG_CalculateChecksum(void* pSaveFile, size_t nSize)

Code: Select all

Function: Fog.#10265
Get address from caller (mov eax, [esp]), mainly used with assertions to print the address

Notes:
none

DWORD __fastcall FOG_GetCallerAddress(void)
Last edited by kidpaddle94 on Fri Mar 25, 2016 6:25 pm, edited 3 times in total.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Fog Ordinals

Post by devurandom » Fri Mar 25, 2016 5:42 am

Good information. Hoping that someone will sticky this thread.

:)
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Fog Ordinals

Post by kidpaddle94 » Fri Mar 25, 2016 5:32 pm

devurandom" wrote:Good information. Hoping that someone will sticky this thread.

:)
Still got quite a few more to add in, just got bored of formatting everything. Feel free to contribute as well.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: Fog Ordinals

Post by Necrolis » Fri Mar 25, 2016 6:06 pm

I added this to the function list sticky, I suppose I can merge in my private notes on the fog internals as well

Fog.#10265 is version specific AFAIK (1.11+), its a non-inline version of the _ReturnAddress() intrinsic.

My old notes for the QSocket stuff (circa 4 years ago??):

Code: Select all

struct D2Socket		//sizeof 0x78
{
	BOOL bConnected;		//+00
	BOOL bInit;			//+04
	SOCKET hSocket;			//+08
	CRITICAL_SECTION pSync;		//+0C
	HANDLE hSocketThread;		//+24
	DWORD dwSocketThread;		//+28
	BOOL bBlocked;			//+2C
	int nError;			//+30
	int nWSALastError;		//+34
	char szHost[0x40];		//+38
};

6FF042EE                                                  .  E8 5D7C0000                   CALL <JMP.&Fog.#10000>                                         ;  D2CloseSocket(SOCKET hSocket);
6FF04E8B                                                  .  E8 8A700000                   CALL <JMP.&Fog.#10001>                                         ;  D2WSAStartup();
00BCD82E                                                 |.  E8 3D400000                   CALL Fog.#10002                                                ;  D2WSACleanup();
00BC170B                                                  .  E8 70010100                   CALL Fog.#10003                                                ;  D2CreateSocket(...);
6FF011A0                                                 |.  E8 69AD0000                   |CALL <JMP.&Fog.#10004>                                        ;  D2CreateSocket(...);
6FF01F3F                                                  .  E8 C49F0000                   CALL <JMP.&Fog.#10005>                                         ;  D2DestroySocket(D2Socket* pSocket);
6FF02173                                                  .  E8 A89D0000                   CALL <JMP.&Fog.#10006>                                         ;  D2SocketRecive(D2Socket* pSocket, void* pBuffer, size_t nSize);
6FF021E9                                                  .  E8 089D0000                   CALL <JMP.&Fog.#10007>                                         ;  D2SocketSend(D2Socket* pSocket, void* pData, size_t nSize);
6FF02134                                                  .  E8 ED9D0000                   CALL <JMP.&Fog.#10008>                                         ;  D2SocketSelect(D2Socket* pSocket);
00BC1330                                                 |.  E8 8B090100                   CALL Fog.#10009                                                ;  D2SocketQuickSend(D2Socket* pSocket, void* pData, size_t nSize);
00BC130C                                                 |.  E8 FF090100                   CALL Fog.#10010                                                ;  D2SocketEnterSync(D2Socket* pSocket);
00BC133D                                                 |.  E8 DE090100                   CALL Fog.#10011                                                ;  D2SocketLeaveSync(D2Socket* pSocket);
6FF0223F                                                 |.  E8 BE9C0000                   CALL <JMP.&Fog.#10012>                                         ;  D2SocketGetPeerName(D2Socket* pSocket, char* szBuffer, size_t nSize);
00BCC9E5                                                 |> \E8 76540000                   CALL Fog.#10013                                                ;  D2SocketGetIP();
Fog.#10014 00BD1F80                                      /$  56                            PUSH ESI                                                       ;  D2SetIP(in_addr dwAddress);
Fog.#10015 00BD1FE0                                      /$  81EC A0010000                 SUB ESP,1A0                                                    ;  D2GetIP(char* szIP);
00BC15DE                                                  .  E8 DD090100                   CALL Fog.#10016                                                ;  D2GetSocketError(D2Socket* pSocket, int* nError, int* nWSAError);
6FF014D9                                                 |.  E8 1EAA0000                   CALL <JMP.&Fog.#10017>                                         ;  D2SocketIOCTL(D2Socket* pSocket);
And again code from somewhere else hidden, this time the memory management system (which has been fully replicated, source available on request):

Code: Select all

D2 Memory Pool System
Fog.#10142 - BOOL __cdecl D2InitalizeMemoryManager(D2PoolManagerStrc** ppManager, const char* szName, size_t nSize, size_t nUnused);
Fog.#10143 - void __cdecl D2DeleteMemoryManager(D2MemoryManager* pManager);



#define MAX_POOL_NAME 32
#define MAX_POOLS 40
#define MAX_MANAGERS 8
#define MAX_POOL_OVERFLOW 1023

struct D2PoolBlockStrc				//sizeof 0x18
{
	BYTE* pCommit;					//+00
	DWORD* pUsage;					//+04
	size_t nBlocks;					//+08
	D2PoolBlockStrc* pPrev;			//+0C
	D2PoolBlockStrc* pNext;			//+10
	D2PoolStrc* pPool;				//+14
};

struct D2PoolStrc				//sizeof 0x30
{
	CRITICAL_SECTION pSync;		//+00
	size_t nBlockSize;			//+18
	size_t nBlocks;				//+1C
	size_t nSize;				//+20
	size_t nAllocBlock;			//+24
	D2PoolBlockStrc* pBlocks;	//+28
	D2PoolBlockStrc* pTail;		//+2C	
};

struct D2PoolBlockEntryStrc		//sizeof 0x8
{
	D2PoolBlockStrc* pBlock;	//+00
	void* pCommit;				//+04
};

struct D2PoolManagerStrc					//sizeof 0x17CC	
{
	DWORD dw;								//+00 - related to pool count..
	CRITICAL_SECTION pSync;					//+04
	size_t nPools;							//+1C
	D2PoolStrc pPools[MAX_POOLS];			//+20
	size_t nBlocks;							//+7A0
	size_t nTotalBlocks;					//+7A4
	D2PoolBlockEntryStrc* pBlocks;			//+7A8
	BYTE* pOverflow[MAX_POOL_OVERFLOW];		//+7AC
	DWORD dwMemory;							//+17A8
	char szName[MAX_POOL_NAME];				//+17AC	
};

struct D2MemoryManagerStrc						//sizeof 0xBEA4
{
	BOOL bInit;									//+00
	CRITICAL_SECTION pSync;						//+04
	D2PoolManagerStrc pManagers[MAX_MANAGERS];	//+1C
	size_t nManagers;							//+BE7C
	size_t nManagerIndex[8];					//+BE80
	size_t nFreeManagers;						//+BEA0
};

gpMemoryManager - Fog.0x6FF7AF00(1.10)
From this you'll notice, there a) isn't any real difference between the two allocators, and b) they technically aren't split between client and server, but rather arena specific and default arena (still easier to call them client and server however). In terms of naming, the manager should really just be an arena (I'm just too lazy to change it):

Code: Select all

/* 
	Date: Sun Jan 17 07:39:55 2010
	Author: Necrolis
	Function: SYNC_EnterSection
	Address: Fog.#10050
	Comments:
*/

void __fastcall SYNC_EnterSection(CRITICAL_SECTION* pSection, size_t nLine = __LINE__)

/* 
	Date: Sun Jan 17 07:40:06 2010
	Author: Necrolis
	Function: SYNC_LeaveSection
	Address: Fog.#10051
	Comments:
*/

void __fastcall SYNC_LeaveSection(CRITICAL_SECTION* pSection, size_t nLine = __LINE__)

/* 
	Date: Sun Aug 15 17:00:48 2010
	Author: Necrolis
	Function: MEMORY_GetBit
	Address: fog.#10252
	Comments:
*/

size_t __fastcall MEMORY_GetBit(DWORD dwScan)

/* 
	Date: Mon Dec 28 00:11:32 2009
	Author: Necrolis
	Function: MEMORY_CAlloc
	Address: Fog.#10042
	Comments:
*/

void* __fastcall MEMORY_CAlloc(size_t nSize, const char* szFile = __FILE__, const size_t nLine = __LINE__)
/* 
	Date: Mon Dec 28 00:11:47 2009
	Author: Necrolis
	Function: MEMORY_SAlloc
	Address: Fog.#10045
	Comments:
*/

void* __fastcall MEMORY_SAlloc(D2PoolManagerStrc* pManager, size_t nSize, const char* szFile = __FILE__, const size_t nLine = __LINE__)

/* 
	Date: Thu Jan 07 17:45:30 2010
	Author: Necrolis
	Function: MEMORY_CFree
	Address: Fog.#10043
	Comments:
*/

BOOL __fastcall MEMORY_CFree(void* pMemory, const char* szFile = __FILE__, const size_t nLine = __LINE__)

/* 
	Date: Thu Jan 07 17:45:51 2010
	Author: Necrolis
	Function: MEMORY_SFree
	Address: Fog.#10046
	Comments:
*/

BOOL __fastcall MEMORY_SFree(D2PoolManagerStrc* pManager, void* pMemory, const char* szFile = __FILE__, const size_t nLine = __LINE__)

/* 
	Date: Thu Jan 07 17:48:10 2010
	Author: Necrolis
	Function: MEMORY_CRealloc
	Address: Fog.#10044
	Comments:
*/

void* __fastcall MEMORY_CRealloc(void* pMemory, size_t nSize, const char* szFile = __FILE__, const size_t nLine = __LINE__)
/* 
	Date: Thu Jan 07 17:49:18 2010
	Author: Necrolis
	Function: MEMORY_SRealloc
	Address: Fog.#10047
	Comments:
*/

void* __fastcall MEMORY_SRealloc(D2PoolManagerStrc* pManager, void* pMemory, size_t nSize, const char* szFile = __FILE__, const size_t nLine = __LINE__)

/* 
	Date: Mon Jan 11 16:34:49 2010
	Author: Necrolis
	Function: MEMORY_SetPoolOverride
	Address: Fog.#10041
	Comments:
*/

void __fastcall MEMORY_SetPoolOverride(BOOL bAllow)
/* 
	Date: Tue Dec 29 01:09:28 2009
	Author: Necrolis
	Function: MEMORY_Initialize
	Address: Fog.#10142
	Comments: WTF?!?! this ALWAYS returns false!!!!
*/

BOOL __cdecl MEMORY_Initialize(D2PoolManagerStrc** ppManager, const char* szName, size_t nSize, DWORD fFlags)
/* 
	Date: Tue Dec 29 01:43:23 2009
	Author: Necrolis
	Function: MEMORY_DeleteManager
	Address: Fog.#10143
	Comments:
*/

void __cdecl MEMORY_DeleteManager(D2PoolManagerStrc* pManager)
/* 
	Date: Tue Dec 29 01:49:41 2009
	Author: Necrolis
	Function: MEMORY_GetUsage
	Address: Fog.#10147
	Comments:
*/

DWORD __cdecl MEMORY_GetUsage(D2PoolManagerStrc* pManager)
/* 
	Date: Tue Dec 29 01:52:11 2009
	Author: Necrolis
	Function: MEMORY_SetAllocMode
	Address: Fog.#10145
	Comments:
*/

void __cdecl MEMORY_SetAllocMode(D2PoolManagerStrc* pManager, BOOL bFreePoolAlloc)
/* 
	Date: Sat Jan 09 11:35:29 2010
	Author: Necrolis
	Function: MEMORY_FlushManager
	Address: Fog.#10144
	Comments:
*/

void __cdecl MEMORY_FlushManager(D2PoolManagerStrc* pManager)
/* 
	Date: Sun Dec 27 02:59:03 2009
	Author: Necrolis
	Function: SYNC_ValidateSection
	Address: Fog.#10251
	Comments: slightly changed: moved the error to the enter/leave funcs
			  lock count can no longer be checked, due to a change in the way it
			  works from win server 2003 sp1
*/

eSectionErrors __fastcall SYNC_ValidateSection(CRITICAL_SECTION* pSection)
I have other notes that need to be dug up.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Fog Ordinals

Post by kidpaddle94 » Fri Mar 25, 2016 6:09 pm

Necrolis" wrote:Fog.#10265 is version specific AFAIK (1.11+), its a non-inline version of the _ReturnAddress() intrinsic.
Hmm, you're right, checked on all versions after 1.11b and it's there, but on previous versions it's missing. Seems to be inlined in a few places.
My old notes for the QSocket stuff (circa 4 years ago??):
This clears the few missing members I had in my structure, which I called NetData when looking into it. Will be updating main list soon, thanks for the contribution.
And again code from somewhere else hidden, this time the memory management system (which has been fully replicated, source available on request)
I surely would like to have this, as I've been meaning to look into the memory pool code myself.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: Fog Ordinals

Post by Necrolis » Fri Mar 25, 2016 7:33 pm

kidpaddle94" wrote:
My old notes for the QSocket stuff (circa 4 years ago??):
This clears the few missing members I had in my structure, which I called NetData when looking into it. Will be updating main list soon, thanks for the contribution.
Should be SafeSocket actually, its QServer that used for game networking (which also has a QSocket)
kidpaddle94" wrote:
And again code from somewhere else hidden, this time the memory management system (which has been fully replicated, source available on request)
I surely would like to have this, as I've been meaning to look into the memory pool code myself.
I have gotten it shifted into CE (thanks Kingpin): viewtopic.php?f=8&t=54165&p=440881#p440881
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: Fog Ordinals

Post by kingpin » Fri Mar 25, 2016 8:05 pm

Some fog's not mentioned in topic:

Code: Select all

static D2Fog2727		FogAssert				= (D2Fog2727)			(FogOffset + 0x0ED30);	// D2Fog #10023 
static D2Fog2728		FogPacketAssert			= (D2Fog2728)			(FogOffset + 0x0ED60);	// D2Fog #10024 
static D2Fog2729		D2SetWindowState		= (D2Fog2729)			(FogOffset + 0x0ED90);	// D2Fog #10025 
static D2Fog273C		FogMemPoolAlloc		= (D2Fog273C)			(FogOffset + 0x0BFB0);  // D2Fog #10044 
static D2Fog280C		FogGetBit				= (D2Fog280C)			(FogOffset + 0x039A0);  // D2Fog #10252 

CDECL_FUNCTION(void,			D2Fog2727,			(const char* ptMessage, const char* ptLocation, DWORD line));
CDECL_FUNCTION(void,			D2Fog2728,			(const char* ptMessage, const char* ptLocation, DWORD line));
STDCALL_FUNCTION(void,			D2Fog2729,			(BOOL bMinimized, LPCSTR lpszErrFile, DWORD ErrLine));
STDCALL_FUNCTION(size_t,		D2Fog280C,			(DWORD dwScan));
FASTCALL_FUNCTION(void*,		D2Fog273C,			(D2PoolManager* pMemPool, size_t nSize, LPCSTR lpszErrFile, DWORD ErrLine, DWORD null));

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Fog Ordinals

Post by devurandom » Mon Dec 17, 2018 5:48 pm

Code: Select all

Fog.#10110
BOOL __fastcall FogReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
Fog.#10111
 BOOL __fastcall FogWriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
Fog.#10112 
DWORD __fastcall FogSetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
Fog.#10137
WORD __stdcall GetNameOffset(const char* szCharName)
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

Post Reply

Return to “Code Editing”