Blob Blame History Raw
#ifndef _NT_CRC32_H_
#define _NT_CRC32_H_

#include <psxtypes/psxtypes.h>

#define NTAPI_CRC32_POLY  0xd35a6b40

#define NTAPI_CRC32_TABLE { \
	0x00000000, 0xd2fcdf96, 0x034d69ad, 0xd1b1b63b, \
	0x069ad35a, 0xd4660ccc, 0x05d7baf7, 0xd72b6561, \
	0x0d35a6b4, 0xdfc97922, 0x0e78cf19, 0xdc84108f, \
	0x0baf75ee, 0xd953aa78, 0x08e21c43, 0xda1ec3d5, \
	0x1a6b4d68, 0xc89792fe, 0x192624c5, 0xcbdafb53, \
	0x1cf19e32, 0xce0d41a4, 0x1fbcf79f, 0xcd402809, \
	0x175eebdc, 0xc5a2344a, 0x14138271, 0xc6ef5de7, \
	0x11c43886, 0xc338e710, 0x1289512b, 0xc0758ebd, \
	0x34d69ad0, 0xe62a4546, 0x379bf37d, 0xe5672ceb, \
	0x324c498a, 0xe0b0961c, 0x31012027, 0xe3fdffb1, \
	0x39e33c64, 0xeb1fe3f2, 0x3aae55c9, 0xe8528a5f, \
	0x3f79ef3e, 0xed8530a8, 0x3c348693, 0xeec85905, \
	0x2ebdd7b8, 0xfc41082e, 0x2df0be15, 0xff0c6183, \
	0x282704e2, 0xfadbdb74, 0x2b6a6d4f, 0xf996b2d9, \
	0x2388710c, 0xf174ae9a, 0x20c518a1, 0xf239c737, \
	0x2512a256, 0xf7ee7dc0, 0x265fcbfb, 0xf4a3146d, \
	0x69ad35a0, 0xbb51ea36, 0x6ae05c0d, 0xb81c839b, \
	0x6f37e6fa, 0xbdcb396c, 0x6c7a8f57, 0xbe8650c1, \
	0x64989314, 0xb6644c82, 0x67d5fab9, 0xb529252f, \
	0x6202404e, 0xb0fe9fd8, 0x614f29e3, 0xb3b3f675, \
	0x73c678c8, 0xa13aa75e, 0x708b1165, 0xa277cef3, \
	0x755cab92, 0xa7a07404, 0x7611c23f, 0xa4ed1da9, \
	0x7ef3de7c, 0xac0f01ea, 0x7dbeb7d1, 0xaf426847, \
	0x78690d26, 0xaa95d2b0, 0x7b24648b, 0xa9d8bb1d, \
	0x5d7baf70, 0x8f8770e6, 0x5e36c6dd, 0x8cca194b, \
	0x5be17c2a, 0x891da3bc, 0x58ac1587, 0x8a50ca11, \
	0x504e09c4, 0x82b2d652, 0x53036069, 0x81ffbfff, \
	0x56d4da9e, 0x84280508, 0x5599b333, 0x87656ca5, \
	0x4710e218, 0x95ec3d8e, 0x445d8bb5, 0x96a15423, \
	0x418a3142, 0x9376eed4, 0x42c758ef, 0x903b8779, \
	0x4a2544ac, 0x98d99b3a, 0x49682d01, 0x9b94f297, \
	0x4cbf97f6, 0x9e434860, 0x4ff2fe5b, 0x9d0e21cd, \
	0xd35a6b40, 0x01a6b4d6, 0xd01702ed, 0x02ebdd7b, \
	0xd5c0b81a, 0x073c678c, 0xd68dd1b7, 0x04710e21, \
	0xde6fcdf4, 0x0c931262, 0xdd22a459, 0x0fde7bcf, \
	0xd8f51eae, 0x0a09c138, 0xdbb87703, 0x0944a895, \
	0xc9312628, 0x1bcdf9be, 0xca7c4f85, 0x18809013, \
	0xcfabf572, 0x1d572ae4, 0xcce69cdf, 0x1e1a4349, \
	0xc404809c, 0x16f85f0a, 0xc749e931, 0x15b536a7, \
	0xc29e53c6, 0x10628c50, 0xc1d33a6b, 0x132fe5fd, \
	0xe78cf190, 0x35702e06, 0xe4c1983d, 0x363d47ab, \
	0xe11622ca, 0x33eafd5c, 0xe25b4b67, 0x30a794f1, \
	0xeab95724, 0x384588b2, 0xe9f43e89, 0x3b08e11f, \
	0xec23847e, 0x3edf5be8, 0xef6eedd3, 0x3d923245, \
	0xfde7bcf8, 0x2f1b636e, 0xfeaad555, 0x2c560ac3, \
	0xfb7d6fa2, 0x2981b034, 0xf830060f, 0x2accd999, \
	0xf0d21a4c, 0x222ec5da, 0xf39f73e1, 0x2163ac77, \
	0xf648c916, 0x24b41680, 0xf505a0bb, 0x27f97f2d, \
	0xbaf75ee0, 0x680b8176, 0xb9ba374d, 0x6b46e8db, \
	0xbc6d8dba, 0x6e91522c, 0xbf20e417, 0x6ddc3b81, \
	0xb7c2f854, 0x653e27c2, 0xb48f91f9, 0x66734e6f, \
	0xb1582b0e, 0x63a4f498, 0xb21542a3, 0x60e99d35, \
	0xa09c1388, 0x7260cc1e, 0xa3d17a25, 0x712da5b3, \
	0xa606c0d2, 0x74fa1f44, 0xa54ba97f, 0x77b776e9, \
	0xada9b53c, 0x7f556aaa, 0xaee4dc91, 0x7c180307, \
	0xab336666, 0x79cfb9f0, 0xa87e0fcb, 0x7a82d05d, \
	0x8e21c430, 0x5cdd1ba6, 0x8d6cad9d, 0x5f90720b, \
	0x88bb176a, 0x5a47c8fc, 0x8bf67ec7, 0x590aa151, \
	0x83146284, 0x51e8bd12, 0x80590b29, 0x52a5d4bf, \
	0x858eb1de, 0x57726e48, 0x86c3d873, 0x543f07e5, \
	0x944a8958, 0x46b656ce, 0x9707e0f5, 0x45fb3f63, \
	0x92d05a02, 0x402c8594, 0x919d33af, 0x4361ec39, \
	0x997f2fec, 0x4b83f07a, 0x9a324641, 0x48ce99d7, \
	0x9fe5fcb6, 0x4d192320, 0x9ca8951b, 0x4e544a8d \
}


typedef struct _ntapi_hashed_symbol {
	uint32_t	crc32_hash;
	uint32_t	ordinal;
} ntapi_hashed_symbol;


typedef uint32_t __cdecl ntapi_tt_buffer_crc32(
	uint32_t	prev_hash,
	const void *	buffer,
	size_t		size);


typedef uint32_t __cdecl ntapi_tt_mbstr_crc32(
	const void * str);


typedef const uint32_t * __cdecl ntapi_tt_crc32_table(void);


#endif