From 0de847bb4832c201233c87fa37867b9d89f0e8c8 Mon Sep 17 00:00:00 2001
From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com>
Date: Fri, 27 May 2022 01:13:14 +0100
Subject: rename project folder (:tf: commit log)
---
LauncherInjector/LauncherInjector.vcxproj | 110 -
LauncherInjector/LauncherInjector.vcxproj.filters | 37 -
LauncherInjector/main.cpp | 453 --
LauncherInjector/ns_icon.ico | Bin 1441814 -> 0 bytes
LauncherInjector/ns_startup_args.txt | 1 -
LauncherInjector/ns_startup_args_dedi.txt | 1 -
LauncherInjector/resource1.h | 16 -
LauncherInjector/resources.rc | 111 -
NorthstarDLL/ExploitFixes.cpp | 415 ++
NorthstarDLL/ExploitFixes.h | 4 +
NorthstarDLL/ExploitFixes_UTF8Parser.h | 175 +
NorthstarDLL/NSMem.h | 211 +
NorthstarDLL/NorthstarDLL.vcxproj | 668 ++
NorthstarDLL/NorthstarDLL.vcxproj.filters | 1774 +++++
NorthstarDLL/audio.cpp | 502 ++
NorthstarDLL/audio.h | 48 +
NorthstarDLL/audio_asm.asm | 8 +
NorthstarDLL/bansystem.cpp | 107 +
NorthstarDLL/bansystem.h | 18 +
NorthstarDLL/bitbuf.h | 1148 +++
NorthstarDLL/bits.cpp | 46 +
NorthstarDLL/bits.h | 10 +
NorthstarDLL/buildainfile.cpp | 384 +
NorthstarDLL/chatcommand.cpp | 37 +
NorthstarDLL/clientauthhooks.cpp | 44 +
NorthstarDLL/clientchathooks.cpp | 87 +
NorthstarDLL/clientruihooks.cpp | 22 +
NorthstarDLL/clientvideooverrides.cpp | 36 +
NorthstarDLL/color.h | 135 +
NorthstarDLL/concommand.cpp | 151 +
NorthstarDLL/concommand.h | 139 +
NorthstarDLL/configurables.cpp | 38 +
NorthstarDLL/configurables.h | 7 +
NorthstarDLL/convar.cpp | 497 ++
NorthstarDLL/convar.h | 193 +
NorthstarDLL/crashhandler.cpp | 216 +
NorthstarDLL/crashhandler.h | 4 +
NorthstarDLL/cvar.cpp | 31 +
NorthstarDLL/cvar.h | 43 +
NorthstarDLL/debugoverlay.cpp | 151 +
NorthstarDLL/dedicated.cpp | 296 +
NorthstarDLL/dedicated.h | 3 +
NorthstarDLL/dedicatedmaterialsystem.cpp | 43 +
NorthstarDLL/demofixes.cpp | 27 +
NorthstarDLL/dllmain.cpp | 169 +
NorthstarDLL/filesystem.cpp | 177 +
NorthstarDLL/filesystem.h | 77 +
NorthstarDLL/hooks.cpp | 338 +
NorthstarDLL/hooks.h | 280 +
NorthstarDLL/hookutils.cpp | 44 +
NorthstarDLL/hookutils.h | 22 +
NorthstarDLL/host.cpp | 71 +
NorthstarDLL/hoststate.cpp | 99 +
NorthstarDLL/hoststate.h | 45 +
NorthstarDLL/include/MinHook.h | 186 +
NorthstarDLL/include/MinHook.x64.lib | Bin 0 -> 32400 bytes
.../include/crypto/__DECC_INCLUDE_EPILOGUE.H | 16 +
.../include/crypto/__DECC_INCLUDE_PROLOGUE.H | 20 +
NorthstarDLL/include/crypto/aes_platform.h | 450 ++
NorthstarDLL/include/crypto/aria.h | 51 +
NorthstarDLL/include/crypto/asn1.h | 149 +
NorthstarDLL/include/crypto/asn1_dsa.h | 24 +
NorthstarDLL/include/crypto/asn1err.h | 27 +
NorthstarDLL/include/crypto/async.h | 19 +
NorthstarDLL/include/crypto/asyncerr.h | 27 +
NorthstarDLL/include/crypto/bioerr.h | 27 +
NorthstarDLL/include/crypto/bn.h | 117 +
NorthstarDLL/include/crypto/bn_conf.h | 29 +
NorthstarDLL/include/crypto/bn_conf.h.in | 28 +
NorthstarDLL/include/crypto/bn_dh.h | 43 +
NorthstarDLL/include/crypto/bn_srp.h | 32 +
NorthstarDLL/include/crypto/bnerr.h | 27 +
NorthstarDLL/include/crypto/buffererr.h | 27 +
NorthstarDLL/include/crypto/chacha.h | 43 +
NorthstarDLL/include/crypto/cmll_platform.h | 51 +
NorthstarDLL/include/crypto/cmperr.h | 30 +
NorthstarDLL/include/crypto/cmserr.h | 30 +
NorthstarDLL/include/crypto/comperr.h | 30 +
NorthstarDLL/include/crypto/conferr.h | 27 +
NorthstarDLL/include/crypto/crmferr.h | 30 +
NorthstarDLL/include/crypto/cryptlib.h | 39 +
NorthstarDLL/include/crypto/cryptoerr.h | 27 +
NorthstarDLL/include/crypto/cterr.h | 30 +
NorthstarDLL/include/crypto/ctype.h | 83 +
NorthstarDLL/include/crypto/decoder.h | 42 +
NorthstarDLL/include/crypto/decodererr.h | 27 +
NorthstarDLL/include/crypto/des_platform.h | 35 +
NorthstarDLL/include/crypto/dh.h | 61 +
NorthstarDLL/include/crypto/dherr.h | 30 +
NorthstarDLL/include/crypto/dsa.h | 48 +
NorthstarDLL/include/crypto/dsaerr.h | 30 +
NorthstarDLL/include/crypto/dso_conf.h | 18 +
NorthstarDLL/include/crypto/dso_conf.h.in | 33 +
NorthstarDLL/include/crypto/ec.h | 100 +
NorthstarDLL/include/crypto/ecerr.h | 30 +
NorthstarDLL/include/crypto/ecx.h | 150 +
NorthstarDLL/include/crypto/encoder.h | 14 +
NorthstarDLL/include/crypto/encodererr.h | 27 +
NorthstarDLL/include/crypto/engine.h | 20 +
NorthstarDLL/include/crypto/engineerr.h | 30 +
NorthstarDLL/include/crypto/err.h | 20 +
NorthstarDLL/include/crypto/ess.h | 76 +
NorthstarDLL/include/crypto/esserr.h | 27 +
NorthstarDLL/include/crypto/evp.h | 944 +++
NorthstarDLL/include/crypto/evperr.h | 27 +
NorthstarDLL/include/crypto/httperr.h | 27 +
NorthstarDLL/include/crypto/lhash.h | 16 +
NorthstarDLL/include/crypto/md32_common.h | 256 +
NorthstarDLL/include/crypto/modes.h | 223 +
NorthstarDLL/include/crypto/objects.h | 12 +
NorthstarDLL/include/crypto/objectserr.h | 27 +
NorthstarDLL/include/crypto/ocsperr.h | 30 +
NorthstarDLL/include/crypto/pem.h | 51 +
NorthstarDLL/include/crypto/pemerr.h | 27 +
NorthstarDLL/include/crypto/pkcs12err.h | 27 +
NorthstarDLL/include/crypto/pkcs7.h | 19 +
NorthstarDLL/include/crypto/pkcs7err.h | 27 +
NorthstarDLL/include/crypto/poly1305.h | 46 +
NorthstarDLL/include/crypto/ppc_arch.h | 28 +
NorthstarDLL/include/crypto/punycode.h | 24 +
NorthstarDLL/include/crypto/rand.h | 128 +
NorthstarDLL/include/crypto/rand_pool.h | 109 +
NorthstarDLL/include/crypto/randerr.h | 27 +
NorthstarDLL/include/crypto/rsa.h | 129 +
NorthstarDLL/include/crypto/rsaerr.h | 27 +
NorthstarDLL/include/crypto/security_bits.h | 16 +
NorthstarDLL/include/crypto/sha.h | 22 +
NorthstarDLL/include/crypto/siphash.h | 50 +
NorthstarDLL/include/crypto/siv.h | 33 +
NorthstarDLL/include/crypto/sm2.h | 86 +
NorthstarDLL/include/crypto/sm2err.h | 49 +
NorthstarDLL/include/crypto/sm4.h | 38 +
NorthstarDLL/include/crypto/sparc_arch.h | 122 +
NorthstarDLL/include/crypto/sparse_array.h | 92 +
NorthstarDLL/include/crypto/store.h | 21 +
NorthstarDLL/include/crypto/storeerr.h | 27 +
NorthstarDLL/include/crypto/tserr.h | 30 +
NorthstarDLL/include/crypto/types.h | 29 +
NorthstarDLL/include/crypto/uierr.h | 27 +
NorthstarDLL/include/crypto/x509.h | 367 +
NorthstarDLL/include/crypto/x509err.h | 27 +
NorthstarDLL/include/crypto/x509v3err.h | 27 +
NorthstarDLL/include/httplib.h | 7832 ++++++++++++++++++++
.../include/internal/__DECC_INCLUDE_EPILOGUE.H | 16 +
.../include/internal/__DECC_INCLUDE_PROLOGUE.H | 20 +
NorthstarDLL/include/internal/asn1.h | 16 +
NorthstarDLL/include/internal/bio.h | 91 +
NorthstarDLL/include/internal/comp.h | 12 +
NorthstarDLL/include/internal/conf.h | 31 +
NorthstarDLL/include/internal/constant_time.h | 421 ++
NorthstarDLL/include/internal/core.h | 66 +
NorthstarDLL/include/internal/cryptlib.h | 261 +
NorthstarDLL/include/internal/dane.h | 104 +
NorthstarDLL/include/internal/deprecated.h | 30 +
NorthstarDLL/include/internal/der.h | 88 +
NorthstarDLL/include/internal/dso.h | 164 +
NorthstarDLL/include/internal/dsoerr.h | 48 +
NorthstarDLL/include/internal/endian.h | 51 +
NorthstarDLL/include/internal/err.h | 16 +
NorthstarDLL/include/internal/ffc.h | 212 +
NorthstarDLL/include/internal/ktls.h | 404 +
NorthstarDLL/include/internal/namemap.h | 43 +
NorthstarDLL/include/internal/nelem.h | 15 +
NorthstarDLL/include/internal/numbers.h | 85 +
NorthstarDLL/include/internal/o_dir.h | 53 +
NorthstarDLL/include/internal/packet.h | 902 +++
NorthstarDLL/include/internal/param_build_set.h | 46 +
NorthstarDLL/include/internal/passphrase.h | 122 +
NorthstarDLL/include/internal/property.h | 93 +
NorthstarDLL/include/internal/propertyerr.h | 43 +
NorthstarDLL/include/internal/provider.h | 117 +
NorthstarDLL/include/internal/refcount.h | 178 +
NorthstarDLL/include/internal/sha3.h | 54 +
NorthstarDLL/include/internal/sizes.h | 22 +
NorthstarDLL/include/internal/sm3.h | 39 +
NorthstarDLL/include/internal/sockets.h | 175 +
NorthstarDLL/include/internal/sslconf.h | 21 +
NorthstarDLL/include/internal/symhacks.h | 27 +
NorthstarDLL/include/internal/thread_once.h | 151 +
NorthstarDLL/include/internal/tlsgroups.h | 50 +
NorthstarDLL/include/internal/tsan_assist.h | 144 +
NorthstarDLL/include/internal/unicode.h | 31 +
NorthstarDLL/include/libcrypto_static.lib | Bin 0 -> 35832382 bytes
NorthstarDLL/include/libcurl/include/curl/curl.h | 3103 ++++++++
.../include/libcurl/include/curl/curlver.h | 77 +
NorthstarDLL/include/libcurl/include/curl/easy.h | 123 +
.../include/libcurl/include/curl/mprintf.h | 50 +
NorthstarDLL/include/libcurl/include/curl/multi.h | 457 ++
.../include/libcurl/include/curl/options.h | 68 +
.../include/libcurl/include/curl/stdcheaders.h | 33 +
NorthstarDLL/include/libcurl/include/curl/system.h | 504 ++
.../include/libcurl/include/curl/typecheck-gcc.h | 707 ++
NorthstarDLL/include/libcurl/include/curl/urlapi.h | 145 +
NorthstarDLL/include/libcurl/lib/libcurl_a.lib | Bin 0 -> 2140640 bytes
NorthstarDLL/include/libssl_static.lib | Bin 0 -> 4851208 bytes
.../include/openssl/__DECC_INCLUDE_EPILOGUE.H | 22 +
.../include/openssl/__DECC_INCLUDE_PROLOGUE.H | 26 +
NorthstarDLL/include/openssl/aes.h | 111 +
NorthstarDLL/include/openssl/asn1.h | 1128 +++
NorthstarDLL/include/openssl/asn1.h.in | 961 +++
NorthstarDLL/include/openssl/asn1_mac.h | 10 +
NorthstarDLL/include/openssl/asn1err.h | 140 +
NorthstarDLL/include/openssl/asn1t.h | 946 +++
NorthstarDLL/include/openssl/asn1t.h.in | 923 +++
NorthstarDLL/include/openssl/async.h | 96 +
NorthstarDLL/include/openssl/asyncerr.h | 29 +
NorthstarDLL/include/openssl/bio.h | 884 +++
NorthstarDLL/include/openssl/bio.h.in | 861 +++
NorthstarDLL/include/openssl/bioerr.h | 65 +
NorthstarDLL/include/openssl/blowfish.h | 78 +
NorthstarDLL/include/openssl/bn.h | 583 ++
NorthstarDLL/include/openssl/bnerr.h | 46 +
NorthstarDLL/include/openssl/buffer.h | 62 +
NorthstarDLL/include/openssl/buffererr.h | 25 +
NorthstarDLL/include/openssl/camellia.h | 117 +
NorthstarDLL/include/openssl/cast.h | 71 +
NorthstarDLL/include/openssl/cmac.h | 52 +
NorthstarDLL/include/openssl/cmp.h | 592 ++
NorthstarDLL/include/openssl/cmp.h.in | 473 ++
NorthstarDLL/include/openssl/cmp_util.h | 56 +
NorthstarDLL/include/openssl/cmperr.h | 112 +
NorthstarDLL/include/openssl/cms.h | 493 ++
NorthstarDLL/include/openssl/cms.h.in | 395 +
NorthstarDLL/include/openssl/cmserr.h | 122 +
NorthstarDLL/include/openssl/comp.h | 59 +
NorthstarDLL/include/openssl/comperr.h | 31 +
NorthstarDLL/include/openssl/conf.h | 211 +
NorthstarDLL/include/openssl/conf.h.in | 174 +
NorthstarDLL/include/openssl/conf_api.h | 46 +
NorthstarDLL/include/openssl/conferr.h | 51 +
NorthstarDLL/include/openssl/configuration.h | 133 +
NorthstarDLL/include/openssl/configuration.h.in | 69 +
NorthstarDLL/include/openssl/conftypes.h | 44 +
NorthstarDLL/include/openssl/core.h | 233 +
NorthstarDLL/include/openssl/core_dispatch.h | 943 +++
NorthstarDLL/include/openssl/core_names.h | 556 ++
NorthstarDLL/include/openssl/core_object.h | 41 +
NorthstarDLL/include/openssl/crmf.h | 227 +
NorthstarDLL/include/openssl/crmf.h.in | 180 +
NorthstarDLL/include/openssl/crmferr.h | 50 +
NorthstarDLL/include/openssl/crypto.h | 556 ++
NorthstarDLL/include/openssl/crypto.h.in | 533 ++
NorthstarDLL/include/openssl/cryptoerr.h | 46 +
NorthstarDLL/include/openssl/cryptoerr_legacy.h | 1466 ++++
NorthstarDLL/include/openssl/ct.h | 573 ++
NorthstarDLL/include/openssl/ct.h.in | 525 ++
NorthstarDLL/include/openssl/cterr.h | 45 +
NorthstarDLL/include/openssl/decoder.h | 133 +
NorthstarDLL/include/openssl/decodererr.h | 28 +
NorthstarDLL/include/openssl/des.h | 211 +
NorthstarDLL/include/openssl/dh.h | 328 +
NorthstarDLL/include/openssl/dherr.h | 57 +
NorthstarDLL/include/openssl/dsa.h | 275 +
NorthstarDLL/include/openssl/dsaerr.h | 43 +
NorthstarDLL/include/openssl/dtls1.h | 57 +
NorthstarDLL/include/openssl/e_os2.h | 305 +
NorthstarDLL/include/openssl/ebcdic.h | 39 +
NorthstarDLL/include/openssl/ec.h | 1566 ++++
NorthstarDLL/include/openssl/ecdh.h | 10 +
NorthstarDLL/include/openssl/ecdsa.h | 10 +
NorthstarDLL/include/openssl/ecerr.h | 102 +
NorthstarDLL/include/openssl/encoder.h | 124 +
NorthstarDLL/include/openssl/encodererr.h | 28 +
NorthstarDLL/include/openssl/engine.h | 832 +++
NorthstarDLL/include/openssl/engineerr.h | 63 +
NorthstarDLL/include/openssl/err.h | 492 ++
NorthstarDLL/include/openssl/err.h.in | 481 ++
NorthstarDLL/include/openssl/ess.h | 128 +
NorthstarDLL/include/openssl/ess.h.in | 81 +
NorthstarDLL/include/openssl/esserr.h | 32 +
NorthstarDLL/include/openssl/evp.h | 2170 ++++++
NorthstarDLL/include/openssl/evperr.h | 134 +
NorthstarDLL/include/openssl/fips_names.h | 60 +
NorthstarDLL/include/openssl/fipskey.h | 36 +
NorthstarDLL/include/openssl/fipskey.h.in | 35 +
NorthstarDLL/include/openssl/hmac.h | 62 +
NorthstarDLL/include/openssl/http.h | 109 +
NorthstarDLL/include/openssl/httperr.h | 55 +
NorthstarDLL/include/openssl/idea.h | 82 +
NorthstarDLL/include/openssl/kdf.h | 138 +
NorthstarDLL/include/openssl/kdferr.h | 16 +
NorthstarDLL/include/openssl/lhash.h | 288 +
NorthstarDLL/include/openssl/lhash.h.in | 263 +
NorthstarDLL/include/openssl/macros.h | 304 +
NorthstarDLL/include/openssl/md2.h | 56 +
NorthstarDLL/include/openssl/md4.h | 63 +
NorthstarDLL/include/openssl/md5.h | 62 +
NorthstarDLL/include/openssl/mdc2.h | 55 +
NorthstarDLL/include/openssl/modes.h | 219 +
NorthstarDLL/include/openssl/obj_mac.h | 5481 ++++++++++++++
NorthstarDLL/include/openssl/objects.h | 183 +
NorthstarDLL/include/openssl/objectserr.h | 28 +
NorthstarDLL/include/openssl/ocsp.h | 483 ++
NorthstarDLL/include/openssl/ocsp.h.in | 387 +
NorthstarDLL/include/openssl/ocsperr.h | 53 +
NorthstarDLL/include/openssl/opensslconf.h | 17 +
NorthstarDLL/include/openssl/opensslv.h | 114 +
NorthstarDLL/include/openssl/opensslv.h.in | 113 +
NorthstarDLL/include/openssl/ossl_typ.h | 16 +
NorthstarDLL/include/openssl/param_build.h | 63 +
NorthstarDLL/include/openssl/params.h | 160 +
NorthstarDLL/include/openssl/pem.h | 538 ++
NorthstarDLL/include/openssl/pem2.h | 19 +
NorthstarDLL/include/openssl/pemerr.h | 58 +
NorthstarDLL/include/openssl/pkcs12.h | 350 +
NorthstarDLL/include/openssl/pkcs12.h.in | 327 +
NorthstarDLL/include/openssl/pkcs12err.h | 45 +
NorthstarDLL/include/openssl/pkcs7.h | 427 ++
NorthstarDLL/include/openssl/pkcs7.h.in | 356 +
NorthstarDLL/include/openssl/pkcs7err.h | 63 +
NorthstarDLL/include/openssl/prov_ssl.h | 34 +
NorthstarDLL/include/openssl/proverr.h | 148 +
NorthstarDLL/include/openssl/provider.h | 60 +
NorthstarDLL/include/openssl/rand.h | 123 +
NorthstarDLL/include/openssl/randerr.h | 68 +
NorthstarDLL/include/openssl/rc2.h | 68 +
NorthstarDLL/include/openssl/rc4.h | 47 +
NorthstarDLL/include/openssl/rc5.h | 79 +
NorthstarDLL/include/openssl/ripemd.h | 59 +
NorthstarDLL/include/openssl/rsa.h | 604 ++
NorthstarDLL/include/openssl/rsaerr.h | 107 +
NorthstarDLL/include/openssl/safestack.h | 297 +
NorthstarDLL/include/openssl/safestack.h.in | 227 +
NorthstarDLL/include/openssl/seed.h | 113 +
NorthstarDLL/include/openssl/self_test.h | 93 +
NorthstarDLL/include/openssl/sha.h | 138 +
NorthstarDLL/include/openssl/srp.h | 285 +
NorthstarDLL/include/openssl/srp.h.in | 214 +
NorthstarDLL/include/openssl/srtp.h | 56 +
NorthstarDLL/include/openssl/ssl.h | 2585 +++++++
NorthstarDLL/include/openssl/ssl.h.in | 2513 +++++++
NorthstarDLL/include/openssl/ssl2.h | 30 +
NorthstarDLL/include/openssl/ssl3.h | 347 +
NorthstarDLL/include/openssl/sslerr.h | 343 +
NorthstarDLL/include/openssl/sslerr_legacy.h | 468 ++
NorthstarDLL/include/openssl/stack.h | 90 +
NorthstarDLL/include/openssl/store.h | 369 +
NorthstarDLL/include/openssl/storeerr.h | 49 +
NorthstarDLL/include/openssl/symhacks.h | 39 +
NorthstarDLL/include/openssl/tls1.h | 1223 +++
NorthstarDLL/include/openssl/trace.h | 312 +
NorthstarDLL/include/openssl/ts.h | 503 ++
NorthstarDLL/include/openssl/tserr.h | 67 +
NorthstarDLL/include/openssl/txt_db.h | 63 +
NorthstarDLL/include/openssl/types.h | 236 +
NorthstarDLL/include/openssl/ui.h | 407 +
NorthstarDLL/include/openssl/ui.h.in | 384 +
NorthstarDLL/include/openssl/uierr.h | 38 +
NorthstarDLL/include/openssl/whrlpool.h | 62 +
NorthstarDLL/include/openssl/x509.h | 1276 ++++
NorthstarDLL/include/openssl/x509.h.in | 1082 +++
NorthstarDLL/include/openssl/x509_vfy.h | 894 +++
NorthstarDLL/include/openssl/x509_vfy.h.in | 797 ++
NorthstarDLL/include/openssl/x509err.h | 68 +
NorthstarDLL/include/openssl/x509v3.h | 1450 ++++
NorthstarDLL/include/openssl/x509v3.h.in | 1017 +++
NorthstarDLL/include/openssl/x509v3err.h | 93 +
NorthstarDLL/include/rapidjson/allocators.h | 271 +
NorthstarDLL/include/rapidjson/document.h | 2575 +++++++
NorthstarDLL/include/rapidjson/encodedstream.h | 299 +
NorthstarDLL/include/rapidjson/encodings.h | 716 ++
NorthstarDLL/include/rapidjson/error/en.h | 74 +
NorthstarDLL/include/rapidjson/error/error.h | 155 +
NorthstarDLL/include/rapidjson/filereadstream.h | 99 +
NorthstarDLL/include/rapidjson/filewritestream.h | 104 +
NorthstarDLL/include/rapidjson/fwd.h | 151 +
.../include/rapidjson/internal/biginteger.h | 290 +
NorthstarDLL/include/rapidjson/internal/diyfp.h | 258 +
NorthstarDLL/include/rapidjson/internal/dtoa.h | 245 +
NorthstarDLL/include/rapidjson/internal/ieee754.h | 78 +
NorthstarDLL/include/rapidjson/internal/itoa.h | 304 +
NorthstarDLL/include/rapidjson/internal/meta.h | 181 +
NorthstarDLL/include/rapidjson/internal/pow10.h | 55 +
NorthstarDLL/include/rapidjson/internal/regex.h | 701 ++
NorthstarDLL/include/rapidjson/internal/stack.h | 230 +
NorthstarDLL/include/rapidjson/internal/strfunc.h | 55 +
NorthstarDLL/include/rapidjson/internal/strtod.h | 269 +
NorthstarDLL/include/rapidjson/internal/swap.h | 46 +
NorthstarDLL/include/rapidjson/istreamwrapper.h | 115 +
NorthstarDLL/include/rapidjson/memorybuffer.h | 70 +
NorthstarDLL/include/rapidjson/memorystream.h | 71 +
.../include/rapidjson/msinttypes/inttypes.h | 316 +
NorthstarDLL/include/rapidjson/msinttypes/stdint.h | 300 +
NorthstarDLL/include/rapidjson/ostreamwrapper.h | 81 +
NorthstarDLL/include/rapidjson/pointer.h | 1358 ++++
NorthstarDLL/include/rapidjson/prettywriter.h | 255 +
NorthstarDLL/include/rapidjson/rapidjson.h | 615 ++
NorthstarDLL/include/rapidjson/reader.h | 1879 +++++
NorthstarDLL/include/rapidjson/schema.h | 2006 +++++
NorthstarDLL/include/rapidjson/stream.h | 179 +
NorthstarDLL/include/rapidjson/stringbuffer.h | 117 +
NorthstarDLL/include/rapidjson/writer.h | 610 ++
NorthstarDLL/include/spdlog/async.h | 93 +
NorthstarDLL/include/spdlog/async_logger-inl.h | 92 +
NorthstarDLL/include/spdlog/async_logger.h | 68 +
NorthstarDLL/include/spdlog/cfg/argv.h | 44 +
NorthstarDLL/include/spdlog/cfg/env.h | 38 +
NorthstarDLL/include/spdlog/cfg/helpers-inl.h | 120 +
NorthstarDLL/include/spdlog/cfg/helpers.h | 29 +
NorthstarDLL/include/spdlog/common-inl.h | 82 +
NorthstarDLL/include/spdlog/common.h | 249 +
.../include/spdlog/details/backtracer-inl.h | 69 +
NorthstarDLL/include/spdlog/details/backtracer.h | 45 +
NorthstarDLL/include/spdlog/details/circular_q.h | 141 +
.../include/spdlog/details/console_globals.h | 32 +
.../include/spdlog/details/file_helper-inl.h | 147 +
NorthstarDLL/include/spdlog/details/file_helper.h | 59 +
NorthstarDLL/include/spdlog/details/fmt_helper.h | 116 +
NorthstarDLL/include/spdlog/details/log_msg-inl.h | 37 +
NorthstarDLL/include/spdlog/details/log_msg.h | 36 +
.../include/spdlog/details/log_msg_buffer-inl.h | 60 +
.../include/spdlog/details/log_msg_buffer.h | 33 +
.../include/spdlog/details/mpmc_blocking_q.h | 126 +
NorthstarDLL/include/spdlog/details/null_mutex.h | 49 +
NorthstarDLL/include/spdlog/details/os-inl.h | 589 ++
NorthstarDLL/include/spdlog/details/os.h | 118 +
.../include/spdlog/details/periodic_worker-inl.h | 49 +
.../include/spdlog/details/periodic_worker.h | 40 +
NorthstarDLL/include/spdlog/details/registry-inl.h | 313 +
NorthstarDLL/include/spdlog/details/registry.h | 115 +
.../include/spdlog/details/synchronous_factory.h | 24 +
.../include/spdlog/details/tcp_client-windows.h | 175 +
NorthstarDLL/include/spdlog/details/tcp_client.h | 146 +
.../include/spdlog/details/thread_pool-inl.h | 129 +
NorthstarDLL/include/spdlog/details/thread_pool.h | 121 +
.../include/spdlog/details/windows_include.h | 11 +
NorthstarDLL/include/spdlog/fmt/bin_to_hex.h | 216 +
.../include/spdlog/fmt/bundled/LICENSE.rst | 27 +
NorthstarDLL/include/spdlog/fmt/bundled/chrono.h | 1116 +++
NorthstarDLL/include/spdlog/fmt/bundled/color.h | 603 ++
NorthstarDLL/include/spdlog/fmt/bundled/compile.h | 701 ++
NorthstarDLL/include/spdlog/fmt/bundled/core.h | 2122 ++++++
.../include/spdlog/fmt/bundled/format-inl.h | 2801 +++++++
NorthstarDLL/include/spdlog/fmt/bundled/format.h | 3960 ++++++++++
NorthstarDLL/include/spdlog/fmt/bundled/locale.h | 64 +
NorthstarDLL/include/spdlog/fmt/bundled/os.h | 480 ++
NorthstarDLL/include/spdlog/fmt/bundled/ostream.h | 177 +
NorthstarDLL/include/spdlog/fmt/bundled/posix.h | 2 +
NorthstarDLL/include/spdlog/fmt/bundled/printf.h | 751 ++
NorthstarDLL/include/spdlog/fmt/bundled/ranges.h | 396 +
NorthstarDLL/include/spdlog/fmt/chrono.h | 20 +
NorthstarDLL/include/spdlog/fmt/fmt.h | 27 +
NorthstarDLL/include/spdlog/fmt/ostr.h | 20 +
NorthstarDLL/include/spdlog/formatter.h | 18 +
NorthstarDLL/include/spdlog/fwd.h | 14 +
NorthstarDLL/include/spdlog/logger-inl.h | 257 +
NorthstarDLL/include/spdlog/logger.h | 366 +
.../include/spdlog/pattern_formatter-inl.h | 1395 ++++
NorthstarDLL/include/spdlog/pattern_formatter.h | 126 +
NorthstarDLL/include/spdlog/sinks/android_sink.h | 119 +
.../include/spdlog/sinks/ansicolor_sink-inl.h | 145 +
NorthstarDLL/include/spdlog/sinks/ansicolor_sink.h | 118 +
NorthstarDLL/include/spdlog/sinks/base_sink-inl.h | 63 +
NorthstarDLL/include/spdlog/sinks/base_sink.h | 52 +
.../include/spdlog/sinks/basic_file_sink-inl.h | 43 +
.../include/spdlog/sinks/basic_file_sink.h | 58 +
.../include/spdlog/sinks/daily_file_sink.h | 238 +
NorthstarDLL/include/spdlog/sinks/dist_sink.h | 97 +
.../include/spdlog/sinks/dup_filter_sink.h | 90 +
.../include/spdlog/sinks/hourly_file_sink.h | 194 +
NorthstarDLL/include/spdlog/sinks/msvc_sink.h | 49 +
NorthstarDLL/include/spdlog/sinks/null_sink.h | 44 +
NorthstarDLL/include/spdlog/sinks/ostream_sink.h | 50 +
.../include/spdlog/sinks/ringbuffer_sink.h | 74 +
.../include/spdlog/sinks/rotating_file_sink-inl.h | 131 +
.../include/spdlog/sinks/rotating_file_sink.h | 78 +
NorthstarDLL/include/spdlog/sinks/sink-inl.h | 25 +
NorthstarDLL/include/spdlog/sinks/sink.h | 35 +
.../include/spdlog/sinks/stdout_color_sinks-inl.h | 38 +
.../include/spdlog/sinks/stdout_color_sinks.h | 45 +
.../include/spdlog/sinks/stdout_sinks-inl.h | 135 +
NorthstarDLL/include/spdlog/sinks/stdout_sinks.h | 87 +
NorthstarDLL/include/spdlog/sinks/syslog_sink.h | 109 +
NorthstarDLL/include/spdlog/sinks/systemd_sink.h | 103 +
NorthstarDLL/include/spdlog/sinks/tcp_sink.h | 81 +
.../include/spdlog/sinks/win_eventlog_sink.h | 276 +
.../include/spdlog/sinks/wincolor_sink-inl.h | 175 +
NorthstarDLL/include/spdlog/sinks/wincolor_sink.h | 85 +
NorthstarDLL/include/spdlog/spdlog-inl.h | 125 +
NorthstarDLL/include/spdlog/spdlog.h | 295 +
NorthstarDLL/include/spdlog/stopwatch.h | 61 +
NorthstarDLL/include/spdlog/tweakme.h | 124 +
NorthstarDLL/include/spdlog/version.h | 10 +
NorthstarDLL/keyvalues.cpp | 128 +
NorthstarDLL/languagehooks.cpp | 116 +
NorthstarDLL/latencyflex.cpp | 41 +
NorthstarDLL/localchatwriter.cpp | 447 ++
NorthstarDLL/localchatwriter.h | 72 +
NorthstarDLL/logging.cpp | 253 +
NorthstarDLL/logging.h | 4 +
NorthstarDLL/main.h | 4 +
NorthstarDLL/masterserver.cpp | 1225 +++
NorthstarDLL/masterserver.h | 153 +
NorthstarDLL/maxplayers.cpp | 681 ++
NorthstarDLL/memalloc.cpp | 74 +
NorthstarDLL/memalloc.h | 49 +
NorthstarDLL/miscclientfixes.cpp | 7 +
NorthstarDLL/misccommands.cpp | 65 +
NorthstarDLL/misccommands.h | 2 +
NorthstarDLL/miscserverfixes.cpp | 15 +
NorthstarDLL/miscserverscript.cpp | 66 +
NorthstarDLL/miscserverscript.h | 2 +
NorthstarDLL/modlocalisation.cpp | 33 +
NorthstarDLL/modmanager.cpp | 644 ++
NorthstarDLL/modmanager.h | 147 +
NorthstarDLL/ns_startup_args.txt | 1 +
NorthstarDLL/ns_startup_args_dedi.txt | 1 +
NorthstarDLL/ns_version.h | 7 +
NorthstarDLL/pch.cpp | 5 +
NorthstarDLL/pch.h | 47 +
NorthstarDLL/pdef.cpp | 117 +
NorthstarDLL/pdef.h | 4 +
NorthstarDLL/playlist.cpp | 114 +
NorthstarDLL/playlist.h | 10 +
NorthstarDLL/plugin_abi.h | 68 +
NorthstarDLL/plugins.cpp | 421 ++
NorthstarDLL/plugins.h | 17 +
NorthstarDLL/printcommand.h | 6 +
NorthstarDLL/printcommands.cpp | 173 +
NorthstarDLL/printmaps.cpp | 169 +
NorthstarDLL/printmaps.h | 2 +
NorthstarDLL/r2client.cpp | 20 +
NorthstarDLL/r2client.h | 11 +
NorthstarDLL/r2engine.cpp | 23 +
NorthstarDLL/r2engine.h | 102 +
NorthstarDLL/r2server.cpp | 21 +
NorthstarDLL/r2server.h | 19 +
NorthstarDLL/rpakfilesystem.cpp | 218 +
NorthstarDLL/rpakfilesystem.h | 14 +
NorthstarDLL/scriptbrowserhooks.cpp | 23 +
NorthstarDLL/scriptmainmenupromos.cpp | 135 +
NorthstarDLL/scriptmodmenu.cpp | 202 +
NorthstarDLL/scriptserverbrowser.cpp | 443 ++
NorthstarDLL/scriptservertoclientstringcommand.cpp | 23 +
NorthstarDLL/scriptsrson.cpp | 64 +
NorthstarDLL/scriptsrson.h | 4 +
NorthstarDLL/serverauthentication.cpp | 689 ++
NorthstarDLL/serverauthentication.h | 108 +
NorthstarDLL/serverchathooks.cpp | 213 +
NorthstarDLL/serverchathooks.h | 25 +
NorthstarDLL/sigscanning.cpp | 41 +
NorthstarDLL/sigscanning.h | 7 +
NorthstarDLL/sourceconsole.cpp | 71 +
NorthstarDLL/sourceconsole.h | 110 +
NorthstarDLL/sourceinterface.cpp | 52 +
NorthstarDLL/sourceinterface.h | 31 +
NorthstarDLL/squirrel.cpp | 382 +
NorthstarDLL/squirrel.h | 285 +
NorthstarDLL/tier0.cpp | 37 +
NorthstarDLL/tier0.h | 68 +
NorthstarDLL/version.cpp | 26 +
NorthstarDLL/version.h | 6 +
NorthstarDedicatedTest/ExploitFixes.cpp | 415 --
NorthstarDedicatedTest/ExploitFixes.h | 4 -
NorthstarDedicatedTest/ExploitFixes_UTF8Parser.h | 175 -
NorthstarDedicatedTest/NSMem.h | 211 -
.../NorthstarDedicatedTest.vcxproj | 667 --
.../NorthstarDedicatedTest.vcxproj.filters | 1771 -----
NorthstarDedicatedTest/audio.cpp | 502 --
NorthstarDedicatedTest/audio.h | 48 -
NorthstarDedicatedTest/audio_asm.asm | 8 -
NorthstarDedicatedTest/bansystem.cpp | 107 -
NorthstarDedicatedTest/bansystem.h | 18 -
NorthstarDedicatedTest/bitbuf.h | 1148 ---
NorthstarDedicatedTest/bits.cpp | 46 -
NorthstarDedicatedTest/bits.h | 10 -
NorthstarDedicatedTest/buildainfile.cpp | 384 -
NorthstarDedicatedTest/chatcommand.cpp | 37 -
NorthstarDedicatedTest/clientauthhooks.cpp | 44 -
NorthstarDedicatedTest/clientchathooks.cpp | 87 -
NorthstarDedicatedTest/clientruihooks.cpp | 22 -
NorthstarDedicatedTest/clientvideooverrides.cpp | 36 -
NorthstarDedicatedTest/color.h | 135 -
NorthstarDedicatedTest/concommand.cpp | 151 -
NorthstarDedicatedTest/concommand.h | 139 -
NorthstarDedicatedTest/configurables.cpp | 38 -
NorthstarDedicatedTest/configurables.h | 7 -
NorthstarDedicatedTest/convar.cpp | 497 --
NorthstarDedicatedTest/convar.h | 183 -
NorthstarDedicatedTest/crashhandler.cpp | 216 -
NorthstarDedicatedTest/crashhandler.h | 4 -
NorthstarDedicatedTest/cvar.cpp | 31 -
NorthstarDedicatedTest/cvar.h | 43 -
NorthstarDedicatedTest/debugoverlay.cpp | 151 -
NorthstarDedicatedTest/dedicated.cpp | 296 -
NorthstarDedicatedTest/dedicated.h | 3 -
NorthstarDedicatedTest/dedicatedmaterialsystem.cpp | 43 -
NorthstarDedicatedTest/demofixes.cpp | 27 -
NorthstarDedicatedTest/dllmain.cpp | 169 -
NorthstarDedicatedTest/filesystem.cpp | 177 -
NorthstarDedicatedTest/filesystem.h | 77 -
NorthstarDedicatedTest/hooks.cpp | 338 -
NorthstarDedicatedTest/hooks.h | 280 -
NorthstarDedicatedTest/hookutils.cpp | 44 -
NorthstarDedicatedTest/hookutils.h | 22 -
NorthstarDedicatedTest/host.cpp | 71 -
NorthstarDedicatedTest/hoststate.cpp | 99 -
NorthstarDedicatedTest/hoststate.h | 45 -
NorthstarDedicatedTest/include/MinHook.h | 186 -
NorthstarDedicatedTest/include/MinHook.x64.lib | Bin 32400 -> 0 bytes
.../include/crypto/__DECC_INCLUDE_EPILOGUE.H | 16 -
.../include/crypto/__DECC_INCLUDE_PROLOGUE.H | 20 -
.../include/crypto/aes_platform.h | 450 --
NorthstarDedicatedTest/include/crypto/aria.h | 51 -
NorthstarDedicatedTest/include/crypto/asn1.h | 149 -
NorthstarDedicatedTest/include/crypto/asn1_dsa.h | 24 -
NorthstarDedicatedTest/include/crypto/asn1err.h | 27 -
NorthstarDedicatedTest/include/crypto/async.h | 19 -
NorthstarDedicatedTest/include/crypto/asyncerr.h | 27 -
NorthstarDedicatedTest/include/crypto/bioerr.h | 27 -
NorthstarDedicatedTest/include/crypto/bn.h | 117 -
NorthstarDedicatedTest/include/crypto/bn_conf.h | 29 -
NorthstarDedicatedTest/include/crypto/bn_conf.h.in | 28 -
NorthstarDedicatedTest/include/crypto/bn_dh.h | 43 -
NorthstarDedicatedTest/include/crypto/bn_srp.h | 32 -
NorthstarDedicatedTest/include/crypto/bnerr.h | 27 -
NorthstarDedicatedTest/include/crypto/buffererr.h | 27 -
NorthstarDedicatedTest/include/crypto/chacha.h | 43 -
.../include/crypto/cmll_platform.h | 51 -
NorthstarDedicatedTest/include/crypto/cmperr.h | 30 -
NorthstarDedicatedTest/include/crypto/cmserr.h | 30 -
NorthstarDedicatedTest/include/crypto/comperr.h | 30 -
NorthstarDedicatedTest/include/crypto/conferr.h | 27 -
NorthstarDedicatedTest/include/crypto/crmferr.h | 30 -
NorthstarDedicatedTest/include/crypto/cryptlib.h | 39 -
NorthstarDedicatedTest/include/crypto/cryptoerr.h | 27 -
NorthstarDedicatedTest/include/crypto/cterr.h | 30 -
NorthstarDedicatedTest/include/crypto/ctype.h | 83 -
NorthstarDedicatedTest/include/crypto/decoder.h | 42 -
NorthstarDedicatedTest/include/crypto/decodererr.h | 27 -
.../include/crypto/des_platform.h | 35 -
NorthstarDedicatedTest/include/crypto/dh.h | 61 -
NorthstarDedicatedTest/include/crypto/dherr.h | 30 -
NorthstarDedicatedTest/include/crypto/dsa.h | 48 -
NorthstarDedicatedTest/include/crypto/dsaerr.h | 30 -
NorthstarDedicatedTest/include/crypto/dso_conf.h | 18 -
.../include/crypto/dso_conf.h.in | 33 -
NorthstarDedicatedTest/include/crypto/ec.h | 100 -
NorthstarDedicatedTest/include/crypto/ecerr.h | 30 -
NorthstarDedicatedTest/include/crypto/ecx.h | 150 -
NorthstarDedicatedTest/include/crypto/encoder.h | 14 -
NorthstarDedicatedTest/include/crypto/encodererr.h | 27 -
NorthstarDedicatedTest/include/crypto/engine.h | 20 -
NorthstarDedicatedTest/include/crypto/engineerr.h | 30 -
NorthstarDedicatedTest/include/crypto/err.h | 20 -
NorthstarDedicatedTest/include/crypto/ess.h | 76 -
NorthstarDedicatedTest/include/crypto/esserr.h | 27 -
NorthstarDedicatedTest/include/crypto/evp.h | 944 ---
NorthstarDedicatedTest/include/crypto/evperr.h | 27 -
NorthstarDedicatedTest/include/crypto/httperr.h | 27 -
NorthstarDedicatedTest/include/crypto/lhash.h | 16 -
.../include/crypto/md32_common.h | 256 -
NorthstarDedicatedTest/include/crypto/modes.h | 223 -
NorthstarDedicatedTest/include/crypto/objects.h | 12 -
NorthstarDedicatedTest/include/crypto/objectserr.h | 27 -
NorthstarDedicatedTest/include/crypto/ocsperr.h | 30 -
NorthstarDedicatedTest/include/crypto/pem.h | 51 -
NorthstarDedicatedTest/include/crypto/pemerr.h | 27 -
NorthstarDedicatedTest/include/crypto/pkcs12err.h | 27 -
NorthstarDedicatedTest/include/crypto/pkcs7.h | 19 -
NorthstarDedicatedTest/include/crypto/pkcs7err.h | 27 -
NorthstarDedicatedTest/include/crypto/poly1305.h | 46 -
NorthstarDedicatedTest/include/crypto/ppc_arch.h | 28 -
NorthstarDedicatedTest/include/crypto/punycode.h | 24 -
NorthstarDedicatedTest/include/crypto/rand.h | 128 -
NorthstarDedicatedTest/include/crypto/rand_pool.h | 109 -
NorthstarDedicatedTest/include/crypto/randerr.h | 27 -
NorthstarDedicatedTest/include/crypto/rsa.h | 129 -
NorthstarDedicatedTest/include/crypto/rsaerr.h | 27 -
.../include/crypto/security_bits.h | 16 -
NorthstarDedicatedTest/include/crypto/sha.h | 22 -
NorthstarDedicatedTest/include/crypto/siphash.h | 50 -
NorthstarDedicatedTest/include/crypto/siv.h | 33 -
NorthstarDedicatedTest/include/crypto/sm2.h | 86 -
NorthstarDedicatedTest/include/crypto/sm2err.h | 49 -
NorthstarDedicatedTest/include/crypto/sm4.h | 38 -
NorthstarDedicatedTest/include/crypto/sparc_arch.h | 122 -
.../include/crypto/sparse_array.h | 92 -
NorthstarDedicatedTest/include/crypto/store.h | 21 -
NorthstarDedicatedTest/include/crypto/storeerr.h | 27 -
NorthstarDedicatedTest/include/crypto/tserr.h | 30 -
NorthstarDedicatedTest/include/crypto/types.h | 29 -
NorthstarDedicatedTest/include/crypto/uierr.h | 27 -
NorthstarDedicatedTest/include/crypto/x509.h | 367 -
NorthstarDedicatedTest/include/crypto/x509err.h | 27 -
NorthstarDedicatedTest/include/crypto/x509v3err.h | 27 -
NorthstarDedicatedTest/include/httplib.h | 7832 --------------------
.../include/internal/__DECC_INCLUDE_EPILOGUE.H | 16 -
.../include/internal/__DECC_INCLUDE_PROLOGUE.H | 20 -
NorthstarDedicatedTest/include/internal/asn1.h | 16 -
NorthstarDedicatedTest/include/internal/bio.h | 91 -
NorthstarDedicatedTest/include/internal/comp.h | 12 -
NorthstarDedicatedTest/include/internal/conf.h | 31 -
.../include/internal/constant_time.h | 421 --
NorthstarDedicatedTest/include/internal/core.h | 66 -
NorthstarDedicatedTest/include/internal/cryptlib.h | 261 -
NorthstarDedicatedTest/include/internal/dane.h | 104 -
.../include/internal/deprecated.h | 30 -
NorthstarDedicatedTest/include/internal/der.h | 88 -
NorthstarDedicatedTest/include/internal/dso.h | 164 -
NorthstarDedicatedTest/include/internal/dsoerr.h | 48 -
NorthstarDedicatedTest/include/internal/endian.h | 51 -
NorthstarDedicatedTest/include/internal/err.h | 16 -
NorthstarDedicatedTest/include/internal/ffc.h | 212 -
NorthstarDedicatedTest/include/internal/ktls.h | 404 -
NorthstarDedicatedTest/include/internal/namemap.h | 43 -
NorthstarDedicatedTest/include/internal/nelem.h | 15 -
NorthstarDedicatedTest/include/internal/numbers.h | 85 -
NorthstarDedicatedTest/include/internal/o_dir.h | 53 -
NorthstarDedicatedTest/include/internal/packet.h | 902 ---
.../include/internal/param_build_set.h | 46 -
.../include/internal/passphrase.h | 122 -
NorthstarDedicatedTest/include/internal/property.h | 93 -
.../include/internal/propertyerr.h | 43 -
NorthstarDedicatedTest/include/internal/provider.h | 117 -
NorthstarDedicatedTest/include/internal/refcount.h | 178 -
NorthstarDedicatedTest/include/internal/sha3.h | 54 -
NorthstarDedicatedTest/include/internal/sizes.h | 22 -
NorthstarDedicatedTest/include/internal/sm3.h | 39 -
NorthstarDedicatedTest/include/internal/sockets.h | 175 -
NorthstarDedicatedTest/include/internal/sslconf.h | 21 -
NorthstarDedicatedTest/include/internal/symhacks.h | 27 -
.../include/internal/thread_once.h | 151 -
.../include/internal/tlsgroups.h | 50 -
.../include/internal/tsan_assist.h | 144 -
NorthstarDedicatedTest/include/internal/unicode.h | 31 -
.../include/libcrypto_static.lib | Bin 35832382 -> 0 bytes
.../include/libcurl/include/curl/curl.h | 3103 --------
.../include/libcurl/include/curl/curlver.h | 77 -
.../include/libcurl/include/curl/easy.h | 123 -
.../include/libcurl/include/curl/mprintf.h | 50 -
.../include/libcurl/include/curl/multi.h | 457 --
.../include/libcurl/include/curl/options.h | 68 -
.../include/libcurl/include/curl/stdcheaders.h | 33 -
.../include/libcurl/include/curl/system.h | 504 --
.../include/libcurl/include/curl/typecheck-gcc.h | 707 --
.../include/libcurl/include/curl/urlapi.h | 145 -
.../include/libcurl/lib/libcurl_a.lib | Bin 2140640 -> 0 bytes
NorthstarDedicatedTest/include/libssl_static.lib | Bin 4851208 -> 0 bytes
.../include/openssl/__DECC_INCLUDE_EPILOGUE.H | 22 -
.../include/openssl/__DECC_INCLUDE_PROLOGUE.H | 26 -
NorthstarDedicatedTest/include/openssl/aes.h | 111 -
NorthstarDedicatedTest/include/openssl/asn1.h | 1128 ---
NorthstarDedicatedTest/include/openssl/asn1.h.in | 961 ---
NorthstarDedicatedTest/include/openssl/asn1_mac.h | 10 -
NorthstarDedicatedTest/include/openssl/asn1err.h | 140 -
NorthstarDedicatedTest/include/openssl/asn1t.h | 946 ---
NorthstarDedicatedTest/include/openssl/asn1t.h.in | 923 ---
NorthstarDedicatedTest/include/openssl/async.h | 96 -
NorthstarDedicatedTest/include/openssl/asyncerr.h | 29 -
NorthstarDedicatedTest/include/openssl/bio.h | 884 ---
NorthstarDedicatedTest/include/openssl/bio.h.in | 861 ---
NorthstarDedicatedTest/include/openssl/bioerr.h | 65 -
NorthstarDedicatedTest/include/openssl/blowfish.h | 78 -
NorthstarDedicatedTest/include/openssl/bn.h | 583 --
NorthstarDedicatedTest/include/openssl/bnerr.h | 46 -
NorthstarDedicatedTest/include/openssl/buffer.h | 62 -
NorthstarDedicatedTest/include/openssl/buffererr.h | 25 -
NorthstarDedicatedTest/include/openssl/camellia.h | 117 -
NorthstarDedicatedTest/include/openssl/cast.h | 71 -
NorthstarDedicatedTest/include/openssl/cmac.h | 52 -
NorthstarDedicatedTest/include/openssl/cmp.h | 592 --
NorthstarDedicatedTest/include/openssl/cmp.h.in | 473 --
NorthstarDedicatedTest/include/openssl/cmp_util.h | 56 -
NorthstarDedicatedTest/include/openssl/cmperr.h | 112 -
NorthstarDedicatedTest/include/openssl/cms.h | 493 --
NorthstarDedicatedTest/include/openssl/cms.h.in | 395 -
NorthstarDedicatedTest/include/openssl/cmserr.h | 122 -
NorthstarDedicatedTest/include/openssl/comp.h | 59 -
NorthstarDedicatedTest/include/openssl/comperr.h | 31 -
NorthstarDedicatedTest/include/openssl/conf.h | 211 -
NorthstarDedicatedTest/include/openssl/conf.h.in | 174 -
NorthstarDedicatedTest/include/openssl/conf_api.h | 46 -
NorthstarDedicatedTest/include/openssl/conferr.h | 51 -
.../include/openssl/configuration.h | 133 -
.../include/openssl/configuration.h.in | 69 -
NorthstarDedicatedTest/include/openssl/conftypes.h | 44 -
NorthstarDedicatedTest/include/openssl/core.h | 233 -
.../include/openssl/core_dispatch.h | 943 ---
.../include/openssl/core_names.h | 556 --
.../include/openssl/core_object.h | 41 -
NorthstarDedicatedTest/include/openssl/crmf.h | 227 -
NorthstarDedicatedTest/include/openssl/crmf.h.in | 180 -
NorthstarDedicatedTest/include/openssl/crmferr.h | 50 -
NorthstarDedicatedTest/include/openssl/crypto.h | 556 --
NorthstarDedicatedTest/include/openssl/crypto.h.in | 533 --
NorthstarDedicatedTest/include/openssl/cryptoerr.h | 46 -
.../include/openssl/cryptoerr_legacy.h | 1466 ----
NorthstarDedicatedTest/include/openssl/ct.h | 573 --
NorthstarDedicatedTest/include/openssl/ct.h.in | 525 --
NorthstarDedicatedTest/include/openssl/cterr.h | 45 -
NorthstarDedicatedTest/include/openssl/decoder.h | 133 -
.../include/openssl/decodererr.h | 28 -
NorthstarDedicatedTest/include/openssl/des.h | 211 -
NorthstarDedicatedTest/include/openssl/dh.h | 328 -
NorthstarDedicatedTest/include/openssl/dherr.h | 57 -
NorthstarDedicatedTest/include/openssl/dsa.h | 275 -
NorthstarDedicatedTest/include/openssl/dsaerr.h | 43 -
NorthstarDedicatedTest/include/openssl/dtls1.h | 57 -
NorthstarDedicatedTest/include/openssl/e_os2.h | 305 -
NorthstarDedicatedTest/include/openssl/ebcdic.h | 39 -
NorthstarDedicatedTest/include/openssl/ec.h | 1566 ----
NorthstarDedicatedTest/include/openssl/ecdh.h | 10 -
NorthstarDedicatedTest/include/openssl/ecdsa.h | 10 -
NorthstarDedicatedTest/include/openssl/ecerr.h | 102 -
NorthstarDedicatedTest/include/openssl/encoder.h | 124 -
.../include/openssl/encodererr.h | 28 -
NorthstarDedicatedTest/include/openssl/engine.h | 832 ---
NorthstarDedicatedTest/include/openssl/engineerr.h | 63 -
NorthstarDedicatedTest/include/openssl/err.h | 492 --
NorthstarDedicatedTest/include/openssl/err.h.in | 481 --
NorthstarDedicatedTest/include/openssl/ess.h | 128 -
NorthstarDedicatedTest/include/openssl/ess.h.in | 81 -
NorthstarDedicatedTest/include/openssl/esserr.h | 32 -
NorthstarDedicatedTest/include/openssl/evp.h | 2170 ------
NorthstarDedicatedTest/include/openssl/evperr.h | 134 -
.../include/openssl/fips_names.h | 60 -
NorthstarDedicatedTest/include/openssl/fipskey.h | 36 -
.../include/openssl/fipskey.h.in | 35 -
NorthstarDedicatedTest/include/openssl/hmac.h | 62 -
NorthstarDedicatedTest/include/openssl/http.h | 109 -
NorthstarDedicatedTest/include/openssl/httperr.h | 55 -
NorthstarDedicatedTest/include/openssl/idea.h | 82 -
NorthstarDedicatedTest/include/openssl/kdf.h | 138 -
NorthstarDedicatedTest/include/openssl/kdferr.h | 16 -
NorthstarDedicatedTest/include/openssl/lhash.h | 288 -
NorthstarDedicatedTest/include/openssl/lhash.h.in | 263 -
NorthstarDedicatedTest/include/openssl/macros.h | 304 -
NorthstarDedicatedTest/include/openssl/md2.h | 56 -
NorthstarDedicatedTest/include/openssl/md4.h | 63 -
NorthstarDedicatedTest/include/openssl/md5.h | 62 -
NorthstarDedicatedTest/include/openssl/mdc2.h | 55 -
NorthstarDedicatedTest/include/openssl/modes.h | 219 -
NorthstarDedicatedTest/include/openssl/obj_mac.h | 5481 --------------
NorthstarDedicatedTest/include/openssl/objects.h | 183 -
.../include/openssl/objectserr.h | 28 -
NorthstarDedicatedTest/include/openssl/ocsp.h | 483 --
NorthstarDedicatedTest/include/openssl/ocsp.h.in | 387 -
NorthstarDedicatedTest/include/openssl/ocsperr.h | 53 -
.../include/openssl/opensslconf.h | 17 -
NorthstarDedicatedTest/include/openssl/opensslv.h | 114 -
.../include/openssl/opensslv.h.in | 113 -
NorthstarDedicatedTest/include/openssl/ossl_typ.h | 16 -
.../include/openssl/param_build.h | 63 -
NorthstarDedicatedTest/include/openssl/params.h | 160 -
NorthstarDedicatedTest/include/openssl/pem.h | 538 --
NorthstarDedicatedTest/include/openssl/pem2.h | 19 -
NorthstarDedicatedTest/include/openssl/pemerr.h | 58 -
NorthstarDedicatedTest/include/openssl/pkcs12.h | 350 -
NorthstarDedicatedTest/include/openssl/pkcs12.h.in | 327 -
NorthstarDedicatedTest/include/openssl/pkcs12err.h | 45 -
NorthstarDedicatedTest/include/openssl/pkcs7.h | 427 --
NorthstarDedicatedTest/include/openssl/pkcs7.h.in | 356 -
NorthstarDedicatedTest/include/openssl/pkcs7err.h | 63 -
NorthstarDedicatedTest/include/openssl/prov_ssl.h | 34 -
NorthstarDedicatedTest/include/openssl/proverr.h | 148 -
NorthstarDedicatedTest/include/openssl/provider.h | 60 -
NorthstarDedicatedTest/include/openssl/rand.h | 123 -
NorthstarDedicatedTest/include/openssl/randerr.h | 68 -
NorthstarDedicatedTest/include/openssl/rc2.h | 68 -
NorthstarDedicatedTest/include/openssl/rc4.h | 47 -
NorthstarDedicatedTest/include/openssl/rc5.h | 79 -
NorthstarDedicatedTest/include/openssl/ripemd.h | 59 -
NorthstarDedicatedTest/include/openssl/rsa.h | 604 --
NorthstarDedicatedTest/include/openssl/rsaerr.h | 107 -
NorthstarDedicatedTest/include/openssl/safestack.h | 297 -
.../include/openssl/safestack.h.in | 227 -
NorthstarDedicatedTest/include/openssl/seed.h | 113 -
NorthstarDedicatedTest/include/openssl/self_test.h | 93 -
NorthstarDedicatedTest/include/openssl/sha.h | 138 -
NorthstarDedicatedTest/include/openssl/srp.h | 285 -
NorthstarDedicatedTest/include/openssl/srp.h.in | 214 -
NorthstarDedicatedTest/include/openssl/srtp.h | 56 -
NorthstarDedicatedTest/include/openssl/ssl.h | 2585 -------
NorthstarDedicatedTest/include/openssl/ssl.h.in | 2513 -------
NorthstarDedicatedTest/include/openssl/ssl2.h | 30 -
NorthstarDedicatedTest/include/openssl/ssl3.h | 347 -
NorthstarDedicatedTest/include/openssl/sslerr.h | 343 -
.../include/openssl/sslerr_legacy.h | 468 --
NorthstarDedicatedTest/include/openssl/stack.h | 90 -
NorthstarDedicatedTest/include/openssl/store.h | 369 -
NorthstarDedicatedTest/include/openssl/storeerr.h | 49 -
NorthstarDedicatedTest/include/openssl/symhacks.h | 39 -
NorthstarDedicatedTest/include/openssl/tls1.h | 1223 ---
NorthstarDedicatedTest/include/openssl/trace.h | 312 -
NorthstarDedicatedTest/include/openssl/ts.h | 503 --
NorthstarDedicatedTest/include/openssl/tserr.h | 67 -
NorthstarDedicatedTest/include/openssl/txt_db.h | 63 -
NorthstarDedicatedTest/include/openssl/types.h | 236 -
NorthstarDedicatedTest/include/openssl/ui.h | 407 -
NorthstarDedicatedTest/include/openssl/ui.h.in | 384 -
NorthstarDedicatedTest/include/openssl/uierr.h | 38 -
NorthstarDedicatedTest/include/openssl/whrlpool.h | 62 -
NorthstarDedicatedTest/include/openssl/x509.h | 1276 ----
NorthstarDedicatedTest/include/openssl/x509.h.in | 1082 ---
NorthstarDedicatedTest/include/openssl/x509_vfy.h | 894 ---
.../include/openssl/x509_vfy.h.in | 797 --
NorthstarDedicatedTest/include/openssl/x509err.h | 68 -
NorthstarDedicatedTest/include/openssl/x509v3.h | 1450 ----
NorthstarDedicatedTest/include/openssl/x509v3.h.in | 1017 ---
NorthstarDedicatedTest/include/openssl/x509v3err.h | 93 -
.../include/rapidjson/allocators.h | 271 -
.../include/rapidjson/document.h | 2575 -------
.../include/rapidjson/encodedstream.h | 299 -
.../include/rapidjson/encodings.h | 716 --
.../include/rapidjson/error/en.h | 74 -
.../include/rapidjson/error/error.h | 155 -
.../include/rapidjson/filereadstream.h | 99 -
.../include/rapidjson/filewritestream.h | 104 -
NorthstarDedicatedTest/include/rapidjson/fwd.h | 151 -
.../include/rapidjson/internal/biginteger.h | 290 -
.../include/rapidjson/internal/diyfp.h | 258 -
.../include/rapidjson/internal/dtoa.h | 245 -
.../include/rapidjson/internal/ieee754.h | 78 -
.../include/rapidjson/internal/itoa.h | 304 -
.../include/rapidjson/internal/meta.h | 181 -
.../include/rapidjson/internal/pow10.h | 55 -
.../include/rapidjson/internal/regex.h | 701 --
.../include/rapidjson/internal/stack.h | 230 -
.../include/rapidjson/internal/strfunc.h | 55 -
.../include/rapidjson/internal/strtod.h | 269 -
.../include/rapidjson/internal/swap.h | 46 -
.../include/rapidjson/istreamwrapper.h | 115 -
.../include/rapidjson/memorybuffer.h | 70 -
.../include/rapidjson/memorystream.h | 71 -
.../include/rapidjson/msinttypes/inttypes.h | 316 -
.../include/rapidjson/msinttypes/stdint.h | 300 -
.../include/rapidjson/ostreamwrapper.h | 81 -
NorthstarDedicatedTest/include/rapidjson/pointer.h | 1358 ----
.../include/rapidjson/prettywriter.h | 255 -
.../include/rapidjson/rapidjson.h | 615 --
NorthstarDedicatedTest/include/rapidjson/reader.h | 1879 -----
NorthstarDedicatedTest/include/rapidjson/schema.h | 2006 -----
NorthstarDedicatedTest/include/rapidjson/stream.h | 179 -
.../include/rapidjson/stringbuffer.h | 117 -
NorthstarDedicatedTest/include/rapidjson/writer.h | 610 --
NorthstarDedicatedTest/include/spdlog/async.h | 93 -
.../include/spdlog/async_logger-inl.h | 92 -
.../include/spdlog/async_logger.h | 68 -
NorthstarDedicatedTest/include/spdlog/cfg/argv.h | 44 -
NorthstarDedicatedTest/include/spdlog/cfg/env.h | 38 -
.../include/spdlog/cfg/helpers-inl.h | 120 -
.../include/spdlog/cfg/helpers.h | 29 -
NorthstarDedicatedTest/include/spdlog/common-inl.h | 82 -
NorthstarDedicatedTest/include/spdlog/common.h | 249 -
.../include/spdlog/details/backtracer-inl.h | 69 -
.../include/spdlog/details/backtracer.h | 45 -
.../include/spdlog/details/circular_q.h | 141 -
.../include/spdlog/details/console_globals.h | 32 -
.../include/spdlog/details/file_helper-inl.h | 147 -
.../include/spdlog/details/file_helper.h | 59 -
.../include/spdlog/details/fmt_helper.h | 116 -
.../include/spdlog/details/log_msg-inl.h | 37 -
.../include/spdlog/details/log_msg.h | 36 -
.../include/spdlog/details/log_msg_buffer-inl.h | 60 -
.../include/spdlog/details/log_msg_buffer.h | 33 -
.../include/spdlog/details/mpmc_blocking_q.h | 126 -
.../include/spdlog/details/null_mutex.h | 49 -
.../include/spdlog/details/os-inl.h | 589 --
NorthstarDedicatedTest/include/spdlog/details/os.h | 118 -
.../include/spdlog/details/periodic_worker-inl.h | 49 -
.../include/spdlog/details/periodic_worker.h | 40 -
.../include/spdlog/details/registry-inl.h | 313 -
.../include/spdlog/details/registry.h | 115 -
.../include/spdlog/details/synchronous_factory.h | 24 -
.../include/spdlog/details/tcp_client-windows.h | 175 -
.../include/spdlog/details/tcp_client.h | 146 -
.../include/spdlog/details/thread_pool-inl.h | 129 -
.../include/spdlog/details/thread_pool.h | 121 -
.../include/spdlog/details/windows_include.h | 11 -
.../include/spdlog/fmt/bin_to_hex.h | 216 -
.../include/spdlog/fmt/bundled/LICENSE.rst | 27 -
.../include/spdlog/fmt/bundled/chrono.h | 1116 ---
.../include/spdlog/fmt/bundled/color.h | 603 --
.../include/spdlog/fmt/bundled/compile.h | 701 --
.../include/spdlog/fmt/bundled/core.h | 2122 ------
.../include/spdlog/fmt/bundled/format-inl.h | 2801 -------
.../include/spdlog/fmt/bundled/format.h | 3960 ----------
.../include/spdlog/fmt/bundled/locale.h | 64 -
.../include/spdlog/fmt/bundled/os.h | 480 --
.../include/spdlog/fmt/bundled/ostream.h | 177 -
.../include/spdlog/fmt/bundled/posix.h | 2 -
.../include/spdlog/fmt/bundled/printf.h | 751 --
.../include/spdlog/fmt/bundled/ranges.h | 396 -
NorthstarDedicatedTest/include/spdlog/fmt/chrono.h | 20 -
NorthstarDedicatedTest/include/spdlog/fmt/fmt.h | 27 -
NorthstarDedicatedTest/include/spdlog/fmt/ostr.h | 20 -
NorthstarDedicatedTest/include/spdlog/formatter.h | 18 -
NorthstarDedicatedTest/include/spdlog/fwd.h | 14 -
NorthstarDedicatedTest/include/spdlog/logger-inl.h | 257 -
NorthstarDedicatedTest/include/spdlog/logger.h | 366 -
.../include/spdlog/pattern_formatter-inl.h | 1395 ----
.../include/spdlog/pattern_formatter.h | 126 -
.../include/spdlog/sinks/android_sink.h | 119 -
.../include/spdlog/sinks/ansicolor_sink-inl.h | 145 -
.../include/spdlog/sinks/ansicolor_sink.h | 118 -
.../include/spdlog/sinks/base_sink-inl.h | 63 -
.../include/spdlog/sinks/base_sink.h | 52 -
.../include/spdlog/sinks/basic_file_sink-inl.h | 43 -
.../include/spdlog/sinks/basic_file_sink.h | 58 -
.../include/spdlog/sinks/daily_file_sink.h | 238 -
.../include/spdlog/sinks/dist_sink.h | 97 -
.../include/spdlog/sinks/dup_filter_sink.h | 90 -
.../include/spdlog/sinks/hourly_file_sink.h | 194 -
.../include/spdlog/sinks/msvc_sink.h | 49 -
.../include/spdlog/sinks/null_sink.h | 44 -
.../include/spdlog/sinks/ostream_sink.h | 50 -
.../include/spdlog/sinks/ringbuffer_sink.h | 74 -
.../include/spdlog/sinks/rotating_file_sink-inl.h | 131 -
.../include/spdlog/sinks/rotating_file_sink.h | 78 -
.../include/spdlog/sinks/sink-inl.h | 25 -
NorthstarDedicatedTest/include/spdlog/sinks/sink.h | 35 -
.../include/spdlog/sinks/stdout_color_sinks-inl.h | 38 -
.../include/spdlog/sinks/stdout_color_sinks.h | 45 -
.../include/spdlog/sinks/stdout_sinks-inl.h | 135 -
.../include/spdlog/sinks/stdout_sinks.h | 87 -
.../include/spdlog/sinks/syslog_sink.h | 109 -
.../include/spdlog/sinks/systemd_sink.h | 103 -
.../include/spdlog/sinks/tcp_sink.h | 81 -
.../include/spdlog/sinks/win_eventlog_sink.h | 276 -
.../include/spdlog/sinks/wincolor_sink-inl.h | 175 -
.../include/spdlog/sinks/wincolor_sink.h | 85 -
NorthstarDedicatedTest/include/spdlog/spdlog-inl.h | 125 -
NorthstarDedicatedTest/include/spdlog/spdlog.h | 295 -
NorthstarDedicatedTest/include/spdlog/stopwatch.h | 61 -
NorthstarDedicatedTest/include/spdlog/tweakme.h | 124 -
NorthstarDedicatedTest/include/spdlog/version.h | 10 -
NorthstarDedicatedTest/keyvalues.cpp | 128 -
NorthstarDedicatedTest/languagehooks.cpp | 116 -
NorthstarDedicatedTest/latencyflex.cpp | 41 -
NorthstarDedicatedTest/localchatwriter.cpp | 447 --
NorthstarDedicatedTest/localchatwriter.h | 72 -
NorthstarDedicatedTest/logging.cpp | 240 -
NorthstarDedicatedTest/logging.h | 4 -
NorthstarDedicatedTest/main.h | 4 -
NorthstarDedicatedTest/masterserver.cpp | 1225 ---
NorthstarDedicatedTest/masterserver.h | 153 -
NorthstarDedicatedTest/maxplayers.cpp | 681 --
NorthstarDedicatedTest/memalloc.cpp | 74 -
NorthstarDedicatedTest/memalloc.h | 49 -
NorthstarDedicatedTest/miscclientfixes.cpp | 7 -
NorthstarDedicatedTest/misccommands.cpp | 65 -
NorthstarDedicatedTest/misccommands.h | 2 -
NorthstarDedicatedTest/miscserverfixes.cpp | 15 -
NorthstarDedicatedTest/miscserverscript.cpp | 66 -
NorthstarDedicatedTest/miscserverscript.h | 2 -
NorthstarDedicatedTest/modlocalisation.cpp | 33 -
NorthstarDedicatedTest/modmanager.cpp | 644 --
NorthstarDedicatedTest/modmanager.h | 147 -
NorthstarDedicatedTest/ns_version.h | 7 -
NorthstarDedicatedTest/pch.cpp | 5 -
NorthstarDedicatedTest/pch.h | 47 -
NorthstarDedicatedTest/pdef.cpp | 117 -
NorthstarDedicatedTest/pdef.h | 4 -
NorthstarDedicatedTest/playlist.cpp | 114 -
NorthstarDedicatedTest/playlist.h | 10 -
NorthstarDedicatedTest/plugin_abi.h | 68 -
NorthstarDedicatedTest/plugins.cpp | 421 --
NorthstarDedicatedTest/plugins.h | 17 -
NorthstarDedicatedTest/printcommand.h | 6 -
NorthstarDedicatedTest/printcommands.cpp | 161 -
NorthstarDedicatedTest/printmaps.cpp | 169 -
NorthstarDedicatedTest/printmaps.h | 2 -
NorthstarDedicatedTest/r2client.cpp | 20 -
NorthstarDedicatedTest/r2client.h | 11 -
NorthstarDedicatedTest/r2engine.cpp | 23 -
NorthstarDedicatedTest/r2engine.h | 102 -
NorthstarDedicatedTest/r2server.cpp | 21 -
NorthstarDedicatedTest/r2server.h | 19 -
NorthstarDedicatedTest/rpakfilesystem.cpp | 218 -
NorthstarDedicatedTest/rpakfilesystem.h | 14 -
NorthstarDedicatedTest/scriptbrowserhooks.cpp | 23 -
NorthstarDedicatedTest/scriptmainmenupromos.cpp | 135 -
NorthstarDedicatedTest/scriptmodmenu.cpp | 202 -
NorthstarDedicatedTest/scriptserverbrowser.cpp | 443 --
.../scriptservertoclientstringcommand.cpp | 23 -
NorthstarDedicatedTest/scriptsrson.cpp | 64 -
NorthstarDedicatedTest/scriptsrson.h | 4 -
NorthstarDedicatedTest/serverauthentication.cpp | 689 --
NorthstarDedicatedTest/serverauthentication.h | 108 -
NorthstarDedicatedTest/serverchathooks.cpp | 213 -
NorthstarDedicatedTest/serverchathooks.h | 25 -
NorthstarDedicatedTest/sigscanning.cpp | 41 -
NorthstarDedicatedTest/sigscanning.h | 7 -
NorthstarDedicatedTest/sourceconsole.cpp | 71 -
NorthstarDedicatedTest/sourceconsole.h | 110 -
NorthstarDedicatedTest/sourceinterface.cpp | 52 -
NorthstarDedicatedTest/sourceinterface.h | 31 -
NorthstarDedicatedTest/squirrel.cpp | 382 -
NorthstarDedicatedTest/squirrel.h | 285 -
NorthstarDedicatedTest/tier0.cpp | 37 -
NorthstarDedicatedTest/tier0.h | 68 -
NorthstarDedicatedTest/version.cpp | 26 -
NorthstarDedicatedTest/version.h | 6 -
NorthstarLauncher/NorthstarLauncher.vcxproj | 110 +
.../NorthstarLauncher.vcxproj.filters | 37 +
NorthstarLauncher/main.cpp | 453 ++
NorthstarLauncher/ns_icon.ico | Bin 0 -> 1441814 bytes
NorthstarLauncher/ns_startup_args.txt | 1 +
NorthstarLauncher/ns_startup_args_dedi.txt | 1 +
NorthstarLauncher/resource1.h | 16 +
NorthstarLauncher/resources.rc | 111 +
R2Northstar.sln | 4 +-
loader_wsock32_proxy/hookutils.cpp | 2 +-
loader_wsock32_proxy/include/MinHook.h | 186 +
loader_wsock32_proxy/include/MinHook.x64.lib | Bin 0 -> 32400 bytes
loader_wsock32_proxy/loader.cpp | 2 +-
loader_wsock32_proxy/loader_wsock32_proxy.vcxproj | 4 +-
1108 files changed, 134859 insertions(+), 134632 deletions(-)
delete mode 100644 LauncherInjector/LauncherInjector.vcxproj
delete mode 100644 LauncherInjector/LauncherInjector.vcxproj.filters
delete mode 100644 LauncherInjector/main.cpp
delete mode 100644 LauncherInjector/ns_icon.ico
delete mode 100644 LauncherInjector/ns_startup_args.txt
delete mode 100644 LauncherInjector/ns_startup_args_dedi.txt
delete mode 100644 LauncherInjector/resource1.h
delete mode 100644 LauncherInjector/resources.rc
create mode 100644 NorthstarDLL/ExploitFixes.cpp
create mode 100644 NorthstarDLL/ExploitFixes.h
create mode 100644 NorthstarDLL/ExploitFixes_UTF8Parser.h
create mode 100644 NorthstarDLL/NSMem.h
create mode 100644 NorthstarDLL/NorthstarDLL.vcxproj
create mode 100644 NorthstarDLL/NorthstarDLL.vcxproj.filters
create mode 100644 NorthstarDLL/audio.cpp
create mode 100644 NorthstarDLL/audio.h
create mode 100644 NorthstarDLL/audio_asm.asm
create mode 100644 NorthstarDLL/bansystem.cpp
create mode 100644 NorthstarDLL/bansystem.h
create mode 100644 NorthstarDLL/bitbuf.h
create mode 100644 NorthstarDLL/bits.cpp
create mode 100644 NorthstarDLL/bits.h
create mode 100644 NorthstarDLL/buildainfile.cpp
create mode 100644 NorthstarDLL/chatcommand.cpp
create mode 100644 NorthstarDLL/clientauthhooks.cpp
create mode 100644 NorthstarDLL/clientchathooks.cpp
create mode 100644 NorthstarDLL/clientruihooks.cpp
create mode 100644 NorthstarDLL/clientvideooverrides.cpp
create mode 100644 NorthstarDLL/color.h
create mode 100644 NorthstarDLL/concommand.cpp
create mode 100644 NorthstarDLL/concommand.h
create mode 100644 NorthstarDLL/configurables.cpp
create mode 100644 NorthstarDLL/configurables.h
create mode 100644 NorthstarDLL/convar.cpp
create mode 100644 NorthstarDLL/convar.h
create mode 100644 NorthstarDLL/crashhandler.cpp
create mode 100644 NorthstarDLL/crashhandler.h
create mode 100644 NorthstarDLL/cvar.cpp
create mode 100644 NorthstarDLL/cvar.h
create mode 100644 NorthstarDLL/debugoverlay.cpp
create mode 100644 NorthstarDLL/dedicated.cpp
create mode 100644 NorthstarDLL/dedicated.h
create mode 100644 NorthstarDLL/dedicatedmaterialsystem.cpp
create mode 100644 NorthstarDLL/demofixes.cpp
create mode 100644 NorthstarDLL/dllmain.cpp
create mode 100644 NorthstarDLL/filesystem.cpp
create mode 100644 NorthstarDLL/filesystem.h
create mode 100644 NorthstarDLL/hooks.cpp
create mode 100644 NorthstarDLL/hooks.h
create mode 100644 NorthstarDLL/hookutils.cpp
create mode 100644 NorthstarDLL/hookutils.h
create mode 100644 NorthstarDLL/host.cpp
create mode 100644 NorthstarDLL/hoststate.cpp
create mode 100644 NorthstarDLL/hoststate.h
create mode 100644 NorthstarDLL/include/MinHook.h
create mode 100644 NorthstarDLL/include/MinHook.x64.lib
create mode 100644 NorthstarDLL/include/crypto/__DECC_INCLUDE_EPILOGUE.H
create mode 100644 NorthstarDLL/include/crypto/__DECC_INCLUDE_PROLOGUE.H
create mode 100644 NorthstarDLL/include/crypto/aes_platform.h
create mode 100644 NorthstarDLL/include/crypto/aria.h
create mode 100644 NorthstarDLL/include/crypto/asn1.h
create mode 100644 NorthstarDLL/include/crypto/asn1_dsa.h
create mode 100644 NorthstarDLL/include/crypto/asn1err.h
create mode 100644 NorthstarDLL/include/crypto/async.h
create mode 100644 NorthstarDLL/include/crypto/asyncerr.h
create mode 100644 NorthstarDLL/include/crypto/bioerr.h
create mode 100644 NorthstarDLL/include/crypto/bn.h
create mode 100644 NorthstarDLL/include/crypto/bn_conf.h
create mode 100644 NorthstarDLL/include/crypto/bn_conf.h.in
create mode 100644 NorthstarDLL/include/crypto/bn_dh.h
create mode 100644 NorthstarDLL/include/crypto/bn_srp.h
create mode 100644 NorthstarDLL/include/crypto/bnerr.h
create mode 100644 NorthstarDLL/include/crypto/buffererr.h
create mode 100644 NorthstarDLL/include/crypto/chacha.h
create mode 100644 NorthstarDLL/include/crypto/cmll_platform.h
create mode 100644 NorthstarDLL/include/crypto/cmperr.h
create mode 100644 NorthstarDLL/include/crypto/cmserr.h
create mode 100644 NorthstarDLL/include/crypto/comperr.h
create mode 100644 NorthstarDLL/include/crypto/conferr.h
create mode 100644 NorthstarDLL/include/crypto/crmferr.h
create mode 100644 NorthstarDLL/include/crypto/cryptlib.h
create mode 100644 NorthstarDLL/include/crypto/cryptoerr.h
create mode 100644 NorthstarDLL/include/crypto/cterr.h
create mode 100644 NorthstarDLL/include/crypto/ctype.h
create mode 100644 NorthstarDLL/include/crypto/decoder.h
create mode 100644 NorthstarDLL/include/crypto/decodererr.h
create mode 100644 NorthstarDLL/include/crypto/des_platform.h
create mode 100644 NorthstarDLL/include/crypto/dh.h
create mode 100644 NorthstarDLL/include/crypto/dherr.h
create mode 100644 NorthstarDLL/include/crypto/dsa.h
create mode 100644 NorthstarDLL/include/crypto/dsaerr.h
create mode 100644 NorthstarDLL/include/crypto/dso_conf.h
create mode 100644 NorthstarDLL/include/crypto/dso_conf.h.in
create mode 100644 NorthstarDLL/include/crypto/ec.h
create mode 100644 NorthstarDLL/include/crypto/ecerr.h
create mode 100644 NorthstarDLL/include/crypto/ecx.h
create mode 100644 NorthstarDLL/include/crypto/encoder.h
create mode 100644 NorthstarDLL/include/crypto/encodererr.h
create mode 100644 NorthstarDLL/include/crypto/engine.h
create mode 100644 NorthstarDLL/include/crypto/engineerr.h
create mode 100644 NorthstarDLL/include/crypto/err.h
create mode 100644 NorthstarDLL/include/crypto/ess.h
create mode 100644 NorthstarDLL/include/crypto/esserr.h
create mode 100644 NorthstarDLL/include/crypto/evp.h
create mode 100644 NorthstarDLL/include/crypto/evperr.h
create mode 100644 NorthstarDLL/include/crypto/httperr.h
create mode 100644 NorthstarDLL/include/crypto/lhash.h
create mode 100644 NorthstarDLL/include/crypto/md32_common.h
create mode 100644 NorthstarDLL/include/crypto/modes.h
create mode 100644 NorthstarDLL/include/crypto/objects.h
create mode 100644 NorthstarDLL/include/crypto/objectserr.h
create mode 100644 NorthstarDLL/include/crypto/ocsperr.h
create mode 100644 NorthstarDLL/include/crypto/pem.h
create mode 100644 NorthstarDLL/include/crypto/pemerr.h
create mode 100644 NorthstarDLL/include/crypto/pkcs12err.h
create mode 100644 NorthstarDLL/include/crypto/pkcs7.h
create mode 100644 NorthstarDLL/include/crypto/pkcs7err.h
create mode 100644 NorthstarDLL/include/crypto/poly1305.h
create mode 100644 NorthstarDLL/include/crypto/ppc_arch.h
create mode 100644 NorthstarDLL/include/crypto/punycode.h
create mode 100644 NorthstarDLL/include/crypto/rand.h
create mode 100644 NorthstarDLL/include/crypto/rand_pool.h
create mode 100644 NorthstarDLL/include/crypto/randerr.h
create mode 100644 NorthstarDLL/include/crypto/rsa.h
create mode 100644 NorthstarDLL/include/crypto/rsaerr.h
create mode 100644 NorthstarDLL/include/crypto/security_bits.h
create mode 100644 NorthstarDLL/include/crypto/sha.h
create mode 100644 NorthstarDLL/include/crypto/siphash.h
create mode 100644 NorthstarDLL/include/crypto/siv.h
create mode 100644 NorthstarDLL/include/crypto/sm2.h
create mode 100644 NorthstarDLL/include/crypto/sm2err.h
create mode 100644 NorthstarDLL/include/crypto/sm4.h
create mode 100644 NorthstarDLL/include/crypto/sparc_arch.h
create mode 100644 NorthstarDLL/include/crypto/sparse_array.h
create mode 100644 NorthstarDLL/include/crypto/store.h
create mode 100644 NorthstarDLL/include/crypto/storeerr.h
create mode 100644 NorthstarDLL/include/crypto/tserr.h
create mode 100644 NorthstarDLL/include/crypto/types.h
create mode 100644 NorthstarDLL/include/crypto/uierr.h
create mode 100644 NorthstarDLL/include/crypto/x509.h
create mode 100644 NorthstarDLL/include/crypto/x509err.h
create mode 100644 NorthstarDLL/include/crypto/x509v3err.h
create mode 100644 NorthstarDLL/include/httplib.h
create mode 100644 NorthstarDLL/include/internal/__DECC_INCLUDE_EPILOGUE.H
create mode 100644 NorthstarDLL/include/internal/__DECC_INCLUDE_PROLOGUE.H
create mode 100644 NorthstarDLL/include/internal/asn1.h
create mode 100644 NorthstarDLL/include/internal/bio.h
create mode 100644 NorthstarDLL/include/internal/comp.h
create mode 100644 NorthstarDLL/include/internal/conf.h
create mode 100644 NorthstarDLL/include/internal/constant_time.h
create mode 100644 NorthstarDLL/include/internal/core.h
create mode 100644 NorthstarDLL/include/internal/cryptlib.h
create mode 100644 NorthstarDLL/include/internal/dane.h
create mode 100644 NorthstarDLL/include/internal/deprecated.h
create mode 100644 NorthstarDLL/include/internal/der.h
create mode 100644 NorthstarDLL/include/internal/dso.h
create mode 100644 NorthstarDLL/include/internal/dsoerr.h
create mode 100644 NorthstarDLL/include/internal/endian.h
create mode 100644 NorthstarDLL/include/internal/err.h
create mode 100644 NorthstarDLL/include/internal/ffc.h
create mode 100644 NorthstarDLL/include/internal/ktls.h
create mode 100644 NorthstarDLL/include/internal/namemap.h
create mode 100644 NorthstarDLL/include/internal/nelem.h
create mode 100644 NorthstarDLL/include/internal/numbers.h
create mode 100644 NorthstarDLL/include/internal/o_dir.h
create mode 100644 NorthstarDLL/include/internal/packet.h
create mode 100644 NorthstarDLL/include/internal/param_build_set.h
create mode 100644 NorthstarDLL/include/internal/passphrase.h
create mode 100644 NorthstarDLL/include/internal/property.h
create mode 100644 NorthstarDLL/include/internal/propertyerr.h
create mode 100644 NorthstarDLL/include/internal/provider.h
create mode 100644 NorthstarDLL/include/internal/refcount.h
create mode 100644 NorthstarDLL/include/internal/sha3.h
create mode 100644 NorthstarDLL/include/internal/sizes.h
create mode 100644 NorthstarDLL/include/internal/sm3.h
create mode 100644 NorthstarDLL/include/internal/sockets.h
create mode 100644 NorthstarDLL/include/internal/sslconf.h
create mode 100644 NorthstarDLL/include/internal/symhacks.h
create mode 100644 NorthstarDLL/include/internal/thread_once.h
create mode 100644 NorthstarDLL/include/internal/tlsgroups.h
create mode 100644 NorthstarDLL/include/internal/tsan_assist.h
create mode 100644 NorthstarDLL/include/internal/unicode.h
create mode 100644 NorthstarDLL/include/libcrypto_static.lib
create mode 100644 NorthstarDLL/include/libcurl/include/curl/curl.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/curlver.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/easy.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/mprintf.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/multi.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/options.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/stdcheaders.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/system.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/typecheck-gcc.h
create mode 100644 NorthstarDLL/include/libcurl/include/curl/urlapi.h
create mode 100644 NorthstarDLL/include/libcurl/lib/libcurl_a.lib
create mode 100644 NorthstarDLL/include/libssl_static.lib
create mode 100644 NorthstarDLL/include/openssl/__DECC_INCLUDE_EPILOGUE.H
create mode 100644 NorthstarDLL/include/openssl/__DECC_INCLUDE_PROLOGUE.H
create mode 100644 NorthstarDLL/include/openssl/aes.h
create mode 100644 NorthstarDLL/include/openssl/asn1.h
create mode 100644 NorthstarDLL/include/openssl/asn1.h.in
create mode 100644 NorthstarDLL/include/openssl/asn1_mac.h
create mode 100644 NorthstarDLL/include/openssl/asn1err.h
create mode 100644 NorthstarDLL/include/openssl/asn1t.h
create mode 100644 NorthstarDLL/include/openssl/asn1t.h.in
create mode 100644 NorthstarDLL/include/openssl/async.h
create mode 100644 NorthstarDLL/include/openssl/asyncerr.h
create mode 100644 NorthstarDLL/include/openssl/bio.h
create mode 100644 NorthstarDLL/include/openssl/bio.h.in
create mode 100644 NorthstarDLL/include/openssl/bioerr.h
create mode 100644 NorthstarDLL/include/openssl/blowfish.h
create mode 100644 NorthstarDLL/include/openssl/bn.h
create mode 100644 NorthstarDLL/include/openssl/bnerr.h
create mode 100644 NorthstarDLL/include/openssl/buffer.h
create mode 100644 NorthstarDLL/include/openssl/buffererr.h
create mode 100644 NorthstarDLL/include/openssl/camellia.h
create mode 100644 NorthstarDLL/include/openssl/cast.h
create mode 100644 NorthstarDLL/include/openssl/cmac.h
create mode 100644 NorthstarDLL/include/openssl/cmp.h
create mode 100644 NorthstarDLL/include/openssl/cmp.h.in
create mode 100644 NorthstarDLL/include/openssl/cmp_util.h
create mode 100644 NorthstarDLL/include/openssl/cmperr.h
create mode 100644 NorthstarDLL/include/openssl/cms.h
create mode 100644 NorthstarDLL/include/openssl/cms.h.in
create mode 100644 NorthstarDLL/include/openssl/cmserr.h
create mode 100644 NorthstarDLL/include/openssl/comp.h
create mode 100644 NorthstarDLL/include/openssl/comperr.h
create mode 100644 NorthstarDLL/include/openssl/conf.h
create mode 100644 NorthstarDLL/include/openssl/conf.h.in
create mode 100644 NorthstarDLL/include/openssl/conf_api.h
create mode 100644 NorthstarDLL/include/openssl/conferr.h
create mode 100644 NorthstarDLL/include/openssl/configuration.h
create mode 100644 NorthstarDLL/include/openssl/configuration.h.in
create mode 100644 NorthstarDLL/include/openssl/conftypes.h
create mode 100644 NorthstarDLL/include/openssl/core.h
create mode 100644 NorthstarDLL/include/openssl/core_dispatch.h
create mode 100644 NorthstarDLL/include/openssl/core_names.h
create mode 100644 NorthstarDLL/include/openssl/core_object.h
create mode 100644 NorthstarDLL/include/openssl/crmf.h
create mode 100644 NorthstarDLL/include/openssl/crmf.h.in
create mode 100644 NorthstarDLL/include/openssl/crmferr.h
create mode 100644 NorthstarDLL/include/openssl/crypto.h
create mode 100644 NorthstarDLL/include/openssl/crypto.h.in
create mode 100644 NorthstarDLL/include/openssl/cryptoerr.h
create mode 100644 NorthstarDLL/include/openssl/cryptoerr_legacy.h
create mode 100644 NorthstarDLL/include/openssl/ct.h
create mode 100644 NorthstarDLL/include/openssl/ct.h.in
create mode 100644 NorthstarDLL/include/openssl/cterr.h
create mode 100644 NorthstarDLL/include/openssl/decoder.h
create mode 100644 NorthstarDLL/include/openssl/decodererr.h
create mode 100644 NorthstarDLL/include/openssl/des.h
create mode 100644 NorthstarDLL/include/openssl/dh.h
create mode 100644 NorthstarDLL/include/openssl/dherr.h
create mode 100644 NorthstarDLL/include/openssl/dsa.h
create mode 100644 NorthstarDLL/include/openssl/dsaerr.h
create mode 100644 NorthstarDLL/include/openssl/dtls1.h
create mode 100644 NorthstarDLL/include/openssl/e_os2.h
create mode 100644 NorthstarDLL/include/openssl/ebcdic.h
create mode 100644 NorthstarDLL/include/openssl/ec.h
create mode 100644 NorthstarDLL/include/openssl/ecdh.h
create mode 100644 NorthstarDLL/include/openssl/ecdsa.h
create mode 100644 NorthstarDLL/include/openssl/ecerr.h
create mode 100644 NorthstarDLL/include/openssl/encoder.h
create mode 100644 NorthstarDLL/include/openssl/encodererr.h
create mode 100644 NorthstarDLL/include/openssl/engine.h
create mode 100644 NorthstarDLL/include/openssl/engineerr.h
create mode 100644 NorthstarDLL/include/openssl/err.h
create mode 100644 NorthstarDLL/include/openssl/err.h.in
create mode 100644 NorthstarDLL/include/openssl/ess.h
create mode 100644 NorthstarDLL/include/openssl/ess.h.in
create mode 100644 NorthstarDLL/include/openssl/esserr.h
create mode 100644 NorthstarDLL/include/openssl/evp.h
create mode 100644 NorthstarDLL/include/openssl/evperr.h
create mode 100644 NorthstarDLL/include/openssl/fips_names.h
create mode 100644 NorthstarDLL/include/openssl/fipskey.h
create mode 100644 NorthstarDLL/include/openssl/fipskey.h.in
create mode 100644 NorthstarDLL/include/openssl/hmac.h
create mode 100644 NorthstarDLL/include/openssl/http.h
create mode 100644 NorthstarDLL/include/openssl/httperr.h
create mode 100644 NorthstarDLL/include/openssl/idea.h
create mode 100644 NorthstarDLL/include/openssl/kdf.h
create mode 100644 NorthstarDLL/include/openssl/kdferr.h
create mode 100644 NorthstarDLL/include/openssl/lhash.h
create mode 100644 NorthstarDLL/include/openssl/lhash.h.in
create mode 100644 NorthstarDLL/include/openssl/macros.h
create mode 100644 NorthstarDLL/include/openssl/md2.h
create mode 100644 NorthstarDLL/include/openssl/md4.h
create mode 100644 NorthstarDLL/include/openssl/md5.h
create mode 100644 NorthstarDLL/include/openssl/mdc2.h
create mode 100644 NorthstarDLL/include/openssl/modes.h
create mode 100644 NorthstarDLL/include/openssl/obj_mac.h
create mode 100644 NorthstarDLL/include/openssl/objects.h
create mode 100644 NorthstarDLL/include/openssl/objectserr.h
create mode 100644 NorthstarDLL/include/openssl/ocsp.h
create mode 100644 NorthstarDLL/include/openssl/ocsp.h.in
create mode 100644 NorthstarDLL/include/openssl/ocsperr.h
create mode 100644 NorthstarDLL/include/openssl/opensslconf.h
create mode 100644 NorthstarDLL/include/openssl/opensslv.h
create mode 100644 NorthstarDLL/include/openssl/opensslv.h.in
create mode 100644 NorthstarDLL/include/openssl/ossl_typ.h
create mode 100644 NorthstarDLL/include/openssl/param_build.h
create mode 100644 NorthstarDLL/include/openssl/params.h
create mode 100644 NorthstarDLL/include/openssl/pem.h
create mode 100644 NorthstarDLL/include/openssl/pem2.h
create mode 100644 NorthstarDLL/include/openssl/pemerr.h
create mode 100644 NorthstarDLL/include/openssl/pkcs12.h
create mode 100644 NorthstarDLL/include/openssl/pkcs12.h.in
create mode 100644 NorthstarDLL/include/openssl/pkcs12err.h
create mode 100644 NorthstarDLL/include/openssl/pkcs7.h
create mode 100644 NorthstarDLL/include/openssl/pkcs7.h.in
create mode 100644 NorthstarDLL/include/openssl/pkcs7err.h
create mode 100644 NorthstarDLL/include/openssl/prov_ssl.h
create mode 100644 NorthstarDLL/include/openssl/proverr.h
create mode 100644 NorthstarDLL/include/openssl/provider.h
create mode 100644 NorthstarDLL/include/openssl/rand.h
create mode 100644 NorthstarDLL/include/openssl/randerr.h
create mode 100644 NorthstarDLL/include/openssl/rc2.h
create mode 100644 NorthstarDLL/include/openssl/rc4.h
create mode 100644 NorthstarDLL/include/openssl/rc5.h
create mode 100644 NorthstarDLL/include/openssl/ripemd.h
create mode 100644 NorthstarDLL/include/openssl/rsa.h
create mode 100644 NorthstarDLL/include/openssl/rsaerr.h
create mode 100644 NorthstarDLL/include/openssl/safestack.h
create mode 100644 NorthstarDLL/include/openssl/safestack.h.in
create mode 100644 NorthstarDLL/include/openssl/seed.h
create mode 100644 NorthstarDLL/include/openssl/self_test.h
create mode 100644 NorthstarDLL/include/openssl/sha.h
create mode 100644 NorthstarDLL/include/openssl/srp.h
create mode 100644 NorthstarDLL/include/openssl/srp.h.in
create mode 100644 NorthstarDLL/include/openssl/srtp.h
create mode 100644 NorthstarDLL/include/openssl/ssl.h
create mode 100644 NorthstarDLL/include/openssl/ssl.h.in
create mode 100644 NorthstarDLL/include/openssl/ssl2.h
create mode 100644 NorthstarDLL/include/openssl/ssl3.h
create mode 100644 NorthstarDLL/include/openssl/sslerr.h
create mode 100644 NorthstarDLL/include/openssl/sslerr_legacy.h
create mode 100644 NorthstarDLL/include/openssl/stack.h
create mode 100644 NorthstarDLL/include/openssl/store.h
create mode 100644 NorthstarDLL/include/openssl/storeerr.h
create mode 100644 NorthstarDLL/include/openssl/symhacks.h
create mode 100644 NorthstarDLL/include/openssl/tls1.h
create mode 100644 NorthstarDLL/include/openssl/trace.h
create mode 100644 NorthstarDLL/include/openssl/ts.h
create mode 100644 NorthstarDLL/include/openssl/tserr.h
create mode 100644 NorthstarDLL/include/openssl/txt_db.h
create mode 100644 NorthstarDLL/include/openssl/types.h
create mode 100644 NorthstarDLL/include/openssl/ui.h
create mode 100644 NorthstarDLL/include/openssl/ui.h.in
create mode 100644 NorthstarDLL/include/openssl/uierr.h
create mode 100644 NorthstarDLL/include/openssl/whrlpool.h
create mode 100644 NorthstarDLL/include/openssl/x509.h
create mode 100644 NorthstarDLL/include/openssl/x509.h.in
create mode 100644 NorthstarDLL/include/openssl/x509_vfy.h
create mode 100644 NorthstarDLL/include/openssl/x509_vfy.h.in
create mode 100644 NorthstarDLL/include/openssl/x509err.h
create mode 100644 NorthstarDLL/include/openssl/x509v3.h
create mode 100644 NorthstarDLL/include/openssl/x509v3.h.in
create mode 100644 NorthstarDLL/include/openssl/x509v3err.h
create mode 100644 NorthstarDLL/include/rapidjson/allocators.h
create mode 100644 NorthstarDLL/include/rapidjson/document.h
create mode 100644 NorthstarDLL/include/rapidjson/encodedstream.h
create mode 100644 NorthstarDLL/include/rapidjson/encodings.h
create mode 100644 NorthstarDLL/include/rapidjson/error/en.h
create mode 100644 NorthstarDLL/include/rapidjson/error/error.h
create mode 100644 NorthstarDLL/include/rapidjson/filereadstream.h
create mode 100644 NorthstarDLL/include/rapidjson/filewritestream.h
create mode 100644 NorthstarDLL/include/rapidjson/fwd.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/biginteger.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/diyfp.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/dtoa.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/ieee754.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/itoa.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/meta.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/pow10.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/regex.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/stack.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/strfunc.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/strtod.h
create mode 100644 NorthstarDLL/include/rapidjson/internal/swap.h
create mode 100644 NorthstarDLL/include/rapidjson/istreamwrapper.h
create mode 100644 NorthstarDLL/include/rapidjson/memorybuffer.h
create mode 100644 NorthstarDLL/include/rapidjson/memorystream.h
create mode 100644 NorthstarDLL/include/rapidjson/msinttypes/inttypes.h
create mode 100644 NorthstarDLL/include/rapidjson/msinttypes/stdint.h
create mode 100644 NorthstarDLL/include/rapidjson/ostreamwrapper.h
create mode 100644 NorthstarDLL/include/rapidjson/pointer.h
create mode 100644 NorthstarDLL/include/rapidjson/prettywriter.h
create mode 100644 NorthstarDLL/include/rapidjson/rapidjson.h
create mode 100644 NorthstarDLL/include/rapidjson/reader.h
create mode 100644 NorthstarDLL/include/rapidjson/schema.h
create mode 100644 NorthstarDLL/include/rapidjson/stream.h
create mode 100644 NorthstarDLL/include/rapidjson/stringbuffer.h
create mode 100644 NorthstarDLL/include/rapidjson/writer.h
create mode 100644 NorthstarDLL/include/spdlog/async.h
create mode 100644 NorthstarDLL/include/spdlog/async_logger-inl.h
create mode 100644 NorthstarDLL/include/spdlog/async_logger.h
create mode 100644 NorthstarDLL/include/spdlog/cfg/argv.h
create mode 100644 NorthstarDLL/include/spdlog/cfg/env.h
create mode 100644 NorthstarDLL/include/spdlog/cfg/helpers-inl.h
create mode 100644 NorthstarDLL/include/spdlog/cfg/helpers.h
create mode 100644 NorthstarDLL/include/spdlog/common-inl.h
create mode 100644 NorthstarDLL/include/spdlog/common.h
create mode 100644 NorthstarDLL/include/spdlog/details/backtracer-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/backtracer.h
create mode 100644 NorthstarDLL/include/spdlog/details/circular_q.h
create mode 100644 NorthstarDLL/include/spdlog/details/console_globals.h
create mode 100644 NorthstarDLL/include/spdlog/details/file_helper-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/file_helper.h
create mode 100644 NorthstarDLL/include/spdlog/details/fmt_helper.h
create mode 100644 NorthstarDLL/include/spdlog/details/log_msg-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/log_msg.h
create mode 100644 NorthstarDLL/include/spdlog/details/log_msg_buffer-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/log_msg_buffer.h
create mode 100644 NorthstarDLL/include/spdlog/details/mpmc_blocking_q.h
create mode 100644 NorthstarDLL/include/spdlog/details/null_mutex.h
create mode 100644 NorthstarDLL/include/spdlog/details/os-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/os.h
create mode 100644 NorthstarDLL/include/spdlog/details/periodic_worker-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/periodic_worker.h
create mode 100644 NorthstarDLL/include/spdlog/details/registry-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/registry.h
create mode 100644 NorthstarDLL/include/spdlog/details/synchronous_factory.h
create mode 100644 NorthstarDLL/include/spdlog/details/tcp_client-windows.h
create mode 100644 NorthstarDLL/include/spdlog/details/tcp_client.h
create mode 100644 NorthstarDLL/include/spdlog/details/thread_pool-inl.h
create mode 100644 NorthstarDLL/include/spdlog/details/thread_pool.h
create mode 100644 NorthstarDLL/include/spdlog/details/windows_include.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bin_to_hex.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/LICENSE.rst
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/chrono.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/color.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/compile.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/core.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/format-inl.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/format.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/locale.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/os.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/ostream.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/posix.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/printf.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/bundled/ranges.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/chrono.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/fmt.h
create mode 100644 NorthstarDLL/include/spdlog/fmt/ostr.h
create mode 100644 NorthstarDLL/include/spdlog/formatter.h
create mode 100644 NorthstarDLL/include/spdlog/fwd.h
create mode 100644 NorthstarDLL/include/spdlog/logger-inl.h
create mode 100644 NorthstarDLL/include/spdlog/logger.h
create mode 100644 NorthstarDLL/include/spdlog/pattern_formatter-inl.h
create mode 100644 NorthstarDLL/include/spdlog/pattern_formatter.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/android_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/ansicolor_sink-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/ansicolor_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/base_sink-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/base_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/basic_file_sink-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/basic_file_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/daily_file_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/dist_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/dup_filter_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/hourly_file_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/msvc_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/null_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/ostream_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/ringbuffer_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/rotating_file_sink-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/rotating_file_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/sink-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/stdout_color_sinks-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/stdout_color_sinks.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/stdout_sinks-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/stdout_sinks.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/syslog_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/systemd_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/tcp_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/win_eventlog_sink.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/wincolor_sink-inl.h
create mode 100644 NorthstarDLL/include/spdlog/sinks/wincolor_sink.h
create mode 100644 NorthstarDLL/include/spdlog/spdlog-inl.h
create mode 100644 NorthstarDLL/include/spdlog/spdlog.h
create mode 100644 NorthstarDLL/include/spdlog/stopwatch.h
create mode 100644 NorthstarDLL/include/spdlog/tweakme.h
create mode 100644 NorthstarDLL/include/spdlog/version.h
create mode 100644 NorthstarDLL/keyvalues.cpp
create mode 100644 NorthstarDLL/languagehooks.cpp
create mode 100644 NorthstarDLL/latencyflex.cpp
create mode 100644 NorthstarDLL/localchatwriter.cpp
create mode 100644 NorthstarDLL/localchatwriter.h
create mode 100644 NorthstarDLL/logging.cpp
create mode 100644 NorthstarDLL/logging.h
create mode 100644 NorthstarDLL/main.h
create mode 100644 NorthstarDLL/masterserver.cpp
create mode 100644 NorthstarDLL/masterserver.h
create mode 100644 NorthstarDLL/maxplayers.cpp
create mode 100644 NorthstarDLL/memalloc.cpp
create mode 100644 NorthstarDLL/memalloc.h
create mode 100644 NorthstarDLL/miscclientfixes.cpp
create mode 100644 NorthstarDLL/misccommands.cpp
create mode 100644 NorthstarDLL/misccommands.h
create mode 100644 NorthstarDLL/miscserverfixes.cpp
create mode 100644 NorthstarDLL/miscserverscript.cpp
create mode 100644 NorthstarDLL/miscserverscript.h
create mode 100644 NorthstarDLL/modlocalisation.cpp
create mode 100644 NorthstarDLL/modmanager.cpp
create mode 100644 NorthstarDLL/modmanager.h
create mode 100644 NorthstarDLL/ns_startup_args.txt
create mode 100644 NorthstarDLL/ns_startup_args_dedi.txt
create mode 100644 NorthstarDLL/ns_version.h
create mode 100644 NorthstarDLL/pch.cpp
create mode 100644 NorthstarDLL/pch.h
create mode 100644 NorthstarDLL/pdef.cpp
create mode 100644 NorthstarDLL/pdef.h
create mode 100644 NorthstarDLL/playlist.cpp
create mode 100644 NorthstarDLL/playlist.h
create mode 100644 NorthstarDLL/plugin_abi.h
create mode 100644 NorthstarDLL/plugins.cpp
create mode 100644 NorthstarDLL/plugins.h
create mode 100644 NorthstarDLL/printcommand.h
create mode 100644 NorthstarDLL/printcommands.cpp
create mode 100644 NorthstarDLL/printmaps.cpp
create mode 100644 NorthstarDLL/printmaps.h
create mode 100644 NorthstarDLL/r2client.cpp
create mode 100644 NorthstarDLL/r2client.h
create mode 100644 NorthstarDLL/r2engine.cpp
create mode 100644 NorthstarDLL/r2engine.h
create mode 100644 NorthstarDLL/r2server.cpp
create mode 100644 NorthstarDLL/r2server.h
create mode 100644 NorthstarDLL/rpakfilesystem.cpp
create mode 100644 NorthstarDLL/rpakfilesystem.h
create mode 100644 NorthstarDLL/scriptbrowserhooks.cpp
create mode 100644 NorthstarDLL/scriptmainmenupromos.cpp
create mode 100644 NorthstarDLL/scriptmodmenu.cpp
create mode 100644 NorthstarDLL/scriptserverbrowser.cpp
create mode 100644 NorthstarDLL/scriptservertoclientstringcommand.cpp
create mode 100644 NorthstarDLL/scriptsrson.cpp
create mode 100644 NorthstarDLL/scriptsrson.h
create mode 100644 NorthstarDLL/serverauthentication.cpp
create mode 100644 NorthstarDLL/serverauthentication.h
create mode 100644 NorthstarDLL/serverchathooks.cpp
create mode 100644 NorthstarDLL/serverchathooks.h
create mode 100644 NorthstarDLL/sigscanning.cpp
create mode 100644 NorthstarDLL/sigscanning.h
create mode 100644 NorthstarDLL/sourceconsole.cpp
create mode 100644 NorthstarDLL/sourceconsole.h
create mode 100644 NorthstarDLL/sourceinterface.cpp
create mode 100644 NorthstarDLL/sourceinterface.h
create mode 100644 NorthstarDLL/squirrel.cpp
create mode 100644 NorthstarDLL/squirrel.h
create mode 100644 NorthstarDLL/tier0.cpp
create mode 100644 NorthstarDLL/tier0.h
create mode 100644 NorthstarDLL/version.cpp
create mode 100644 NorthstarDLL/version.h
delete mode 100644 NorthstarDedicatedTest/ExploitFixes.cpp
delete mode 100644 NorthstarDedicatedTest/ExploitFixes.h
delete mode 100644 NorthstarDedicatedTest/ExploitFixes_UTF8Parser.h
delete mode 100644 NorthstarDedicatedTest/NSMem.h
delete mode 100644 NorthstarDedicatedTest/NorthstarDedicatedTest.vcxproj
delete mode 100644 NorthstarDedicatedTest/NorthstarDedicatedTest.vcxproj.filters
delete mode 100644 NorthstarDedicatedTest/audio.cpp
delete mode 100644 NorthstarDedicatedTest/audio.h
delete mode 100644 NorthstarDedicatedTest/audio_asm.asm
delete mode 100644 NorthstarDedicatedTest/bansystem.cpp
delete mode 100644 NorthstarDedicatedTest/bansystem.h
delete mode 100644 NorthstarDedicatedTest/bitbuf.h
delete mode 100644 NorthstarDedicatedTest/bits.cpp
delete mode 100644 NorthstarDedicatedTest/bits.h
delete mode 100644 NorthstarDedicatedTest/buildainfile.cpp
delete mode 100644 NorthstarDedicatedTest/chatcommand.cpp
delete mode 100644 NorthstarDedicatedTest/clientauthhooks.cpp
delete mode 100644 NorthstarDedicatedTest/clientchathooks.cpp
delete mode 100644 NorthstarDedicatedTest/clientruihooks.cpp
delete mode 100644 NorthstarDedicatedTest/clientvideooverrides.cpp
delete mode 100644 NorthstarDedicatedTest/color.h
delete mode 100644 NorthstarDedicatedTest/concommand.cpp
delete mode 100644 NorthstarDedicatedTest/concommand.h
delete mode 100644 NorthstarDedicatedTest/configurables.cpp
delete mode 100644 NorthstarDedicatedTest/configurables.h
delete mode 100644 NorthstarDedicatedTest/convar.cpp
delete mode 100644 NorthstarDedicatedTest/convar.h
delete mode 100644 NorthstarDedicatedTest/crashhandler.cpp
delete mode 100644 NorthstarDedicatedTest/crashhandler.h
delete mode 100644 NorthstarDedicatedTest/cvar.cpp
delete mode 100644 NorthstarDedicatedTest/cvar.h
delete mode 100644 NorthstarDedicatedTest/debugoverlay.cpp
delete mode 100644 NorthstarDedicatedTest/dedicated.cpp
delete mode 100644 NorthstarDedicatedTest/dedicated.h
delete mode 100644 NorthstarDedicatedTest/dedicatedmaterialsystem.cpp
delete mode 100644 NorthstarDedicatedTest/demofixes.cpp
delete mode 100644 NorthstarDedicatedTest/dllmain.cpp
delete mode 100644 NorthstarDedicatedTest/filesystem.cpp
delete mode 100644 NorthstarDedicatedTest/filesystem.h
delete mode 100644 NorthstarDedicatedTest/hooks.cpp
delete mode 100644 NorthstarDedicatedTest/hooks.h
delete mode 100644 NorthstarDedicatedTest/hookutils.cpp
delete mode 100644 NorthstarDedicatedTest/hookutils.h
delete mode 100644 NorthstarDedicatedTest/host.cpp
delete mode 100644 NorthstarDedicatedTest/hoststate.cpp
delete mode 100644 NorthstarDedicatedTest/hoststate.h
delete mode 100644 NorthstarDedicatedTest/include/MinHook.h
delete mode 100644 NorthstarDedicatedTest/include/MinHook.x64.lib
delete mode 100644 NorthstarDedicatedTest/include/crypto/__DECC_INCLUDE_EPILOGUE.H
delete mode 100644 NorthstarDedicatedTest/include/crypto/__DECC_INCLUDE_PROLOGUE.H
delete mode 100644 NorthstarDedicatedTest/include/crypto/aes_platform.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/aria.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/asn1.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/asn1_dsa.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/asn1err.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/async.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/asyncerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/bioerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/bn.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/bn_conf.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/bn_conf.h.in
delete mode 100644 NorthstarDedicatedTest/include/crypto/bn_dh.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/bn_srp.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/bnerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/buffererr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/chacha.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/cmll_platform.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/cmperr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/cmserr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/comperr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/conferr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/crmferr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/cryptlib.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/cryptoerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/cterr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/ctype.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/decoder.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/decodererr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/des_platform.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/dh.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/dherr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/dsa.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/dsaerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/dso_conf.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/dso_conf.h.in
delete mode 100644 NorthstarDedicatedTest/include/crypto/ec.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/ecerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/ecx.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/encoder.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/encodererr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/engine.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/engineerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/err.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/ess.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/esserr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/evp.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/evperr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/httperr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/lhash.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/md32_common.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/modes.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/objects.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/objectserr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/ocsperr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/pem.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/pemerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/pkcs12err.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/pkcs7.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/pkcs7err.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/poly1305.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/ppc_arch.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/punycode.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/rand.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/rand_pool.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/randerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/rsa.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/rsaerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/security_bits.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/sha.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/siphash.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/siv.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/sm2.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/sm2err.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/sm4.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/sparc_arch.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/sparse_array.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/store.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/storeerr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/tserr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/types.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/uierr.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/x509.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/x509err.h
delete mode 100644 NorthstarDedicatedTest/include/crypto/x509v3err.h
delete mode 100644 NorthstarDedicatedTest/include/httplib.h
delete mode 100644 NorthstarDedicatedTest/include/internal/__DECC_INCLUDE_EPILOGUE.H
delete mode 100644 NorthstarDedicatedTest/include/internal/__DECC_INCLUDE_PROLOGUE.H
delete mode 100644 NorthstarDedicatedTest/include/internal/asn1.h
delete mode 100644 NorthstarDedicatedTest/include/internal/bio.h
delete mode 100644 NorthstarDedicatedTest/include/internal/comp.h
delete mode 100644 NorthstarDedicatedTest/include/internal/conf.h
delete mode 100644 NorthstarDedicatedTest/include/internal/constant_time.h
delete mode 100644 NorthstarDedicatedTest/include/internal/core.h
delete mode 100644 NorthstarDedicatedTest/include/internal/cryptlib.h
delete mode 100644 NorthstarDedicatedTest/include/internal/dane.h
delete mode 100644 NorthstarDedicatedTest/include/internal/deprecated.h
delete mode 100644 NorthstarDedicatedTest/include/internal/der.h
delete mode 100644 NorthstarDedicatedTest/include/internal/dso.h
delete mode 100644 NorthstarDedicatedTest/include/internal/dsoerr.h
delete mode 100644 NorthstarDedicatedTest/include/internal/endian.h
delete mode 100644 NorthstarDedicatedTest/include/internal/err.h
delete mode 100644 NorthstarDedicatedTest/include/internal/ffc.h
delete mode 100644 NorthstarDedicatedTest/include/internal/ktls.h
delete mode 100644 NorthstarDedicatedTest/include/internal/namemap.h
delete mode 100644 NorthstarDedicatedTest/include/internal/nelem.h
delete mode 100644 NorthstarDedicatedTest/include/internal/numbers.h
delete mode 100644 NorthstarDedicatedTest/include/internal/o_dir.h
delete mode 100644 NorthstarDedicatedTest/include/internal/packet.h
delete mode 100644 NorthstarDedicatedTest/include/internal/param_build_set.h
delete mode 100644 NorthstarDedicatedTest/include/internal/passphrase.h
delete mode 100644 NorthstarDedicatedTest/include/internal/property.h
delete mode 100644 NorthstarDedicatedTest/include/internal/propertyerr.h
delete mode 100644 NorthstarDedicatedTest/include/internal/provider.h
delete mode 100644 NorthstarDedicatedTest/include/internal/refcount.h
delete mode 100644 NorthstarDedicatedTest/include/internal/sha3.h
delete mode 100644 NorthstarDedicatedTest/include/internal/sizes.h
delete mode 100644 NorthstarDedicatedTest/include/internal/sm3.h
delete mode 100644 NorthstarDedicatedTest/include/internal/sockets.h
delete mode 100644 NorthstarDedicatedTest/include/internal/sslconf.h
delete mode 100644 NorthstarDedicatedTest/include/internal/symhacks.h
delete mode 100644 NorthstarDedicatedTest/include/internal/thread_once.h
delete mode 100644 NorthstarDedicatedTest/include/internal/tlsgroups.h
delete mode 100644 NorthstarDedicatedTest/include/internal/tsan_assist.h
delete mode 100644 NorthstarDedicatedTest/include/internal/unicode.h
delete mode 100644 NorthstarDedicatedTest/include/libcrypto_static.lib
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/curl.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/curlver.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/easy.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/mprintf.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/multi.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/options.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/stdcheaders.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/system.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/typecheck-gcc.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/include/curl/urlapi.h
delete mode 100644 NorthstarDedicatedTest/include/libcurl/lib/libcurl_a.lib
delete mode 100644 NorthstarDedicatedTest/include/libssl_static.lib
delete mode 100644 NorthstarDedicatedTest/include/openssl/__DECC_INCLUDE_EPILOGUE.H
delete mode 100644 NorthstarDedicatedTest/include/openssl/__DECC_INCLUDE_PROLOGUE.H
delete mode 100644 NorthstarDedicatedTest/include/openssl/aes.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/asn1.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/asn1.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/asn1_mac.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/asn1err.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/asn1t.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/asn1t.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/async.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/asyncerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/bio.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/bio.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/bioerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/blowfish.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/bn.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/bnerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/buffer.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/buffererr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/camellia.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cast.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cmac.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cmp.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cmp.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/cmp_util.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cmperr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cms.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cms.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/cmserr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/comp.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/comperr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/conf.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/conf.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/conf_api.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/conferr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/configuration.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/configuration.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/conftypes.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/core.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/core_dispatch.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/core_names.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/core_object.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/crmf.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/crmf.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/crmferr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/crypto.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/crypto.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/cryptoerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/cryptoerr_legacy.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ct.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ct.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/cterr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/decoder.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/decodererr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/des.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/dh.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/dherr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/dsa.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/dsaerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/dtls1.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/e_os2.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ebcdic.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ec.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ecdh.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ecdsa.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ecerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/encoder.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/encodererr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/engine.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/engineerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/err.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/err.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/ess.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ess.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/esserr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/evp.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/evperr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/fips_names.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/fipskey.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/fipskey.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/hmac.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/http.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/httperr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/idea.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/kdf.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/kdferr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/lhash.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/lhash.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/macros.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/md2.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/md4.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/md5.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/mdc2.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/modes.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/obj_mac.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/objects.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/objectserr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ocsp.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ocsp.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/ocsperr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/opensslconf.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/opensslv.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/opensslv.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/ossl_typ.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/param_build.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/params.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pem.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pem2.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pemerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pkcs12.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pkcs12.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/pkcs12err.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pkcs7.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/pkcs7.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/pkcs7err.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/prov_ssl.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/proverr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/provider.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/rand.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/randerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/rc2.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/rc4.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/rc5.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ripemd.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/rsa.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/rsaerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/safestack.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/safestack.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/seed.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/self_test.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/sha.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/srp.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/srp.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/srtp.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ssl.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ssl.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/ssl2.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ssl3.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/sslerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/sslerr_legacy.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/stack.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/store.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/storeerr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/symhacks.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/tls1.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/trace.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ts.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/tserr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/txt_db.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/types.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ui.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/ui.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/uierr.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/whrlpool.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509_vfy.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509_vfy.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509err.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509v3.h
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509v3.h.in
delete mode 100644 NorthstarDedicatedTest/include/openssl/x509v3err.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/allocators.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/document.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/encodedstream.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/encodings.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/error/en.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/error/error.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/filereadstream.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/filewritestream.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/fwd.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/biginteger.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/diyfp.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/dtoa.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/ieee754.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/itoa.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/meta.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/pow10.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/regex.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/stack.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/strfunc.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/strtod.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/internal/swap.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/istreamwrapper.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/memorybuffer.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/memorystream.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/msinttypes/inttypes.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/msinttypes/stdint.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/ostreamwrapper.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/pointer.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/prettywriter.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/rapidjson.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/reader.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/schema.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/stream.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/stringbuffer.h
delete mode 100644 NorthstarDedicatedTest/include/rapidjson/writer.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/async.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/async_logger-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/async_logger.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/cfg/argv.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/cfg/env.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/cfg/helpers-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/cfg/helpers.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/common-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/common.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/backtracer-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/backtracer.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/circular_q.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/console_globals.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/file_helper-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/file_helper.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/fmt_helper.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/log_msg-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/log_msg.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/log_msg_buffer-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/log_msg_buffer.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/mpmc_blocking_q.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/null_mutex.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/os-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/os.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/periodic_worker-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/periodic_worker.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/registry-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/registry.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/synchronous_factory.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/tcp_client-windows.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/tcp_client.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/thread_pool-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/thread_pool.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/details/windows_include.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bin_to_hex.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/LICENSE.rst
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/chrono.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/color.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/compile.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/core.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/format-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/format.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/locale.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/os.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/ostream.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/posix.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/printf.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/bundled/ranges.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/chrono.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/fmt.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fmt/ostr.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/formatter.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/fwd.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/logger-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/logger.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/pattern_formatter-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/pattern_formatter.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/android_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/ansicolor_sink-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/ansicolor_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/base_sink-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/base_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/basic_file_sink-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/basic_file_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/daily_file_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/dist_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/dup_filter_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/hourly_file_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/msvc_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/null_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/ostream_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/ringbuffer_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/rotating_file_sink-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/rotating_file_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/sink-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/stdout_color_sinks-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/stdout_color_sinks.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/stdout_sinks-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/stdout_sinks.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/syslog_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/systemd_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/tcp_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/win_eventlog_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/wincolor_sink-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/sinks/wincolor_sink.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/spdlog-inl.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/spdlog.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/stopwatch.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/tweakme.h
delete mode 100644 NorthstarDedicatedTest/include/spdlog/version.h
delete mode 100644 NorthstarDedicatedTest/keyvalues.cpp
delete mode 100644 NorthstarDedicatedTest/languagehooks.cpp
delete mode 100644 NorthstarDedicatedTest/latencyflex.cpp
delete mode 100644 NorthstarDedicatedTest/localchatwriter.cpp
delete mode 100644 NorthstarDedicatedTest/localchatwriter.h
delete mode 100644 NorthstarDedicatedTest/logging.cpp
delete mode 100644 NorthstarDedicatedTest/logging.h
delete mode 100644 NorthstarDedicatedTest/main.h
delete mode 100644 NorthstarDedicatedTest/masterserver.cpp
delete mode 100644 NorthstarDedicatedTest/masterserver.h
delete mode 100644 NorthstarDedicatedTest/maxplayers.cpp
delete mode 100644 NorthstarDedicatedTest/memalloc.cpp
delete mode 100644 NorthstarDedicatedTest/memalloc.h
delete mode 100644 NorthstarDedicatedTest/miscclientfixes.cpp
delete mode 100644 NorthstarDedicatedTest/misccommands.cpp
delete mode 100644 NorthstarDedicatedTest/misccommands.h
delete mode 100644 NorthstarDedicatedTest/miscserverfixes.cpp
delete mode 100644 NorthstarDedicatedTest/miscserverscript.cpp
delete mode 100644 NorthstarDedicatedTest/miscserverscript.h
delete mode 100644 NorthstarDedicatedTest/modlocalisation.cpp
delete mode 100644 NorthstarDedicatedTest/modmanager.cpp
delete mode 100644 NorthstarDedicatedTest/modmanager.h
delete mode 100644 NorthstarDedicatedTest/ns_version.h
delete mode 100644 NorthstarDedicatedTest/pch.cpp
delete mode 100644 NorthstarDedicatedTest/pch.h
delete mode 100644 NorthstarDedicatedTest/pdef.cpp
delete mode 100644 NorthstarDedicatedTest/pdef.h
delete mode 100644 NorthstarDedicatedTest/playlist.cpp
delete mode 100644 NorthstarDedicatedTest/playlist.h
delete mode 100644 NorthstarDedicatedTest/plugin_abi.h
delete mode 100644 NorthstarDedicatedTest/plugins.cpp
delete mode 100644 NorthstarDedicatedTest/plugins.h
delete mode 100644 NorthstarDedicatedTest/printcommand.h
delete mode 100644 NorthstarDedicatedTest/printcommands.cpp
delete mode 100644 NorthstarDedicatedTest/printmaps.cpp
delete mode 100644 NorthstarDedicatedTest/printmaps.h
delete mode 100644 NorthstarDedicatedTest/r2client.cpp
delete mode 100644 NorthstarDedicatedTest/r2client.h
delete mode 100644 NorthstarDedicatedTest/r2engine.cpp
delete mode 100644 NorthstarDedicatedTest/r2engine.h
delete mode 100644 NorthstarDedicatedTest/r2server.cpp
delete mode 100644 NorthstarDedicatedTest/r2server.h
delete mode 100644 NorthstarDedicatedTest/rpakfilesystem.cpp
delete mode 100644 NorthstarDedicatedTest/rpakfilesystem.h
delete mode 100644 NorthstarDedicatedTest/scriptbrowserhooks.cpp
delete mode 100644 NorthstarDedicatedTest/scriptmainmenupromos.cpp
delete mode 100644 NorthstarDedicatedTest/scriptmodmenu.cpp
delete mode 100644 NorthstarDedicatedTest/scriptserverbrowser.cpp
delete mode 100644 NorthstarDedicatedTest/scriptservertoclientstringcommand.cpp
delete mode 100644 NorthstarDedicatedTest/scriptsrson.cpp
delete mode 100644 NorthstarDedicatedTest/scriptsrson.h
delete mode 100644 NorthstarDedicatedTest/serverauthentication.cpp
delete mode 100644 NorthstarDedicatedTest/serverauthentication.h
delete mode 100644 NorthstarDedicatedTest/serverchathooks.cpp
delete mode 100644 NorthstarDedicatedTest/serverchathooks.h
delete mode 100644 NorthstarDedicatedTest/sigscanning.cpp
delete mode 100644 NorthstarDedicatedTest/sigscanning.h
delete mode 100644 NorthstarDedicatedTest/sourceconsole.cpp
delete mode 100644 NorthstarDedicatedTest/sourceconsole.h
delete mode 100644 NorthstarDedicatedTest/sourceinterface.cpp
delete mode 100644 NorthstarDedicatedTest/sourceinterface.h
delete mode 100644 NorthstarDedicatedTest/squirrel.cpp
delete mode 100644 NorthstarDedicatedTest/squirrel.h
delete mode 100644 NorthstarDedicatedTest/tier0.cpp
delete mode 100644 NorthstarDedicatedTest/tier0.h
delete mode 100644 NorthstarDedicatedTest/version.cpp
delete mode 100644 NorthstarDedicatedTest/version.h
create mode 100644 NorthstarLauncher/NorthstarLauncher.vcxproj
create mode 100644 NorthstarLauncher/NorthstarLauncher.vcxproj.filters
create mode 100644 NorthstarLauncher/main.cpp
create mode 100644 NorthstarLauncher/ns_icon.ico
create mode 100644 NorthstarLauncher/ns_startup_args.txt
create mode 100644 NorthstarLauncher/ns_startup_args_dedi.txt
create mode 100644 NorthstarLauncher/resource1.h
create mode 100644 NorthstarLauncher/resources.rc
create mode 100644 loader_wsock32_proxy/include/MinHook.h
create mode 100644 loader_wsock32_proxy/include/MinHook.x64.lib
diff --git a/LauncherInjector/LauncherInjector.vcxproj b/LauncherInjector/LauncherInjector.vcxproj
deleted file mode 100644
index 0c727918..00000000
--- a/LauncherInjector/LauncherInjector.vcxproj
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- 16.0
- Win32Proj
- {0ea82cb0-53fe-4d4c-96df-47fa970513d0}
- LauncherInjector
- 10.0
- NorthstarLauncher
-
-
-
- Application
- true
- v143
- Unicode
-
-
- Application
- false
- v143
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- false
-
-
-
- Level3
- true
- _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- stdcpp17
- /F8000000 %(AdditionalOptions)
-
-
- Console
- true
- shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- 8000000
-
-
- copy /Y "$(TargetPath)" "D:\origin\titanfall\Titanfall2"
-
-
-
-
- Level3
- true
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- stdcpp17
- /F8000000 %(AdditionalOptions)
-
-
- Console
- true
- true
- true
- shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
- 8000000
-
-
- copy /Y "$(TargetPath)" "D:\origin\titanfall\Titanfall2"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/LauncherInjector/LauncherInjector.vcxproj.filters b/LauncherInjector/LauncherInjector.vcxproj.filters
deleted file mode 100644
index 87e25fa8..00000000
--- a/LauncherInjector/LauncherInjector.vcxproj.filters
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Source Files
-
-
-
-
- Header Files
-
-
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
-
\ No newline at end of file
diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp
deleted file mode 100644
index 99e5ba15..00000000
--- a/LauncherInjector/main.cpp
+++ /dev/null
@@ -1,453 +0,0 @@
-#define WIN32_LEAN_AND_MEAN
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#pragma comment(lib, "Ws2_32.lib")
-
-#include
-#include
-
-namespace fs = std::filesystem;
-
-extern "C"
-{
- __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
- __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
-}
-
-HMODULE hLauncherModule;
-HMODULE hHookModule;
-HMODULE hTier0Module;
-
-wchar_t exePath[4096];
-wchar_t buffer[8192];
-
-bool noLoadPlugins = false;
-
-DWORD GetProcessByName(std::wstring processName)
-{
- HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
-
- PROCESSENTRY32 processSnapshotEntry = {0};
- processSnapshotEntry.dwSize = sizeof(PROCESSENTRY32);
-
- if (snapshot == INVALID_HANDLE_VALUE)
- return 0;
-
- if (!Process32First(snapshot, &processSnapshotEntry))
- return 0;
-
- while (Process32Next(snapshot, &processSnapshotEntry))
- {
- if (!wcscmp(processSnapshotEntry.szExeFile, processName.c_str()))
- {
- CloseHandle(snapshot);
- return processSnapshotEntry.th32ProcessID;
- }
- }
-
- CloseHandle(snapshot);
- return 0;
-}
-
-bool GetExePathWide(wchar_t* dest, DWORD destSize)
-{
- if (!dest)
- return NULL;
- if (destSize < MAX_PATH)
- return NULL;
-
- DWORD length = GetModuleFileNameW(NULL, dest, destSize);
- return length && PathRemoveFileSpecW(dest);
-}
-
-FARPROC GetLauncherMain()
-{
- static FARPROC Launcher_LauncherMain;
- if (!Launcher_LauncherMain)
- Launcher_LauncherMain = GetProcAddress(hLauncherModule, "LauncherMain");
- return Launcher_LauncherMain;
-}
-
-void LibraryLoadError(DWORD dwMessageId, const wchar_t* libName, const wchar_t* location)
-{
- char text[8192];
- std::string message = std::system_category().message(dwMessageId);
-
- sprintf_s(
- text,
- "Failed to load the %ls at \"%ls\" (%lu):\n\n%hs\n\nMake sure you followed the Northstar installation instructions carefully "
- "before reaching out for help.",
- libName,
- location,
- dwMessageId,
- message.c_str());
-
- if (dwMessageId == 126 && std::filesystem::exists(location))
- {
- sprintf_s(
- text,
- "%s\n\nThe file at the specified location DOES exist, so this error indicates that one of its *dependencies* failed to be "
- "found.\n\nTry the following steps:\n1. Install Visual C++ 2022 Redistributable: "
- "https://aka.ms/vs/17/release/vc_redist.x64.exe\n2. Repair game files",
- text);
- }
- else if (!fs::exists("Titanfall2.exe") && (fs::exists("..\\Titanfall2.exe") || fs::exists("..\\..\\Titanfall2.exe")))
- {
- auto curDir = std::filesystem::current_path().filename().string();
- auto aboveDir = std::filesystem::current_path().parent_path().filename().string();
- sprintf_s(
- text,
- "%s\n\nWe detected that in your case you have extracted the files into a *subdirectory* of your Titanfall 2 "
- "installation.\nPlease move all the files and folders from current folder (\"%s\") into the Titanfall 2 installation directory "
- "just above (\"%s\").\n\nPlease try out the above steps by yourself before reaching out to the community for support.",
- text,
- curDir.c_str(),
- aboveDir.c_str());
- }
- else if (!fs::exists("Titanfall2.exe"))
- {
- sprintf_s(
- text,
- "%s\n\nRemember: you need to unpack the contents of this archive into your Titanfall 2 game installation directory, not just "
- "to any random folder.",
- text);
- }
- else if (fs::exists("Titanfall2.exe"))
- {
- sprintf_s(
- text,
- "%s\n\nTitanfall2.exe has been found in the current directory: is the game installation corrupted or did you not unpack all "
- "Northstar files here?",
- text);
- }
-
- MessageBoxA(GetForegroundWindow(), text, "Northstar Launcher Error", 0);
-}
-
-void AwaitOriginStartup()
-{
- WSADATA wsaData;
- WSAStartup(MAKEWORD(2, 2), &wsaData);
- SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-
- if (sock != INVALID_SOCKET)
- {
- const int LSX_PORT = 3216;
-
- sockaddr_in lsxAddr;
- lsxAddr.sin_family = AF_INET;
- inet_pton(AF_INET, "127.0.0.1", &(lsxAddr.sin_addr));
- lsxAddr.sin_port = htons(LSX_PORT);
-
- std::cout << "LSX: connect()" << std::endl;
- connect(sock, (struct sockaddr*)&lsxAddr, sizeof(lsxAddr));
-
- char buf[4096];
- memset(buf, 0, sizeof(buf));
-
- do
- {
- recv(sock, buf, 4096, 0);
- std::cout << buf << std::endl;
-
- // honestly really shit, this isn't needed for origin due to being able to check OriginClientService
- // but for ea desktop we don't have anything like this, so atm we just have to wait to ensure that we start after logging in
- Sleep(8000);
- } while (!strstr(buf, "")); // ensure we're actually getting data from lsx
- }
-
- WSACleanup(); // cleanup sockets and such so game can contact lsx itself
-}
-
-void EnsureOriginStarted()
-{
- if (GetProcessByName(L"Origin.exe") || GetProcessByName(L"EADesktop.exe"))
- return; // already started
-
- // unpacked exe will crash if origin isn't open on launch, so launch it
- // get origin path from registry, code here is reversed from OriginSDK.dll
- HKEY key;
- if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\WOW6432Node\\Origin", 0, KEY_READ, &key) != ERROR_SUCCESS)
- {
- MessageBoxA(0, "Error: failed reading Origin path!", "Northstar Launcher Error", MB_OK);
- return;
- }
-
- char originPath[520];
- DWORD originPathLength = 520;
- if (RegQueryValueExA(key, "ClientPath", 0, 0, (LPBYTE)&originPath, &originPathLength) != ERROR_SUCCESS)
- {
- MessageBoxA(0, "Error: failed reading Origin path!", "Northstar Launcher Error", MB_OK);
- return;
- }
-
- std::cout << "[*] Starting Origin..." << std::endl;
-
- PROCESS_INFORMATION pi;
- memset(&pi, 0, sizeof(pi));
- STARTUPINFO si;
- memset(&si, 0, sizeof(si));
- si.cb = sizeof(STARTUPINFO);
- si.dwFlags = STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_MINIMIZE;
- CreateProcessA(
- originPath,
- (char*)"",
- NULL,
- NULL,
- false,
- CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_PROCESS_GROUP,
- NULL,
- NULL,
- (LPSTARTUPINFOA)&si,
- &pi);
-
- std::cout << "[*] Waiting for Origin..." << std::endl;
-
- // wait for origin process to boot
- do
- {
- Sleep(500);
- } while (!GetProcessByName(L"OriginClientService.exe") && !GetProcessByName(L"EADesktop.exe"));
-
- // wait for origin to be ready to start
- AwaitOriginStartup();
-
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
-}
-
-void PrependPath()
-{
- wchar_t* pPath;
- size_t len;
- errno_t err = _wdupenv_s(&pPath, &len, L"PATH");
- if (!err)
- {
- swprintf_s(buffer, L"PATH=%s\\bin\\x64_retail\\;%s", exePath, pPath);
- auto result = _wputenv(buffer);
- if (result == -1)
- {
- MessageBoxW(
- GetForegroundWindow(),
- L"Warning: could not prepend the current directory to app's PATH environment variable. Something may break because of "
- L"that.",
- L"Northstar Launcher Warning",
- 0);
- }
- free(pPath);
- }
- else
- {
- MessageBoxW(
- GetForegroundWindow(),
- L"Warning: could not get current PATH environment variable in order to prepend the current directory to it. Something may "
- L"break because of that.",
- L"Northstar Launcher Warning",
- 0);
- }
-}
-
-bool ShouldLoadNorthstar(int argc, char* argv[])
-{
- bool loadNorthstar = true;
- for (int i = 0; i < argc; i++)
- if (!strcmp(argv[i], "-vanilla"))
- loadNorthstar = false;
-
- if (!loadNorthstar)
- return loadNorthstar;
-
- auto runNorthstarFile = std::ifstream("run_northstar.txt");
- if (runNorthstarFile)
- {
- std::stringstream runNorthstarFileBuffer;
- runNorthstarFileBuffer << runNorthstarFile.rdbuf();
- runNorthstarFile.close();
- if (runNorthstarFileBuffer.str()._Starts_with("0"))
- loadNorthstar = false;
- }
- return loadNorthstar;
-}
-
-bool LoadNorthstar()
-{
- FARPROC Hook_Init = nullptr;
- {
- swprintf_s(buffer, L"%s\\Northstar.dll", exePath);
- hHookModule = LoadLibraryExW(buffer, 0i64, 8u);
- if (hHookModule)
- Hook_Init = GetProcAddress(hHookModule, "InitialiseNorthstar");
- if (!hHookModule || Hook_Init == nullptr)
- {
- LibraryLoadError(GetLastError(), L"Northstar.dll", buffer);
- return false;
- }
- }
- ((bool (*)())Hook_Init)();
-
- FARPROC LoadPlugins = nullptr;
- if (!noLoadPlugins)
- {
- LoadPlugins = GetProcAddress(hHookModule, "LoadPlugins");
- if (!hHookModule || LoadPlugins == nullptr)
- {
- std::cout << "Failed to get function pointer to LoadPlugins of Northstar.dll" << std::endl;
- LibraryLoadError(GetLastError(), L"Northstar.dll", buffer);
- return false;
- }
- ((bool (*)())LoadPlugins)();
- }
-
- return true;
-}
-
-HMODULE LoadDediStub(const char* name)
-{
- // this works because materialsystem_dx11.dll uses relative imports, and even a DLL loaded with an absolute path will take precedence
- std::cout << "[*] Loading " << name << std::endl;
- swprintf_s(buffer, L"%s\\bin\\x64_dedi\\%hs", exePath, name);
- HMODULE h = LoadLibraryExW(buffer, 0, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!h)
- {
- wprintf(L"[*] Failed to load stub %hs from \"%ls\": %hs\n", name, buffer, std::system_category().message(GetLastError()).c_str());
- }
- return h;
-}
-
-int main(int argc, char* argv[])
-{
-
- if (!GetExePathWide(exePath, sizeof(exePath)))
- {
- MessageBoxA(
- GetForegroundWindow(),
- "Failed getting game directory.\nThe game cannot continue and has to exit.",
- "Northstar Launcher Error",
- 0);
- return 1;
- }
-
- bool noOriginStartup = false;
- bool dedicated = false;
- bool nostubs = false;
-
- for (int i = 0; i < argc; i++)
- if (!strcmp(argv[i], "-noOriginStartup"))
- noOriginStartup = true;
- else if (!strcmp(argv[i], "-dedicated")) // also checked by Northstar.dll
- dedicated = true;
- else if (!strcmp(argv[i], "-nostubs"))
- nostubs = true;
- else if (!strcmp(argv[i], "-noplugins"))
- noLoadPlugins = true;
-
- if (!noOriginStartup && !dedicated)
- {
- EnsureOriginStarted();
- }
-
- if (dedicated && !nostubs)
- {
- std::cout << "[*] Loading stubs" << std::endl;
- HMODULE gssao, gtxaa, d3d11;
- if (!(gssao = GetModuleHandleA("GFSDK_SSAO.win64.dll")) && !(gtxaa = GetModuleHandleA("GFSDK_TXAA.win64.dll")) &&
- !(d3d11 = GetModuleHandleA("d3d11.dll")))
- {
- if (!(gssao = LoadDediStub("GFSDK_SSAO.win64.dll")) || !(gtxaa = LoadDediStub("GFSDK_TXAA.win64.dll")) ||
- !(d3d11 = LoadDediStub("d3d11.dll")))
- {
- if ((!gssao || FreeLibrary(gssao)) && (!gtxaa || FreeLibrary(gtxaa)) && (!d3d11 || FreeLibrary(d3d11)))
- {
- std::cout <<"[*] WARNING: Failed to load d3d11/gfsdk stubs from bin/x64_dedi. "
- "The stubs have been unloaded and the original libraries will be used instead" << std::endl;
- }
- else
- {
- // this is highly unlikely
- MessageBoxA(
- GetForegroundWindow(),
- "Failed to load one or more stubs, but could not unload them either.\n"
- "The game cannot continue and has to exit.",
- "Northstar Launcher Error",
- 0);
- return 1;
- }
- }
- }
- else
- {
- // this should never happen
- std::cout << "[*] WARNING: Failed to load stubs because conflicting modules are already loaded, so those will be used instead "
- "(did Northstar initialize too late?)." << std::endl;
- }
- }
-
- {
- PrependPath();
-
- if (!fs::exists("ns_startup_args.txt"))
- {
- std::ofstream file("ns_startup_args.txt");
- std::string defaultArgs = "-multiple";
- file.write(defaultArgs.c_str(), defaultArgs.length());
- file.close();
- }
- if (!fs::exists("ns_startup_args_dedi.txt"))
- {
- std::ofstream file("ns_startup_args_dedi.txt");
- std::string defaultArgs = "+setplaylist private_match";
- file.write(defaultArgs.c_str(), defaultArgs.length());
- file.close();
- }
-
- std::cout << "[*] Loading tier0.dll" << std::endl;
- swprintf_s(buffer, L"%s\\bin\\x64_retail\\tier0.dll", exePath);
- hTier0Module = LoadLibraryExW(buffer, 0, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!hTier0Module)
- {
- LibraryLoadError(GetLastError(), L"tier0.dll", buffer);
- return 1;
- }
-
- bool loadNorthstar = ShouldLoadNorthstar(argc, argv);
- if (loadNorthstar)
- {
- std::cout << "[*] Loading Northstar" << std::endl;
- if (!LoadNorthstar())
- return 1;
- }
- else
- std::cout << "[*] Going to load the vanilla game" << std::endl;
-
- std::cout << "[*] Loading launcher.dll" << std::endl;
- swprintf_s(buffer, L"%s\\bin\\x64_retail\\launcher.dll", exePath);
- hLauncherModule = LoadLibraryExW(buffer, 0, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!hLauncherModule)
- {
- LibraryLoadError(GetLastError(), L"launcher.dll", buffer);
- return 1;
- }
- }
-
- std::cout << "[*] Launching the game..." << std::endl;
- auto LauncherMain = GetLauncherMain();
- if (!LauncherMain)
- MessageBoxA(
- GetForegroundWindow(),
- "Failed loading launcher.dll.\nThe game cannot continue and has to exit.",
- "Northstar Launcher Error",
- 0);
- // auto result = ((__int64(__fastcall*)())LauncherMain)();
- // auto result = ((signed __int64(__fastcall*)(__int64))LauncherMain)(0i64);
-
- std::cout.flush();
- return ((int(/*__fastcall*/*)(HINSTANCE, HINSTANCE, LPSTR, int))LauncherMain)(
- NULL, NULL, NULL, 0); // the parameters aren't really used anyways
-}
diff --git a/LauncherInjector/ns_icon.ico b/LauncherInjector/ns_icon.ico
deleted file mode 100644
index fc9ad166..00000000
Binary files a/LauncherInjector/ns_icon.ico and /dev/null differ
diff --git a/LauncherInjector/ns_startup_args.txt b/LauncherInjector/ns_startup_args.txt
deleted file mode 100644
index 0713aef2..00000000
--- a/LauncherInjector/ns_startup_args.txt
+++ /dev/null
@@ -1 +0,0 @@
--multiple
\ No newline at end of file
diff --git a/LauncherInjector/ns_startup_args_dedi.txt b/LauncherInjector/ns_startup_args_dedi.txt
deleted file mode 100644
index ce1dcf5f..00000000
--- a/LauncherInjector/ns_startup_args_dedi.txt
+++ /dev/null
@@ -1 +0,0 @@
-+setplaylist private_match
\ No newline at end of file
diff --git a/LauncherInjector/resource1.h b/LauncherInjector/resource1.h
deleted file mode 100644
index bb584502..00000000
--- a/LauncherInjector/resource1.h
+++ /dev/null
@@ -1,16 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by resources.rc
-//
-#define IDI_ICON1 101
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 102
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/LauncherInjector/resources.rc b/LauncherInjector/resources.rc
deleted file mode 100644
index de16250b..00000000
--- a/LauncherInjector/resources.rc
+++ /dev/null
@@ -1,111 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource1.h"
-#include "../NorthstarDedicatedTest/ns_version.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (United Kingdom) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
-#pragma code_page(1252)
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource1.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""winres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1 ICON "ns_icon.ico"
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION NORTHSTAR_VERSION
- PRODUCTVERSION NORTHSTAR_VERSION
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "080904b0"
- BEGIN
- VALUE "CompanyName", "Northstar Developers"
- VALUE "FileDescription", "Northstar Launcher"
- VALUE "FileVersion", "DEV"
- VALUE "InternalName", "NorthstarLauncher.exe"
- VALUE "LegalCopyright", "Copyright (C) 2021"
- VALUE "OriginalFilename", "NorthstarLauncher.exe"
- VALUE "ProductName", "Northstar Launcher"
- VALUE "ProductVersion", "DEV"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x809, 1200
- END
-END
-
-#endif // English (United Kingdom) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/NorthstarDLL/ExploitFixes.cpp b/NorthstarDLL/ExploitFixes.cpp
new file mode 100644
index 00000000..154091df
--- /dev/null
+++ b/NorthstarDLL/ExploitFixes.cpp
@@ -0,0 +1,415 @@
+#include "pch.h"
+
+#include "ExploitFixes.h"
+#include "ExploitFixes_UTF8Parser.h"
+#include "NSMem.h"
+#include "cvar.h"
+#include "tier0.h"
+
+ConVar* ns_exploitfixes_log;
+#define SHOULD_LOG (ns_exploitfixes_log->m_Value.m_nValue > 0)
+#define BLOCKED_INFO(s) \
+ ( \
+ [=]() -> bool \
+ { \
+ if (SHOULD_LOG) \
+ { \
+ std::stringstream stream; \
+ stream << "ExploitFixes.cpp: " << BLOCK_PREFIX << s; \
+ spdlog::error(stream.str()); \
+ } \
+ return false; \
+ }())
+
+// Make sure 3 or less floats are valid
+bool ValidateFloats(float a, float b = 0, float c = 0)
+{
+ return !isnan(a) && !isnan(b) && !isnan(c);
+}
+
+struct Vector
+{
+ float x, y, z;
+
+ Vector(float x = 0, float y = 0, float z = 0) : x(x), y(y), z(z) {}
+
+ bool IsValid()
+ {
+ return ValidateFloats(x, y, z);
+ }
+};
+
+struct Angle
+{
+ float pitch, yaw, roll;
+
+ Angle(float pitch = 0, float yaw = 0, float roll = 0) : pitch(pitch), yaw(yaw), roll(roll) {}
+
+ bool IsInvalid()
+ {
+ return !ValidateFloats(pitch, yaw, roll);
+
+ if (!ValidateFloats(pitch, yaw, roll))
+ return false;
+
+ return (pitch > 90 || pitch < -90) || (yaw > 180 || yaw < -180) || (roll > 180 || roll < -180);
+ }
+};
+
+#define BLOCK_NETMSG_FUNC(name, pattern) \
+ KHOOK(name, ("engine.dll", pattern), bool, __fastcall, (void* thisptr, void* buffer)) \
+ { \
+ return false; \
+ }
+
+// Servers can literally request a screenshot from any client, yeah no
+BLOCK_NETMSG_FUNC(CLC_Screenshot_WriteToBuffer, "48 89 5C 24 ? 57 48 83 EC 20 8B 42 10");
+BLOCK_NETMSG_FUNC(CLC_Screenshot_ReadFromBuffer, "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B DA 48 8B 52 38");
+
+// This is unused ingame and a big exploit vector
+BLOCK_NETMSG_FUNC(Base_CmdKeyValues_ReadFromBuffer, "40 55 48 81 EC ? ? ? ? 48 8D 6C 24 ? 48 89 5D 70");
+
+KHOOK(CClient_ProcessSetConVar, ("engine.dll", "48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10"), bool, __fastcall, (void* pMsg))
+{
+
+ constexpr int ENTRY_STR_LEN = 260;
+ struct SetConVarEntry
+ {
+ char name[ENTRY_STR_LEN];
+ char val[ENTRY_STR_LEN];
+ };
+
+ struct NET_SetConVar
+ {
+ void* vtable;
+ void* unk1;
+ void* unk2;
+ void* m_pMessageHandler;
+ SetConVarEntry* m_ConVars; // convar entry array
+ void* unk5; // these 2 unks are just vector capacity or whatever
+ void* unk6;
+ int m_ConVars_count; // amount of cvar entries in array (this will not be out of bounds)
+ };
+
+ auto msg = (NET_SetConVar*)pMsg;
+
+ bool areWeServer;
+
+ {
+ // Figure out of we are the client or the server
+ // To do this, we utilize the msg's m_pMessageHandler pointer
+ // m_pMessageHandler points to a virtual class that handles all net messages
+ // The first virtual table function of our m_pMessageHandler will differ if it is IServerMessageHandler or IClientMessageHandler
+ void* msgHandlerVTableFirstFunc = **(void****)(msg->m_pMessageHandler);
+ static auto engineBaseAddress = (uintptr_t)GetModuleHandleA("engine.dll");
+ auto offset = uintptr_t(msgHandlerVTableFirstFunc) - engineBaseAddress;
+
+ constexpr uintptr_t CLIENTSTATE_FIRST_VFUNC_OFFSET = 0x8A15C;
+ areWeServer = offset != CLIENTSTATE_FIRST_VFUNC_OFFSET;
+ }
+
+ std::string BLOCK_PREFIX = std::string {"NET_SetConVar ("} + (areWeServer ? "server" : "client") + "): Blocked dangerous/invalid msg: ";
+
+ if (areWeServer)
+ {
+ constexpr int SETCONVAR_SANITY_AMOUNT_LIMIT = 69;
+ if (msg->m_ConVars_count < 1 || msg->m_ConVars_count > SETCONVAR_SANITY_AMOUNT_LIMIT)
+ {
+ return BLOCKED_INFO("Invalid m_ConVars_count (" << msg->m_ConVars_count << ")");
+ }
+ }
+
+ for (int i = 0; i < msg->m_ConVars_count; i++)
+ {
+ auto entry = msg->m_ConVars + i;
+
+ // Safety check for memory access
+ if (NSMem::IsMemoryReadable(entry, sizeof(*entry)))
+ {
+
+ // Find null terminators
+ bool nameValid = false, valValid = false;
+ for (int i = 0; i < ENTRY_STR_LEN; i++)
+ {
+ if (!entry->name[i])
+ nameValid = true;
+ if (!entry->val[i])
+ valValid = true;
+ }
+
+ if (!nameValid || !valValid)
+ return BLOCKED_INFO("Missing null terminators");
+
+ auto realVar = R2::g_pCVar->FindVar(entry->name);
+
+ if (realVar)
+ memcpy(
+ entry->name,
+ realVar->m_ConCommandBase.m_pszName,
+ strlen(realVar->m_ConCommandBase.m_pszName) + 1); // Force name to match case
+
+ bool isValidFlags = true;
+ if (areWeServer)
+ {
+ if (realVar)
+ isValidFlags = realVar->IsFlagSet(FCVAR_USERINFO); // ConVar MUST be userinfo var
+ }
+ else
+ {
+ // TODO: Should probably have some sanity checks, but can't find any that are consistent
+ }
+
+ if (!isValidFlags)
+ {
+ if (!realVar)
+ {
+ return BLOCKED_INFO("Invalid flags on nonexistant cvar (how tho???)");
+ }
+ else
+ {
+ return BLOCKED_INFO(
+ "Invalid flags (" << std::hex << "0x" << realVar->m_ConCommandBase.m_nFlags << "), var is " << entry->name);
+ }
+ }
+ }
+ else
+ {
+ return BLOCKED_INFO("Unreadable memory at " << (void*)entry); // Not risking that one, they all gotta be readable
+ }
+ }
+
+ return oCClient_ProcessSetConVar(msg);
+}
+
+// Purpose: prevent invalid user CMDs
+KHOOK(CClient_ProcessUsercmds, ("engine.dll", "40 55 56 48 83 EC 58"), bool, __fastcall, (void* thisptr, void* pMsg))
+{
+ struct CLC_Move
+ {
+ BYTE gap0[24];
+ void* m_pMessageHandler;
+ int m_nBackupCommands;
+ int m_nNewCommands;
+ int m_nLength;
+ // bf_read m_DataIn;
+ // bf_write m_DataOut;
+ };
+
+ auto msg = (CLC_Move*)pMsg;
+
+ const char* BLOCK_PREFIX = "ProcessUserCmds: ";
+
+ if (msg->m_nBackupCommands < 0)
+ {
+ return BLOCKED_INFO("Invalid m_nBackupCommands (" << msg->m_nBackupCommands << ")");
+ }
+
+ if (msg->m_nNewCommands < 0)
+ {
+ return BLOCKED_INFO("Invalid m_nNewCommands (" << msg->m_nNewCommands << ")");
+ }
+
+ // removing, as vanilla already limits num usercmds per frame
+ /*constexpr int NUMCMD_SANITY_LIMIT = 16;
+ if ((msg->m_nNewCommands + msg->m_nBackupCommands) > NUMCMD_SANITY_LIMIT)
+ {
+ return BLOCKED_INFO("Command count is too high (new: " << msg->m_nNewCommands << ", backup: " << msg->m_nBackupCommands << ")");
+
+ }*/
+
+ if (msg->m_nLength <= 0)
+ return BLOCKED_INFO("Invalid message length (" << msg->m_nLength << ")");
+
+ return oCClient_ProcessUsercmds(thisptr, pMsg);
+}
+
+KHOOK(ReadUsercmd, ("server.dll", "4C 89 44 24 ? 53 55 56 57"), void, __fastcall, (void* buf, void* pCmd_move, void* pCmd_from))
+{
+ // Let normal usercmd read happen first, it's safe
+ oReadUsercmd(buf, pCmd_move, pCmd_from);
+
+ // Now let's make sure the CMD we read isnt messed up to prevent numerous exploits (including server crashing)
+ struct __declspec(align(4)) SV_CUserCmd
+ {
+ DWORD command_number;
+ DWORD tick_count;
+ float command_time;
+ Angle worldViewAngles;
+ BYTE gap18[4];
+ Angle localViewAngles;
+ Angle attackangles;
+ Vector move;
+ DWORD buttons;
+ BYTE impulse;
+ short weaponselect;
+ DWORD meleetarget;
+ BYTE gap4C[24];
+ char headoffset;
+ BYTE gap65[11];
+ Vector cameraPos;
+ Angle cameraAngles;
+ BYTE gap88[4];
+ int tickSomething;
+ DWORD dword90;
+ DWORD predictedServerEventAck;
+ DWORD dword98;
+ float frameTime;
+ };
+
+ auto cmd = (SV_CUserCmd*)pCmd_move;
+ auto fromCmd = (SV_CUserCmd*)pCmd_from;
+
+ std::string BLOCK_PREFIX =
+ "ReadUsercmd (command_number delta: " + std::to_string(cmd->command_number - fromCmd->command_number) + "): ";
+
+ if (cmd->worldViewAngles.IsInvalid())
+ {
+ BLOCKED_INFO("CMD has invalid worldViewAngles");
+ goto INVALID_CMD;
+ }
+
+ if (cmd->attackangles.IsInvalid())
+ {
+ BLOCKED_INFO("CMD has invalid attackangles");
+ goto INVALID_CMD;
+ }
+
+ if (cmd->localViewAngles.IsInvalid())
+ {
+ BLOCKED_INFO("CMD has invalid localViewAngles");
+ goto INVALID_CMD;
+ }
+
+ if (cmd->cameraAngles.IsInvalid())
+ {
+ BLOCKED_INFO("CMD has invalid cameraAngles");
+ goto INVALID_CMD;
+ }
+
+ if (cmd->frameTime <= 0 || cmd->tick_count == 0 || cmd->command_time <= 0)
+ {
+ BLOCKED_INFO(
+ "Bogus cmd timing (tick_count: " << cmd->tick_count << ", frameTime: " << cmd->frameTime
+ << ", commandTime : " << cmd->command_time << ")");
+ goto INVALID_CMD; // No simulation of bogus-timed cmds
+ }
+
+ if (!cmd->move.IsValid())
+ {
+ BLOCKED_INFO("Invalid move vector");
+ goto INVALID_CMD;
+ }
+
+ if (!cmd->cameraPos.IsValid())
+ {
+ BLOCKED_INFO("Invalid cameraPos"); // IIRC this can crash spectating clients or anyone watching replays
+ goto INVALID_CMD;
+ }
+
+ return;
+INVALID_CMD:
+
+ // Fix any gameplay-affecting cmd properties
+ // NOTE: Currently tickcount/frametime is set to 0, this ~shouldn't~ cause any problems
+ cmd->worldViewAngles = cmd->localViewAngles = cmd->attackangles = cmd->cameraAngles = Angle(0, 0, 0);
+ cmd->tick_count = cmd->frameTime = 0;
+ cmd->move = cmd->cameraPos = Vector(0, 0, 0);
+ cmd->buttons = 0;
+ cmd->meleetarget = 0;
+}
+
+// basically: by default r2 isn't set as a valve mod, meaning that m_bRestrictServerCommands is false
+// this is HORRIBLE for security, because it means servers can run arbitrary concommands on clients
+// especially since we have script commands this could theoretically be awful
+KHOOK(IsValveMod, ("engine.dll", "48 83 EC 28 48 8B 0D ? ? ? ? 48 8D 15 ? ? ? ? E8 ? ? ? ? 85 C0 74 63"), bool, __fastcall, ())
+{
+ return !Tier0::CommandLine()->CheckParm("-norestrictservercommands");
+}
+
+// Fix respawn's crappy UTF8 parser so it doesn't crash -_-
+// This also means you can launch multiplayer with "communities_enabled 1" and not crash, you're welcome
+KHOOK(
+ CrashFunc_ParseUTF8,
+ ("engine.dll", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 20 8B 1A"),
+ bool,
+ __fastcall,
+ (INT64 * a1, DWORD* a2, char* strData))
+{
+
+ static void* targetRetAddr = NSMem::PatternScan("engine.dll", "84 C0 75 2C 49 8B 16");
+
+ if (_ReturnAddress() == targetRetAddr)
+ {
+ if (!ExploitFixes_UTF8Parser::CheckValid(a1, a2, strData))
+ {
+ const char* BLOCK_PREFIX = "ParseUTF8 Hook: ";
+ BLOCKED_INFO("Ignoring potentially-crashing utf8 string");
+ return false;
+ }
+ }
+
+ return oCrashFunc_ParseUTF8(a1, a2, strData);
+}
+
+//////////////////////////////////////////////////
+
+void DoBytePatches()
+{
+ uintptr_t engineBase = (uintptr_t)GetModuleHandleA("engine.dll");
+ uintptr_t serverBase = (uintptr_t)GetModuleHandleA("server.dll");
+
+ // patches to make commands run from client/ui script still work
+ // note: this is likely preventable in a nicer way? test prolly
+ NSMem::BytePatch(engineBase + 0x4FB65, "EB 11");
+ NSMem::BytePatch(engineBase + 0x4FBAC, "EB 16");
+
+ { // Dumb ANTITAMPER patches (they negatively impact performance and security)
+
+ constexpr const char* ANTITAMPER_EXPORTS[] = {
+ "ANTITAMPER_SPOTCHECK_CODEMARKER",
+ "ANTITAMPER_TESTVALUE_CODEMARKER",
+ "ANTITAMPER_TRIGGER_CODEMARKER",
+ };
+
+ // Prevent thesefrom actually doing anything
+ for (auto exportName : ANTITAMPER_EXPORTS)
+ {
+
+ auto address = (uintptr_t)GetProcAddress(GetModuleHandleA("server.dll"), exportName);
+ if (!address)
+ {
+ spdlog::warn("Failed to find AntiTamper function export \"{}\"", exportName);
+ }
+ else
+ {
+ // Just return, none of them have any args or are userpurge
+ NSMem::BytePatch(address, "C3");
+ spdlog::info("Patched AntiTamper function export \"{}\"", exportName);
+ }
+ }
+ }
+}
+
+ON_DLL_LOAD_RELIESON("server.dll", ExploitFixes, ConVar, [](HMODULE baseAddress)
+{
+ spdlog::info("ExploitFixes::LoadCallback ...");
+
+ spdlog::info("\tByte patching...");
+ DoBytePatches();
+
+ if (KHook::InitAllHooks())
+ {
+ spdlog::info("\tInitialized " + std::to_string(KHook::_allHooks.size()) + " exploit-patch hooks.");
+ }
+ else
+ {
+ spdlog::critical("\tFAILED to initialize all exploit patches.");
+
+ // Force exit?
+ MessageBoxA(0, "FAILED to initialize all exploit patches.", "Northstar", MB_ICONERROR);
+ exit(0);
+ }
+
+ ns_exploitfixes_log =
+ new ConVar("ns_exploitfixes_log", "1", FCVAR_GAMEDLL, "Whether to log whenever ExploitFixes.cpp blocks/corrects something");
+})
\ No newline at end of file
diff --git a/NorthstarDLL/ExploitFixes.h b/NorthstarDLL/ExploitFixes.h
new file mode 100644
index 00000000..ae30a899
--- /dev/null
+++ b/NorthstarDLL/ExploitFixes.h
@@ -0,0 +1,4 @@
+// KittenPopo's exploit fix hooks, feel free to add more here
+
+#pragma once
+#include "pch.h"
\ No newline at end of file
diff --git a/NorthstarDLL/ExploitFixes_UTF8Parser.h b/NorthstarDLL/ExploitFixes_UTF8Parser.h
new file mode 100644
index 00000000..41242655
--- /dev/null
+++ b/NorthstarDLL/ExploitFixes_UTF8Parser.h
@@ -0,0 +1,175 @@
+// Reimplementation of a exploitable UTF decoding function in titanfall
+
+#include "NSMem.h"
+
+#pragma once
+
+namespace ExploitFixes_UTF8Parser
+{
+ bool __fastcall CheckValid(INT64* a1, DWORD* a2, char* strData)
+ {
+ static auto sub_F1320 = (INT64(__fastcall*)(DWORD a1, char* a2))NSMem::PatternScan("engine.dll", "83 F9 7F 77 08 88 0A");
+
+ DWORD v3; // eax
+ char* v4; // rbx
+ char v5; // si
+ char* _strData; // rdi
+ char* v7; // rbp
+ char v11; // al
+ DWORD v12; // er9
+ DWORD v13; // ecx
+ DWORD v14; // edx
+ DWORD v15; // er8
+ int v16; // eax
+ DWORD v17; // er9
+ int v18; // eax
+ DWORD v19; // er9
+ DWORD v20; // ecx
+ int v21; // eax
+ int v22; // er9
+ DWORD v23; // edx
+ int v24; // eax
+ int v25; // er9
+ DWORD v26; // er9
+ DWORD v27; // er10
+ DWORD v28; // ecx
+ DWORD v29; // edx
+ DWORD v30; // er8
+ int v31; // eax
+ DWORD v32; // er10
+ int v33; // eax
+ DWORD v34; // er10
+ DWORD v35; // ecx
+ int v36; // eax
+ int v37; // er10
+ DWORD v38; // edx
+ int v39; // eax
+ int v40; // er10
+ DWORD v41; // er10
+ INT64 v43; // r8
+ INT64 v44; // rdx
+ INT64 v45; // rcx
+ INT64 v46; // rax
+ INT64 v47; // rax
+ char v48; // al
+ INT64 v49; // r8
+ INT64 v50; // rdx
+ INT64 v51; // rcx
+ INT64 v52; // rax
+ INT64 v53; // rax
+
+ v3 = a2[2];
+ v4 = (char*)(a1[1] + *a2);
+ v5 = 0;
+ _strData = strData;
+ v7 = &v4[*((UINT16*)a2 + 2)];
+ if (v3 >= 2)
+ {
+ ++v4;
+ --v7;
+ if (v3 != 2)
+ {
+ while (1)
+ {
+
+ if (!NSMem::IsMemoryReadable(v4, 1))
+ return false; // INVALID
+
+ v11 = *v4++; // crash potential
+ if (v11 != 92)
+ goto LABEL_6;
+ v11 = *v4++;
+ if (v11 == 110)
+ break;
+ switch (v11)
+ {
+ case 't':
+ v11 = 9;
+ goto LABEL_6;
+ case 'r':
+ v11 = 13;
+ goto LABEL_6;
+ case 'b':
+ v11 = 8;
+ goto LABEL_6;
+ case 'f':
+ v11 = 12;
+ goto LABEL_6;
+ }
+ if (v11 != 117)
+ goto LABEL_6;
+ v12 = *v4 | 0x20;
+ v13 = v4[1] | 0x20;
+ v14 = v4[2] | 0x20;
+ v15 = v4[3] | 0x20;
+ v16 = 87;
+ if (v12 <= 0x39)
+ v16 = 48;
+ v17 = v12 - v16;
+ v18 = 87;
+ v19 = v17 << 12;
+ if (v13 <= 0x39)
+ v18 = 48;
+ v20 = v13 - v18;
+ v21 = 87;
+ v22 = (v20 << 8) | v19;
+ if (v14 <= 0x39)
+ v21 = 48;
+ v23 = v14 - v21;
+ v24 = 87;
+ v25 = (16 * v23) | v22;
+ if (v15 <= 0x39)
+ v24 = 48;
+ v4 += 4;
+ v26 = (v15 - v24) | v25;
+ if (v26 - 55296 <= 0x7FF)
+ {
+ if (v26 >= 0xDC00)
+ return true;
+ if (*v4 != 92 || v4[1] != 117)
+ return true;
+
+ v27 = v4[2] | 0x20;
+ v28 = v4[3] | 0x20;
+ v29 = v4[4] | 0x20;
+ v30 = v4[5] | 0x20;
+ v31 = 87;
+ if (v27 <= 0x39)
+ v31 = 48;
+ v32 = v27 - v31;
+ v33 = 87;
+ v34 = v32 << 12;
+ if (v28 <= 0x39)
+ v33 = 48;
+ v35 = v28 - v33;
+ v36 = 87;
+ v37 = (v35 << 8) | v34;
+ if (v29 <= 0x39)
+ v36 = 48;
+ v38 = v29 - v36;
+ v39 = 87;
+ v40 = (16 * v38) | v37;
+ if (v30 <= 0x39)
+ v39 = 48;
+ v4 += 6;
+ v41 = ((v30 - v39) | v40) - 56320;
+ if (v41 > 0x3FF)
+ return true;
+ v26 = v41 | ((v26 - 55296) << 10);
+ }
+ _strData += (DWORD)sub_F1320(v26, _strData);
+ LABEL_7:
+ if (v4 == v7)
+ goto LABEL_48;
+ }
+ v11 = 10;
+ LABEL_6:
+ v5 |= v11;
+ *_strData++ = v11;
+ goto LABEL_7;
+ }
+ }
+ LABEL_48:
+ return true;
+ }
+} // namespace ExploitFixes_UTF8Parser
\ No newline at end of file
diff --git a/NorthstarDLL/NSMem.h b/NorthstarDLL/NSMem.h
new file mode 100644
index 00000000..74df3a84
--- /dev/null
+++ b/NorthstarDLL/NSMem.h
@@ -0,0 +1,211 @@
+#pragma once
+#include "pch.h"
+
+// KittenPopo's memory stuff, made for northstar (because I really can't handle working with northstar's original memory stuff tbh)
+
+#pragma region Pattern Scanning
+namespace NSMem
+{
+ inline std::vector HexBytesToString(const char* str)
+ {
+ std::vector patternNums;
+ int size = strlen(str);
+ for (int i = 0; i < size; i++)
+ {
+ char c = str[i];
+
+ // If this is a space character, ignore it
+ if (c == ' ' || c == '\t')
+ continue;
+
+ if (c == '?')
+ {
+ // Add a wildcard (-1)
+ patternNums.push_back(-1);
+ }
+ else if (i < size - 1)
+ {
+ BYTE result = 0;
+ for (int j = 0; j < 2; j++)
+ {
+ int val = 0;
+ char c = *(str + i + j);
+ if (c >= 'a')
+ {
+ val = c - 'a' + 0xA;
+ }
+ else if (c >= 'A')
+ {
+ val = c - 'A' + 0xA;
+ }
+ else if (isdigit(c))
+ {
+ val = c - '0';
+ }
+ else
+ {
+ assert(false, "Failed to parse invalid hex string.");
+ val = -1;
+ }
+
+ result += (j == 0) ? val * 16 : val;
+ }
+ patternNums.push_back(result);
+ }
+
+ i++;
+ }
+
+ return patternNums;
+ }
+
+ inline void* PatternScan(void* module, const int* pattern, int patternSize, int offset)
+ {
+ if (!module)
+ return NULL;
+
+ auto dosHeader = (PIMAGE_DOS_HEADER)module;
+ auto ntHeaders = (PIMAGE_NT_HEADERS)((BYTE*)module + dosHeader->e_lfanew);
+
+ auto sizeOfImage = ntHeaders->OptionalHeader.SizeOfImage;
+
+ auto scanBytes = (BYTE*)module;
+
+ for (auto i = 0; i < sizeOfImage - patternSize; ++i)
+ {
+ bool found = true;
+ for (auto j = 0; j < patternSize; ++j)
+ {
+ if (scanBytes[i + j] != pattern[j] && pattern[j] != -1)
+ {
+ found = false;
+ break;
+ }
+ }
+
+ if (found)
+ {
+ uintptr_t addressInt = (uintptr_t)(&scanBytes[i]) + offset;
+ return (uint8_t*)addressInt;
+ }
+ }
+
+ return nullptr;
+ }
+
+ inline void* PatternScan(const char* moduleName, const char* pattern, int offset = 0)
+ {
+ std::vector patternNums = HexBytesToString(pattern);
+
+ return PatternScan(GetModuleHandleA(moduleName), &patternNums[0], patternNums.size(), offset);
+ }
+
+ inline void BytePatch(uintptr_t address, const BYTE* vals, int size)
+ {
+ WriteProcessMemory(GetCurrentProcess(), (LPVOID)address, vals, size, NULL);
+ }
+
+ inline void BytePatch(uintptr_t address, std::initializer_list vals)
+ {
+ std::vector bytes = vals;
+ if (!bytes.empty())
+ BytePatch(address, &bytes[0], bytes.size());
+ }
+
+ inline void BytePatch(uintptr_t address, const char* bytesStr)
+ {
+ std::vector byteInts = HexBytesToString(bytesStr);
+ std::vector bytes;
+ for (int v : byteInts)
+ bytes.push_back(v);
+
+ if (!bytes.empty())
+ BytePatch(address, &bytes[0], bytes.size());
+ }
+
+ inline void NOP(uintptr_t address, int size)
+ {
+ BYTE* buf = (BYTE*)malloc(size);
+ memset(buf, 0x90, size);
+ BytePatch(address, buf, size);
+ free(buf);
+ }
+
+ inline bool IsMemoryReadable(void* ptr, size_t size)
+ {
+ static SYSTEM_INFO sysInfo;
+ if (!sysInfo.dwPageSize)
+ GetSystemInfo(&sysInfo); // This should always be 4096 unless ur playing on NES or some shit but whatever
+
+ MEMORY_BASIC_INFORMATION memInfo;
+
+ if (!VirtualQuery(ptr, &memInfo, sizeof(memInfo)))
+ return false;
+
+ if (memInfo.RegionSize < size)
+ return false;
+
+ return (memInfo.State & MEM_COMMIT) && !(memInfo.Protect & PAGE_NOACCESS);
+ }
+} // namespace NSMem
+
+#pragma region KHOOK
+struct KHookPatternInfo
+{
+ const char *moduleName, *pattern;
+ int offset = 0;
+
+ KHookPatternInfo(const char* moduleName, const char* pattern, int offset = 0) : moduleName(moduleName), pattern(pattern), offset(offset)
+ {
+ }
+};
+
+struct KHook
+{
+ KHookPatternInfo targetFunc;
+ void* targetFuncAddr;
+ void* hookFunc;
+ void** original;
+
+ static inline std::vector _allHooks;
+
+ KHook(KHookPatternInfo targetFunc, void* hookFunc, void** original) : targetFunc(targetFunc)
+ {
+ this->hookFunc = hookFunc;
+ this->original = original;
+ _allHooks.push_back(this);
+ }
+
+ bool Setup()
+ {
+ targetFuncAddr = NSMem::PatternScan(targetFunc.moduleName, targetFunc.pattern, targetFunc.offset);
+ if (!targetFuncAddr)
+ return false;
+
+ return MH_CreateHook(targetFuncAddr, hookFunc, original) == MH_OK;
+ }
+
+ // Returns true if succeeded
+ static bool InitAllHooks()
+ {
+ for (KHook* hook : _allHooks)
+ {
+ if (hook->Setup())
+ {
+ spdlog::info("KHook hooked at {}", hook->targetFuncAddr);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ return MH_EnableHook(MH_ALL_HOOKS) == MH_OK;
+ }
+};
+#define KHOOK(name, funcPatternInfo, returnType, convention, args) \
+ returnType convention hk##name args; \
+ auto o##name = (returnType(convention*) args)0; \
+ KHook k##name = KHook(KHookPatternInfo funcPatternInfo, &hk##name, (void**)&o##name); \
+ returnType convention hk##name args
+#pragma endregion
\ No newline at end of file
diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj
new file mode 100644
index 00000000..f17ac7ab
--- /dev/null
+++ b/NorthstarDLL/NorthstarDLL.vcxproj
@@ -0,0 +1,668 @@
+
+
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 16.0
+ Win32Proj
+ {cfad2623-064f-453c-8196-79ee10292e32}
+ NorthstarDedicatedTest
+ 10.0
+ NorthstarDLL
+
+
+
+ DynamicLibrary
+ true
+ v143
+ Unicode
+
+
+ DynamicLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ Northstar
+
+
+ false
+ Northstar
+
+
+
+ Level3
+ true
+ _DEBUG;NORTHSTARDEDICATEDTEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);CURL_STATICLIB
+ true
+ Use
+ pch.h
+ stdcpp17
+ $(ProjectDir)include;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ false
+ $(ProjectDir)include\MinHook.x64.lib;$(ProjectDir)include\libcurl\lib\libcurl_a.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies)
+
+
+ %(AdditionalLibraryDirectories)
+
+
+
+
+
+
+ copy /Y "$(TargetPath)" "D:\origin\titanfall\Titanfall2"
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;NORTHSTARDEDICATEDTEST_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);CURL_STATICLIB
+ true
+ Use
+ pch.h
+ stdcpp17
+ $(ProjectDir)include;%(AdditionalIncludeDirectories)
+ MultiThreadedDLL
+
+
+ Windows
+ true
+ true
+ true
+ false
+ $(ProjectDir)include\MinHook.x64.lib;$(ProjectDir)include\libcurl\lib\libcurl_a.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies)
+
+
+ %(AdditionalLibraryDirectories)
+
+
+
+
+
+
+ copy /Y "$(TargetPath)" "D:\origin\titanfall\Titanfall2"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create
+ Create
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters
new file mode 100644
index 00000000..b14e0ce8
--- /dev/null
+++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters
@@ -0,0 +1,1774 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+ {d4199e4b-10d2-43ce-af9c-e1fa79e1e64e}
+
+
+ {4d322431-dcaa-4f75-aee0-3b6371cf52a6}
+
+
+ {94259c8c-5411-48bf-af4f-46ca32b7d0bb}
+
+
+ {4f525372-34a8-40b3-8a95-81d77cdfcf7f}
+
+
+ {b6f79919-9735-476d-8798-067a75cbeca0}
+
+
+ {ca657be5-c2d8-4322-a689-1154aaafe57b}
+
+
+ {a18afb37-5fdd-4340-a6b4-a6541593e398}
+
+
+ {9751b551-5886-45d4-a039-cbd10445263d}
+
+
+ {8596cc1c-0492-4467-91e3-1f03b7e19f77}
+
+
+ {11eaa578-6336-456e-9c7c-8bd202470945}
+
+
+ {7ecd75d2-7eee-41c4-87b6-3b7c2213f34e}
+
+
+ {8afc70f1-639c-49ef-9348-ef6dcece114e}
+
+
+ {398efed5-0a92-4d32-b5ba-b4a725b2a70a}
+
+
+ {74567974-c66b-45ef-ab28-97b7154ca224}
+
+
+ {3e892d07-2239-44da-9cf3-c288a34cf9a2}
+
+
+ {6bbce8a5-38b4-4763-a7cb-4e98012ec245}
+
+
+ {4ca5392e-7d3d-4066-833f-f534cd5787c3}
+
+
+ {94b15898-ef33-41c7-995a-31791fccb7e2}
+
+
+ {6495657f-ea55-4552-8aa7-b54eb8e86a99}
+
+
+ {85aacdee-0f92-4ec4-b20c-0739c1175055}
+
+
+ {4db0d1e9-9035-457f-87f1-5dc3f13b6b9e}
+
+
+ {d1f93d1e-0ecb-44fe-a277-d3e75aec2570}
+
+
+ {3d41d3fc-8a3b-4358-b3e8-4f06dc96abfe}
+
+
+ {d69760a9-d5ec-4f3e-8f43-f74041654d44}
+
+
+ {365e5c1f-4b2f-4d8b-a1d8-cdef401ca689}
+
+
+ {24fd0855-9288-4129-93ba-c6cafdc98d1b}
+
+
+ {2cbddb28-0b17-4881-847d-8773da52b268}
+
+
+ {0c93d909-e0d6-4c35-a8a4-a13f681a1012}
+
+
+ {4cb0dd89-5f16-4549-a864-34ca3075352a}
+
+
+ {914d8b8f-6b19-4f23-b746-f40062d72906}
+
+
+ {09516029-fac7-4235-ad61-402977534a0b}
+
+
+ {8cc1ae44-9dbf-4719-91a2-82e00b8d78e2}
+
+
+ {ea1e17a6-40b7-4e1b-8edb-e9ae704ce604}
+
+
+ {59b0f68f-daa7-4641-b6fa-8464b56da2bb}
+
+
+ {44a83740-9d70-480d-9a7a-43b81f8eab9e}
+
+
+ {4a8a695a-a103-4b1f-b314-0ec19a253119}
+
+
+ {b30e08b1-b962-4264-8cbb-a0a31924b93e}
+
+
+ {947835db-67d6-42c0-870d-62743f85231f}
+
+
+ {14fc0931-acad-46ec-a55e-94f4469d4235}
+
+
+ {51910ba0-2ff8-461d-9f67-8d7907b57d22}
+
+
+ {04fd662a-6e70-494c-b720-c694a5cc2fb1}
+
+
+ {325e0d7d-6832-496d-8d8e-968fdfa5dd40}
+
+
+ {802d0771-62f1-4733-89f9-57a4d8864b8d}
+
+
+ {0f1ba4c4-78ee-4b05-afa5-6f598063f5c1}
+
+
+ {bf0769d8-40fd-4701-85e9-7ed94aab2283}
+
+
+ {d8a83b5e-9a23-4124-824f-eab37880cb08}
+
+
+ {ee3ba13a-3061-41d7-981d-328ac2596fd2}
+
+
+
+
+ Header Files
+
+
+ Header Files\include
+
+
+ Header Files\Shared\Hooks
+
+
+ Header Files\Shared\Hooks
+
+
+ Header Files
+
+
+ Header Files\Client
+
+
+ Header Files\Shared
+
+
+ Header Files\Shared\Hooks
+
+
+ Header Files\Shared
+
+
+ Header Files\Shared
+
+
+ Header Files\Shared\Convar
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog
+
+
+ Header Files\include\spdlog\cfg
+
+
+ Header Files\include\spdlog\cfg
+
+
+ Header Files\include\spdlog\cfg
+
+
+ Header Files\include\spdlog\cfg
+
+
+ Header Files\include\spdlog\fmt
+
+
+ Header Files\include\spdlog\fmt
+
+
+ Header Files\include\spdlog\fmt
+
+
+ Header Files\include\spdlog\fmt
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\sinks
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\include\spdlog\details
+
+
+ Header Files\Shared\Convar
+
+
+ Header Files\Shared\Mods
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson
+
+
+ Header Files\include\rapidjson\error
+
+
+ Header Files\include\rapidjson\error
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\internal
+
+
+ Header Files\include\rapidjson\msinttypes
+
+
+ Header Files\include\rapidjson\msinttypes
+
+
+ Header Files\Shared\Mods\Compiled
+
+
+ Header Files\Server\Authentication
+
+
+ Header Files\include
+
+
+ Header Files\Shared
+
+
+ Header Files\Shared\Convar
+
+
+ Header Files\Shared\Mods\Compiled
+
+
+ Header Files\Shared
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\openssl\internal
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\include\libcurl
+
+
+ Header Files\Server\Authentication
+
+
+ Header Files\Client
+
+
+ Header Files\Shared
+
+
+ Header Files\Client
+
+
+ Header Files\Shared\Convar
+
+
+ Header Files\Shared\Math
+
+
+ Header Files\Shared\Math
+
+
+ Header Files\Client
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Source Files\Shared\Exploit Fixes
+
+
+ Source Files\Shared\Exploit Fixes
+
+
+ Source Files\Shared\Exploit Fixes\UTF8Parser
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files\Shared
+
+
+ Header Files\Shared\Game Functions
+
+
+ Header Files\Shared
+
+
+ Header Files\Server\Scripted
+
+
+ Header Files\Server\Scripted
+
+
+ Header Files\Server\Dedicated
+
+
+ Header Files\Shared\Console
+
+
+ Header Files\Shared\Console
+
+
+ Header Files\Shared\Game Functions
+
+
+ Header Files\Shared\Game Functions
+
+
+ Header Files\Shared\Game Functions
+
+
+ Header Files\Shared
+
+
+ Header Files\Shared\Filesystem
+
+
+ Header Files\Shared\Filesystem
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files\Shared\Hooks
+
+
+ Source Files\Shared\Hooks
+
+
+ Source Files\Server\Dedicated
+
+
+ Source Files\Client
+
+
+ Source Files\Shared
+
+
+ Source Files\Shared\Hooks
+
+
+ Source Files\Shared
+
+
+ Source Files\Shared\Convar
+
+
+ Source Files\Shared\Convar
+
+
+ Source Files\Shared\Mods
+
+
+ Source Files\Shared\Mods\Compiled Assets
+
+
+ Source Files\Server\Authentication
+
+
+ Source Files\Shared\Mods\Compiled Assets
+
+
+ Source Files\Shared
+
+
+ Source Files\Client
+
+
+ Source Files\Client
+
+
+ Source Files\Server\Dedicated
+
+
+ Source Files\Shared\Convar
+
+
+ Source Files\Shared\Mods\Compiled Assets
+
+
+ Source Files\Client
+
+
+ Source Files\Shared
+
+
+ Source Files\Client
+
+
+ Source Files\Shared
+
+
+ Source Files\Server
+
+
+ Source Files\Server\Authentication
+
+
+ Source Files\Client
+
+
+ Source Files\Client
+
+
+ Source Files\Client
+
+
+ Source Files\Server
+
+
+ Source Files\Client
+
+
+ Source Files\Shared\Convar
+
+
+ Source Files\Shared\Math
+
+
+ Source Files\Client
+
+
+ Source Files
+
+
+ Source Files\Client
+
+
+ Source Files\Client
+
+
+ Source Files\Shared\Exploit Fixes
+
+
+ Source Files
+
+
+ Source Files\Client
+
+
+ Source Files\Shared
+
+
+ Source Files\Shared\Game Functions
+
+
+ Source Files\Shared
+
+
+ Source Files\Shared
+
+
+ Source Files\Client\Scripted
+
+
+ Source Files\Client\Scripted
+
+
+ Source Files\Client\Scripted
+
+
+ Source Files\Client\Scripted
+
+
+ Source Files\Client\Scripted
+
+
+ Source Files\Client\Scripted
+
+
+ Source Files\Server\Scripted
+
+
+ Source Files\Server\Scripted
+
+
+ Source Files\Shared\Console
+
+
+ Source Files\Client
+
+
+ Source Files\Shared\Console
+
+
+ Source Files\Shared\Game Functions
+
+
+ Source Files\Shared\Game Functions
+
+
+ Source Files\Shared\Game Functions
+
+
+ Source Files\Shared
+
+
+ Source Files\Shared\Console
+
+
+ Source Files\Shared\Filesystem
+
+
+ Source Files\Shared\Filesystem
+
+
+
+
+ Source Files\Client
+
+
+
+
+ Header Files\include\spdlog\fmt\bundled
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\openssl
+
+
+ Header Files\include\openssl\crypto
+
+
+ Header Files\include\openssl\crypto
+
+
+
\ No newline at end of file
diff --git a/NorthstarDLL/audio.cpp b/NorthstarDLL/audio.cpp
new file mode 100644
index 00000000..6f47786f
--- /dev/null
+++ b/NorthstarDLL/audio.cpp
@@ -0,0 +1,502 @@
+#include "pch.h"
+#include "audio.h"
+#include "dedicated.h"
+#include "convar.h"
+
+#include "rapidjson/error/en.h"
+#include
+#include
+#include
+#include
+
+AUTOHOOK_INIT()
+
+extern "C"
+{
+ // should be called only in LoadSampleMetadata_Hook
+ extern void* __fastcall Audio_GetParentEvent();
+}
+
+ConVar* Cvar_ns_print_played_sounds;
+
+CustomAudioManager g_CustomAudioManager;
+
+EventOverrideData::EventOverrideData()
+{
+ spdlog::warn("Initialised struct EventOverrideData without any data!");
+ LoadedSuccessfully = false;
+}
+
+// Empty stereo 48000 WAVE file
+unsigned char EMPTY_WAVE[45] = {0x52, 0x49, 0x46, 0x46, 0x25, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45, 0x66, 0x6D, 0x74,
+ 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x44, 0xAC, 0x00, 0x00, 0x88, 0x58,
+ 0x01, 0x00, 0x02, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61, 0x74, 0x00, 0x00, 0x00, 0x00};
+
+EventOverrideData::EventOverrideData(const std::string& data, const fs::path& path)
+{
+ if (data.length() <= 0)
+ {
+ spdlog::error("Failed reading audio override file {}: file is empty", path.string());
+ return;
+ }
+
+ fs::path samplesFolder = path;
+ samplesFolder = samplesFolder.replace_extension();
+
+ if (!fs::exists(samplesFolder))
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: samples folder doesn't exist; should be named the same as the definition file without "
+ "JSON extension.",
+ path.string());
+ return;
+ }
+
+ rapidjson_document dataJson;
+ dataJson.Parse(data);
+
+ // fail if parse error
+ if (dataJson.HasParseError())
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: encountered parse error \"{}\" at offset {}",
+ path.string(),
+ GetParseError_En(dataJson.GetParseError()),
+ dataJson.GetErrorOffset());
+ return;
+ }
+
+ // fail if it's not a json obj (could be an array, string, etc)
+ if (!dataJson.IsObject())
+ {
+ spdlog::error("Failed reading audio override file {}: file is not a JSON object", path.string());
+ return;
+ }
+
+ // fail if no event ids given
+ if (!dataJson.HasMember("EventId"))
+ {
+ spdlog::error("Failed reading audio override file {}: JSON object does not have the EventId property", path.string());
+ return;
+ }
+
+ // array of event ids
+ if (dataJson["EventId"].IsArray())
+ {
+ for (auto& eventId : dataJson["EventId"].GetArray())
+ {
+ if (!eventId.IsString())
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: EventId array has a value of invalid type, all must be strings", path.string());
+ return;
+ }
+
+ EventIds.push_back(eventId.GetString());
+ }
+ }
+ // singular event id
+ else if (dataJson["EventId"].IsString())
+ {
+ EventIds.push_back(dataJson["EventId"].GetString());
+ }
+ // incorrect type
+ else
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: EventId property is of invalid type (must be a string or an array of strings)",
+ path.string());
+ return;
+ }
+
+ if (dataJson.HasMember("EventIdRegex"))
+ {
+ // array of event id regex
+ if (dataJson["EventIdRegex"].IsArray())
+ {
+ for (auto& eventId : dataJson["EventIdRegex"].GetArray())
+ {
+ if (!eventId.IsString())
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: EventIdRegex array has a value of invalid type, all must be strings",
+ path.string());
+ return;
+ }
+
+ const std::string& regex = eventId.GetString();
+
+ try
+ {
+ EventIdsRegex.push_back({regex, std::regex(regex)});
+ }
+ catch (...)
+ {
+ spdlog::error("Malformed regex \"{}\" in audio override file {}", regex, path.string());
+ return;
+ }
+ }
+ }
+ // singular event id regex
+ else if (dataJson["EventIdRegex"].IsString())
+ {
+ const std::string& regex = dataJson["EventIdRegex"].GetString();
+ try
+ {
+ EventIdsRegex.push_back({regex, std::regex(regex)});
+ }
+ catch (...)
+ {
+ spdlog::error("Malformed regex \"{}\" in audio override file {}", regex, path.string());
+ return;
+ }
+ }
+ // incorrect type
+ else
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: EventIdRegex property is of invalid type (must be a string or an array of strings)",
+ path.string());
+ return;
+ }
+ }
+
+ if (dataJson.HasMember("AudioSelectionStrategy"))
+ {
+ if (!dataJson["AudioSelectionStrategy"].IsString())
+ {
+ spdlog::error("Failed reading audio override file {}: AudioSelectionStrategy property must be a string", path.string());
+ return;
+ }
+
+ std::string strategy = dataJson["AudioSelectionStrategy"].GetString();
+
+ if (strategy == "sequential")
+ {
+ Strategy = AudioSelectionStrategy::SEQUENTIAL;
+ }
+ else if (strategy == "random")
+ {
+ Strategy = AudioSelectionStrategy::RANDOM;
+ }
+ else
+ {
+ spdlog::error(
+ "Failed reading audio override file {}: AudioSelectionStrategy string must be either \"sequential\" or \"random\"",
+ path.string());
+ return;
+ }
+ }
+
+ // load samples
+ for (fs::directory_entry file : fs::recursive_directory_iterator(samplesFolder))
+ {
+ if (file.is_regular_file() && file.path().extension().string() == ".wav")
+ {
+ std::string pathString = file.path().string();
+
+ // Open the file.
+ std::basic_ifstream wavStream(pathString, std::ios::binary);
+
+ if (wavStream.fail())
+ {
+ spdlog::error("Failed reading audio sample {}", file.path().string());
+ continue;
+ }
+
+ // Get file size.
+ wavStream.seekg(0, std::ios::end);
+ size_t fileSize = wavStream.tellg();
+ wavStream.close();
+
+ // Allocate enough memory for the file.
+ // blank out the memory for now, then read it later
+ uint8_t* data = new uint8_t[fileSize];
+ memcpy(data, EMPTY_WAVE, sizeof(EMPTY_WAVE));
+ Samples.push_back({fileSize, std::unique_ptr(data)});
+
+ // thread off the file read
+ // should we spawn one thread per read? or should there be a cap to the number of reads at once?
+ std::thread readThread(
+ [pathString, fileSize, data]
+ {
+ std::shared_lock lock(g_CustomAudioManager.m_loadingMutex);
+ std::basic_ifstream wavStream(pathString, std::ios::binary);
+
+ // would be weird if this got hit, since it would've worked previously
+ if (wavStream.fail())
+ {
+ spdlog::error("Failed async read of audio sample {}", pathString);
+ return;
+ }
+
+ // read from after the header first to preserve the empty header, then read the header last
+ wavStream.seekg(0, std::ios::beg);
+ wavStream.read(data, fileSize);
+ wavStream.close();
+
+ spdlog::info("Finished async read of audio sample {}", pathString);
+ });
+
+ readThread.detach();
+ }
+ }
+
+ /*
+ if (dataJson.HasMember("EnableOnLoopedSounds"))
+ {
+ if (!dataJson["EnableOnLoopedSounds"].IsBool())
+ {
+ spdlog::error("Failed reading audio override file {}: EnableOnLoopedSounds property is of invalid type (must be a bool)",
+ path.string()); return;
+ }
+
+ EnableOnLoopedSounds = dataJson["EnableOnLoopedSounds"].GetBool();
+ }
+ */
+
+ if (Samples.size() == 0)
+ spdlog::warn("Audio override {} has no valid samples! Sounds will not play for this event.", path.string());
+
+ spdlog::info("Loaded audio override file {}", path.string());
+
+ LoadedSuccessfully = true;
+}
+
+bool CustomAudioManager::TryLoadAudioOverride(const fs::path& defPath)
+{
+ if (IsDedicatedServer())
+ return true; // silently fail
+
+ std::ifstream jsonStream(defPath);
+ std::stringstream jsonStringStream;
+
+ // fail if no audio json
+ if (jsonStream.fail())
+ {
+ spdlog::warn("Unable to read audio override from file {}", defPath.string());
+ return false;
+ }
+
+ while (jsonStream.peek() != EOF)
+ jsonStringStream << (char)jsonStream.get();
+
+ jsonStream.close();
+
+ std::shared_ptr data = std::make_shared(jsonStringStream.str(), defPath);
+
+ if (!data->LoadedSuccessfully)
+ return false; // no logging, the constructor has probably already logged
+
+ for (const std::string& eventId : data->EventIds)
+ {
+ spdlog::info("Registering sound event {}", eventId);
+ m_loadedAudioOverrides.insert({eventId, data});
+ }
+
+ for (const auto& eventIdRegexData : data->EventIdsRegex)
+ {
+ spdlog::info("Registering sound event regex {}", eventIdRegexData.first);
+ m_loadedAudioOverridesRegex.insert({eventIdRegexData.first, data});
+ }
+
+ return true;
+}
+
+typedef void (*MilesStopAll_Type)();
+MilesStopAll_Type MilesStopAll;
+
+void CustomAudioManager::ClearAudioOverrides()
+{
+ if (IsDedicatedServer())
+ return;
+
+ if (m_loadedAudioOverrides.size() > 0 || m_loadedAudioOverridesRegex.size() > 0)
+ {
+ // stop all miles sounds beforehand
+ // miles_stop_all
+ MilesStopAll();
+
+ // this is cancer but it works
+ Sleep(50);
+ }
+
+ // slightly (very) bad
+ // wait for all audio reads to complete so we don't kill preexisting audio buffers as we're writing to them
+ std::unique_lock lock(g_CustomAudioManager.m_loadingMutex);
+
+ m_loadedAudioOverrides.clear();
+ m_loadedAudioOverridesRegex.clear();
+}
+
+template Iter select_randomly(Iter start, Iter end, RandomGenerator& g)
+{
+ std::uniform_int_distribution<> dis(0, std::distance(start, end) - 1);
+ std::advance(start, dis(g));
+ return start;
+}
+
+template Iter select_randomly(Iter start, Iter end)
+{
+ static std::random_device rd;
+ static std::mt19937 gen(rd());
+ return select_randomly(start, end, gen);
+}
+
+bool ShouldPlayAudioEvent(const char* eventName, const std::shared_ptr& data)
+{
+ std::string eventNameString = eventName;
+ std::string eventNameStringBlacklistEntry = ("!" + eventNameString);
+
+ for (const std::string& name : data->EventIds)
+ {
+ if (name == eventNameStringBlacklistEntry)
+ return false; // event blacklisted
+
+ if (name == "*")
+ {
+ // check for bad sounds I guess?
+ // really feel like this should be an option but whatever
+ if (!!strstr(eventName, "_amb_") || !!strstr(eventName, "_emit_") || !!strstr(eventName, "amb_"))
+ return false; // would play static noise, I hate this
+ }
+ }
+
+ return true; // good to go
+}
+
+// forward declare
+bool __declspec(noinline) __fastcall LoadSampleMetadata_Internal(
+ uintptr_t parentEvent, void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType);
+
+// DO NOT TOUCH THIS FUNCTION
+// The actual logic of it in a separate function (forcefully not inlined) to preserve the r12 register, which holds the event pointer.
+AUTOHOOK(LoadSampleMetadata, mileswin64.dll + 0xF110,
+bool, __fastcall, (void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType),
+{
+ uintptr_t parentEvent = (uintptr_t)Audio_GetParentEvent();
+
+ // Raw source, used for voice data only
+ if (audioType == 0)
+ return LoadSampleMetadata(sample, audioBuffer, audioBufferLength, audioType);
+
+ return LoadSampleMetadata_Internal(parentEvent, sample, audioBuffer, audioBufferLength, audioType);
+})
+
+// DO NOT INLINE THIS FUNCTION
+// See comment below.
+bool __declspec(noinline) __fastcall LoadSampleMetadata_Internal(
+ uintptr_t parentEvent, void* sample, void* audioBuffer, unsigned int audioBufferLength, int audioType)
+{
+ char* eventName = (char*)parentEvent + 0x110;
+
+ if (Cvar_ns_print_played_sounds->GetInt() > 0)
+ spdlog::info("[AUDIO] Playing event {}", eventName);
+
+ auto iter = g_CustomAudioManager.m_loadedAudioOverrides.find(eventName);
+ std::shared_ptr overrideData;
+
+ if (iter == g_CustomAudioManager.m_loadedAudioOverrides.end())
+ {
+ // override for that specific event not found, try wildcard
+ iter = g_CustomAudioManager.m_loadedAudioOverrides.find("*");
+
+ if (iter == g_CustomAudioManager.m_loadedAudioOverrides.end())
+ {
+ // not found
+
+ // try regex
+ for (const auto& item : g_CustomAudioManager.m_loadedAudioOverridesRegex)
+ for (const auto& regexData : item.second->EventIdsRegex)
+ if (std::regex_search(eventName, regexData.second))
+ overrideData = item.second;
+
+ if (!overrideData)
+ // not found either
+ return LoadSampleMetadata(sample, audioBuffer, audioBufferLength, audioType);
+ else
+ {
+ // cache found pattern to improve performance
+ g_CustomAudioManager.m_loadedAudioOverrides[eventName] = overrideData;
+ }
+ }
+ else
+ overrideData = iter->second;
+ }
+ else
+ overrideData = iter->second;
+
+ if (!ShouldPlayAudioEvent(eventName, overrideData))
+ return LoadSampleMetadata(sample, audioBuffer, audioBufferLength, audioType);
+
+ void* data = 0;
+ unsigned int dataLength = 0;
+
+ if (overrideData->Samples.size() == 0)
+ {
+ // 0 samples, turn off this particular event.
+
+ // using a dummy empty wave file
+ data = EMPTY_WAVE;
+ dataLength = sizeof(EMPTY_WAVE);
+ }
+ else
+ {
+ std::pair>* dat = NULL;
+
+ switch (overrideData->Strategy)
+ {
+ case AudioSelectionStrategy::RANDOM:
+ dat = &*select_randomly(overrideData->Samples.begin(), overrideData->Samples.end());
+ break;
+ case AudioSelectionStrategy::SEQUENTIAL:
+ default:
+ dat = &overrideData->Samples[overrideData->CurrentIndex++];
+ if (overrideData->CurrentIndex >= overrideData->Samples.size())
+ overrideData->CurrentIndex = 0; // reset back to the first sample entry
+ break;
+ }
+
+ if (!dat)
+ spdlog::warn("Could not get sample data from override struct for event {}! Shouldn't happen", eventName);
+ else
+ {
+ data = dat->second.get();
+ dataLength = dat->first;
+ }
+ }
+
+ if (!data)
+ {
+ spdlog::warn("Could not fetch override sample data for event {}! Using original data instead.", eventName);
+ return LoadSampleMetadata(sample, audioBuffer, audioBufferLength, audioType);
+ }
+
+ audioBuffer = data;
+ audioBufferLength = dataLength;
+
+ // most important change: set the sample class buffer so that the correct audio plays
+ *(void**)((uintptr_t)sample + 0xE8) = audioBuffer;
+ *(unsigned int*)((uintptr_t)sample + 0xF0) = audioBufferLength;
+
+ // 64 - Auto-detect sample type
+ bool res = LoadSampleMetadata(sample, audioBuffer, audioBufferLength, 64);
+ if (!res)
+ spdlog::error("LoadSampleMetadata failed! The game will crash :(");
+
+ return res;
+}
+
+AUTOHOOK(MilesLog, mileswin64.dll + 0x57DAD0,
+void, __fastcall, (int level, const char* string),
+{
+ spdlog::info("[MSS] {} - {}", level, string);
+})
+
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", AudioHooks, ConVar, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ Cvar_ns_print_played_sounds = new ConVar("ns_print_played_sounds", "0", FCVAR_NONE, "");
+ MilesStopAll = (MilesStopAll_Type)((char*)GetModuleHandleA("mileswin64.dll") + 0x580850);
+})
\ No newline at end of file
diff --git a/NorthstarDLL/audio.h b/NorthstarDLL/audio.h
new file mode 100644
index 00000000..98da2fa1
--- /dev/null
+++ b/NorthstarDLL/audio.h
@@ -0,0 +1,48 @@
+#pragma once
+
+#include
+#include
+#include
+#include
+
+namespace fs = std::filesystem;
+
+enum class AudioSelectionStrategy
+{
+ INVALID = -1,
+ SEQUENTIAL,
+ RANDOM
+};
+
+class EventOverrideData
+{
+ public:
+ EventOverrideData(const std::string&, const fs::path&);
+ EventOverrideData();
+
+ public:
+ bool LoadedSuccessfully = false;
+
+ std::vector EventIds = {};
+ std::vector> EventIdsRegex = {};
+
+ std::vector>> Samples = {};
+
+ AudioSelectionStrategy Strategy = AudioSelectionStrategy::SEQUENTIAL;
+ size_t CurrentIndex = 0;
+
+ bool EnableOnLoopedSounds = false;
+};
+
+class CustomAudioManager
+{
+ public:
+ bool TryLoadAudioOverride(const fs::path&);
+ void ClearAudioOverrides();
+
+ std::shared_mutex m_loadingMutex;
+ std::unordered_map> m_loadedAudioOverrides = {};
+ std::unordered_map> m_loadedAudioOverridesRegex = {};
+};
+
+extern CustomAudioManager g_CustomAudioManager;
\ No newline at end of file
diff --git a/NorthstarDLL/audio_asm.asm b/NorthstarDLL/audio_asm.asm
new file mode 100644
index 00000000..4c527f9d
--- /dev/null
+++ b/NorthstarDLL/audio_asm.asm
@@ -0,0 +1,8 @@
+public Audio_GetParentEvent
+
+.code
+Audio_GetParentEvent proc
+ mov rax, r12
+ ret
+Audio_GetParentEvent endp
+end
\ No newline at end of file
diff --git a/NorthstarDLL/bansystem.cpp b/NorthstarDLL/bansystem.cpp
new file mode 100644
index 00000000..08115998
--- /dev/null
+++ b/NorthstarDLL/bansystem.cpp
@@ -0,0 +1,107 @@
+#pragma once
+#include "pch.h"
+#include "bansystem.h"
+#include "serverauthentication.h"
+#include "concommand.h"
+#include "miscserverscript.h"
+#include "configurables.h"
+
+#include
+
+const char* BANLIST_PATH_SUFFIX = "/banlist.txt";
+
+ServerBanSystem* g_ServerBanSystem;
+
+void ServerBanSystem::OpenBanlist()
+{
+ std::ifstream enabledModsStream(GetNorthstarPrefix() + "/banlist.txt");
+ std::stringstream enabledModsStringStream;
+
+ if (!enabledModsStream.fail())
+ {
+ std::string line;
+ while (std::getline(enabledModsStream, line))
+ m_vBannedUids.push_back(strtoll(line.c_str(), nullptr, 10));
+
+ enabledModsStream.close();
+ }
+
+ // open write stream for banlist
+ m_sBanlistStream.open(GetNorthstarPrefix() + "/banlist.txt", std::ofstream::out | std::ofstream::binary | std::ofstream::app);
+}
+
+void ServerBanSystem::ClearBanlist()
+{
+ m_vBannedUids.clear();
+
+ // reopen the file, don't provide std::ofstream::app so it clears on open
+ m_sBanlistStream.close();
+ m_sBanlistStream.open(GetNorthstarPrefix() + "/banlist.txt", std::ofstream::out | std::ofstream::binary);
+}
+
+void ServerBanSystem::BanUID(uint64_t uid)
+{
+ m_vBannedUids.push_back(uid);
+ m_sBanlistStream << std::to_string(uid) << std::endl;
+ spdlog::info("{} was banned", uid);
+}
+
+void ServerBanSystem::UnbanUID(uint64_t uid)
+{
+ auto findResult = std::find(m_vBannedUids.begin(), m_vBannedUids.end(), uid);
+ if (findResult == m_vBannedUids.end())
+ return;
+
+ m_vBannedUids.erase(findResult);
+ spdlog::info("{} was unbanned", uid);
+ // todo: this needs to erase from the banlist file
+ // atm unsure how to do this aside from just clearing and fully rewriting the file
+}
+
+bool ServerBanSystem::IsUIDAllowed(uint64_t uid)
+{
+ return std::find(m_vBannedUids.begin(), m_vBannedUids.end(), uid) == m_vBannedUids.end();
+}
+
+void ConCommand_ban(const CCommand& args)
+{
+ if (args.ArgC() < 2)
+ return;
+
+ // assuming maxplayers 32
+ for (int i = 0; i < 32; i++)
+ {
+ void* player = GetPlayerByIndex(i);
+
+ if (!strcmp((char*)player + 0x16, args.Arg(1)) || !strcmp((char*)player + 0xF500, args.Arg(1)))
+ {
+ g_ServerBanSystem->BanUID(strtoll((char*)player + 0xF500, nullptr, 10));
+ CBaseClient__Disconnect(player, 1, "Banned from server");
+ break;
+ }
+ }
+}
+
+void ConCommand_unban(const CCommand& args)
+{
+ if (args.ArgC() < 2)
+ return;
+
+ // assumedly the player being unbanned here wasn't already connected, so don't need to iterate over players or anything
+ g_ServerBanSystem->UnbanUID(strtoll(args.Arg(1), nullptr, 10));
+}
+
+void ConCommand_clearbanlist(const CCommand& args)
+{
+ g_ServerBanSystem->ClearBanlist();
+}
+
+ON_DLL_LOAD_RELIESON("engine.dll", BanSystem, ConCommand, [](HMODULE baseAddress)
+{
+ g_ServerBanSystem = new ServerBanSystem;
+ g_ServerBanSystem->OpenBanlist();
+
+ RegisterConCommand("ban", ConCommand_ban, "bans a given player by uid or name", FCVAR_GAMEDLL);
+ RegisterConCommand("unban", ConCommand_unban, "unbans a given player by uid", FCVAR_NONE);
+ RegisterConCommand("clearbanlist", ConCommand_clearbanlist, "clears all uids on the banlist", FCVAR_NONE);
+})
\ No newline at end of file
diff --git a/NorthstarDLL/bansystem.h b/NorthstarDLL/bansystem.h
new file mode 100644
index 00000000..8080da91
--- /dev/null
+++ b/NorthstarDLL/bansystem.h
@@ -0,0 +1,18 @@
+#pragma once
+#include
+
+class ServerBanSystem
+{
+ private:
+ std::ofstream m_sBanlistStream;
+ std::vector m_vBannedUids;
+
+ public:
+ void OpenBanlist();
+ void ClearBanlist();
+ void BanUID(uint64_t uid);
+ void UnbanUID(uint64_t uid);
+ bool IsUIDAllowed(uint64_t uid);
+};
+
+extern ServerBanSystem* g_ServerBanSystem;
diff --git a/NorthstarDLL/bitbuf.h b/NorthstarDLL/bitbuf.h
new file mode 100644
index 00000000..8e8e216f
--- /dev/null
+++ b/NorthstarDLL/bitbuf.h
@@ -0,0 +1,1148 @@
+#pragma once
+
+#define INLINE inline
+
+#define BITS_PER_INT 32
+
+INLINE int GetBitForBitnum(int bitNum)
+{
+ static int bitsForBitnum[] = {
+ (1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7), (1 << 8), (1 << 9), (1 << 10),
+ (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15), (1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21),
+ (1 << 22), (1 << 23), (1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
+ };
+
+ return bitsForBitnum[(bitNum) & (BITS_PER_INT - 1)];
+}
+
+#undef BITS_PER_INT
+
+using u8 = uint8_t;
+using u16 = uint16_t;
+using u32 = uint32_t;
+using u64 = uint64_t;
+using uptr = uintptr_t;
+
+using i8 = int8_t;
+using i16 = int16_t;
+using i32 = int32_t;
+using i64 = int64_t;
+using iptr = intptr_t;
+
+// Endianess, don't use on PPC64 nor ARM64BE
+#define LittleDWord(val) (val)
+
+static INLINE void StoreLittleDWord(u32* base, size_t dwordIndex, u32 dword)
+{
+ base[dwordIndex] = LittleDWord(dword);
+}
+
+static INLINE u32 LoadLittleDWord(u32* base, size_t dwordIndex)
+{
+ return LittleDWord(base[dwordIndex]);
+}
+
+#include
+
+static inline const u32 s_nMaskTable[33] = {
+ 0,
+ (1 << 1) - 1,
+ (1 << 2) - 1,
+ (1 << 3) - 1,
+ (1 << 4) - 1,
+ (1 << 5) - 1,
+ (1 << 6) - 1,
+ (1 << 7) - 1,
+ (1 << 8) - 1,
+ (1 << 9) - 1,
+ (1 << 10) - 1,
+ (1 << 11) - 1,
+ (1 << 12) - 1,
+ (1 << 13) - 1,
+ (1 << 14) - 1,
+ (1 << 15) - 1,
+ (1 << 16) - 1,
+ (1 << 17) - 1,
+ (1 << 18) - 1,
+ (1 << 19) - 1,
+ (1 << 20) - 1,
+ (1 << 21) - 1,
+ (1 << 22) - 1,
+ (1 << 23) - 1,
+ (1 << 24) - 1,
+ (1 << 25) - 1,
+ (1 << 26) - 1,
+ (1 << 27) - 1,
+ (1 << 28) - 1,
+ (1 << 29) - 1,
+ (1 << 30) - 1,
+ 0x7fffffff,
+ 0xffffffff,
+};
+
+enum EBitCoordType
+{
+ kCW_None,
+ kCW_LowPrecision,
+ kCW_Integral
+};
+
+class BitBufferBase
+{
+ protected:
+ INLINE void SetName(const char* name)
+ {
+ m_BufferName = name;
+ }
+
+ public:
+ INLINE bool IsOverflowed()
+ {
+ return m_Overflow;
+ }
+ INLINE void SetOverflowed()
+ {
+ m_Overflow = true;
+ }
+
+ INLINE const char* GetName()
+ {
+ return m_BufferName;
+ }
+
+ private:
+ const char* m_BufferName = "";
+
+ protected:
+ u8 m_Overflow = false;
+};
+
+class BFRead : public BitBufferBase
+{
+ public:
+ BFRead() = default;
+
+ INLINE BFRead(uptr data, size_t byteLength, size_t startPos = 0, const char* bufferName = 0)
+ {
+ StartReading(data, byteLength, startPos);
+
+ if (bufferName)
+ SetName(bufferName);
+ }
+
+ public:
+ INLINE void StartReading(uptr data, size_t byteLength, size_t startPos = 0)
+ {
+ m_Data = reinterpret_cast(data);
+ m_DataIn = m_Data;
+
+ m_DataBytes = byteLength;
+ m_DataBits = byteLength << 3;
+
+ m_DataEnd = reinterpret_cast(reinterpret_cast(m_Data) + m_DataBytes);
+
+ Seek(startPos);
+ }
+
+ INLINE void GrabNextDWord(bool overflow = false)
+ {
+ if (m_Data == m_DataEnd)
+ {
+ m_CachedBitsLeft = 1;
+ m_CachedBufWord = 0;
+
+ m_DataIn++;
+
+ if (overflow)
+ SetOverflowed();
+ }
+ else
+ {
+ if (m_DataIn > m_DataEnd)
+ {
+ SetOverflowed();
+ m_CachedBufWord = 0;
+ }
+ else
+ {
+ m_CachedBufWord = LittleDWord(*(m_DataIn++));
+ }
+ }
+ }
+
+ INLINE void FetchNext()
+ {
+ m_CachedBitsLeft = 32;
+ GrabNextDWord(false);
+ }
+
+ INLINE i32 ReadOneBit()
+ {
+ i32 ret = m_CachedBufWord & 1;
+
+ if (--m_CachedBitsLeft == 0)
+ FetchNext();
+ else
+ m_CachedBufWord >>= 1;
+
+ return ret;
+ }
+
+ INLINE u32 ReadUBitLong(i32 numBits)
+ {
+ if (m_CachedBitsLeft >= numBits)
+ {
+ u32 ret = m_CachedBufWord & s_nMaskTable[numBits];
+
+ m_CachedBitsLeft -= numBits;
+
+ if (m_CachedBitsLeft)
+ m_CachedBufWord >>= numBits;
+ else
+ FetchNext();
+
+ return ret;
+ }
+ else
+ {
+ // need to merge words
+ u32 ret = m_CachedBufWord;
+ numBits -= m_CachedBitsLeft;
+
+ GrabNextDWord(true);
+
+ if (IsOverflowed())
+ return 0;
+
+ ret |= ((m_CachedBufWord & s_nMaskTable[numBits]) << m_CachedBitsLeft);
+
+ m_CachedBitsLeft = 32 - numBits;
+ m_CachedBufWord >>= numBits;
+
+ return ret;
+ }
+ }
+
+ INLINE i32 ReadSBitLong(int numBits)
+ {
+ i32 ret = ReadUBitLong(numBits);
+ return (ret << (32 - numBits)) >> (32 - numBits);
+ }
+
+ INLINE u32 ReadUBitVar()
+ {
+ u32 ret = ReadUBitLong(6);
+
+ switch (ret & (16 | 32))
+ {
+ case 16:
+ ret = (ret & 15) | (ReadUBitLong(4) << 4);
+ // Assert(ret >= 16);
+ break;
+ case 32:
+ ret = (ret & 15) | (ReadUBitLong(8) << 4);
+ // Assert(ret >= 256);
+ break;
+ case 48:
+ ret = (ret & 15) | (ReadUBitLong(32 - 4) << 4);
+ // Assert(ret >= 4096);
+ break;
+ }
+
+ return ret;
+ }
+
+ INLINE u32 PeekUBitLong(i32 numBits)
+ {
+ i32 nSaveBA = m_CachedBitsLeft;
+ i32 nSaveW = m_CachedBufWord;
+ u32 const* pSaveP = m_DataIn;
+ u32 nRet = ReadUBitLong(numBits);
+
+ m_CachedBitsLeft = nSaveBA;
+ m_CachedBufWord = nSaveW;
+ m_DataIn = pSaveP;
+
+ return nRet;
+ }
+
+ INLINE float ReadBitFloat()
+ {
+ u32 value = ReadUBitLong(32);
+ return *reinterpret_cast(&value);
+ }
+
+ /*INLINE float ReadBitCoord() {
+ i32 intval = 0, fractval = 0, signbit = 0;
+ float value = 0.0;
+
+ // Read the required integer and fraction flags
+ intval = ReadOneBit();
+ fractval = ReadOneBit();
+
+ // If we got either parse them, otherwise it's a zero.
+ if (intval || fractval) {
+ // Read the sign bit
+ signbit = ReadOneBit();
+
+ // If there's an integer, read it in
+ if (intval) {
+ // Adjust the integers from [0..MAX_COORD_VALUE-1] to [1..MAX_COORD_VALUE]
+ intval = ReadUBitLong(COORD_INTEGER_BITS) + 1;
+ }
+
+ // If there's a fraction, read it in
+ if (fractval) {
+ fractval = ReadUBitLong(COORD_FRACTIONAL_BITS);
+ }
+
+ // Calculate the correct floating point value
+ value = intval + ((float)fractval * COORD_RESOLUTION);
+
+ // Fixup the sign if negative.
+ if (signbit)
+ value = -value;
+ }
+
+ return value;
+ }
+
+ INLINE float ReadBitCoordMP() {
+ i32 intval = 0, fractval = 0, signbit = 0;
+ float value = 0.0;
+
+ bool inBounds = ReadOneBit() ? true : false;
+
+ // Read the required integer and fraction flags
+ intval = ReadOneBit();
+
+ // If we got either parse them, otherwise it's a zero.
+ if (intval) {
+ // Read the sign bit
+ signbit = ReadOneBit();
+
+ // If there's an integer, read it in
+ // Adjust the integers from [0..MAX_COORD_VALUE-1] to [1..MAX_COORD_VALUE]
+ if (inBounds)
+ value = ReadUBitLong(COORD_INTEGER_BITS_MP) + 1;
+ else
+ value = ReadUBitLong(COORD_INTEGER_BITS) + 1;
+ }
+
+ // Fixup the sign if negative.
+ if (signbit)
+ value = -value;
+
+ return value;
+ }
+
+ INLINE float ReadBitCellCoord(int bits, EBitCoordType coordType) {
+ bool bIntegral = (coordType == kCW_Integral);
+ bool bLowPrecision = (coordType == kCW_LowPrecision);
+
+ int intval = 0, fractval = 0;
+ float value = 0.0;
+
+ if (bIntegral)
+ value = ReadUBitLong(bits);
+ else {
+ intval = ReadUBitLong(bits);
+
+ // If there's a fraction, read it in
+ fractval = ReadUBitLong(bLowPrecision ? COORD_FRACTIONAL_BITS_MP_LOWPRECISION : COORD_FRACTIONAL_BITS);
+
+ // Calculate the correct floating point value
+ value = intval + ((float)fractval * (bLowPrecision ? COORD_RESOLUTION_LOWPRECISION : COORD_RESOLUTION));
+ }
+
+ return value;
+ }
+
+ INLINE float ReadBitNormal() {
+ // Read the sign bit
+ i32 signbit = ReadOneBit();
+
+ // Read the fractional part
+ u32 fractval = ReadUBitLong(NORMAL_FRACTIONAL_BITS);
+
+ // Calculate the correct floating point value
+ float value = (float)fractval * NORMAL_RESOLUTION;
+
+ // Fixup the sign if negative.
+ if (signbit)
+ value = -value;
+
+ return value;
+ }
+
+ INLINE void ReadBitVec3Coord(Vector& fa) {
+ i32 xflag, yflag, zflag;
+
+ // This vector must be initialized! Otherwise, If any of the flags aren't set,
+ // the corresponding component will not be read and will be stack garbage.
+ fa.Init(0, 0, 0);
+
+ xflag = ReadOneBit();
+ yflag = ReadOneBit();
+ zflag = ReadOneBit();
+
+ if (xflag)
+ fa[0] = ReadBitCoord();
+ if (yflag)
+ fa[1] = ReadBitCoord();
+ if (zflag)
+ fa[2] = ReadBitCoord();
+ }
+
+ INLINE void ReadBitVec3Normal(Vector& fa) {
+ i32 xflag = ReadOneBit();
+ i32 yflag = ReadOneBit();
+
+ if (xflag)
+ fa[0] = ReadBitNormal();
+ else
+ fa[0] = 0.0f;
+
+ if (yflag)
+ fa[1] = ReadBitNormal();
+ else
+ fa[1] = 0.0f;
+
+ // The first two imply the third (but not its sign)
+ i32 znegative = ReadOneBit();
+
+ float fafafbfb = fa[0] * fa[0] + fa[1] * fa[1];
+ if (fafafbfb < 1.0f)
+ fa[2] = sqrt(1.0f - fafafbfb);
+ else
+ fa[2] = 0.0f;
+
+ if (znegative)
+ fa[2] = -fa[2];
+ }
+
+ INLINE void ReadBitAngles(QAngle& fa) {
+ Vector tmp;
+ ReadBitVec3Coord(tmp);
+ fa.Init(tmp.x, tmp.y, tmp.z);
+ }*/
+
+ INLINE float ReadBitAngle(int numBits)
+ {
+ float shift = (float)(GetBitForBitnum(numBits));
+
+ i32 i = ReadUBitLong(numBits);
+ float fReturn = (float)i * (360.0 / shift);
+
+ return fReturn;
+ }
+
+ INLINE i32 ReadChar()
+ {
+ return ReadSBitLong(sizeof(char) << 3);
+ }
+ INLINE u32 ReadByte()
+ {
+ return ReadUBitLong(sizeof(unsigned char) << 3);
+ }
+
+ INLINE i32 ReadShort()
+ {
+ return ReadSBitLong(sizeof(short) << 3);
+ }
+ INLINE u32 ReadWord()
+ {
+ return ReadUBitLong(sizeof(unsigned short) << 3);
+ }
+
+ INLINE i32 ReadLong()
+ {
+ return (i32)(ReadUBitLong(sizeof(i32) << 3));
+ }
+ INLINE float ReadFloat()
+ {
+ u32 temp = ReadUBitLong(sizeof(float) << 3);
+ return *reinterpret_cast(&temp);
+ }
+
+ INLINE u32 ReadVarInt32()
+ {
+ constexpr int kMaxVarint32Bytes = 5;
+
+ u32 result = 0;
+ int count = 0;
+ u32 b;
+
+ do
+ {
+ if (count == kMaxVarint32Bytes)
+ return result;
+
+ b = ReadUBitLong(8);
+ result |= (b & 0x7F) << (7 * count);
+ ++count;
+ } while (b & 0x80);
+
+ return result;
+ }
+
+ INLINE u64 ReadVarInt64()
+ {
+ constexpr int kMaxVarintBytes = 10;
+
+ u64 result = 0;
+ int count = 0;
+ u64 b;
+
+ do
+ {
+ if (count == kMaxVarintBytes)
+ return result;
+
+ b = ReadUBitLong(8);
+ result |= static_cast(b & 0x7F) << (7 * count);
+ ++count;
+ } while (b & 0x80);
+
+ return result;
+ }
+
+ INLINE void ReadBits(uptr outData, u32 bitLength)
+ {
+ u8* out = reinterpret_cast(outData);
+ int bitsLeft = bitLength;
+
+ // align output to dword boundary
+ while (((uptr)out & 3) != 0 && bitsLeft >= 8)
+ {
+ *out = (unsigned char)ReadUBitLong(8);
+ ++out;
+ bitsLeft -= 8;
+ }
+
+ // read dwords
+ while (bitsLeft >= 32)
+ {
+ *((u32*)out) = ReadUBitLong(32);
+ out += sizeof(u32);
+ bitsLeft -= 32;
+ }
+
+ // read remaining bytes
+ while (bitsLeft >= 8)
+ {
+ *out = ReadUBitLong(8);
+ ++out;
+ bitsLeft -= 8;
+ }
+
+ // read remaining bits
+ if (bitsLeft)
+ *out = ReadUBitLong(bitsLeft);
+ }
+
+ INLINE bool ReadBytes(uptr outData, u32 byteLength)
+ {
+ ReadBits(outData, byteLength << 3);
+ return !IsOverflowed();
+ }
+
+ INLINE bool ReadString(char* str, i32 maxLength, bool stopAtLineTermination = false, i32* outNumChars = 0)
+ {
+ bool tooSmall = false;
+ int iChar = 0;
+
+ while (1)
+ {
+ char val = ReadChar();
+
+ if (val == 0)
+ break;
+ else if (stopAtLineTermination && val == '\n')
+ break;
+
+ if (iChar < (maxLength - 1))
+ {
+ str[iChar] = val;
+ ++iChar;
+ }
+ else
+ {
+ tooSmall = true;
+ }
+ }
+
+ // Make sure it's null-terminated.
+ // Assert(iChar < maxLength);
+ str[iChar] = 0;
+
+ if (outNumChars)
+ *outNumChars = iChar;
+
+ return !IsOverflowed() && !tooSmall;
+ }
+
+ INLINE char* ReadAndAllocateString(bool* hasOverflowed = 0)
+ {
+ char str[2048];
+
+ int chars = 0;
+ bool overflowed = !ReadString(str, sizeof(str), false, &chars);
+
+ if (hasOverflowed)
+ *hasOverflowed = overflowed;
+
+ // Now copy into the output and return it;
+ char* ret = new char[chars + 1];
+ for (u32 i = 0; i <= chars; i++)
+ ret[i] = str[i];
+
+ return ret;
+ }
+
+ INLINE i64 ReadLongLong()
+ {
+ i64 retval;
+ u32* longs = (u32*)&retval;
+
+ // Read the two DWORDs according to network endian
+ const short endianIndex = 0x0100;
+ u8* idx = (u8*)&endianIndex;
+
+ longs[*idx++] = ReadUBitLong(sizeof(i32) << 3);
+ longs[*idx] = ReadUBitLong(sizeof(i32) << 3);
+
+ return retval;
+ }
+
+ INLINE bool Seek(size_t startPos)
+ {
+ bool bSucc = true;
+
+ if (startPos < 0 || startPos > m_DataBits)
+ {
+ SetOverflowed();
+ bSucc = false;
+ startPos = m_DataBits;
+ }
+
+ // non-multiple-of-4 bytes at head of buffer. We put the "round off"
+ // at the head to make reading and detecting the end efficient.
+ int nHead = m_DataBytes & 3;
+
+ int posBytes = startPos / 8;
+ if ((m_DataBytes < 4) || (nHead && (posBytes < nHead)))
+ {
+ // partial first dword
+ u8 const* partial = (u8 const*)m_Data;
+
+ if (m_Data)
+ {
+ m_CachedBufWord = *(partial++);
+ if (nHead > 1)
+ m_CachedBufWord |= (*partial++) << 8;
+ if (nHead > 2)
+ m_CachedBufWord |= (*partial++) << 16;
+ }
+
+ m_DataIn = (u32 const*)partial;
+
+ m_CachedBufWord >>= (startPos & 31);
+ m_CachedBitsLeft = (nHead << 3) - (startPos & 31);
+ }
+ else
+ {
+ int adjustedPos = startPos - (nHead << 3);
+
+ m_DataIn = reinterpret_cast(reinterpret_cast(m_Data) + ((adjustedPos / 32) << 2) + nHead);
+
+ if (m_Data)
+ {
+ m_CachedBitsLeft = 32;
+ GrabNextDWord();
+ }
+ else
+ {
+ m_CachedBufWord = 0;
+ m_CachedBitsLeft = 1;
+ }
+
+ m_CachedBufWord >>= (adjustedPos & 31);
+ m_CachedBitsLeft = std::min(m_CachedBitsLeft, u32(32 - (adjustedPos & 31))); // in case grabnextdword overflowed
+ }
+
+ return bSucc;
+ }
+
+ INLINE size_t GetNumBitsRead()
+ {
+ if (!m_Data)
+ return 0;
+
+ size_t nCurOfs = size_t(((iptr(m_DataIn) - iptr(m_Data)) / 4) - 1);
+ nCurOfs *= 32;
+ nCurOfs += (32 - m_CachedBitsLeft);
+
+ size_t nAdjust = 8 * (m_DataBytes & 3);
+ return std::min(nCurOfs + nAdjust, m_DataBits);
+ }
+
+ INLINE bool SeekRelative(size_t offset)
+ {
+ return Seek(GetNumBitsRead() + offset);
+ }
+
+ INLINE size_t TotalBytesAvailable()
+ {
+ return m_DataBytes;
+ }
+
+ INLINE size_t GetNumBitsLeft()
+ {
+ return m_DataBits - GetNumBitsRead();
+ }
+ INLINE size_t GetNumBytesLeft()
+ {
+ return GetNumBitsLeft() >> 3;
+ }
+
+ private:
+ size_t m_DataBits; // 0x0010
+ size_t m_DataBytes; // 0x0018
+
+ u32 m_CachedBufWord; // 0x0020
+ u32 m_CachedBitsLeft; // 0x0024
+
+ const u32* m_DataIn; // 0x0028
+ const u32* m_DataEnd; // 0x0030
+ const u32* m_Data; // 0x0038
+};
+
+class BFWrite : public BitBufferBase
+{
+ public:
+ BFWrite() = default;
+
+ INLINE BFWrite(uptr data, size_t byteLength, const char* bufferName = 0)
+ {
+ StartWriting(data, byteLength);
+
+ if (bufferName)
+ SetName(bufferName);
+ }
+
+ public:
+ INLINE void StartWriting(uptr data, size_t byteLength)
+ {
+ m_Data = reinterpret_cast(data);
+ m_DataOut = m_Data;
+
+ m_DataBytes = byteLength;
+ m_DataBits = byteLength << 3;
+
+ m_DataEnd = reinterpret_cast(reinterpret_cast(m_Data) + m_DataBytes);
+ }
+
+ INLINE int GetNumBitsLeft()
+ {
+ return m_OutBitsLeft + (32 * (m_DataEnd - m_DataOut - 1));
+ }
+
+ INLINE void Reset()
+ {
+ m_Overflow = false;
+ m_OutBufWord = 0;
+ m_OutBitsLeft = 32;
+ m_DataOut = m_Data;
+ }
+
+ INLINE void TempFlush()
+ {
+ if (m_OutBitsLeft != 32)
+ {
+ if (m_DataOut == m_DataEnd)
+ SetOverflowed();
+ else
+ StoreLittleDWord(m_DataOut, 0, LoadLittleDWord(m_DataOut, 0) & ~s_nMaskTable[32 - m_OutBitsLeft] | m_OutBufWord);
+ }
+
+ m_Flushed = true;
+ }
+
+ INLINE u8* GetBasePointer()
+ {
+ TempFlush();
+ return reinterpret_cast(m_Data);
+ }
+
+ INLINE u8* GetData()
+ {
+ return GetBasePointer();
+ }
+
+ INLINE void Finish()
+ {
+ if (m_OutBitsLeft != 32)
+ {
+ if (m_DataOut == m_DataEnd)
+ SetOverflowed();
+
+ StoreLittleDWord(m_DataOut, 0, m_OutBufWord);
+ }
+ }
+
+ INLINE void FlushNoCheck()
+ {
+ StoreLittleDWord(m_DataOut++, 0, m_OutBufWord);
+
+ m_OutBitsLeft = 32;
+ m_OutBufWord = 0;
+ }
+
+ INLINE void Flush()
+ {
+ if (m_DataOut == m_DataEnd)
+ SetOverflowed();
+ else
+ StoreLittleDWord(m_DataOut++, 0, m_OutBufWord);
+
+ m_OutBitsLeft = 32;
+ m_OutBufWord = 0;
+ }
+
+ INLINE void WriteOneBitNoCheck(i32 value)
+ {
+ m_OutBufWord |= (value & 1) << (32 - m_OutBitsLeft);
+
+ if (--m_OutBitsLeft == 0)
+ FlushNoCheck();
+ }
+
+ INLINE void WriteOneBit(i32 value)
+ {
+ m_OutBufWord |= (value & 1) << (32 - m_OutBitsLeft);
+
+ if (--m_OutBitsLeft == 0)
+ Flush();
+ }
+
+ INLINE void WriteUBitLong(u32 data, i32 numBits, bool checkRange = true)
+ {
+ if (numBits <= m_OutBitsLeft)
+ {
+ if (checkRange)
+ m_OutBufWord |= (data) << (32 - m_OutBitsLeft);
+ else
+ m_OutBufWord |= (data & s_nMaskTable[numBits]) << (32 - m_OutBitsLeft);
+
+ m_OutBitsLeft -= numBits;
+
+ if (m_OutBitsLeft == 0)
+ Flush();
+ }
+ else
+ {
+ // split dwords case
+ i32 overflowBits = (numBits - m_OutBitsLeft);
+ m_OutBufWord |= (data & s_nMaskTable[m_OutBitsLeft]) << (32 - m_OutBitsLeft);
+ Flush();
+ m_OutBufWord = (data >> (numBits - overflowBits));
+ m_OutBitsLeft = 32 - overflowBits;
+ }
+ }
+
+ INLINE void WriteSBitLong(i32 data, i32 numBits)
+ {
+ WriteUBitLong((u32)data, numBits, false);
+ }
+
+ INLINE void WriteUBitVar(u32 n)
+ {
+ if (n < 16)
+ WriteUBitLong(n, 6);
+ else if (n < 256)
+ WriteUBitLong((n & 15) | 16 | ((n & (128 | 64 | 32 | 16)) << 2), 10);
+ else if (n < 4096)
+ WriteUBitLong((n & 15) | 32 | ((n & (2048 | 1024 | 512 | 256 | 128 | 64 | 32 | 16)) << 2), 14);
+ else
+ {
+ WriteUBitLong((n & 15) | 48, 6);
+ WriteUBitLong((n >> 4), 32 - 4);
+ }
+ }
+
+ INLINE void WriteBitFloat(float value)
+ {
+ auto temp = &value;
+ WriteUBitLong(*reinterpret_cast(temp), 32);
+ }
+
+ INLINE void WriteFloat(float value)
+ {
+ auto temp = &value;
+ WriteUBitLong(*reinterpret_cast(temp), 32);
+ }
+
+ INLINE bool WriteBits(const uptr data, i32 numBits)
+ {
+ u8* out = (u8*)data;
+ i32 numBitsLeft = numBits;
+
+ // Bounds checking..
+ if ((GetNumBitsWritten() + numBits) > m_DataBits)
+ {
+ SetOverflowed();
+ return false;
+ }
+
+ // !! speed!! need fast paths
+ // write remaining bytes
+ while (numBitsLeft >= 8)
+ {
+ WriteUBitLong(*out, 8, false);
+ ++out;
+ numBitsLeft -= 8;
+ }
+
+ // write remaining bits
+ if (numBitsLeft)
+ WriteUBitLong(*out, numBitsLeft, false);
+
+ return !IsOverflowed();
+ }
+
+ INLINE bool WriteBytes(const uptr data, i32 numBytes)
+ {
+ return WriteBits(data, numBytes << 3);
+ }
+
+ INLINE i32 GetNumBitsWritten()
+ {
+ return (32 - m_OutBitsLeft) + (32 * (m_DataOut - m_Data));
+ }
+
+ INLINE i32 GetNumBytesWritten()
+ {
+ return (GetNumBitsWritten() + 7) >> 3;
+ }
+
+ INLINE void WriteChar(i32 val)
+ {
+ WriteSBitLong(val, sizeof(char) << 3);
+ }
+
+ INLINE void WriteByte(i32 val)
+ {
+ WriteUBitLong(val, sizeof(unsigned char) << 3, false);
+ }
+
+ INLINE void WriteShort(i32 val)
+ {
+ WriteSBitLong(val, sizeof(short) << 3);
+ }
+
+ INLINE void WriteWord(i32 val)
+ {
+ WriteUBitLong(val, sizeof(unsigned short) << 3);
+ }
+
+ INLINE bool WriteString(const char* str)
+ {
+ if (str)
+ while (*str)
+ WriteChar(*(str++));
+
+ WriteChar(0);
+
+ return !IsOverflowed();
+ }
+
+ INLINE void WriteLongLong(i64 val)
+ {
+ u32* pLongs = (u32*)&val;
+
+ // Insert the two DWORDS according to network endian
+ const short endianIndex = 0x0100;
+ u8* idx = (u8*)&endianIndex;
+
+ WriteUBitLong(pLongs[*idx++], sizeof(i32) << 3);
+ WriteUBitLong(pLongs[*idx], sizeof(i32) << 3);
+ }
+
+ /*INLINE void WriteBitCoord(const float f) {
+ i32 signbit = (f <= -COORD_RESOLUTION);
+ i32 intval = (i32)abs(f);
+ i32 fractval = abs((i32)(f * COORD_DENOMINATOR)) & (COORD_DENOMINATOR - 1);
+
+ // Send the bit flags that indicate whether we have an integer part and/or a fraction part.
+ WriteOneBit(intval);
+ WriteOneBit(fractval);
+
+ if (intval || fractval) {
+ // Send the sign bit
+ WriteOneBit(signbit);
+
+ // Send the integer if we have one.
+ if (intval) {
+ // Adjust the integers from [1..MAX_COORD_VALUE] to [0..MAX_COORD_VALUE-1]
+ intval--;
+ WriteUBitLong((u32)intval, COORD_INTEGER_BITS);
+ }
+
+ // Send the fraction if we have one
+ if (fractval) {
+ WriteUBitLong((u32)fractval, COORD_FRACTIONAL_BITS);
+ }
+ }
+ }
+
+ INLINE void WriteBitCoordMP(const float f) {
+ i32 signbit = (f <= -COORD_RESOLUTION);
+ i32 intval = (i32)abs(f);
+ i32 fractval = (abs((i32)(f * COORD_DENOMINATOR)) & (COORD_DENOMINATOR - 1));
+
+ bool bInBounds = intval < (1 << COORD_INTEGER_BITS_MP);
+
+ WriteOneBit(bInBounds);
+
+ // Send the sign bit
+ WriteOneBit(intval);
+
+ if (intval) {
+ WriteOneBit(signbit);
+
+ // Send the integer if we have one.
+ // Adjust the integers from [1..MAX_COORD_VALUE] to [0..MAX_COORD_VALUE-1]
+ intval--;
+
+ if (bInBounds)
+ WriteUBitLong((u32)intval, COORD_INTEGER_BITS_MP);
+ else
+ WriteUBitLong((u32)intval, COORD_INTEGER_BITS);
+ }
+ }
+
+ INLINE void WriteBitCellCoord(const float f, int bits, EBitCoordType coordType) {
+ bool bIntegral = (coordType == kCW_Integral);
+ bool bLowPrecision = (coordType == kCW_LowPrecision);
+
+ i32 intval = (i32)abs(f);
+ i32 fractval = bLowPrecision ? (abs((i32)(f * COORD_DENOMINATOR_LOWPRECISION)) & (COORD_DENOMINATOR_LOWPRECISION - 1)) :
+ (abs((i32)(f * COORD_DENOMINATOR)) & (COORD_DENOMINATOR - 1));
+
+ if (bIntegral)
+ WriteUBitLong((u32)intval, bits);
+ else {
+ WriteUBitLong((u32)intval, bits);
+ WriteUBitLong((u32)fractval, bLowPrecision ? COORD_FRACTIONAL_BITS_MP_LOWPRECISION : COORD_FRACTIONAL_BITS);
+ }
+ }*/
+
+ INLINE void SeekToBit(int bit)
+ {
+ TempFlush();
+
+ m_DataOut = m_Data + (bit / 32);
+ m_OutBufWord = LoadLittleDWord(m_DataOut, 0);
+ m_OutBitsLeft = 32 - (bit & 31);
+ }
+
+ /*INLINE void WriteBitVec3Coord(const Vector& fa) {
+ i32 xflag, yflag, zflag;
+
+ xflag = (fa[0] >= COORD_RESOLUTION) || (fa[0] <= -COORD_RESOLUTION);
+ yflag = (fa[1] >= COORD_RESOLUTION) || (fa[1] <= -COORD_RESOLUTION);
+ zflag = (fa[2] >= COORD_RESOLUTION) || (fa[2] <= -COORD_RESOLUTION);
+
+ WriteOneBit(xflag);
+ WriteOneBit(yflag);
+ WriteOneBit(zflag);
+
+ if (xflag)
+ WriteBitCoord(fa[0]);
+ if (yflag)
+ WriteBitCoord(fa[1]);
+ if (zflag)
+ WriteBitCoord(fa[2]);
+ }
+
+ INLINE void WriteBitNormal(float f) {
+ i32 signbit = (f <= -NORMAL_RESOLUTION);
+
+ // NOTE: Since +/-1 are valid values for a normal, I'm going to encode that as all ones
+ u32 fractval = abs((i32)(f * NORMAL_DENOMINATOR));
+
+ // clamp..
+ if (fractval > NORMAL_DENOMINATOR)
+ fractval = NORMAL_DENOMINATOR;
+
+ // Send the sign bit
+ WriteOneBit(signbit);
+
+ // Send the fractional component
+ WriteUBitLong(fractval, NORMAL_FRACTIONAL_BITS);
+ }
+
+ INLINE void WriteBitVec3Normal(const Vector& fa) {
+ i32 xflag, yflag;
+
+ xflag = (fa[0] >= NORMAL_RESOLUTION) || (fa[0] <= -NORMAL_RESOLUTION);
+ yflag = (fa[1] >= NORMAL_RESOLUTION) || (fa[1] <= -NORMAL_RESOLUTION);
+
+ WriteOneBit(xflag);
+ WriteOneBit(yflag);
+
+ if (xflag)
+ WriteBitNormal(fa[0]);
+ if (yflag)
+ WriteBitNormal(fa[1]);
+
+ // Write z sign bit
+ i32 signbit = (fa[2] <= -NORMAL_RESOLUTION);
+ WriteOneBit(signbit);
+ }*/
+
+ INLINE void WriteBitAngle(float angle, int numBits)
+ {
+ u32 shift = GetBitForBitnum(numBits);
+ u32 mask = shift - 1;
+
+ i32 d = (i32)((angle / 360.0) * shift);
+ d &= mask;
+
+ WriteUBitLong((u32)d, numBits);
+ }
+
+ INLINE bool WriteBitsFromBuffer(BFRead* in, int numBits)
+ {
+ while (numBits > 32)
+ {
+ WriteUBitLong(in->ReadUBitLong(32), 32);
+ numBits -= 32;
+ }
+
+ WriteUBitLong(in->ReadUBitLong(numBits), numBits);
+ return !IsOverflowed() && !in->IsOverflowed();
+ }
+
+ /*INLINE void WriteBitAngles(const QAngle& fa) {
+ // FIXME:
+ Vector tmp(fa.x, fa.y, fa.z);
+ WriteBitVec3Coord(tmp);
+ }*/
+
+ private:
+ size_t m_DataBits = 0;
+ size_t m_DataBytes = 0;
+
+ u32 m_OutBufWord = 0;
+ u32 m_OutBitsLeft = 32;
+
+ u32* m_DataOut = nullptr;
+ u32* m_DataEnd = nullptr;
+ u32* m_Data = nullptr;
+
+ bool m_Flushed = false; // :flushed:
+};
+
+#undef INLINE
diff --git a/NorthstarDLL/bits.cpp b/NorthstarDLL/bits.cpp
new file mode 100644
index 00000000..014899f2
--- /dev/null
+++ b/NorthstarDLL/bits.cpp
@@ -0,0 +1,46 @@
+//=============================================================================//
+//
+// Purpose: look for NANs, infinities, and underflows.
+//
+//=============================================================================//
+
+#include "pch.h"
+#include "bits.h"
+
+//-----------------------------------------------------------------------------
+// This follows the ANSI/IEEE 754-1985 standard
+//-----------------------------------------------------------------------------
+unsigned long& FloatBits(float& f)
+{
+ return *reinterpret_cast(&f);
+}
+
+unsigned long const& FloatBits(float const& f)
+{
+ return *reinterpret_cast(&f);
+}
+
+float BitsToFloat(unsigned long i)
+{
+ return *reinterpret_cast(&i);
+}
+
+bool IsFinite(float f)
+{
+ return ((FloatBits(f) & 0x7F800000) != 0x7F800000);
+}
+
+unsigned long FloatAbsBits(float f)
+{
+ return FloatBits(f) & 0x7FFFFFFF;
+}
+
+float FloatMakePositive(float f)
+{
+ return fabsf(f);
+}
+
+float FloatNegate(float f)
+{
+ return -f; // BitsToFloat( FloatBits(f) ^ 0x80000000 );
+}
diff --git a/NorthstarDLL/bits.h b/NorthstarDLL/bits.h
new file mode 100644
index 00000000..0532a9bd
--- /dev/null
+++ b/NorthstarDLL/bits.h
@@ -0,0 +1,10 @@
+#pragma once
+
+unsigned long& FloatBits(float& f);
+unsigned long const& FloatBits(float const& f);
+float BitsToFloat(unsigned long i);
+bool IsFinite(float f);
+unsigned long FloatAbsBits(float f);
+
+#define FLOAT32_NAN_BITS (std::uint32_t)0x7FC00000 // NaN!
+#define FLOAT32_NAN BitsToFloat(FLOAT32_NAN_BITS)
diff --git a/NorthstarDLL/buildainfile.cpp b/NorthstarDLL/buildainfile.cpp
new file mode 100644
index 00000000..a80185e5
--- /dev/null
+++ b/NorthstarDLL/buildainfile.cpp
@@ -0,0 +1,384 @@
+#include "pch.h"
+#include "convar.h"
+#include "hoststate.h"
+#include "NSMem.h"
+
+#include
+#include
+
+AUTOHOOK_INIT()
+
+namespace fs = std::filesystem;
+
+const int AINET_VERSION_NUMBER = 57;
+const int AINET_SCRIPT_VERSION_NUMBER = 21;
+const int PLACEHOLDER_CRC = 0;
+const int MAX_HULLS = 5;
+
+struct CAI_NodeLink
+{
+ short srcId;
+ short destId;
+ bool hulls[MAX_HULLS];
+ char unk0;
+ char unk1; // maps => unk0 on disk
+ char unk2[5];
+ int64_t flags;
+};
+
+#pragma pack(push, 1)
+struct CAI_NodeLinkDisk
+{
+ short srcId;
+ short destId;
+ char unk0;
+ bool hulls[MAX_HULLS];
+};
+
+struct CAI_Node
+{
+ int index; // not present on disk
+ float x;
+ float y;
+ float z;
+ float hulls[MAX_HULLS];
+ float yaw;
+
+ int unk0; // always 2 in buildainfile, maps directly to unk0 in disk struct
+ int unk1; // maps directly to unk1 in disk struct
+ int unk2[MAX_HULLS]; // maps directly to unk2 in disk struct, despite being ints rather than shorts
+
+ // view server.dll+393672 for context and death wish
+ char unk3[MAX_HULLS]; // hell on earth, should map to unk3 on disk
+ char pad[3]; // aligns next bytes
+ float unk4[MAX_HULLS]; // i have no fucking clue, calculated using some kind of demon hell function float magic
+
+ CAI_NodeLink** links;
+ char unk5[16];
+ int linkcount;
+ int unk11; // bad name lmao
+ short unk6; // should match up to unk4 on disk
+ char unk7[16]; // padding until next bit
+ short unk8; // should match up to unk5 on disk
+ char unk9[8]; // padding until next bit
+ char unk10[8]; // should match up to unk6 on disk
+};
+
+// the way CAI_Nodes are represented in on-disk ain files
+#pragma pack(push, 1)
+struct CAI_NodeDisk
+{
+ float x;
+ float y;
+ float z;
+ float yaw;
+ float hulls[MAX_HULLS];
+
+ char unk0;
+ int unk1;
+ short unk2[MAX_HULLS];
+ char unk3[MAX_HULLS];
+ short unk4;
+ short unk5;
+ char unk6[8];
+}; // total size of 68 bytes
+
+struct UnkNodeStruct0
+{
+ int index;
+ char unk0;
+ char unk1; // maps to unk1 on disk
+ char pad0[2]; // padding to +8
+
+ float x;
+ float y;
+ float z;
+
+ char pad5[4];
+ int* unk2; // maps to unk5 on disk;
+ char pad1[16]; // pad to +48
+ int unkcount0; // maps to unkcount0 on disk
+
+ char pad2[4]; // pad to +56
+ int* unk3;
+ char pad3[16]; // pad to +80
+ int unkcount1;
+
+ char pad4[132];
+ char unk5;
+};
+
+int* pUnkStruct0Count;
+UnkNodeStruct0*** pppUnkNodeStruct0s;
+
+struct UnkLinkStruct1
+{
+ short unk0;
+ short unk1;
+ int unk2;
+ char unk3;
+ char unk4;
+ char unk5;
+};
+
+int* pUnkLinkStruct1Count;
+UnkLinkStruct1*** pppUnkStruct1s;
+
+struct CAI_ScriptNode
+{
+ float x;
+ float y;
+ float z;
+ uint64_t scriptdata;
+};
+
+struct CAI_Network
+{
+ // +0
+ char unk0[8];
+ // +8
+ int linkcount; // this is uninitialised and never set on ain build, fun!
+ // +12
+ char unk1[124];
+ // +136
+ int zonecount;
+ // +140
+ char unk2[16];
+ // +156
+ int unk5; // unk8 on disk
+ // +160
+ char unk6[4];
+ // +164
+ int hintcount;
+ // +168
+ short hints[2000]; // these probably aren't actually hints, but there's 1 of them per hint so idk
+ // +4168
+ int scriptnodecount;
+ // +4172
+ CAI_ScriptNode scriptnodes[4000];
+ // +84172
+ int nodecount;
+ // +84176
+ CAI_Node** nodes;
+};
+
+char** pUnkServerMapversionGlobal;
+
+ConVar* Cvar_ns_ai_dumpAINfileFromLoad;
+
+void DumpAINInfo(CAI_Network* aiNetwork)
+{
+ fs::path writePath("r2/maps/graphs");
+ writePath /= R2::g_pHostState->m_levelName;
+ writePath += ".ain";
+
+ // dump from memory
+ spdlog::info("writing ain file {}", writePath.string());
+ spdlog::info("");
+ spdlog::info("");
+ spdlog::info("");
+ spdlog::info("");
+ spdlog::info("");
+
+ std::ofstream writeStream(writePath, std::ofstream::binary);
+ spdlog::info("writing ainet version: {}", AINET_VERSION_NUMBER);
+ writeStream.write((char*)&AINET_VERSION_NUMBER, sizeof(int));
+
+ // could probably be cleaner but whatever
+ int mapVersion = *(int*)(*pUnkServerMapversionGlobal + 104);
+ spdlog::info("writing map version: {}", mapVersion); // temp
+ writeStream.write((char*)&mapVersion, sizeof(int));
+ spdlog::info("writing placeholder crc: {}", PLACEHOLDER_CRC);
+ writeStream.write((char*)&PLACEHOLDER_CRC, sizeof(int));
+
+ int calculatedLinkcount = 0;
+
+ // path nodes
+ spdlog::info("writing nodecount: {}", aiNetwork->nodecount);
+ writeStream.write((char*)&aiNetwork->nodecount, sizeof(int));
+
+ for (int i = 0; i < aiNetwork->nodecount; i++)
+ {
+ // construct on-disk node struct
+ CAI_NodeDisk diskNode;
+ diskNode.x = aiNetwork->nodes[i]->x;
+ diskNode.y = aiNetwork->nodes[i]->y;
+ diskNode.z = aiNetwork->nodes[i]->z;
+ diskNode.yaw = aiNetwork->nodes[i]->yaw;
+ memcpy(diskNode.hulls, aiNetwork->nodes[i]->hulls, sizeof(diskNode.hulls));
+ diskNode.unk0 = (char)aiNetwork->nodes[i]->unk0;
+ diskNode.unk1 = aiNetwork->nodes[i]->unk1;
+
+ for (int j = 0; j < MAX_HULLS; j++)
+ {
+ diskNode.unk2[j] = (short)aiNetwork->nodes[i]->unk2[j];
+ spdlog::info((short)aiNetwork->nodes[i]->unk2[j]);
+ }
+
+ memcpy(diskNode.unk3, aiNetwork->nodes[i]->unk3, sizeof(diskNode.unk3));
+ diskNode.unk4 = aiNetwork->nodes[i]->unk6;
+ diskNode.unk5 =
+ -1; // aiNetwork->nodes[i]->unk8; // this field is wrong, however, it's always -1 in vanilla navmeshes anyway, so no biggie
+ memcpy(diskNode.unk6, aiNetwork->nodes[i]->unk10, sizeof(diskNode.unk6));
+
+ spdlog::info("writing node {} from {} to {:x}", aiNetwork->nodes[i]->index, (void*)aiNetwork->nodes[i], writeStream.tellp());
+ writeStream.write((char*)&diskNode, sizeof(CAI_NodeDisk));
+
+ calculatedLinkcount += aiNetwork->nodes[i]->linkcount;
+ }
+
+ // links
+ spdlog::info("linkcount: {}", aiNetwork->linkcount);
+ spdlog::info("calculated total linkcount: {}", calculatedLinkcount);
+
+ calculatedLinkcount /= 2;
+ if (Cvar_ns_ai_dumpAINfileFromLoad->GetBool())
+ {
+ if (aiNetwork->linkcount == calculatedLinkcount)
+ spdlog::info("caculated linkcount is normal!");
+ else
+ spdlog::warn("calculated linkcount has weird value! this is expected on build!");
+ }
+
+ spdlog::info("writing linkcount: {}", calculatedLinkcount);
+ writeStream.write((char*)&calculatedLinkcount, sizeof(int));
+
+ for (int i = 0; i < aiNetwork->nodecount; i++)
+ {
+ for (int j = 0; j < aiNetwork->nodes[i]->linkcount; j++)
+ {
+ // skip links that don't originate from current node
+ if (aiNetwork->nodes[i]->links[j]->srcId != aiNetwork->nodes[i]->index)
+ continue;
+
+ CAI_NodeLinkDisk diskLink;
+ diskLink.srcId = aiNetwork->nodes[i]->links[j]->srcId;
+ diskLink.destId = aiNetwork->nodes[i]->links[j]->destId;
+ diskLink.unk0 = aiNetwork->nodes[i]->links[j]->unk1;
+ memcpy(diskLink.hulls, aiNetwork->nodes[i]->links[j]->hulls, sizeof(diskLink.hulls));
+
+ spdlog::info("writing link {} => {} to {:x}", diskLink.srcId, diskLink.destId, writeStream.tellp());
+ writeStream.write((char*)&diskLink, sizeof(CAI_NodeLinkDisk));
+ }
+ }
+
+ // don't know what this is, it's likely a block from tf1 that got deprecated? should just be 1 int per node
+ spdlog::info("writing {:x} bytes for unknown block at {:x}", aiNetwork->nodecount * sizeof(uint32_t), writeStream.tellp());
+ uint32_t* unkNodeBlock = new uint32_t[aiNetwork->nodecount];
+ memset(unkNodeBlock, 0, aiNetwork->nodecount * sizeof(uint32_t));
+ writeStream.write((char*)unkNodeBlock, aiNetwork->nodecount * sizeof(uint32_t));
+ delete[] unkNodeBlock;
+
+ // TODO: this is traverse nodes i think? these aren't used in tf2 ains so we can get away with just writing count=0 and skipping
+ // but ideally should actually dump these
+ spdlog::info("writing {} traversal nodes at {:x}...", 0, writeStream.tellp());
+ short traverseNodeCount = 0;
+ writeStream.write((char*)&traverseNodeCount, sizeof(short));
+ // only write count since count=0 means we don't have to actually do anything here
+
+ // TODO: ideally these should be actually dumped, but they're always 0 in tf2 from what i can tell
+ spdlog::info("writing {} bytes for unknown hull block at {:x}", MAX_HULLS * 8, writeStream.tellp());
+ char* unkHullBlock = new char[MAX_HULLS * 8];
+ memset(unkHullBlock, 0, MAX_HULLS * 8);
+ writeStream.write(unkHullBlock, MAX_HULLS * 8);
+ delete[] unkHullBlock;
+
+ // unknown struct that's seemingly node-related
+ spdlog::info("writing {} unknown node structs at {:x}", *pUnkStruct0Count, writeStream.tellp());
+ writeStream.write((char*)pUnkStruct0Count, sizeof(*pUnkStruct0Count));
+ for (int i = 0; i < *pUnkStruct0Count; i++)
+ {
+ spdlog::info("writing unknown node struct {} at {:x}", i, writeStream.tellp());
+ UnkNodeStruct0* nodeStruct = (*pppUnkNodeStruct0s)[i];
+
+ writeStream.write((char*)&nodeStruct->index, sizeof(nodeStruct->index));
+ writeStream.write((char*)&nodeStruct->unk1, sizeof(nodeStruct->unk1));
+
+ writeStream.write((char*)&nodeStruct->x, sizeof(nodeStruct->x));
+ writeStream.write((char*)&nodeStruct->y, sizeof(nodeStruct->y));
+ writeStream.write((char*)&nodeStruct->z, sizeof(nodeStruct->z));
+
+ writeStream.write((char*)&nodeStruct->unkcount0, sizeof(nodeStruct->unkcount0));
+ for (int j = 0; j < nodeStruct->unkcount0; j++)
+ {
+ short unk2Short = (short)nodeStruct->unk2[j];
+ writeStream.write((char*)&unk2Short, sizeof(unk2Short));
+ }
+
+ writeStream.write((char*)&nodeStruct->unkcount1, sizeof(nodeStruct->unkcount1));
+ for (int j = 0; j < nodeStruct->unkcount1; j++)
+ {
+ short unk3Short = (short)nodeStruct->unk3[j];
+ writeStream.write((char*)&unk3Short, sizeof(unk3Short));
+ }
+
+ writeStream.write((char*)&nodeStruct->unk5, sizeof(nodeStruct->unk5));
+ }
+
+ // unknown struct that's seemingly link-related
+ spdlog::info("writing {} unknown link structs at {:x}", *pUnkLinkStruct1Count, writeStream.tellp());
+ writeStream.write((char*)pUnkLinkStruct1Count, sizeof(*pUnkLinkStruct1Count));
+ for (int i = 0; i < *pUnkLinkStruct1Count; i++)
+ {
+ // disk and memory structs are literally identical here so just directly write
+ spdlog::info("writing unknown link struct {} at {:x}", i, writeStream.tellp());
+ writeStream.write((char*)(*pppUnkStruct1s)[i], sizeof(*(*pppUnkStruct1s)[i]));
+ }
+
+ // some weird int idk what this is used for
+ writeStream.write((char*)&aiNetwork->unk5, sizeof(aiNetwork->unk5));
+
+ // tf2-exclusive stuff past this point, i.e. ain v57 only
+ spdlog::info("writing {} script nodes at {:x}", aiNetwork->scriptnodecount, writeStream.tellp());
+ writeStream.write((char*)&aiNetwork->scriptnodecount, sizeof(aiNetwork->scriptnodecount));
+ for (int i = 0; i < aiNetwork->scriptnodecount; i++)
+ {
+ // disk and memory structs are literally identical here so just directly write
+ spdlog::info("writing script node {} at {:x}", i, writeStream.tellp());
+ writeStream.write((char*)&aiNetwork->scriptnodes[i], sizeof(aiNetwork->scriptnodes[i]));
+ }
+
+ spdlog::info("writing {} hints at {:x}", aiNetwork->hintcount, writeStream.tellp());
+ writeStream.write((char*)&aiNetwork->hintcount, sizeof(aiNetwork->hintcount));
+ for (int i = 0; i < aiNetwork->hintcount; i++)
+ {
+ spdlog::info("writing hint data {} at {:x}", i, writeStream.tellp());
+ writeStream.write((char*)&aiNetwork->hints[i], sizeof(aiNetwork->hints[i]));
+ }
+
+ writeStream.close();
+}
+
+AUTOHOOK(CAI_NetworkBuilder__Build, server.dll + 0x385E20,
+void,, (void* builder, CAI_Network* aiNetwork, void* unknown),
+{
+ CAI_NetworkBuilder__Build(builder, aiNetwork, unknown);
+
+ DumpAINInfo(aiNetwork);
+})
+
+AUTOHOOK(LoadAINFile, server.dll + 0x3933A0,
+void,, (void* aimanager, void* buf, const char* filename),
+{
+ LoadAINFile(aimanager, buf, filename);
+
+ if (Cvar_ns_ai_dumpAINfileFromLoad->GetBool())
+ {
+ spdlog::info("running DumpAINInfo for loaded file {}", filename);
+ DumpAINInfo(*(CAI_Network**)((char*)aimanager + 2536));
+ }
+})
+
+ON_DLL_LOAD("server.dll", BuildAINFile, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ Cvar_ns_ai_dumpAINfileFromLoad = new ConVar(
+ "ns_ai_dumpAINfileFromLoad", "0", FCVAR_NONE, "For debugging: whether we should dump ain data for ains loaded from disk");
+
+ pUnkStruct0Count = (int*)((char*)baseAddress + 0x1063BF8);
+ pppUnkNodeStruct0s = (UnkNodeStruct0***)((char*)baseAddress + 0x1063BE0);
+ pUnkLinkStruct1Count = (int*)((char*)baseAddress + 0x1063AA8);
+ pppUnkStruct1s = (UnkLinkStruct1***)((char*)baseAddress + 0x1063A90);
+ pUnkServerMapversionGlobal = (char**)((char*)baseAddress + 0xBFBE08);
+});
\ No newline at end of file
diff --git a/NorthstarDLL/chatcommand.cpp b/NorthstarDLL/chatcommand.cpp
new file mode 100644
index 00000000..86060a91
--- /dev/null
+++ b/NorthstarDLL/chatcommand.cpp
@@ -0,0 +1,37 @@
+#include "pch.h"
+#include "convar.h"
+#include "concommand.h"
+#include "localchatwriter.h"
+
+// note: isIngameChat is an int64 because the whole register the arg is stored in needs to be 0'd out to work
+// if isIngameChat is false, we use network chat instead
+typedef void(__fastcall* ClientSayTextType)(void* a1, const char* message, __int64 isIngameChat, bool isTeamChat);
+ClientSayTextType ClientSayText;
+
+void ConCommand_say(const CCommand& args)
+{
+ if (args.ArgC() >= 2)
+ ClientSayText(nullptr, args.ArgS(), true, false);
+}
+
+void ConCommand_say_team(const CCommand& args)
+{
+ if (args.ArgC() >= 2)
+ ClientSayText(nullptr, args.ArgS(), true, true);
+}
+
+void ConCommand_log(const CCommand& args)
+{
+ if (args.ArgC() >= 2)
+ {
+ LocalChatWriter(LocalChatWriter::GameContext).WriteLine(args.ArgS());
+ }
+}
+
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientChatCommand, ConCommand, [](HMODULE baseAddress)
+{
+ ClientSayText = (ClientSayTextType)((char*)baseAddress + 0x54780);
+ RegisterConCommand("say", ConCommand_say, "Enters a message in public chat", FCVAR_CLIENTDLL);
+ RegisterConCommand("say_team", ConCommand_say_team, "Enters a message in team chat", FCVAR_CLIENTDLL);
+ RegisterConCommand("log", ConCommand_log, "Log a message to the local chat window", FCVAR_CLIENTDLL);
+})
diff --git a/NorthstarDLL/clientauthhooks.cpp b/NorthstarDLL/clientauthhooks.cpp
new file mode 100644
index 00000000..7463028b
--- /dev/null
+++ b/NorthstarDLL/clientauthhooks.cpp
@@ -0,0 +1,44 @@
+#include "pch.h"
+#include "masterserver.h"
+#include "convar.h"
+#include "r2client.h"
+
+AUTOHOOK_INIT()
+
+ConVar* Cvar_ns_has_agreed_to_send_token;
+
+// mirrored in script
+const int NOT_DECIDED_TO_SEND_TOKEN = 0;
+const int AGREED_TO_SEND_TOKEN = 1;
+const int DISAGREED_TO_SEND_TOKEN = 2;
+
+AUTOHOOK(AuthWithStryder, engine.dll + 0x1843A0,
+void,, (void* a1),
+{
+ // game will call this forever, until it gets a valid auth key
+ // so, we need to manually invalidate our key until we're authed with northstar, then we'll allow game to auth with stryder
+ if (!g_MasterServerManager->m_bOriginAuthWithMasterServerDone && Cvar_ns_has_agreed_to_send_token->GetInt() != DISAGREED_TO_SEND_TOKEN)
+ {
+ // if player has agreed to send token and we aren't already authing, try to auth
+ if (Cvar_ns_has_agreed_to_send_token->GetInt() == AGREED_TO_SEND_TOKEN &&
+ !g_MasterServerManager->m_bOriginAuthWithMasterServerInProgress)
+ g_MasterServerManager->AuthenticateOriginWithMasterServer(R2::g_pLocalPlayerUserID, R2::g_pLocalPlayerOriginToken);
+
+ // invalidate key so auth will fail
+ *R2::g_pLocalPlayerOriginToken = 0;
+ }
+
+ AuthWithStryder(a1);
+})
+
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", ClientAuthHooks, ConVar, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ // this cvar will save to cfg once initially agreed with
+ Cvar_ns_has_agreed_to_send_token = new ConVar(
+ "ns_has_agreed_to_send_token",
+ "0",
+ FCVAR_ARCHIVE_PLAYERPROFILE,
+ "whether the user has agreed to send their origin token to the northstar masterserver");
+})
\ No newline at end of file
diff --git a/NorthstarDLL/clientchathooks.cpp b/NorthstarDLL/clientchathooks.cpp
new file mode 100644
index 00000000..f778c6ee
--- /dev/null
+++ b/NorthstarDLL/clientchathooks.cpp
@@ -0,0 +1,87 @@
+#include "pch.h"
+#include "squirrel.h"
+#include "serverchathooks.h"
+#include "localchatwriter.h"
+
+#include
+
+AUTOHOOK_INIT()
+
+AUTOHOOK(CHudChat__AddGameLine, client.dll + 0x22E580,
+void,, (void* self, const char* message, int inboxId, bool isTeam, bool isDead),
+{
+ // This hook is called for each HUD, but we only want our logic to run once.
+ if (self != *CHudChat::allHuds)
+ {
+ return;
+ }
+
+ if (g_pClientSquirrel->setupfunc("CHudChat_ProcessMessageStartThread") != SQRESULT_ERROR)
+ {
+ int senderId = inboxId & CUSTOM_MESSAGE_INDEX_MASK;
+ bool isAnonymous = senderId == 0;
+ bool isCustom = isAnonymous || (inboxId & CUSTOM_MESSAGE_INDEX_BIT);
+
+ // Type is set to 0 for non-custom messages, custom messages have a type encoded as the first byte
+ int type = 0;
+ const char* payload = message;
+ if (isCustom)
+ {
+ type = message[0];
+ payload = message + 1;
+ }
+
+ g_pClientSquirrel->pushinteger(g_pClientSquirrel->sqvm2, (int) senderId - 1);
+ g_pClientSquirrel->pushstring(g_pClientSquirrel->sqvm2, payload);
+ g_pClientSquirrel->pushbool(g_pClientSquirrel->sqvm2, isTeam);
+ g_pClientSquirrel->pushbool(g_pClientSquirrel->sqvm2, isDead);
+ g_pClientSquirrel->pushinteger(g_pClientSquirrel->sqvm2, type);
+ g_pClientSquirrel->call(g_pClientSquirrel->sqvm2, 5);
+ }
+ else
+ {
+ for (CHudChat* hud = *CHudChat::allHuds; hud != NULL; hud = hud->next)
+ {
+ CHudChat__AddGameLine(hud, message, inboxId, isTeam, isDead);
+ }
+ }
+})
+
+// void NSChatWrite( int context, string str )
+static SQRESULT SQ_ChatWrite(void* sqvm)
+{
+ int context = g_pClientSquirrel->getinteger(g_pClientSquirrel->sqvm2, 1);
+ const char* str = g_pClientSquirrel->getstring(g_pClientSquirrel->sqvm2, 2);
+
+ LocalChatWriter((LocalChatWriter::Context)context).Write(str);
+ return SQRESULT_NOTNULL;
+}
+
+// void NSChatWriteRaw( int context, string str )
+static SQRESULT SQ_ChatWriteRaw(void* sqvm)
+{
+ int context = g_pClientSquirrel->getinteger(g_pClientSquirrel->sqvm2, 1);
+ const char* str = g_pClientSquirrel->getstring(g_pClientSquirrel->sqvm2, 2);
+
+ LocalChatWriter((LocalChatWriter::Context)context).InsertText(str);
+ return SQRESULT_NOTNULL;
+}
+
+// void NSChatWriteLine( int context, string str )
+static SQRESULT SQ_ChatWriteLine(void* sqvm)
+{
+ int context = g_pClientSquirrel->getinteger(g_pClientSquirrel->sqvm2, 1);
+ const char* str = g_pClientSquirrel->getstring(g_pClientSquirrel->sqvm2, 2);
+
+ LocalChatWriter((LocalChatWriter::Context)context).WriteLine(str);
+ return SQRESULT_NOTNULL;
+}
+
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientChatHooks, ClientSquirrel, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ g_pClientSquirrel->AddFuncRegistration("void", "NSChatWrite", "int context, string text", "", SQ_ChatWrite);
+ g_pClientSquirrel->AddFuncRegistration("void", "NSChatWriteRaw", "int context, string text", "", SQ_ChatWriteRaw);
+ g_pClientSquirrel->AddFuncRegistration("void", "NSChatWriteLine", "int context, string text", "", SQ_ChatWriteLine);
+})
diff --git a/NorthstarDLL/clientruihooks.cpp b/NorthstarDLL/clientruihooks.cpp
new file mode 100644
index 00000000..5fb0b348
--- /dev/null
+++ b/NorthstarDLL/clientruihooks.cpp
@@ -0,0 +1,22 @@
+#include "pch.h"
+#include "convar.h"
+
+AUTOHOOK_INIT()
+
+ConVar* Cvar_rui_drawEnable;
+
+AUTOHOOK(DrawRUIFunc, engine.dll + 0xFC500,
+bool,, (void* a1, float* a2),
+{
+ if (!Cvar_rui_drawEnable->GetBool())
+ return 0;
+
+ return DrawRUIFunc(a1, a2);
+})
+
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", RUI, ConVar, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ Cvar_rui_drawEnable = new ConVar("rui_drawEnable", "1", FCVAR_CLIENTDLL, "Controls whether RUI should be drawn");
+})
\ No newline at end of file
diff --git a/NorthstarDLL/clientvideooverrides.cpp b/NorthstarDLL/clientvideooverrides.cpp
new file mode 100644
index 00000000..0bc6bb06
--- /dev/null
+++ b/NorthstarDLL/clientvideooverrides.cpp
@@ -0,0 +1,36 @@
+#include "pch.h"
+#include "modmanager.h"
+
+AUTOHOOK_INIT()
+
+AUTOHOOK_PROCADDRESS(BinkOpen, bink2w64.dll, BinkOpen,
+void*,, (const char* path, uint32_t flags),
+{
+ std::string filename(fs::path(path).filename().string());
+ spdlog::info("BinkOpen {}", filename);
+
+ // figure out which mod is handling the bink
+ Mod* fileOwner = nullptr;
+ for (Mod& mod : g_pModManager->m_loadedMods)
+ {
+ if (!mod.Enabled)
+ continue;
+
+ if (std::find(mod.BinkVideos.begin(), mod.BinkVideos.end(), filename) != mod.BinkVideos.end())
+ fileOwner = &mod;
+ }
+
+ if (fileOwner)
+ {
+ // create new path
+ fs::path binkPath(fileOwner->ModDirectory / "media" / filename);
+ return BinkOpen(binkPath.string().c_str(), flags);
+ }
+ else
+ return BinkOpen(path, flags);
+})
+
+ON_DLL_LOAD_CLIENT("client.dll", BinkVideo, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+})
\ No newline at end of file
diff --git a/NorthstarDLL/color.h b/NorthstarDLL/color.h
new file mode 100644
index 00000000..e2c1ebba
--- /dev/null
+++ b/NorthstarDLL/color.h
@@ -0,0 +1,135 @@
+#pragma once
+
+struct color24
+{
+ uint8_t r, g, b;
+};
+
+typedef struct color32_s
+{
+ bool operator!=(const struct color32_s& other) const
+ {
+ return r != other.r || g != other.g || b != other.b || a != other.a;
+ }
+ inline unsigned* asInt(void)
+ {
+ return reinterpret_cast(this);
+ }
+ inline const unsigned* asInt(void) const
+ {
+ return reinterpret_cast(this);
+ }
+ inline void Copy(const color32_s& rhs)
+ {
+ *asInt() = *rhs.asInt();
+ }
+
+ uint8_t r, g, b, a;
+} color32;
+
+//-----------------------------------------------------------------------------
+// Purpose: Basic handler for an rgb set of colors
+// This class is fully inline
+//-----------------------------------------------------------------------------
+class Color
+{
+ public:
+ Color(int r, int g, int b, int a)
+ {
+ _color[0] = (unsigned char)r;
+ _color[1] = (unsigned char)g;
+ _color[2] = (unsigned char)b;
+ _color[3] = (unsigned char)a;
+ }
+ void SetColor(int _r, int _g, int _b, int _a = 0)
+ {
+ _color[0] = (unsigned char)_r;
+ _color[1] = (unsigned char)_g;
+ _color[2] = (unsigned char)_b;
+ _color[3] = (unsigned char)_a;
+ }
+ void GetColor(int& _r, int& _g, int& _b, int& _a) const
+ {
+ _r = _color[0];
+ _g = _color[1];
+ _b = _color[2];
+ _a = _color[3];
+ }
+ int GetValue(int index) const
+ {
+ return _color[index];
+ }
+ void SetRawColor(int color32)
+ {
+ *((int*)this) = color32;
+ }
+ int GetRawColor(void) const
+ {
+ return *((int*)this);
+ }
+
+ inline int r() const
+ {
+ return _color[0];
+ }
+ inline int g() const
+ {
+ return _color[1];
+ }
+ inline int b() const
+ {
+ return _color[2];
+ }
+ inline int a() const
+ {
+ return _color[3];
+ }
+
+ unsigned char& operator[](int index)
+ {
+ return _color[index];
+ }
+
+ const unsigned char& operator[](int index) const
+ {
+ return _color[index];
+ }
+
+ bool operator==(const Color& rhs) const
+ {
+ return (*((int*)this) == *((int*)&rhs));
+ }
+
+ bool operator!=(const Color& rhs) const
+ {
+ return !(operator==(rhs));
+ }
+
+ Color& operator=(const Color& rhs)
+ {
+ SetRawColor(rhs.GetRawColor());
+ return *this;
+ }
+
+ Color& operator=(const color32& rhs)
+ {
+ _color[0] = rhs.r;
+ _color[1] = rhs.g;
+ _color[2] = rhs.b;
+ _color[3] = rhs.a;
+ return *this;
+ }
+
+ color32 ToColor32(void) const
+ {
+ color32 newColor {};
+ newColor.r = _color[0];
+ newColor.g = _color[1];
+ newColor.b = _color[2];
+ newColor.a = _color[3];
+ return newColor;
+ }
+
+ private:
+ unsigned char _color[4];
+};
diff --git a/NorthstarDLL/concommand.cpp b/NorthstarDLL/concommand.cpp
new file mode 100644
index 00000000..fddad088
--- /dev/null
+++ b/NorthstarDLL/concommand.cpp
@@ -0,0 +1,151 @@
+#include "pch.h"
+#include "concommand.h"
+#include "misccommands.h"
+
+#include
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns true if this is a command
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConCommand::IsCommand(void) const
+{
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns true if this is a command
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConCommandBase::IsCommand(void) const
+{
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Has this cvar been registered
+// Output : Returns true on success, false on failure.
+//-----------------------------------------------------------------------------
+bool ConCommandBase::IsRegistered(void) const
+{
+ return m_bRegistered;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Test each ConCommand query before execution.
+// Input : *pCommandBase - nFlags
+// Output : False if execution is permitted, true if not.
+//-----------------------------------------------------------------------------
+bool ConCommandBase::IsFlagSet(int nFlags) const
+{
+ return m_nFlags & nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Checks if ConCommand has requested flags.
+// Input : nFlags -
+// Output : True if ConCommand has nFlags.
+//-----------------------------------------------------------------------------
+bool ConCommandBase::HasFlags(int nFlags)
+{
+ return m_nFlags & nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Add's flags to ConCommand.
+// Input : nFlags -
+//-----------------------------------------------------------------------------
+void ConCommandBase::AddFlags(int nFlags)
+{
+ m_nFlags |= nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Removes flags from ConCommand.
+// Input : nFlags -
+//-----------------------------------------------------------------------------
+void ConCommandBase::RemoveFlags(int nFlags)
+{
+ m_nFlags &= ~nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns current flags.
+// Output : int
+//-----------------------------------------------------------------------------
+int ConCommandBase::GetFlags(void) const
+{
+ return m_nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Output : const ConCommandBase
+//-----------------------------------------------------------------------------
+ConCommandBase* ConCommandBase::GetNext(void) const
+{
+ return m_pNext;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns the ConCommandBase help text.
+// Output : const char*
+//-----------------------------------------------------------------------------
+const char* ConCommandBase::GetHelpText(void) const
+{
+ return m_pszHelpString;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Copies string using local new/delete operators
+// Input : *szFrom -
+// Output : char
+//-----------------------------------------------------------------------------
+char* ConCommandBase::CopyString(const char* szFrom) const
+{
+ size_t nLen;
+ char* szTo;
+
+ nLen = strlen(szFrom);
+ if (nLen <= 0)
+ {
+ szTo = new char[1];
+ szTo[0] = 0;
+ }
+ else
+ {
+ szTo = new char[nLen + 1];
+ memmove(szTo, szFrom, nLen + 1);
+ }
+ return szTo;
+}
+
+typedef void (*ConCommandConstructorType)(
+ ConCommand* newCommand, const char* name, FnCommandCallback_t callback, const char* helpString, int flags, void* parent);
+ConCommandConstructorType ConCommandConstructor;
+
+void RegisterConCommand(const char* name, FnCommandCallback_t callback, const char* helpString, int flags)
+{
+ spdlog::info("Registering ConCommand {}", name);
+
+ // no need to free this ever really, it should exist as long as game does
+ ConCommand* newCommand = new ConCommand;
+ ConCommandConstructor(newCommand, name, callback, helpString, flags, nullptr);
+}
+
+void RegisterConCommand(
+ const char* name, FnCommandCallback_t callback, const char* helpString, int flags, FnCommandCompletionCallback completionCallback)
+{
+ spdlog::info("Registering ConCommand {}", name);
+
+ // no need to free this ever really, it should exist as long as game does
+ ConCommand* newCommand = new ConCommand;
+ ConCommandConstructor(newCommand, name, callback, helpString, flags, nullptr);
+ newCommand->m_pCompletionCallback = completionCallback;
+}
+
+ON_DLL_LOAD("engine.dll", ConCommand, [](HMODULE baseAddress)
+{
+ ConCommandConstructor = (ConCommandConstructorType)((char*)baseAddress + 0x415F60);
+ AddMiscConCommands();
+})
\ No newline at end of file
diff --git a/NorthstarDLL/concommand.h b/NorthstarDLL/concommand.h
new file mode 100644
index 00000000..a02604f2
--- /dev/null
+++ b/NorthstarDLL/concommand.h
@@ -0,0 +1,139 @@
+#pragma once
+
+// From Source SDK
+class ConCommandBase;
+class IConCommandBaseAccessor
+{
+ public:
+ // Flags is a combination of FCVAR flags in cvar.h.
+ // hOut is filled in with a handle to the variable.
+ virtual bool RegisterConCommandBase(ConCommandBase* pVar) = 0;
+};
+
+class CCommand
+{
+ public:
+ CCommand() = delete;
+
+ int64_t ArgC() const;
+ const char** ArgV() const;
+ const char* ArgS() const; // All args that occur after the 0th arg, in string form
+ const char* GetCommandString() const; // The entire command in string form, including the 0th arg
+ const char* operator[](int nIndex) const; // Gets at arguments
+ const char* Arg(int nIndex) const; // Gets at arguments
+
+ static int MaxCommandLength();
+
+ private:
+ enum
+ {
+ COMMAND_MAX_ARGC = 64,
+ COMMAND_MAX_LENGTH = 512,
+ };
+
+ int64_t m_nArgc;
+ int64_t m_nArgv0Size;
+ char m_pArgSBuffer[COMMAND_MAX_LENGTH];
+ char m_pArgvBuffer[COMMAND_MAX_LENGTH];
+ const char* m_ppArgv[COMMAND_MAX_ARGC];
+};
+
+inline int CCommand::MaxCommandLength()
+{
+ return COMMAND_MAX_LENGTH - 1;
+}
+inline int64_t CCommand::ArgC() const
+{
+ return m_nArgc;
+}
+inline const char** CCommand::ArgV() const
+{
+ return m_nArgc ? (const char**)m_ppArgv : NULL;
+}
+inline const char* CCommand::ArgS() const
+{
+ return m_nArgv0Size ? &m_pArgSBuffer[m_nArgv0Size] : "";
+}
+inline const char* CCommand::GetCommandString() const
+{
+ return m_nArgc ? m_pArgSBuffer : "";
+}
+inline const char* CCommand::Arg(int nIndex) const
+{
+ // FIXME: Many command handlers appear to not be particularly careful
+ // about checking for valid argc range. For now, we're going to
+ // do the extra check and return an empty string if it's out of range
+ if (nIndex < 0 || nIndex >= m_nArgc)
+ return "";
+ return m_ppArgv[nIndex];
+}
+inline const char* CCommand::operator[](int nIndex) const
+{
+ return Arg(nIndex);
+}
+
+//-----------------------------------------------------------------------------
+// Called when a ConCommand needs to execute
+//-----------------------------------------------------------------------------
+typedef void (*FnCommandCallback_t)(const CCommand& command);
+
+#define COMMAND_COMPLETION_MAXITEMS 64
+#define COMMAND_COMPLETION_ITEM_LENGTH 128
+
+//-----------------------------------------------------------------------------
+// Returns 0 to COMMAND_COMPLETION_MAXITEMS worth of completion strings
+//-----------------------------------------------------------------------------
+typedef int (*__fastcall FnCommandCompletionCallback)(const char* partial, char commands[COMMAND_COMPLETION_MAXITEMS][COMMAND_COMPLETION_ITEM_LENGTH]);
+
+// From r5reloaded
+class ConCommandBase
+{
+ public:
+ bool HasFlags(int nFlags);
+ void AddFlags(int nFlags);
+ void RemoveFlags(int nFlags);
+
+ bool IsCommand(void) const;
+ bool IsRegistered(void) const;
+ bool IsFlagSet(int nFlags) const;
+ static bool IsFlagSet(ConCommandBase* pCommandBase, int nFlags); // For hooking to engine's implementation.
+
+ int GetFlags(void) const;
+ ConCommandBase* GetNext(void) const;
+ const char* GetHelpText(void) const;
+
+ char* CopyString(const char* szFrom) const;
+
+ void* m_pConCommandBaseVTable; // 0x0000
+ ConCommandBase* m_pNext; // 0x0008
+ bool m_bRegistered; // 0x0010
+ char pad_0011[7]; // 0x0011 <- 3 bytes padding + unk int32.
+ const char* m_pszName; // 0x0018
+ const char* m_pszHelpString; // 0x0020
+ int m_nFlags; // 0x0028
+ ConCommandBase* s_pConCommandBases; // 0x002C
+ IConCommandBaseAccessor* s_pAccessor; // 0x0034
+}; // Size: 0x0040
+
+// taken from ttf2sdk
+class ConCommand : public ConCommandBase
+{
+ friend class CCVar;
+
+ public:
+ ConCommand(void) {}; // !TODO: Rebuild engine constructor in SDK instead.
+ ConCommand(const char* szName, const char* szHelpString, int nFlags, void* pCallback, void* pCommandCompletionCallback);
+ void Init(void);
+ bool IsCommand(void) const;
+
+ FnCommandCallback_t m_pCommandCallback {}; // 0x0040 <- starts from 0x40 since we inherit ConCommandBase.
+ FnCommandCompletionCallback m_pCompletionCallback {}; // 0x0048 <- defaults to sub_180417410 ('xor eax, eax').
+ int m_nCallbackFlags {}; // 0x0050
+ char pad_0054[4]; // 0x0054
+ int unk0; // 0x0058
+ int unk1; // 0x005C
+}; // Size: 0x0060
+
+void RegisterConCommand(const char* name, void (*callback)(const CCommand&), const char* helpString, int flags);
+void RegisterConCommand(
+ const char* name, void (*callback)(const CCommand&), const char* helpString, int flags, FnCommandCompletionCallback completionCallback);
diff --git a/NorthstarDLL/configurables.cpp b/NorthstarDLL/configurables.cpp
new file mode 100644
index 00000000..389e6e0b
--- /dev/null
+++ b/NorthstarDLL/configurables.cpp
@@ -0,0 +1,38 @@
+#include
+#include "pch.h"
+#include "configurables.h"
+
+std::string GetNorthstarPrefix()
+{
+ return NORTHSTAR_FOLDER_PREFIX;
+}
+
+void parseConfigurables()
+{
+ char* clachar = strstr(GetCommandLineA(), "-profile=");
+ if (clachar)
+ {
+ std::string cla = std::string(clachar);
+ if (strncmp(cla.substr(9, 1).c_str(), "\"", 1))
+ {
+ int space = cla.find(" ");
+ std::string dirname = cla.substr(9, space - 9);
+ spdlog::info("Found profile in command line arguments: " + dirname);
+ NORTHSTAR_FOLDER_PREFIX = dirname;
+ }
+ else
+ {
+ std::string quote = "\"";
+ int quote1 = cla.find(quote);
+ int quote2 = (cla.substr(quote1 + 1)).find(quote);
+ std::string dirname = cla.substr(quote1 + 1, quote2);
+ spdlog::info("Found profile in command line arguments: " + dirname);
+ NORTHSTAR_FOLDER_PREFIX = dirname;
+ }
+ }
+ else
+ {
+ spdlog::info("Profile was not found in command line arguments. Using default: R2Northstar");
+ NORTHSTAR_FOLDER_PREFIX = "R2Northstar";
+ }
+}
diff --git a/NorthstarDLL/configurables.h b/NorthstarDLL/configurables.h
new file mode 100644
index 00000000..cc98e15e
--- /dev/null
+++ b/NorthstarDLL/configurables.h
@@ -0,0 +1,7 @@
+#pragma once
+#include
+
+static std::string NORTHSTAR_FOLDER_PREFIX;
+
+std::string GetNorthstarPrefix();
+void parseConfigurables();
diff --git a/NorthstarDLL/convar.cpp b/NorthstarDLL/convar.cpp
new file mode 100644
index 00000000..1b2e0679
--- /dev/null
+++ b/NorthstarDLL/convar.cpp
@@ -0,0 +1,497 @@
+#include "pch.h"
+#include "bits.h"
+#include "cvar.h"
+#include "convar.h"
+#include "sourceinterface.h"
+
+typedef void (*ConVarRegisterType)(
+ ConVar* pConVar,
+ const char* pszName,
+ const char* pszDefaultValue,
+ int nFlags,
+ const char* pszHelpString,
+ bool bMin,
+ float fMin,
+ bool bMax,
+ float fMax,
+ void* pCallback);
+ConVarRegisterType conVarRegister;
+
+typedef void (*ConVarMallocType)(void* pConVarMaloc, int a2, int a3);
+ConVarMallocType conVarMalloc;
+
+void* g_pConVar_Vtable = nullptr;
+void* g_pIConVar_Vtable = nullptr;
+
+//-----------------------------------------------------------------------------
+// Purpose: ConVar interface initialization
+//-----------------------------------------------------------------------------
+ON_DLL_LOAD("engine.dll", ConVar, [](HMODULE baseAddress)
+{
+ conVarMalloc = (ConVarMallocType)((char*)baseAddress + 0x415C20);
+ conVarRegister = (ConVarRegisterType)((char*)baseAddress + 0x417230);
+
+ g_pConVar_Vtable = (char*)baseAddress + 0x67FD28;
+ g_pIConVar_Vtable = (char*)baseAddress + 0x67FDC8;
+
+ R2::g_pCVarInterface = new SourceInterface("vstdlib.dll", "VEngineCvar007");
+ R2::g_pCVar = *R2::g_pCVarInterface;
+})
+
+//-----------------------------------------------------------------------------
+// Purpose: constructor
+//-----------------------------------------------------------------------------
+ConVar::ConVar(const char* pszName, const char* pszDefaultValue, int nFlags, const char* pszHelpString)
+{
+ spdlog::info("Registering Convar {}", pszName);
+
+ this->m_ConCommandBase.m_pConCommandBaseVTable = g_pConVar_Vtable;
+ this->m_ConCommandBase.s_pConCommandBases = (ConCommandBase*)g_pIConVar_Vtable;
+
+ conVarMalloc(&this->m_pMalloc, 0, 0); // Allocate new memory for ConVar.
+ conVarRegister(this, pszName, pszDefaultValue, nFlags, pszHelpString, 0, 0, 0, 0, 0);
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: constructor
+//-----------------------------------------------------------------------------
+ConVar::ConVar(
+ const char* pszName,
+ const char* pszDefaultValue,
+ int nFlags,
+ const char* pszHelpString,
+ bool bMin,
+ float fMin,
+ bool bMax,
+ float fMax,
+ FnChangeCallback_t pCallback)
+{
+ spdlog::info("Registering Convar {}", pszName);
+
+ this->m_ConCommandBase.m_pConCommandBaseVTable = g_pConVar_Vtable;
+ this->m_ConCommandBase.s_pConCommandBases = (ConCommandBase*)g_pIConVar_Vtable;
+
+ conVarMalloc(&this->m_pMalloc, 0, 0); // Allocate new memory for ConVar.
+ conVarRegister(this, pszName, pszDefaultValue, nFlags, pszHelpString, bMin, fMin, bMax, fMax, pCallback);
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: destructor
+//-----------------------------------------------------------------------------
+ConVar::~ConVar(void)
+{
+ if (m_Value.m_pszString)
+ delete[] m_Value.m_pszString;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns the base ConVar name.
+// Output : const char*
+//-----------------------------------------------------------------------------
+const char* ConVar::GetBaseName(void) const
+{
+ return m_ConCommandBase.m_pszName;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns the ConVar help text.
+// Output : const char*
+//-----------------------------------------------------------------------------
+const char* ConVar::GetHelpText(void) const
+{
+ return m_ConCommandBase.m_pszHelpString;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Add's flags to ConVar.
+// Input : nFlags -
+//-----------------------------------------------------------------------------
+void ConVar::AddFlags(int nFlags)
+{
+ m_ConCommandBase.m_nFlags |= nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Removes flags from ConVar.
+// Input : nFlags -
+//-----------------------------------------------------------------------------
+void ConVar::RemoveFlags(int nFlags)
+{
+ m_ConCommandBase.m_nFlags &= ~nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Return ConVar value as a boolean.
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConVar::GetBool(void) const
+{
+ return !!GetInt();
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Return ConVar value as a float.
+// Output : float
+//-----------------------------------------------------------------------------
+float ConVar::GetFloat(void) const
+{
+ return m_Value.m_fValue;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Return ConVar value as an integer.
+// Output : int
+//-----------------------------------------------------------------------------
+int ConVar::GetInt(void) const
+{
+ return m_Value.m_nValue;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Return ConVar value as a color.
+// Output : Color
+//-----------------------------------------------------------------------------
+Color ConVar::GetColor(void) const
+{
+ unsigned char* pColorElement = ((unsigned char*)&m_Value.m_nValue);
+ return Color(pColorElement[0], pColorElement[1], pColorElement[2], pColorElement[3]);
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Return ConVar value as a string.
+// Output : const char *
+//-----------------------------------------------------------------------------
+const char* ConVar::GetString(void) const
+{
+ if (m_ConCommandBase.m_nFlags & FCVAR_NEVER_AS_STRING)
+ {
+ return "FCVAR_NEVER_AS_STRING";
+ }
+
+ char const* str = m_Value.m_pszString;
+ return str ? str : "";
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : flMinVal -
+// Output : true if there is a min set.
+//-----------------------------------------------------------------------------
+bool ConVar::GetMin(float& flMinVal) const
+{
+ flMinVal = m_fMinVal;
+ return m_bHasMin;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : flMaxVal -
+// Output : true if there is a max set.
+//-----------------------------------------------------------------------------
+bool ConVar::GetMax(float& flMaxVal) const
+{
+ flMaxVal = m_fMaxVal;
+ return m_bHasMax;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: returns the min value.
+// Output : float
+//-----------------------------------------------------------------------------
+float ConVar::GetMinValue(void) const
+{
+ return m_fMinVal;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: returns the max value.
+// Output : float
+//-----------------------------------------------------------------------------
+float ConVar::GetMaxValue(void) const
+{
+ return m_fMaxVal;
+ ;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: checks if ConVar has min value.
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConVar::HasMin(void) const
+{
+ return m_bHasMin;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: checks if ConVar has max value.
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConVar::HasMax(void) const
+{
+ return m_bHasMax;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: sets the ConVar int value.
+// Input : nValue -
+//-----------------------------------------------------------------------------
+void ConVar::SetValue(int nValue)
+{
+ if (nValue == m_Value.m_nValue)
+ {
+ return;
+ }
+
+ float flValue = (float)nValue;
+
+ // Check bounds.
+ if (ClampValue(flValue))
+ {
+ nValue = (int)(flValue);
+ }
+
+ // Redetermine value.
+ float flOldValue = m_Value.m_fValue;
+ m_Value.m_fValue = flValue;
+ m_Value.m_nValue = nValue;
+
+ if (!(m_ConCommandBase.m_nFlags & FCVAR_NEVER_AS_STRING))
+ {
+ char szTempValue[32];
+ snprintf(szTempValue, sizeof(szTempValue), "%d", m_Value.m_nValue);
+ ChangeStringValue(szTempValue, flOldValue);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: sets the ConVar float value.
+// Input : flValue -
+//-----------------------------------------------------------------------------
+void ConVar::SetValue(float flValue)
+{
+ if (flValue == m_Value.m_fValue)
+ {
+ return;
+ }
+
+ // Check bounds.
+ ClampValue(flValue);
+
+ // Redetermine value.
+ float flOldValue = m_Value.m_fValue;
+ m_Value.m_fValue = flValue;
+ m_Value.m_nValue = (int)m_Value.m_fValue;
+
+ if (!(m_ConCommandBase.m_nFlags & FCVAR_NEVER_AS_STRING))
+ {
+ char szTempValue[32];
+ snprintf(szTempValue, sizeof(szTempValue), "%f", m_Value.m_fValue);
+ ChangeStringValue(szTempValue, flOldValue);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: sets the ConVar string value.
+// Input : *szValue -
+//-----------------------------------------------------------------------------
+void ConVar::SetValue(const char* pszValue)
+{
+ if (strcmp(this->m_Value.m_pszString, pszValue) == 0)
+ {
+ return;
+ }
+ this->m_Value.m_pszString = pszValue;
+
+ char szTempValue[32] {};
+ const char* pszNewValue {};
+
+ float flOldValue = m_Value.m_fValue;
+ pszNewValue = (char*)pszValue;
+ if (!pszNewValue)
+ {
+ pszNewValue = "";
+ }
+
+ if (!SetColorFromString(pszValue))
+ {
+ // Not a color, do the standard thing
+ float flNewValue = (float)atof(pszValue);
+ if (!IsFinite(flNewValue))
+ {
+ spdlog::warn("Warning: ConVar '{}' = '{}' is infinite, clamping value.\n", GetBaseName(), pszValue);
+ flNewValue = FLT_MAX;
+ }
+
+ if (ClampValue(flNewValue))
+ {
+ snprintf(szTempValue, sizeof(szTempValue), "%f", flNewValue);
+ pszNewValue = szTempValue;
+ }
+
+ // Redetermine value
+ m_Value.m_fValue = flNewValue;
+ m_Value.m_nValue = (int)(m_Value.m_fValue);
+ }
+
+ if (!(m_ConCommandBase.m_nFlags & FCVAR_NEVER_AS_STRING))
+ {
+ ChangeStringValue(pszNewValue, flOldValue);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: sets the ConVar color value.
+// Input : clValue -
+//-----------------------------------------------------------------------------
+void ConVar::SetValue(Color clValue)
+{
+ std::string svResult = "";
+
+ for (int i = 0; i < 4; i++)
+ {
+ if (!(clValue.GetValue(i) == 0 && svResult.size() == 0))
+ {
+ svResult += std::to_string(clValue.GetValue(i));
+ svResult.append(" ");
+ }
+ }
+
+ this->m_Value.m_pszString = svResult.c_str();
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: changes the ConVar string value.
+// Input : *pszTempVal - flOldValue
+//-----------------------------------------------------------------------------
+void ConVar::ChangeStringValue(const char* pszTempVal, float flOldValue)
+{
+ assert(!(m_ConCommandBase.m_nFlags & FCVAR_NEVER_AS_STRING));
+
+ char* pszOldValue = (char*)_malloca(m_Value.m_iStringLength);
+ if (pszOldValue != NULL)
+ {
+ memcpy(pszOldValue, m_Value.m_pszString, m_Value.m_iStringLength);
+ }
+
+ if (pszTempVal)
+ {
+ int len = strlen(pszTempVal) + 1;
+
+ if (len > m_Value.m_iStringLength)
+ {
+ if (m_Value.m_pszString)
+ {
+ // !TODO: Causes issues in tier0.dll, but doesn't in apex.
+ // Not a big issue since we are creating a new string below
+ // anyways to prevent buffer overflow if string is longer
+ // then the old string.
+ // delete[] m_Value.m_pszString;
+ }
+
+ m_Value.m_pszString = new char[len];
+ m_Value.m_iStringLength = len;
+ }
+
+ memcpy((char*)m_Value.m_pszString, pszTempVal, len);
+ }
+ else
+ {
+ m_Value.m_pszString = NULL;
+ }
+
+ pszOldValue = 0;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: sets the ConVar color value from string.
+// Input : *pszValue -
+//-----------------------------------------------------------------------------
+bool ConVar::SetColorFromString(const char* pszValue)
+{
+ bool bColor = false;
+
+ // Try pulling RGBA color values out of the string.
+ int nRGBA[4] {};
+ int nParamsRead = sscanf_s(pszValue, "%i %i %i %i", &(nRGBA[0]), &(nRGBA[1]), &(nRGBA[2]), &(nRGBA[3]));
+
+ if (nParamsRead >= 3)
+ {
+ // This is probably a color!
+ if (nParamsRead == 3)
+ {
+ // Assume they wanted full alpha.
+ nRGBA[3] = 255;
+ }
+
+ if (nRGBA[0] >= 0 && nRGBA[0] <= 255 && nRGBA[1] >= 0 && nRGBA[1] <= 255 && nRGBA[2] >= 0 && nRGBA[2] <= 255 && nRGBA[3] >= 0 &&
+ nRGBA[3] <= 255)
+ {
+ // printf("*** WOW! Found a color!! ***\n");
+
+ // This is definitely a color!
+ bColor = true;
+
+ // Stuff all the values into each byte of our int.
+ unsigned char* pColorElement = ((unsigned char*)&m_Value.m_nValue);
+ pColorElement[0] = nRGBA[0];
+ pColorElement[1] = nRGBA[1];
+ pColorElement[2] = nRGBA[2];
+ pColorElement[3] = nRGBA[3];
+
+ // Copy that value into our float.
+ m_Value.m_fValue = (float)(m_Value.m_nValue);
+ }
+ }
+
+ return bColor;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Checks if ConVar is registered.
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConVar::IsRegistered(void) const
+{
+ return m_ConCommandBase.m_bRegistered;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns true if this is a command
+// Output : bool
+//-----------------------------------------------------------------------------
+bool ConVar::IsCommand(void) const
+{
+ return false;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Test each ConVar query before setting the value.
+// Input : nFlags
+// Output : False if change is permitted, true if not.
+//-----------------------------------------------------------------------------
+bool ConVar::IsFlagSet(int nFlags) const
+{
+ return m_ConCommandBase.m_nFlags & nFlags;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Check whether to clamp and then perform clamp.
+// Input : flValue -
+// Output : Returns true if value changed.
+//-----------------------------------------------------------------------------
+bool ConVar::ClampValue(float& flValue)
+{
+ if (m_bHasMin && (flValue < m_fMinVal))
+ {
+ flValue = m_fMinVal;
+ return true;
+ }
+
+ if (m_bHasMax && (flValue > m_fMaxVal))
+ {
+ flValue = m_fMaxVal;
+ return true;
+ }
+
+ return false;
+}
diff --git a/NorthstarDLL/convar.h b/NorthstarDLL/convar.h
new file mode 100644
index 00000000..e7fb5397
--- /dev/null
+++ b/NorthstarDLL/convar.h
@@ -0,0 +1,193 @@
+#pragma once
+#include "sourceinterface.h"
+#include "color.h"
+#include "cvar.h"
+#include "concommand.h"
+
+// taken directly from iconvar.h
+
+// The default, no flags at all
+#define FCVAR_NONE 0
+
+// Command to ConVars and ConCommands
+// ConVar Systems
+#define FCVAR_UNREGISTERED (1 << 0) // If this is set, don't add to linked list, etc.
+#define FCVAR_DEVELOPMENTONLY (1 << 1) // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
+#define FCVAR_GAMEDLL (1 << 2) // defined by the game DLL
+#define FCVAR_CLIENTDLL (1 << 3) // defined by the client DLL
+#define FCVAR_HIDDEN (1 << 4) // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
+
+// ConVar only
+#define FCVAR_PROTECTED \
+ (1 << 5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as
+ // value.
+#define FCVAR_SPONLY (1 << 6) // This cvar cannot be changed by clients connected to a multiplayer server.
+#define FCVAR_ARCHIVE (1 << 7) // set to cause it to be saved to vars.rc
+#define FCVAR_NOTIFY (1 << 8) // notifies players when changed
+#define FCVAR_USERINFO (1 << 9) // changes the client's info string
+
+#define FCVAR_PRINTABLEONLY (1 << 10) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
+#define FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS \
+ (1 << 10) // When on concommands this allows remote clients to execute this cmd on the server.
+ // We are changing the default behavior of concommands to disallow execution by remote clients without
+ // this flag due to the number existing concommands that can lag or crash the server when clients abuse them.
+
+#define FCVAR_UNLOGGED (1 << 11) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
+#define FCVAR_NEVER_AS_STRING (1 << 12) // never try to print that cvar
+
+// It's a ConVar that's shared between the client and the server.
+// At signon, the values of all such ConVars are sent from the server to the client (skipped for local client, of course )
+// If a change is requested it must come from the console (i.e., no remote client changes)
+// If a value is changed while a server is active, it's replicated to all connected clients
+#define FCVAR_REPLICATED (1 << 13) // server setting enforced on clients, TODO rename to FCAR_SERVER at some time
+#define FCVAR_CHEAT (1 << 14) // Only useable in singleplayer / debug / multiplayer & sv_cheats
+#define FCVAR_SS (1 << 15) // causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
+#define FCVAR_DEMO (1 << 16) // record this cvar when starting a demo file
+#define FCVAR_DONTRECORD (1 << 17) // don't record these command in demofiles
+#define FCVAR_SS_ADDED (1 << 18) // This is one of the "added" FCVAR_SS variables for the splitscreen players
+#define FCVAR_RELEASE (1 << 19) // Cvars tagged with this are the only cvars avaliable to customers
+#define FCVAR_RELOAD_MATERIALS (1 << 20) // If this cvar changes, it forces a material reload
+#define FCVAR_RELOAD_TEXTURES (1 << 21) // If this cvar changes, if forces a texture reload
+
+#define FCVAR_NOT_CONNECTED (1 << 22) // cvar cannot be changed by a client that is connected to a server
+#define FCVAR_MATERIAL_SYSTEM_THREAD (1 << 23) // Indicates this cvar is read from the material system thread
+#define FCVAR_ARCHIVE_PLAYERPROFILE (1 << 24) // respawn-defined flag, same as FCVAR_ARCHIVE but writes to profile.cfg
+
+#define FCVAR_SERVER_CAN_EXECUTE \
+ (1 << 28) // the server is allowed to execute this command on clients via
+ // ClientCommand/NET_StringCmd/CBaseClientState::ProcessStringCmd.
+#define FCVAR_SERVER_CANNOT_QUERY \
+ (1 << 29) // If this is set, then the server is not allowed to query this cvar's value (via IServerPluginHelpers::StartQueryCvarValue).
+
+// !!!NOTE!!! : this is likely incorrect, there are multiple concommands that the vanilla game registers with this flag that 100% should not be remotely executable
+// i.e. multiple commands that only exist on client (screenshot, joystick_initialize)
+// we now use FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS in all places this flag was previously used
+#define FCVAR_CLIENTCMD_CAN_EXECUTE \
+ (1 << 30) // IVEngineClient::ClientCmd is allowed to execute this command.
+ // Note: IVEngineClient::ClientCmd_Unrestricted can run any client command.
+
+#define FCVAR_ACCESSIBLE_FROM_THREADS (1 << 25) // used as a debugging tool necessary to check material system thread convars
+
+// TODO: could be cool to repurpose these for northstar use somehow?
+// #define FCVAR_AVAILABLE (1<<26)
+// #define FCVAR_AVAILABLE (1<<27)
+// #define FCVAR_AVAILABLE (1<<31)
+
+// flag => string stuff
+const std::multimap g_PrintCommandFlags = {
+ {FCVAR_UNREGISTERED, "UNREGISTERED"},
+ {FCVAR_DEVELOPMENTONLY, "DEVELOPMENTONLY"},
+ {FCVAR_GAMEDLL, "GAMEDLL"},
+ {FCVAR_CLIENTDLL, "CLIENTDLL"},
+ {FCVAR_HIDDEN, "HIDDEN"},
+ {FCVAR_PROTECTED, "PROTECTED"},
+ {FCVAR_SPONLY, "SPONLY"},
+ {FCVAR_ARCHIVE, "ARCHIVE"},
+ {FCVAR_NOTIFY, "NOTIFY"},
+ {FCVAR_USERINFO, "USERINFO"},
+
+ // TODO: PRINTABLEONLY and GAMEDLL_FOR_REMOTE_CLIENTS are both 1<<10, one is for vars and one is for commands
+ // this fucking sucks i think
+ {FCVAR_PRINTABLEONLY, "PRINTABLEONLY"},
+ {FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS, "GAMEDLL_FOR_REMOTE_CLIENTS"},
+
+ {FCVAR_UNLOGGED, "UNLOGGED"},
+ {FCVAR_NEVER_AS_STRING, "NEVER_AS_STRING"},
+ {FCVAR_REPLICATED, "REPLICATED"},
+ {FCVAR_CHEAT, "CHEAT"},
+ {FCVAR_SS, "SS"},
+ {FCVAR_DEMO, "DEMO"},
+ {FCVAR_DONTRECORD, "DONTRECORD"},
+ {FCVAR_SS_ADDED, "SS_ADDED"},
+ {FCVAR_RELEASE, "RELEASE"},
+ {FCVAR_RELOAD_MATERIALS, "RELOAD_MATERIALS"},
+ {FCVAR_RELOAD_TEXTURES, "RELOAD_TEXTURES"},
+ {FCVAR_NOT_CONNECTED, "NOT_CONNECTED"},
+ {FCVAR_MATERIAL_SYSTEM_THREAD, "MATERIAL_SYSTEM_THREAD"},
+ {FCVAR_ARCHIVE_PLAYERPROFILE, "ARCHIVE_PLAYERPROFILE"},
+ {FCVAR_SERVER_CAN_EXECUTE, "SERVER_CAN_EXECUTE"},
+ {FCVAR_SERVER_CANNOT_QUERY, "SERVER_CANNOT_QUERY"},
+ {FCVAR_CLIENTCMD_CAN_EXECUTE, "UNKNOWN"},
+ {FCVAR_ACCESSIBLE_FROM_THREADS, "ACCESSIBLE_FROM_THREADS"}
+};
+
+//-----------------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------------
+class ConCommandBase;
+class ConCommand;
+class ConVar;
+
+typedef void (*FnChangeCallback_t)(ConVar* var, const char* pOldValue, float flOldValue);
+
+//-----------------------------------------------------------------------------
+// Purpose: A console variable
+//-----------------------------------------------------------------------------
+class ConVar
+{
+ public:
+ ConVar(void) {};
+ ConVar(const char* pszName, const char* pszDefaultValue, int nFlags, const char* pszHelpString);
+ ConVar(
+ const char* pszName,
+ const char* pszDefaultValue,
+ int nFlags,
+ const char* pszHelpString,
+ bool bMin,
+ float fMin,
+ bool bMax,
+ float fMax,
+ FnChangeCallback_t pCallback);
+ ~ConVar(void);
+
+ const char* GetBaseName(void) const;
+ const char* GetHelpText(void) const;
+
+ void AddFlags(int nFlags);
+ void RemoveFlags(int nFlags);
+
+ bool GetBool(void) const;
+ float GetFloat(void) const;
+ int GetInt(void) const;
+ Color GetColor(void) const;
+ const char* GetString(void) const;
+
+ bool GetMin(float& flMinValue) const;
+ bool GetMax(float& flMaxValue) const;
+ float GetMinValue(void) const;
+ float GetMaxValue(void) const;
+
+ bool HasMin(void) const;
+ bool HasMax(void) const;
+
+ void SetValue(int nValue);
+ void SetValue(float flValue);
+ void SetValue(const char* pszValue);
+ void SetValue(Color clValue);
+
+ void ChangeStringValue(const char* pszTempValue, float flOldValue);
+ bool SetColorFromString(const char* pszValue);
+ bool ClampValue(float& value);
+
+ bool IsRegistered(void) const;
+ bool IsCommand(void) const;
+ bool IsFlagSet(int nFlags) const;
+
+ struct CVValue_t
+ {
+ const char* m_pszString;
+ int64_t m_iStringLength;
+ float m_fValue;
+ int m_nValue;
+ };
+
+ ConCommandBase m_ConCommandBase {}; // 0x0000
+ const char* m_pszDefaultValue {}; // 0x0040
+ CVValue_t m_Value {}; // 0x0048
+ bool m_bHasMin {}; // 0x005C
+ float m_fMinVal {}; // 0x0060
+ bool m_bHasMax {}; // 0x0064
+ float m_fMaxVal {}; // 0x0068
+ void* m_pMalloc {}; // 0x0070
+ char m_pPad80[10] {}; // 0x0080
+}; // Size: 0x0080
diff --git a/NorthstarDLL/crashhandler.cpp b/NorthstarDLL/crashhandler.cpp
new file mode 100644
index 00000000..90091883
--- /dev/null
+++ b/NorthstarDLL/crashhandler.cpp
@@ -0,0 +1,216 @@
+#include "pch.h"
+#include "crashhandler.h"
+#include "dedicated.h"
+#include "configurables.h"
+
+#include
+
+HANDLE hExceptionFilter;
+
+long __stdcall ExceptionFilter(EXCEPTION_POINTERS* exceptionInfo)
+{
+ static bool logged = false;
+ if (logged)
+ return EXCEPTION_CONTINUE_SEARCH;
+
+ if (!IsDebuggerPresent())
+ {
+ const DWORD exceptionCode = exceptionInfo->ExceptionRecord->ExceptionCode;
+ if (exceptionCode != EXCEPTION_ACCESS_VIOLATION && exceptionCode != EXCEPTION_ARRAY_BOUNDS_EXCEEDED &&
+ exceptionCode != EXCEPTION_DATATYPE_MISALIGNMENT && exceptionCode != EXCEPTION_FLT_DENORMAL_OPERAND &&
+ exceptionCode != EXCEPTION_FLT_DIVIDE_BY_ZERO && exceptionCode != EXCEPTION_FLT_INEXACT_RESULT &&
+ exceptionCode != EXCEPTION_FLT_INVALID_OPERATION && exceptionCode != EXCEPTION_FLT_OVERFLOW &&
+ exceptionCode != EXCEPTION_FLT_STACK_CHECK && exceptionCode != EXCEPTION_FLT_UNDERFLOW &&
+ exceptionCode != EXCEPTION_ILLEGAL_INSTRUCTION && exceptionCode != EXCEPTION_IN_PAGE_ERROR &&
+ exceptionCode != EXCEPTION_INT_DIVIDE_BY_ZERO && exceptionCode != EXCEPTION_INT_OVERFLOW &&
+ exceptionCode != EXCEPTION_INVALID_DISPOSITION && exceptionCode != EXCEPTION_NONCONTINUABLE_EXCEPTION &&
+ exceptionCode != EXCEPTION_PRIV_INSTRUCTION && exceptionCode != EXCEPTION_STACK_OVERFLOW)
+ return EXCEPTION_CONTINUE_SEARCH;
+
+ std::stringstream exceptionCause;
+ exceptionCause << "Cause: ";
+ switch (exceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ {
+ exceptionCause << "Access Violation" << std::endl;
+
+ auto exceptionInfo0 = exceptionInfo->ExceptionRecord->ExceptionInformation[0];
+ auto exceptionInfo1 = exceptionInfo->ExceptionRecord->ExceptionInformation[1];
+
+ if (!exceptionInfo0)
+ exceptionCause << "Attempted to read from: 0x" << (void*)exceptionInfo1;
+ else if (exceptionInfo0 == 1)
+ exceptionCause << "Attempted to write to: 0x" << (void*)exceptionInfo1;
+ else if (exceptionInfo0 == 8)
+ exceptionCause << "Data Execution Prevention (DEP) at: 0x" << (void*)std::hex << exceptionInfo1;
+ else
+ exceptionCause << "Unknown access violation at: 0x" << (void*)exceptionInfo1;
+
+ break;
+ }
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ exceptionCause << "Array bounds exceeded";
+ break;
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ exceptionCause << "Datatype misalignment";
+ break;
+ case EXCEPTION_FLT_DENORMAL_OPERAND:
+ exceptionCause << "Denormal operand";
+ break;
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO:
+ exceptionCause << "Divide by zero (float)";
+ break;
+ case EXCEPTION_INT_DIVIDE_BY_ZERO:
+ exceptionCause << "Divide by zero (int)";
+ break;
+ case EXCEPTION_FLT_INEXACT_RESULT:
+ exceptionCause << "Inexact result";
+ break;
+ case EXCEPTION_FLT_INVALID_OPERATION:
+ exceptionCause << "Invalid operation";
+ break;
+ case EXCEPTION_FLT_OVERFLOW:
+ case EXCEPTION_INT_OVERFLOW:
+ exceptionCause << "Numeric overflow";
+ break;
+ case EXCEPTION_FLT_UNDERFLOW:
+ exceptionCause << "Numeric underflow";
+ break;
+ case EXCEPTION_FLT_STACK_CHECK:
+ exceptionCause << "Stack check";
+ break;
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ exceptionCause << "Illegal instruction";
+ break;
+ case EXCEPTION_INVALID_DISPOSITION:
+ exceptionCause << "Invalid disposition";
+ break;
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exceptionCause << "Noncontinuable exception";
+ break;
+ case EXCEPTION_PRIV_INSTRUCTION:
+ exceptionCause << "Priviledged instruction";
+ break;
+ case EXCEPTION_STACK_OVERFLOW:
+ exceptionCause << "Stack overflow";
+ break;
+ default:
+ exceptionCause << "Unknown";
+ break;
+ }
+
+ void* exceptionAddress = exceptionInfo->ExceptionRecord->ExceptionAddress;
+
+ HMODULE crashedModuleHandle;
+ GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, static_cast(exceptionAddress), &crashedModuleHandle);
+
+ MODULEINFO crashedModuleInfo;
+ GetModuleInformation(GetCurrentProcess(), crashedModuleHandle, &crashedModuleInfo, sizeof(crashedModuleInfo));
+
+ char crashedModuleFullName[MAX_PATH];
+ GetModuleFileNameExA(GetCurrentProcess(), crashedModuleHandle, crashedModuleFullName, MAX_PATH);
+ char* crashedModuleName = strrchr(crashedModuleFullName, '\\') + 1;
+
+ DWORD64 crashedModuleOffset = ((DWORD64)exceptionAddress) - ((DWORD64)crashedModuleInfo.lpBaseOfDll);
+ CONTEXT* exceptionContext = exceptionInfo->ContextRecord;
+
+ spdlog::error("Northstar has crashed! a minidump has been written and exception info is available below:");
+ spdlog::error(exceptionCause.str());
+ spdlog::error("At: {} + {}", crashedModuleName, (void*)crashedModuleOffset);
+
+ PVOID framesToCapture[62];
+ int frames = RtlCaptureStackBackTrace(0, 62, framesToCapture, NULL);
+ for (int i = 0; i < frames; i++)
+ {
+ HMODULE backtraceModuleHandle;
+ GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, static_cast(framesToCapture[i]), &backtraceModuleHandle);
+
+ char backtraceModuleFullName[MAX_PATH];
+ GetModuleFileNameExA(GetCurrentProcess(), backtraceModuleHandle, backtraceModuleFullName, MAX_PATH);
+ char* backtraceModuleName = strrchr(backtraceModuleFullName, '\\') + 1;
+
+ void* actualAddress = (void*)framesToCapture[i];
+ void* relativeAddress = (void*)(uintptr_t(actualAddress) - uintptr_t(backtraceModuleHandle));
+
+ spdlog::error(" {} + {} ({})", backtraceModuleName, relativeAddress, actualAddress);
+ }
+
+ spdlog::error("RAX: 0x{0:x}", exceptionContext->Rax);
+ spdlog::error("RBX: 0x{0:x}", exceptionContext->Rbx);
+ spdlog::error("RCX: 0x{0:x}", exceptionContext->Rcx);
+ spdlog::error("RDX: 0x{0:x}", exceptionContext->Rdx);
+ spdlog::error("RSI: 0x{0:x}", exceptionContext->Rsi);
+ spdlog::error("RDI: 0x{0:x}", exceptionContext->Rdi);
+ spdlog::error("RBP: 0x{0:x}", exceptionContext->Rbp);
+ spdlog::error("RSP: 0x{0:x}", exceptionContext->Rsp);
+ spdlog::error("R8: 0x{0:x}", exceptionContext->R8);
+ spdlog::error("R9: 0x{0:x}", exceptionContext->R9);
+ spdlog::error("R10: 0x{0:x}", exceptionContext->R10);
+ spdlog::error("R11: 0x{0:x}", exceptionContext->R11);
+ spdlog::error("R12: 0x{0:x}", exceptionContext->R12);
+ spdlog::error("R13: 0x{0:x}", exceptionContext->R13);
+ spdlog::error("R14: 0x{0:x}", exceptionContext->R14);
+ spdlog::error("R15: 0x{0:x}", exceptionContext->R15);
+
+ time_t time = std::time(nullptr);
+ tm currentTime = *std::localtime(&time);
+ std::stringstream stream;
+ stream << std::put_time(¤tTime, (GetNorthstarPrefix() + "/logs/nsdump%Y-%m-%d %H-%M-%S.dmp").c_str());
+
+ auto hMinidumpFile = CreateFileA(stream.str().c_str(), GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
+ if (hMinidumpFile)
+ {
+ MINIDUMP_EXCEPTION_INFORMATION dumpExceptionInfo;
+ dumpExceptionInfo.ThreadId = GetCurrentThreadId();
+ dumpExceptionInfo.ExceptionPointers = exceptionInfo;
+ dumpExceptionInfo.ClientPointers = false;
+
+ MiniDumpWriteDump(
+ GetCurrentProcess(),
+ GetCurrentProcessId(),
+ hMinidumpFile,
+ MINIDUMP_TYPE(MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory),
+ &dumpExceptionInfo,
+ nullptr,
+ nullptr);
+ CloseHandle(hMinidumpFile);
+ }
+ else
+ spdlog::error("Failed to write minidump file {}!", stream.str());
+
+ if (!IsDedicatedServer())
+ MessageBoxA(
+ 0, "Northstar has crashed! Crash info can be found in R2Northstar/logs", "Northstar has crashed!", MB_ICONERROR | MB_OK);
+ }
+
+ logged = true;
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
+BOOL WINAPI ConsoleHandlerRoutine(DWORD eventCode)
+{
+ switch (eventCode)
+ {
+ case CTRL_CLOSE_EVENT:
+ // User closed console, shut everything down
+ spdlog::info("Exiting due to console close...");
+ RemoveCrashHandler();
+ exit(EXIT_SUCCESS);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void InitialiseCrashHandler()
+{
+ hExceptionFilter = AddVectoredExceptionHandler(TRUE, ExceptionFilter);
+ SetConsoleCtrlHandler(ConsoleHandlerRoutine, true);
+}
+
+void RemoveCrashHandler()
+{
+ RemoveVectoredExceptionHandler(hExceptionFilter);
+}
\ No newline at end of file
diff --git a/NorthstarDLL/crashhandler.h b/NorthstarDLL/crashhandler.h
new file mode 100644
index 00000000..510372d2
--- /dev/null
+++ b/NorthstarDLL/crashhandler.h
@@ -0,0 +1,4 @@
+#pragma once
+
+void InitialiseCrashHandler();
+void RemoveCrashHandler();
\ No newline at end of file
diff --git a/NorthstarDLL/cvar.cpp b/NorthstarDLL/cvar.cpp
new file mode 100644
index 00000000..787790be
--- /dev/null
+++ b/NorthstarDLL/cvar.cpp
@@ -0,0 +1,31 @@
+#include "pch.h"
+#include "cvar.h"
+#include "convar.h"
+#include "concommand.h"
+
+//-----------------------------------------------------------------------------
+// Purpose: returns all ConVars
+//-----------------------------------------------------------------------------
+std::unordered_map CCvar::DumpToMap()
+{
+ std::stringstream ss;
+ CCVarIteratorInternal* itint = FactoryInternalIterator(); // Allocate new InternalIterator.
+
+ std::unordered_map allConVars;
+
+ for (itint->SetFirst(); itint->IsValid(); itint->Next()) // Loop through all instances.
+ {
+ ConCommandBase* pCommand = itint->Get();
+ const char* pszCommandName = pCommand->m_pszName;
+ allConVars[pszCommandName] = pCommand;
+ }
+
+ return allConVars;
+}
+
+// use the R2 namespace for game funcs
+namespace R2
+{
+ SourceInterface* g_pCVarInterface;
+ CCvar* g_pCVar;
+} // namespace R2
diff --git a/NorthstarDLL/cvar.h b/NorthstarDLL/cvar.h
new file mode 100644
index 00000000..ead30d3e
--- /dev/null
+++ b/NorthstarDLL/cvar.h
@@ -0,0 +1,43 @@
+#pragma once
+#include "convar.h"
+#include "pch.h"
+
+//-----------------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------------
+class ConCommandBase;
+class ConCommand;
+class ConVar;
+
+//-----------------------------------------------------------------------------
+// Internals for ICVarIterator
+//-----------------------------------------------------------------------------
+class CCVarIteratorInternal // Fully reversed table, just look at the virtual function table and rename the function.
+{
+ public:
+ virtual void SetFirst(void) = 0; // 0
+ virtual void Next(void) = 0; // 1
+ virtual bool IsValid(void) = 0; // 2
+ virtual ConCommandBase* Get(void) = 0; // 3
+};
+
+//-----------------------------------------------------------------------------
+// Default implementation
+//-----------------------------------------------------------------------------
+class CCvar
+{
+ public:
+ M_VMETHOD(ConCommandBase*, FindCommandBase, 14, (const char* pszCommandName), (this, pszCommandName));
+ M_VMETHOD(ConVar*, FindVar, 16, (const char* pszVarName), (this, pszVarName));
+ M_VMETHOD(ConCommand*, FindCommand, 18, (const char* pszCommandName), (this, pszCommandName));
+ M_VMETHOD(CCVarIteratorInternal*, FactoryInternalIterator, 41, (), (this));
+
+ std::unordered_map DumpToMap();
+};
+
+// use the R2 namespace for game funcs
+namespace R2
+{
+ extern SourceInterface* g_pCVarInterface;
+ extern CCvar* g_pCVar;
+} // namespace R2
diff --git a/NorthstarDLL/debugoverlay.cpp b/NorthstarDLL/debugoverlay.cpp
new file mode 100644
index 00000000..e6601223
--- /dev/null
+++ b/NorthstarDLL/debugoverlay.cpp
@@ -0,0 +1,151 @@
+#include "pch.h"
+#include "dedicated.h"
+#include "cvar.h"
+
+AUTOHOOK_INIT()
+
+struct Vector3
+{
+ float x, y, z;
+};
+
+struct QAngle
+{
+ float x, y, z, w;
+};
+
+enum OverlayType_t
+{
+ OVERLAY_BOX = 0,
+ OVERLAY_SPHERE,
+ OVERLAY_LINE,
+ OVERLAY_TRIANGLE,
+ OVERLAY_SWEPT_BOX,
+ OVERLAY_BOX2,
+ OVERLAY_CAPSULE
+};
+
+struct OverlayBase_t
+{
+ OverlayBase_t()
+ {
+ m_Type = OVERLAY_BOX;
+ m_nServerCount = -1;
+ m_nCreationTick = -1;
+ m_flEndTime = 0.0f;
+ m_pNextOverlay = NULL;
+ }
+
+ OverlayType_t m_Type; // What type of overlay is it?
+ int m_nCreationTick; // Duration -1 means go away after this frame #
+ int m_nServerCount; // Latch server count, too
+ float m_flEndTime; // When does this box go away
+ OverlayBase_t* m_pNextOverlay;
+ __int64 m_pUnk;
+};
+
+struct OverlayLine_t : public OverlayBase_t
+{
+ OverlayLine_t()
+ {
+ m_Type = OVERLAY_LINE;
+ }
+
+ Vector3 origin;
+ Vector3 dest;
+ int r;
+ int g;
+ int b;
+ int a;
+ bool noDepthTest;
+};
+
+struct OverlayBox_t : public OverlayBase_t
+{
+ OverlayBox_t()
+ {
+ m_Type = OVERLAY_BOX;
+ }
+
+ Vector3 origin;
+ Vector3 mins;
+ Vector3 maxs;
+ QAngle angles;
+ int r;
+ int g;
+ int b;
+ int a;
+};
+
+static HMODULE sEngineModule;
+
+typedef void (*RenderLineType)(Vector3 v1, Vector3 v2, Color c, bool bZBuffer);
+static RenderLineType RenderLine;
+typedef void (*RenderBoxType)(Vector3 vOrigin, QAngle angles, Vector3 vMins, Vector3 vMaxs, Color c, bool bZBuffer, bool bInsideOut);
+static RenderBoxType RenderBox;
+static RenderBoxType RenderWireframeBox;
+
+AUTOHOOK(DrawOverlay, engine.dll + 0xABCB0,
+void, __fastcall, (OverlayBase_t * pOverlay),
+{
+ EnterCriticalSection((LPCRITICAL_SECTION)((char*)sEngineModule + 0x10DB0A38)); // s_OverlayMutex
+
+ void* pMaterialSystem = *(void**)((char*)sEngineModule + 0x14C675B0);
+
+ switch (pOverlay->m_Type)
+ {
+ case OVERLAY_LINE:
+ {
+ OverlayLine_t* pLine = static_cast(pOverlay);
+ RenderLine(pLine->origin, pLine->dest, Color(pLine->r, pLine->g, pLine->b, pLine->a), pLine->noDepthTest);
+ }
+ break;
+ case OVERLAY_BOX:
+ {
+ OverlayBox_t* pCurrBox = static_cast(pOverlay);
+ if (pCurrBox->a > 0)
+ {
+ RenderBox(
+ pCurrBox->origin,
+ pCurrBox->angles,
+ pCurrBox->mins,
+ pCurrBox->maxs,
+ Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, pCurrBox->a),
+ false,
+ false);
+ }
+ if (pCurrBox->a < 255)
+ {
+ RenderWireframeBox(
+ pCurrBox->origin,
+ pCurrBox->angles,
+ pCurrBox->mins,
+ pCurrBox->maxs,
+ Color(pCurrBox->r, pCurrBox->g, pCurrBox->b, 255),
+ false,
+ false);
+ }
+ }
+ break;
+ }
+ LeaveCriticalSection((LPCRITICAL_SECTION)((char*)sEngineModule + 0x10DB0A38));
+})
+
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", DebugOverlay, ConVar, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ RenderLine = reinterpret_cast((char*)baseAddress + 0x192A70);
+
+ RenderBox = reinterpret_cast((char*)baseAddress + 0x192520);
+
+ RenderWireframeBox = reinterpret_cast((char*)baseAddress + 0x193DA0);
+
+ sEngineModule = baseAddress;
+
+ // not in g_pCVar->FindVar by this point for whatever reason, so have to get from memory
+ ConVar* Cvar_enable_debug_overlays = (ConVar*)((char*)baseAddress + 0x10DB0990);
+ Cvar_enable_debug_overlays->SetValue(false);
+ Cvar_enable_debug_overlays->m_pszDefaultValue = (char*)"0";
+ Cvar_enable_debug_overlays->AddFlags(FCVAR_CHEAT);
+})
\ No newline at end of file
diff --git a/NorthstarDLL/dedicated.cpp b/NorthstarDLL/dedicated.cpp
new file mode 100644
index 00000000..4aa1b072
--- /dev/null
+++ b/NorthstarDLL/dedicated.cpp
@@ -0,0 +1,296 @@
+#include "pch.h"
+#include "dedicated.h"
+#include "tier0.h"
+#include "playlist.h"
+#include "r2engine.h"
+#include "hoststate.h"
+#include "serverauthentication.h"
+#include "masterserver.h"
+#include "printcommand.h"
+
+AUTOHOOK_INIT()
+
+using namespace R2;
+
+bool IsDedicatedServer()
+{
+ static bool result = strstr(GetCommandLineA(), "-dedicated");
+ return result;
+}
+
+// CDedidcatedExports defs
+struct CDedicatedExports; // forward declare
+
+typedef void (*DedicatedSys_PrintfType)(CDedicatedExports* dedicated, const char* msg);
+typedef void (*DedicatedRunServerType)(CDedicatedExports* dedicated);
+
+// would've liked to just do this as a class but have not been able to get it to work
+struct CDedicatedExports
+{
+ void* vtable; // because it's easier, we just set this to &this, since CDedicatedExports has no props we care about other than funcs
+
+ char unused[56];
+
+ DedicatedSys_PrintfType Sys_Printf;
+ DedicatedRunServerType RunServer;
+};
+
+void Sys_Printf(CDedicatedExports* dedicated, const char* msg)
+{
+ spdlog::info("[DEDICATED SERVER] {}", msg);
+}
+
+typedef void (*CHostState__InitType)(CHostState* self);
+
+void RunServer(CDedicatedExports* dedicated)
+{
+ spdlog::info("CDedicatedExports::RunServer(): starting");
+ spdlog::info(Tier0::CommandLine()->GetCmdLine());
+
+ // initialise engine
+ g_pEngine->Frame();
+
+ // add +map if not present
+ // don't manually execute this from cbuf as users may have it in their startup args anyway, easier just to run from stuffcmds if present
+ if (!Tier0::CommandLine()->CheckParm("+map"))
+ Tier0::CommandLine()->AppendParm("+map", g_pCVar->FindVar("match_defaultMap")->GetString());
+
+ // re-run commandline
+ Cbuf_AddText(Cbuf_GetCurrentPlayer(), "stuffcmds", cmd_source_t::kCommandSrcCode);
+ Cbuf_Execute();
+
+ // get tickinterval
+ ConVar* Cvar_base_tickinterval_mp = g_pCVar->FindVar("base_tickinterval_mp");
+
+ // main loop
+ double frameTitle = 0;
+ while (g_pEngine->m_nQuitting == EngineQuitState::QUIT_NOTQUITTING)
+ {
+ double frameStart = Tier0::Plat_FloatTime();
+ g_pEngine->Frame();
+
+ // only update the title after at least 500ms since the last update
+ if ((frameStart - frameTitle) > 0.5)
+ {
+ frameTitle = frameStart;
+
+ // this way of getting playercount/maxplayers honestly really sucks, but not got any other methods of doing it rn
+ const char* maxPlayers = GetCurrentPlaylistVar("max_players", true);
+ if (!maxPlayers)
+ maxPlayers = "6";
+
+ SetConsoleTitleA(fmt::format(
+ "{} - {} {}/{} players ({})",
+ g_MasterServerManager->m_sUnicodeServerName,
+ g_pHostState->m_levelName,
+ g_ServerAuthenticationManager->m_additionalPlayerData.size(),
+ maxPlayers,
+ GetCurrentPlaylistName())
+ .c_str());
+ }
+
+ std::this_thread::sleep_for(std::chrono::duration>(
+ Cvar_base_tickinterval_mp->GetFloat() - fmin(Tier0::Plat_FloatTime() - frameStart, 0.25)));
+ }
+}
+
+AUTOHOOK(IsGameActiveWindow, engine.dll + 0x1CDC80,
+bool,, (),
+{
+ return true;
+})
+
+HANDLE consoleInputThreadHandle = NULL;
+
+DWORD WINAPI ConsoleInputThread(PVOID pThreadParameter)
+{
+ while (!g_pEngine || !g_pHostState || g_pHostState->m_iCurrentState != HostState_t::HS_RUN)
+ Sleep(1000);
+
+ // Bind stdin to receive console input.
+ FILE* fp = nullptr;
+ freopen_s(&fp, "CONIN$", "r", stdin);
+
+ spdlog::info("Ready to receive console commands.");
+
+ {
+ // Process console input
+ std::string input;
+ while (g_pEngine && g_pEngine->m_nQuitting == EngineQuitState::QUIT_NOTQUITTING && std::getline(std::cin, input))
+ {
+ input += "\n";
+ Cbuf_AddText(Cbuf_GetCurrentPlayer(), input.c_str(), cmd_source_t::kCommandSrcCode);
+ TryPrintCvarHelpForCommand(input.c_str());
+ }
+ }
+
+ return 0;
+}
+
+#include "NSMem.h"
+ON_DLL_LOAD_DEDI("engine.dll", DedicatedServer, [](HMODULE engineAddress)
+{
+ spdlog::info("InitialiseDedicated");
+
+ AUTOHOOK_DISPATCH_MODULE("engine.dll")
+
+ uintptr_t ea = (uintptr_t)engineAddress;
+
+ // Host_Init
+ // prevent a particle init that relies on client dll
+ NSMem::NOP(ea + 0x156799, 5);
+
+ // Host_Init
+ // don't call Key_Init to avoid loading some extra rsons from rpak (will be necessary to boot if we ever wanna disable rpaks entirely)
+ NSMem::NOP(ea + 0x1565B0, 5);
+
+
+ // CModAppSystemGroup::Create
+ // force the engine into dedicated mode by changing the first comparison to IsServerOnly to an assignment
+ auto ptr = ea + 0x1C4EBD;
+
+ // cmp => mov
+ NSMem::BytePatch(ptr + 1, "C6 87");
+
+ // 00 => 01
+ NSMem::BytePatch(ptr + 7, "01");
+
+ // Some init that i'm not sure of that crashes
+ // nop the call to it
+ NSMem::NOP(ea + 0x156A63, 5);
+
+ // runframeserver
+ // nop some access violations
+ NSMem::NOP(ea + 0x159819, 17);
+
+ NSMem::NOP(ea + 0x156B4C, 7);
+
+ // previously patched these, took me a couple weeks to figure out they were the issue
+ // removing these will mess up register state when this function is over, so we'll write HS_RUN to the wrong address
+ // so uhh, don't do that
+ // NSMem::NOP(ea + 0x156B4C + 7, 8);
+ NSMem::NOP(ea + 0x156B4C + 15, 9);
+
+ // HostState_State_NewGame
+ // nop an access violation
+ NSMem::NOP(ea + 0xB934C, 9);
+
+ // CEngineAPI::Connect
+ // remove call to Shader_Connect
+ NSMem::NOP(ea + 0x1C4D7D, 5);
+
+ // Host_Init
+ // remove call to ui loading stuff
+ NSMem::NOP(ea + 0x156595, 5);
+
+ // some function that gets called from RunFrameServer
+ // nop a function that makes requests to stryder, this will eventually access violation if left alone and isn't necessary anyway
+ NSMem::NOP(ea + 0x15A0BB, 5);
+
+ // RunFrameServer
+ // nop a function that access violations
+ NSMem::NOP(ea + 0x159BF3, 5);
+
+ // func that checks if origin is inited
+ // always return 1
+ NSMem::BytePatch(
+ ea + 0x183B70,
+ {
+ 0xB0,
+ 0x01, // mov al,01
+ 0xC3 // ret
+ });
+
+ // HostState_State_ChangeLevel
+ // nop clientinterface call
+ NSMem::NOP(ea + 0x1552ED, 16);
+
+ // HostState_State_ChangeLevel
+ // nop clientinterface call
+ NSMem::NOP(ea + 0x155363, 16);
+
+ // note: previously had DisableDedicatedWindowCreation patches here, but removing those rn since they're all shit and unstable and bad
+ // and such check commit history if any are needed for reimplementation
+ {
+ // IVideoMode::CreateGameWindow
+ // nop call to ShowWindow
+ NSMem::NOP(ea + 0x1CD146, 5);
+ }
+
+ CDedicatedExports* dedicatedExports = new CDedicatedExports;
+ dedicatedExports->vtable = dedicatedExports;
+ dedicatedExports->Sys_Printf = Sys_Printf;
+ dedicatedExports->RunServer = RunServer;
+
+ CDedicatedExports** exports = (CDedicatedExports**)((char*)engineAddress + 0x13F0B668);
+ *exports = dedicatedExports;
+
+ // extra potential patches:
+ // nop engine.dll+1c67d1 and +1c67d8 to skip videomode creategamewindow
+ // also look into launcher.dll+d381, seems to cause renderthread to get made
+ // this crashes HARD if no window which makes sense tbh
+ // also look into materialsystem + 5B344 since it seems to be the base of all the renderthread stuff
+
+ // big note: datatable gets registered in window creation
+ // make sure it still gets registered
+
+ // add cmdline args that are good for dedi
+ Tier0::CommandLine()->AppendParm("-nomenuvid", 0);
+ Tier0::CommandLine()->AppendParm("-nosound", 0);
+ Tier0::CommandLine()->AppendParm("-windowed", 0);
+ Tier0::CommandLine()->AppendParm("-nomessagebox", 0);
+ Tier0::CommandLine()->AppendParm("+host_preload_shaders", "0");
+ Tier0::CommandLine()->AppendParm("+net_usesocketsforloopback", "1");
+
+ // Disable Quick Edit mode to reduce chance of user unintentionally hanging their server by selecting something.
+ if (!Tier0::CommandLine()->CheckParm("-bringbackquickedit"))
+ {
+ HANDLE stdIn = GetStdHandle(STD_INPUT_HANDLE);
+ DWORD mode = 0;
+
+ if (GetConsoleMode(stdIn, &mode))
+ {
+ if (mode & ENABLE_QUICK_EDIT_MODE)
+ {
+ mode &= ~ENABLE_QUICK_EDIT_MODE;
+ mode &= ~ENABLE_MOUSE_INPUT;
+
+ mode |= ENABLE_PROCESSED_INPUT;
+
+ SetConsoleMode(stdIn, mode);
+ }
+ }
+ }
+ else
+ spdlog::info("Quick Edit enabled by user request");
+
+ // create console input thread
+ if (!Tier0::CommandLine()->CheckParm("-noconsoleinput"))
+ consoleInputThreadHandle = CreateThread(0, 0, ConsoleInputThread, 0, 0, NULL);
+ else
+ spdlog::info("Console input disabled by user request");
+})
+
+ON_DLL_LOAD_DEDI("tier0.dll", DedicatedServerOrigin, [](HMODULE baseAddress)
+{
+ // disable origin on dedicated
+ // for any big ea lawyers, this can't be used to play the game without origin, game will throw a fit if you try to do anything without
+ // an origin id as a client for dedi it's fine though, game doesn't care if origin is disabled as long as there's only a server
+
+ NSMem::BytePatch((uintptr_t)GetProcAddress(GetModuleHandleA("tier0.dll"), "Tier0_InitOrigin"),
+ {
+ 0xC3 // ret
+ });
+})
+
+AUTOHOOK(PrintFatalSquirrelError, server.dll + 0x794D0,
+void, , (void* sqvm),
+{
+ PrintFatalSquirrelError(sqvm);
+ g_pEngine->m_nQuitting = EngineQuitState::QUIT_TODESKTOP;
+})
+
+ON_DLL_LOAD_DEDI("server.dll", DedicatedServerGameDLL, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH_MODULE("server.dll")
+})
\ No newline at end of file
diff --git a/NorthstarDLL/dedicated.h b/NorthstarDLL/dedicated.h
new file mode 100644
index 00000000..82806763
--- /dev/null
+++ b/NorthstarDLL/dedicated.h
@@ -0,0 +1,3 @@
+#pragma once
+
+bool IsDedicatedServer();
diff --git a/NorthstarDLL/dedicatedmaterialsystem.cpp b/NorthstarDLL/dedicatedmaterialsystem.cpp
new file mode 100644
index 00000000..3f1bf323
--- /dev/null
+++ b/NorthstarDLL/dedicatedmaterialsystem.cpp
@@ -0,0 +1,43 @@
+#pragma once
+#include "pch.h"
+#include "dedicated.h"
+#include "tier0.h"
+#include "NSMem.h"
+
+AUTOHOOK_INIT()
+
+AUTOHOOK(D3D11CreateDevice, materialsystem_dx11.dll + 0xD9A0E,
+HRESULT, __stdcall, (
+ void* pAdapter,
+ int DriverType,
+ HMODULE Software,
+ UINT Flags,
+ int* pFeatureLevels,
+ UINT FeatureLevels,
+ UINT SDKVersion,
+ void** ppDevice,
+ int* pFeatureLevel,
+ void** ppImmediateContext),
+{
+ // note: this is super duper temp pretty much just messing around with it
+ // does run surprisingly well on dedi for a software driver tho if you ignore the +1gb ram usage at times, seems like dedi doesn't
+ // really call gpu much even with renderthread still being a thing will be using this hook for actual d3d stubbing and stuff later
+
+ // atm, i think the play might be to run d3d in software, and then just stub out any calls that allocate memory/use alot of resources
+ // (e.g. createtexture and that sorta thing)
+ // note: this has been succeeded by the d3d11 and gfsdk stubs, and is only being kept around for posterity and as a fallback option
+ if (Tier0::CommandLine()->CheckParm("-softwared3d11"))
+ DriverType = 5; // D3D_DRIVER_TYPE_WARP
+
+ return D3D11CreateDevice(
+ pAdapter, DriverType, Software, Flags, pFeatureLevels, FeatureLevels, SDKVersion, ppDevice, pFeatureLevel, ppImmediateContext);
+})
+
+ON_DLL_LOAD_DEDI("materialsystem_dx11.dll", DedicatedServerMaterialSystem, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ // CMaterialSystem::FindMaterial
+ // make the game always use the error material
+ NSMem::BytePatch((uintptr_t)baseAddress + 0x5F0F1, {0xE9, 0x34, 0x03, 0x00});
+})
\ No newline at end of file
diff --git a/NorthstarDLL/demofixes.cpp b/NorthstarDLL/demofixes.cpp
new file mode 100644
index 00000000..ff06ae12
--- /dev/null
+++ b/NorthstarDLL/demofixes.cpp
@@ -0,0 +1,27 @@
+#include "pch.h"
+#include "convar.h"
+#include "NSMem.h"
+
+ON_DLL_LOAD_CLIENT("engine.dll", EngineDemoFixes, [](HMODULE baseAddress)
+{
+ // allow demo recording on loopback
+ NSMem::NOP((uintptr_t)baseAddress + 0x8E1B1, 2);
+ NSMem::NOP((uintptr_t)baseAddress + 0x56CC3, 2);
+})
+
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ClientDemoFixes, ConVar, [](HMODULE baseAddress)
+{
+ // change default values of demo cvars to enable them by default, but not autorecord
+ // this is before Host_Init, the setvalue calls here will get overwritten by custom cfgs/launch options
+ ConVar* Cvar_demo_enableDemos = R2::g_pCVar->FindVar("demo_enabledemos");
+ Cvar_demo_enableDemos->m_pszDefaultValue = "1";
+ Cvar_demo_enableDemos->SetValue(true);
+
+ ConVar* Cvar_demo_writeLocalFile = R2::g_pCVar->FindVar("demo_writeLocalFile");
+ Cvar_demo_writeLocalFile->m_pszDefaultValue = "1";
+ Cvar_demo_writeLocalFile->SetValue(true);
+
+ ConVar* Cvar_demo_autoRecord = R2::g_pCVar->FindVar("demo_autoRecord");
+ Cvar_demo_autoRecord->m_pszDefaultValue = "0";
+ Cvar_demo_autoRecord->SetValue(false);
+})
\ No newline at end of file
diff --git a/NorthstarDLL/dllmain.cpp b/NorthstarDLL/dllmain.cpp
new file mode 100644
index 00000000..e27cd529
--- /dev/null
+++ b/NorthstarDLL/dllmain.cpp
@@ -0,0 +1,169 @@
+#include "pch.h"
+#include "main.h"
+#include "logging.h"
+#include "crashhandler.h"
+#include "memalloc.h"
+#include "configurables.h"
+#include "plugin_abi.h"
+#include "plugins.h"
+#include "version.h"
+#include "pch.h"
+
+#include "rapidjson/document.h"
+#include "rapidjson/stringbuffer.h"
+#include "rapidjson/writer.h"
+#include "rapidjson/error/en.h"
+
+#include
+#include
+namespace fs = std::filesystem;
+
+typedef void (*initPluginFuncPtr)(void* getPluginObject);
+
+BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
+}
+
+void freeLibrary(HMODULE hLib)
+{
+ if (!FreeLibrary(hLib))
+ {
+ spdlog::error("There was an error while trying to free library");
+ }
+}
+
+bool LoadPlugins()
+{
+
+ std::vector paths;
+
+ std::string pluginPath = GetNorthstarPrefix() + "/plugins";
+ if (!fs::exists(pluginPath))
+ {
+ spdlog::warn("Could not find a plugins directory. Skipped loading plugins");
+ return false;
+ }
+ // ensure dirs exist
+ fs::recursive_directory_iterator iterator(pluginPath);
+ if (std::filesystem::begin(iterator) == std::filesystem::end(iterator))
+ {
+ spdlog::warn("Could not find any plugins. Skipped loading plugins");
+ return false;
+ }
+ for (auto const& entry : iterator)
+ {
+ if (fs::is_regular_file(entry) && entry.path().extension() == ".dll")
+ paths.emplace_back(entry.path().filename());
+ }
+ initGameState();
+ for (fs::path path : paths)
+ {
+ std::string pathstring = (pluginPath / path).string();
+ std::wstring wpath = (pluginPath / path).wstring();
+
+ LPCWSTR wpptr = wpath.c_str();
+ HMODULE datafile =
+ LoadLibraryExW(wpptr, 0, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); // Load the DLL as a data file
+ if (datafile == NULL)
+ {
+ spdlog::info("Failed to load library {}: ", std::system_category().message(GetLastError()));
+ continue;
+ }
+ HRSRC manifestResource = FindResourceW(datafile, MAKEINTRESOURCE(101), MAKEINTRESOURCE(RT_RCDATA));
+
+ if (manifestResource == NULL)
+ {
+ spdlog::info("Could not find manifest for library {}", pathstring);
+ freeLibrary(datafile);
+ continue;
+ }
+ spdlog::info("Loading resource from library");
+ HGLOBAL myResourceData = LoadResource(datafile, manifestResource);
+ if (myResourceData == NULL)
+ {
+ spdlog::error("Failed to load resource from library");
+ freeLibrary(datafile);
+ continue;
+ }
+ int manifestSize = SizeofResource(datafile, manifestResource);
+ std::string manifest = std::string((const char*)LockResource(myResourceData), 0, manifestSize);
+ freeLibrary(datafile);
+
+ rapidjson_document manifestJSON;
+ manifestJSON.Parse(manifest.c_str());
+
+ if (manifestJSON.HasParseError())
+ {
+ spdlog::error("Manifest for {} was invalid", pathstring);
+ continue;
+ }
+ if (!manifestJSON.HasMember("api_version"))
+ {
+ spdlog::error("{} does not have a version number in its manifest", pathstring);
+ continue;
+ // spdlog::info(manifestJSON["version"].GetString());
+ }
+ if (strcmp(manifestJSON["api_version"].GetString(), std::to_string(ABI_VERSION).c_str()))
+ {
+ spdlog::error("{} has an incompatible API version number in its manifest", pathstring);
+ continue;
+ }
+ // Passed all checks, going to actually load it now
+
+ HMODULE pluginLib = LoadLibraryW(wpptr); // Load the DLL as a data file
+ if (pluginLib == NULL)
+ {
+ spdlog::info("Failed to load library {}: ", std::system_category().message(GetLastError()));
+ continue;
+ }
+ initPluginFuncPtr initPlugin = (initPluginFuncPtr)GetProcAddress(pluginLib, "initializePlugin");
+ if (initPlugin == NULL)
+ {
+ spdlog::info("Library {} has no function initializePlugin", pathstring);
+ continue;
+ }
+ spdlog::info("Succesfully loaded {}", pathstring);
+ initPlugin(&getPluginObject);
+ }
+ return true;
+}
+
+bool InitialiseNorthstar()
+{
+ static bool bInitialised = false;
+ if (bInitialised)
+ return false;
+
+ bInitialised = true;
+
+ parseConfigurables();
+ InitialiseVersion();
+
+ // Fix some users' failure to connect to respawn datacenters
+ SetEnvironmentVariableA("OPENSSL_ia32cap", "~0x200000200000000");
+
+ curl_global_init_mem(CURL_GLOBAL_DEFAULT, _malloc_base, _free_base, _realloc_base, _strdup_base, _calloc_base);
+
+ InitialiseCrashHandler();
+ InitialiseLogging();
+ InstallInitialHooks();
+ CreateLogFiles();
+
+ // Write launcher version to log
+ spdlog::info("NorthstarLauncher version: {}", version);
+
+ // run callbacks for any libraries that are already loaded by now
+ CallAllPendingDLLLoadCallbacks();
+
+ return true;
+}
\ No newline at end of file
diff --git a/NorthstarDLL/filesystem.cpp b/NorthstarDLL/filesystem.cpp
new file mode 100644
index 00000000..a879b40e
--- /dev/null
+++ b/NorthstarDLL/filesystem.cpp
@@ -0,0 +1,177 @@
+#include "pch.h"
+#include "filesystem.h"
+#include "sourceinterface.h"
+#include "modmanager.h"
+
+#include
+#include
+
+AUTOHOOK_INIT()
+
+using namespace R2;
+
+bool bReadingOriginalFile = false;
+std::string sCurrentModPath;
+
+ConVar* Cvar_ns_fs_log_reads;
+
+// use the R2 namespace for game funcs
+namespace R2
+{
+ SourceInterface* g_pFilesystem;
+
+ std::string ReadVPKFile(const char* path)
+ {
+ // read scripts.rson file, todo: check if this can be overwritten
+ FileHandle_t fileHandle = (*g_pFilesystem)->m_vtable2->Open(&(*g_pFilesystem)->m_vtable2, path, "rb", "GAME", 0);
+
+ std::stringstream fileStream;
+ int bytesRead = 0;
+ char data[4096];
+ do
+ {
+ bytesRead = (*g_pFilesystem)->m_vtable2->Read(&(*g_pFilesystem)->m_vtable2, data, (int)std::size(data), fileHandle);
+ fileStream.write(data, bytesRead);
+ } while (bytesRead == std::size(data));
+
+ (*g_pFilesystem)->m_vtable2->Close(*g_pFilesystem, fileHandle);
+
+ return fileStream.str();
+ }
+
+ std::string ReadVPKOriginalFile(const char* path)
+ {
+ bReadingOriginalFile = true;
+ std::string ret = ReadVPKFile(path);
+ bReadingOriginalFile = false;
+
+ return ret;
+ }
+} // namespace R2
+
+HOOK(AddSearchPathHook, AddSearchPath,
+void,, (IFileSystem* fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType),
+{
+ AddSearchPath(fileSystem, pPath, pathID, addType);
+
+ // make sure current mod paths are at head
+ if (!strcmp(pathID, "GAME") && sCurrentModPath.compare(pPath) && addType == PATH_ADD_TO_HEAD)
+ {
+ AddSearchPath(fileSystem, sCurrentModPath.c_str(), "GAME", PATH_ADD_TO_HEAD);
+ AddSearchPath(fileSystem, GetCompiledAssetsPath().string().c_str(), "GAME", PATH_ADD_TO_HEAD);
+ }
+})
+
+void SetNewModSearchPaths(Mod* mod)
+{
+ // put our new path to the head if we need to read from a different mod path
+ // in the future we could also determine whether the file we're setting paths for needs a mod dir, or compiled assets
+ if (mod != nullptr)
+ {
+ if ((fs::absolute(mod->ModDirectory) / MOD_OVERRIDE_DIR).string().compare(sCurrentModPath))
+ {
+ spdlog::info("changing mod search path from {} to {}", sCurrentModPath, mod->ModDirectory.string());
+
+ AddSearchPath(
+ &*(*g_pFilesystem), (fs::absolute(mod->ModDirectory) / MOD_OVERRIDE_DIR).string().c_str(), "GAME", PATH_ADD_TO_HEAD);
+ sCurrentModPath = (fs::absolute(mod->ModDirectory) / MOD_OVERRIDE_DIR).string();
+ }
+ }
+ else // push compiled to head
+ AddSearchPath(&*(*g_pFilesystem), fs::absolute(GetCompiledAssetsPath()).string().c_str(), "GAME", PATH_ADD_TO_HEAD);
+}
+
+bool TryReplaceFile(const char* pPath, bool shouldCompile)
+{
+ if (bReadingOriginalFile)
+ return false;
+
+ if (shouldCompile)
+ g_pModManager->CompileAssetsForFile(pPath);
+
+ // idk how efficient the lexically normal check is
+ // can't just set all /s in path to \, since some paths aren't in writeable memory
+ auto file = g_pModManager->m_modFiles.find(g_pModManager->NormaliseModFilePath(fs::path(pPath)));
+ if (file != g_pModManager->m_modFiles.end())
+ {
+ SetNewModSearchPaths(file->second.owningMod);
+ return true;
+ }
+
+ return false;
+}
+
+// force modded files to be read from mods, not cache
+HOOK(ReadFromCacheHook, ReadFromCache,
+bool,, (IFileSystem* filesystem, char* pPath, void* result),
+{
+ if (TryReplaceFile(pPath, true))
+ return false;
+
+ return ReadFromCache(filesystem, pPath, result);
+})
+
+// force modded files to be read from mods, not vpk
+AUTOHOOK(ReadFileFromVPK, filesystem_stdio.dll + 0x5CBA0,
+FileHandle_t,, (VPKData* vpkInfo, __int64* b, char* filename),
+{
+ // don't compile here because this is only ever called from OpenEx, which already compiles
+ if (TryReplaceFile(filename, false))
+ {
+ *b = -1;
+ return b;
+ }
+
+ return ReadFileFromVPK(vpkInfo, b, filename);
+})
+
+AUTOHOOK(CBaseFileSystem__OpenEx, filesystem_stdio.dll + 0x15F50,
+FileHandle_t,, (IFileSystem* filesystem, const char* pPath, const char* pOptions, uint32_t flags, const char* pPathID, char **ppszResolvedFilename),
+{
+ TryReplaceFile(pPath, true);
+ return CBaseFileSystem__OpenEx(filesystem, pPath, pOptions, flags, pPathID, ppszResolvedFilename);
+})
+
+HOOK(MountVPKHook, MountVPK,
+VPKData*,, (IFileSystem * fileSystem, const char* pVpkPath),
+{
+ spdlog::info("MountVPK {}", pVpkPath);
+ VPKData* ret = MountVPK(fileSystem, pVpkPath);
+
+ for (Mod mod : g_pModManager->m_loadedMods)
+ {
+ if (!mod.Enabled)
+ continue;
+
+ for (ModVPKEntry& vpkEntry : mod.Vpks)
+ {
+ // if we're autoloading, just load no matter what
+ if (!vpkEntry.m_bAutoLoad)
+ {
+ // resolve vpk name and try to load one with the same name
+ // todo: we should be unloading these on map unload manually
+ std::string mapName(fs::path(pVpkPath).filename().string());
+ std::string modMapName(fs::path(vpkEntry.m_sVpkPath.c_str()).filename().string());
+ if (mapName.compare(modMapName))
+ continue;
+ }
+
+ VPKData* loaded = MountVPK(fileSystem, vpkEntry.m_sVpkPath.c_str());
+ if (!ret) // this is primarily for map vpks and stuff, so the map's vpk is what gets returned from here
+ ret = loaded;
+ }
+ }
+
+ return ret;
+})
+
+ON_DLL_LOAD("filesystem_stdio.dll", Filesystem, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ R2::g_pFilesystem = new SourceInterface("filesystem_stdio.dll", "VFileSystem017");
+
+ AddSearchPathHook.Dispatch((*g_pFilesystem)->m_vtable->AddSearchPath);
+ ReadFromCacheHook.Dispatch((*g_pFilesystem)->m_vtable->ReadFromCache);
+ MountVPKHook.Dispatch((*g_pFilesystem)->m_vtable->MountVPK);
+})
\ No newline at end of file
diff --git a/NorthstarDLL/filesystem.h b/NorthstarDLL/filesystem.h
new file mode 100644
index 00000000..abfdd14b
--- /dev/null
+++ b/NorthstarDLL/filesystem.h
@@ -0,0 +1,77 @@
+#pragma once
+#include "sourceinterface.h"
+
+// taken from ttf2sdk
+typedef void* FileHandle_t;
+
+#pragma pack(push, 1)
+struct VPKFileEntry
+{
+ char* directory;
+ char* filename;
+ char* extension;
+ unsigned char unknown[0x38];
+};
+#pragma pack(pop)
+
+#pragma pack(push, 1)
+struct VPKData
+{
+ unsigned char unknown[5];
+ char path[255];
+ unsigned char unknown2[0x134];
+ int32_t numEntries;
+ unsigned char unknown3[12];
+ VPKFileEntry* entries;
+};
+#pragma pack(pop)
+
+enum SearchPathAdd_t
+{
+ PATH_ADD_TO_HEAD, // First path searched
+ PATH_ADD_TO_TAIL, // Last path searched
+};
+
+class CSearchPath
+{
+ public:
+ unsigned char unknown[0x18];
+ const char* debugPath;
+};
+
+class IFileSystem
+{
+ public:
+ struct VTable
+ {
+ void* unknown[10];
+ void (*AddSearchPath)(IFileSystem* fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType);
+ void* unknown2[84];
+ bool (*ReadFromCache)(IFileSystem* fileSystem, const char* path, void* result);
+ void* unknown3[15];
+ VPKData* (*MountVPK)(IFileSystem* fileSystem, const char* vpkPath);
+ };
+
+ struct VTable2
+ {
+ int (*Read)(IFileSystem::VTable2** fileSystem, void* pOutput, int size, FileHandle_t file);
+ void* unknown[1];
+ FileHandle_t (*Open)(
+ IFileSystem::VTable2** fileSystem, const char* pFileName, const char* pOptions, const char* pathID, int64_t unknown);
+ void (*Close)(IFileSystem* fileSystem, FileHandle_t file);
+ void* unknown2[6];
+ bool (*FileExists)(IFileSystem::VTable2** fileSystem, const char* pFileName, const char* pPathID);
+ };
+
+ VTable* m_vtable;
+ VTable2* m_vtable2;
+};
+
+// use the R2 namespace for game funcs
+namespace R2
+{
+ extern SourceInterface* g_pFilesystem;
+
+ std::string ReadVPKFile(const char* path);
+ std::string ReadVPKOriginalFile(const char* path);
+} // namespace R2
diff --git a/NorthstarDLL/hooks.cpp b/NorthstarDLL/hooks.cpp
new file mode 100644
index 00000000..2b117178
--- /dev/null
+++ b/NorthstarDLL/hooks.cpp
@@ -0,0 +1,338 @@
+#include "pch.h"
+#include "dedicated.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace fs = std::filesystem;
+
+AUTOHOOK_INIT()
+
+// called from the ON_DLL_LOAD macros
+__dllLoadCallback::__dllLoadCallback(
+ eDllLoadCallbackSide side, const std::string dllName, DllLoadCallbackFuncType callback, std::string uniqueStr, std::string reliesOn)
+{
+ switch (side)
+ {
+ case eDllLoadCallbackSide::UNSIDED:
+ {
+ AddDllLoadCallback(dllName, callback, uniqueStr, reliesOn);
+ break;
+ }
+
+ case eDllLoadCallbackSide::CLIENT:
+ {
+ AddDllLoadCallbackForClient(dllName, callback, uniqueStr, reliesOn);
+ break;
+ }
+
+ case eDllLoadCallbackSide::DEDICATED_SERVER:
+ {
+ AddDllLoadCallbackForDedicatedServer(dllName, callback, uniqueStr, reliesOn);
+ break;
+ }
+ }
+}
+
+void __fileAutohook::Dispatch()
+{
+ for (__autohook* hook : hooks)
+ hook->Dispatch();
+}
+
+void __fileAutohook::DispatchForModule(const char* pModuleName)
+{
+ const int iModuleNameLen = strlen(pModuleName);
+
+ for (__autohook* hook : hooks)
+ if ((hook->iAddressResolutionMode == __autohook::OFFSET_STRING && !strncmp(pModuleName, hook->pAddrString, iModuleNameLen)) ||
+ (hook->iAddressResolutionMode == __autohook::PROCADDRESS && !strcmp(pModuleName, hook->pModuleName)))
+ hook->Dispatch();
+}
+
+ManualHook::ManualHook(const char* funcName, LPVOID func)
+ : pHookFunc(func), ppOrigFunc(nullptr)
+{
+ const int iFuncNameStrlen = strlen(funcName);
+ pFuncName = new char[iFuncNameStrlen];
+ memcpy(pFuncName, funcName, iFuncNameStrlen);
+}
+
+ManualHook::ManualHook(const char* funcName, LPVOID* orig, LPVOID func)
+ : pHookFunc(func), ppOrigFunc(orig)
+{
+ const int iFuncNameStrlen = strlen(funcName);
+ pFuncName = new char[iFuncNameStrlen];
+ memcpy(pFuncName, funcName, iFuncNameStrlen);
+}
+
+bool ManualHook::Dispatch(LPVOID addr, LPVOID* orig)
+{
+ if (orig)
+ ppOrigFunc = orig;
+
+ if (MH_CreateHook(addr, pHookFunc, ppOrigFunc) == MH_OK)
+ {
+ if (MH_EnableHook(addr) == MH_OK)
+ {
+ spdlog::info("Enabling hook {}", pFuncName);
+ return true;
+ }
+ else
+ spdlog::error("MH_EnableHook failed for function {}", pFuncName);
+ }
+ else
+ spdlog::error("MH_CreateHook failed for function {}", pFuncName);
+
+ return false;
+}
+
+// dll load callback stuff
+// this allows for code to register callbacks to be run as soon as a dll is loaded, mainly to allow for patches to be made on dll load
+struct DllLoadCallback
+{
+ std::string dll;
+ DllLoadCallbackFuncType callback;
+ std::string tag;
+ std::string reliesOn;
+ bool called;
+};
+
+// HACK: declaring and initialising this vector at file scope crashes on debug builds due to static initialisation order
+// using a static var like this ensures that the vector is initialised lazily when it's used
+std::vector& GetDllLoadCallbacks()
+{
+ static std::vector vec = std::vector();
+ return vec;
+}
+
+void AddDllLoadCallback(std::string dll, DllLoadCallbackFuncType callback, std::string tag, std::string reliesOn)
+{
+ DllLoadCallback& callbackStruct = GetDllLoadCallbacks().emplace_back();
+
+ callbackStruct.dll = dll;
+ callbackStruct.callback = callback;
+ callbackStruct.tag = tag;
+ callbackStruct.reliesOn = reliesOn;
+ callbackStruct.called = false;
+}
+
+void AddDllLoadCallbackForDedicatedServer(
+ std::string dll, DllLoadCallbackFuncType callback, std::string tag, std::string reliesOn)
+{
+ if (!IsDedicatedServer())
+ return;
+
+ AddDllLoadCallback(dll, callback, tag, reliesOn);
+}
+
+void AddDllLoadCallbackForClient(std::string dll, DllLoadCallbackFuncType callback, std::string tag, std::string reliesOn)
+{
+ if (IsDedicatedServer())
+ return;
+
+ AddDllLoadCallback(dll, callback, tag, reliesOn);
+}
+
+AUTOHOOK_ABSOLUTEADDR(_GetCommandLineA, GetCommandLineA,
+LPSTR, WINAPI, (),
+{
+ static char* cmdlineModified;
+ static char* cmdlineOrg;
+
+ if (cmdlineOrg == nullptr || cmdlineModified == nullptr)
+ {
+ cmdlineOrg = _GetCommandLineA();
+ bool isDedi = strstr(cmdlineOrg, "-dedicated"); // well, this one has to be a real argument
+ bool ignoreStartupArgs = strstr(cmdlineOrg, "-nostartupargs");
+
+ std::string args;
+ std::ifstream cmdlineArgFile;
+
+ // it looks like CommandLine() prioritizes parameters apprearing first, so we want the real commandline to take priority
+ // not to mention that cmdlineOrg starts with the EXE path
+ args.append(cmdlineOrg);
+ args.append(" ");
+
+ // append those from the file
+
+ if (!ignoreStartupArgs)
+ {
+
+ cmdlineArgFile = std::ifstream(!isDedi ? "ns_startup_args.txt" : "ns_startup_args_dedi.txt");
+
+ if (cmdlineArgFile)
+ {
+ std::stringstream argBuffer;
+ argBuffer << cmdlineArgFile.rdbuf();
+ cmdlineArgFile.close();
+
+ // if some other command line option includes "-northstar" in the future then you have to refactor this check to check with
+ // both either space after or ending with
+ if (!isDedi && argBuffer.str().find("-northstar") != std::string::npos)
+ MessageBoxA(
+ NULL,
+ "The \"-northstar\" command line option is NOT supposed to go into ns_startup_args.txt file!\n\nThis option is "
+ "supposed to go into Origin/Steam game launch options, and then you are supposed to launch the original "
+ "Titanfall2.exe "
+ "rather than NorthstarLauncher.exe to make use of it.",
+ "Northstar Warning",
+ MB_ICONWARNING);
+
+ args.append(argBuffer.str());
+ }
+ }
+
+ auto len = args.length();
+ cmdlineModified = new char[len + 1];
+ if (!cmdlineModified)
+ {
+ spdlog::error("malloc failed for command line");
+ return cmdlineOrg;
+ }
+ memcpy(cmdlineModified, args.c_str(), len + 1);
+
+ spdlog::info("Command line: {}", cmdlineModified);
+ }
+
+ return cmdlineModified;
+})
+
+std::vector calledTags;
+void CallLoadLibraryACallbacks(LPCSTR lpLibFileName, HMODULE moduleAddress)
+{
+ while (true)
+ {
+ bool bDoneCalling = true;
+
+ for (auto& callbackStruct : GetDllLoadCallbacks())
+ {
+ if (!callbackStruct.called && fs::path(lpLibFileName).filename() == fs::path(callbackStruct.dll).filename())
+ {
+ if (callbackStruct.reliesOn != "" &&
+ std::find(calledTags.begin(), calledTags.end(), callbackStruct.reliesOn) == calledTags.end())
+ {
+ bDoneCalling = false;
+ continue;
+ }
+
+ callbackStruct.callback(moduleAddress);
+ calledTags.push_back(callbackStruct.tag);
+ callbackStruct.called = true;
+ }
+ }
+
+ if (bDoneCalling)
+ break;
+ }
+}
+
+void CallLoadLibraryWCallbacks(LPCWSTR lpLibFileName, HMODULE moduleAddress)
+{
+ while (true)
+ {
+ bool bDoneCalling = true;
+
+ for (auto& callbackStruct : GetDllLoadCallbacks())
+ {
+ if (!callbackStruct.called && fs::path(lpLibFileName).filename() == fs::path(callbackStruct.dll).filename())
+ {
+ if (callbackStruct.reliesOn != "" &&
+ std::find(calledTags.begin(), calledTags.end(), callbackStruct.reliesOn) == calledTags.end())
+ {
+ bDoneCalling = false;
+ continue;
+ }
+
+ callbackStruct.callback(moduleAddress);
+ calledTags.push_back(callbackStruct.tag);
+ callbackStruct.called = true;
+ }
+ }
+
+ if (bDoneCalling)
+ break;
+ }
+}
+
+void CallAllPendingDLLLoadCallbacks()
+{
+ HMODULE hMods[1024];
+ HANDLE hProcess = GetCurrentProcess();
+ DWORD cbNeeded;
+ unsigned int i;
+
+ // Get a list of all the modules in this process.
+ if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
+ {
+ for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++)
+ {
+ wchar_t szModName[MAX_PATH];
+
+ // Get the full path to the module's file.
+ if (GetModuleFileNameExW(hProcess, hMods[i], szModName, sizeof(szModName) / sizeof(TCHAR)))
+ {
+ CallLoadLibraryWCallbacks(szModName, hMods[i]);
+ }
+ }
+ }
+}
+
+AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExA, LoadLibraryExA,
+HMODULE, WINAPI, (LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags),
+ {
+ HMODULE moduleAddress = _LoadLibraryExA(lpLibFileName, hFile, dwFlags);
+
+ if (moduleAddress)
+ CallLoadLibraryACallbacks(lpLibFileName, moduleAddress);
+
+ return moduleAddress;
+})
+
+
+AUTOHOOK_ABSOLUTEADDR(_LoadLibraryA, LoadLibraryA,
+HMODULE, WINAPI, (LPCSTR lpLibFileName),
+{
+ HMODULE moduleAddress = _LoadLibraryA(lpLibFileName);
+
+ if (moduleAddress)
+ CallLoadLibraryACallbacks(lpLibFileName, moduleAddress);
+
+ return moduleAddress;
+})
+
+AUTOHOOK_ABSOLUTEADDR(_LoadLibraryExW, LoadLibraryExW,
+HMODULE, WINAPI, (LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags),
+{
+ HMODULE moduleAddress = _LoadLibraryExW(lpLibFileName, hFile, dwFlags);
+
+ if (moduleAddress)
+ CallLoadLibraryWCallbacks(lpLibFileName, moduleAddress);
+
+ return moduleAddress;
+})
+
+AUTOHOOK_ABSOLUTEADDR(_LoadLibraryW, LoadLibraryW,
+HMODULE, WINAPI, (LPCWSTR lpLibFileName),
+{
+ HMODULE moduleAddress = _LoadLibraryW(lpLibFileName);
+
+ if (moduleAddress)
+ CallLoadLibraryWCallbacks(lpLibFileName, moduleAddress);
+
+ return moduleAddress;
+})
+
+void InstallInitialHooks()
+{
+ if (MH_Initialize() != MH_OK)
+ spdlog::error("MH_Initialize (minhook initialization) failed");
+
+ AUTOHOOK_DISPATCH()
+}
\ No newline at end of file
diff --git a/NorthstarDLL/hooks.h b/NorthstarDLL/hooks.h
new file mode 100644
index 00000000..9bb4766d
--- /dev/null
+++ b/NorthstarDLL/hooks.h
@@ -0,0 +1,280 @@
+#pragma once
+#include
+#include
+
+void InstallInitialHooks();
+
+typedef void (*DllLoadCallbackFuncType)(HMODULE moduleAddress);
+void AddDllLoadCallback(std::string dll, DllLoadCallbackFuncType callback, std::string tag = "", std::string reliesOn = "");
+void AddDllLoadCallbackForDedicatedServer(
+ std::string dll, DllLoadCallbackFuncType callback, std::string tag = "", std::string reliesOn = "");
+void AddDllLoadCallbackForClient(std::string dll, DllLoadCallbackFuncType callback, std::string tag = "", std::string reliesOn = "");
+
+void CallAllPendingDLLLoadCallbacks();
+
+// new dll load callback stuff
+enum class eDllLoadCallbackSide
+{
+ UNSIDED,
+ CLIENT,
+ DEDICATED_SERVER
+};
+
+class __dllLoadCallback
+{
+ public:
+ __dllLoadCallback() = delete;
+ __dllLoadCallback(
+ eDllLoadCallbackSide side,
+ const std::string dllName,
+ DllLoadCallbackFuncType callback,
+ std::string uniqueStr,
+ std::string reliesOn);
+};
+
+#define __CONCAT3(x, y, z) x##y##z
+#define CONCAT3(x, y, z) __CONCAT3(x, y, z)
+#define __CONCAT2(x, y) x##y
+#define CONCAT2(x, y) __CONCAT2(x, y)
+#define __STR(s) #s
+
+// adds a callback to be called when a given dll is loaded, for creating hooks and such
+#define __ON_DLL_LOAD(dllName, func, side, uniquestr, reliesOn) \
+namespace { __dllLoadCallback CONCAT2(__dllLoadCallbackInstance, __LINE__)(side, dllName, func, __STR(uniquestr), reliesOn); }
+
+#define ON_DLL_LOAD(dllName, uniquestr, func) __ON_DLL_LOAD(dllName, func, eDllLoadCallbackSide::UNSIDED, uniquestr, "")
+#define ON_DLL_LOAD_RELIESON(dllName, uniquestr, reliesOn, func) __ON_DLL_LOAD(dllName, func, eDllLoadCallbackSide::UNSIDED, uniquestr, __STR(reliesOn))
+#define ON_DLL_LOAD_CLIENT(dllName, uniquestr, func) __ON_DLL_LOAD(dllName, func, eDllLoadCallbackSide::CLIENT, uniquestr, "")
+#define ON_DLL_LOAD_CLIENT_RELIESON(dllName, uniquestr, reliesOn, func) __ON_DLL_LOAD(dllName, func, eDllLoadCallbackSide::CLIENT, uniquestr, __STR(reliesOn))
+#define ON_DLL_LOAD_DEDI(dllName, uniquestr, func) __ON_DLL_LOAD(dllName, func, eDllLoadCallbackSide::DEDICATED_SERVER, uniquestr, "")
+#define ON_DLL_LOAD_DEDI_RELIESON(dllName, uniquestr, reliesOn, func) __ON_DLL_LOAD(dllName, func, eDllLoadCallbackSide::DEDICATED_SERVER, uniquestr, __STR(reliesOn))
+
+// new macro hook stuff
+class __autohook;
+
+class __fileAutohook
+{
+ public:
+ std::vector<__autohook*> hooks;
+
+ void Dispatch();
+ void DispatchForModule(const char* pModuleName);
+};
+
+// initialise autohooks for this file
+#define AUTOHOOK_INIT() \
+namespace { __fileAutohook __FILEAUTOHOOK; } \
+
+// dispatch all autohooks in this file
+#define AUTOHOOK_DISPATCH() \
+__FILEAUTOHOOK.Dispatch(); \
+
+#define AUTOHOOK_DISPATCH_MODULE(moduleName) \
+__FILEAUTOHOOK.DispatchForModule(__STR(moduleName)); \
+
+class __autohook
+{
+ public:
+ enum AddressResolutionMode
+ {
+ OFFSET_STRING, // we're using a string that of the format dllname.dll + offset
+ ABSOLUTE_ADDR, // we're using an absolute address, we don't need to process it at all
+ PROCADDRESS // resolve using GetModuleHandle and GetProcAddress
+ };
+
+ char* pFuncName;
+
+ LPVOID pHookFunc;
+ LPVOID* ppOrigFunc;
+
+ // address resolution props
+ AddressResolutionMode iAddressResolutionMode;
+ char* pAddrString = nullptr; // for OFFSET_STRING
+ LPVOID iAbsoluteAddress = nullptr; // for ABSOLUTE_ADDR
+ char* pModuleName; // for PROCADDRESS
+ char* pProcName; // for PROCADDRESS
+
+ public:
+ __autohook() = delete;
+
+ __autohook(__fileAutohook* autohook, const char* funcName, LPVOID absoluteAddress, LPVOID* orig, LPVOID func)
+ : pHookFunc(func), ppOrigFunc(orig), iAbsoluteAddress(absoluteAddress)
+ {
+ iAddressResolutionMode = ABSOLUTE_ADDR;
+
+ const int iFuncNameStrlen = strlen(funcName) + 1;
+ pFuncName = new char[iFuncNameStrlen];
+ memcpy(pFuncName, funcName, iFuncNameStrlen);
+
+ autohook->hooks.push_back(this);
+ }
+
+ __autohook(__fileAutohook* autohook, const char* funcName, const char* addrString, LPVOID* orig, LPVOID func)
+ : pHookFunc(func), ppOrigFunc(orig)
+ {
+ iAddressResolutionMode = OFFSET_STRING;
+
+ const int iFuncNameStrlen = strlen(funcName) + 1;
+ pFuncName = new char[iFuncNameStrlen];
+ memcpy(pFuncName, funcName, iFuncNameStrlen);
+
+ const int iAddrStrlen = strlen(addrString) + 1;
+ pAddrString = new char[iAddrStrlen];
+ memcpy(pAddrString, addrString, iAddrStrlen);
+
+ autohook->hooks.push_back(this);
+ }
+
+ __autohook(__fileAutohook* autohook, const char* funcName, const char* moduleName, const char* procName, LPVOID* orig, LPVOID func)
+ : pHookFunc(func), ppOrigFunc(orig)
+ {
+ iAddressResolutionMode = PROCADDRESS;
+
+ const int iFuncNameStrlen = strlen(funcName) + 1;
+ pFuncName = new char[iFuncNameStrlen];
+ memcpy(pFuncName, funcName, iFuncNameStrlen);
+
+ const int iModuleNameStrlen = strlen(moduleName) + 1;
+ pModuleName = new char[iModuleNameStrlen];
+ memcpy(pModuleName, moduleName, iModuleNameStrlen);
+
+ const int iProcNameStrlen = strlen(procName) + 1;
+ pProcName = new char[iProcNameStrlen];
+ memcpy(pProcName, procName, iProcNameStrlen);
+
+ autohook->hooks.push_back(this);
+ }
+
+ ~__autohook()
+ {
+ delete[] pFuncName;
+
+ if (pAddrString)
+ delete[] pAddrString;
+
+ if (pModuleName)
+ delete[] pModuleName;
+
+ if (pProcName)
+ delete[] pProcName;
+ }
+
+ void Dispatch()
+ {
+ LPVOID targetAddr = nullptr;
+
+ // determine the address of the function we're hooking
+ switch (iAddressResolutionMode)
+ {
+ case ABSOLUTE_ADDR:
+ {
+ targetAddr = iAbsoluteAddress;
+ break;
+ }
+
+ case OFFSET_STRING:
+ {
+ // in the format server.dll + 0xDEADBEEF
+ int iDllNameEnd = 0;
+ for (; !isspace(pAddrString[iDllNameEnd]) && pAddrString[iDllNameEnd] != '+'; iDllNameEnd++);
+
+ char* pModuleName = new char[iDllNameEnd + 1];
+ memcpy(pModuleName, pAddrString, iDllNameEnd);
+ pModuleName[iDllNameEnd] = '\0';
+
+ // get the module address
+ const HMODULE pModuleAddr = GetModuleHandleA(pModuleName);
+
+ if (!pModuleAddr)
+ break;
+
+ // get the offset string
+ uintptr_t iOffset = 0;
+
+ int iOffsetBegin = iDllNameEnd;
+ int iOffsetEnd = strlen(pAddrString);
+
+ // seek until we hit the start of the number offset
+ for (; !(pAddrString[iOffsetBegin] >= '0' && pAddrString[iOffsetBegin] <= '9') && pAddrString[iOffsetBegin]; iOffsetBegin++);
+
+ bool bIsHex = pAddrString[iOffsetBegin] == '0' && (pAddrString[iOffsetBegin + 1] == 'X' || pAddrString[iOffsetBegin + 1] == 'x');
+ if (bIsHex)
+ iOffset = std::stoi(pAddrString + iOffsetBegin + 2, 0, 16);
+ else
+ iOffset = std::stoi(pAddrString + iOffsetBegin);
+
+ targetAddr = (LPVOID)((uintptr_t)pModuleAddr + iOffset);
+ break;
+ }
+
+ case PROCADDRESS:
+ {
+ targetAddr = GetProcAddress(GetModuleHandleA(pModuleName), pProcName);
+ break;
+ }
+ }
+
+ if (MH_CreateHook(targetAddr, pHookFunc, ppOrigFunc) == MH_OK)
+ {
+ if (MH_EnableHook(targetAddr) == MH_OK)
+ spdlog::info("Enabling hook {}", pFuncName);
+ else
+ spdlog::error("MH_EnableHook failed for function {}", pFuncName);
+ }
+ else
+ spdlog::error("MH_CreateHook failed for function {}", pFuncName);
+ }
+};
+
+// hook a function at a given offset from a dll to be dispatched with AUTOHOOK_DISPATCH()
+#define AUTOHOOK(name, addrString, type, callingConvention, args, func) \
+namespace { \
+type(*callingConvention name) args; \
+type callingConvention CONCAT2(__autohookfunc, name) args func \
+__autohook CONCAT2(__autohook, __LINE__)(&__FILEAUTOHOOK, __STR(name), __STR(addrString), (LPVOID*)&name, (LPVOID)CONCAT2(__autohookfunc, name)); \
+} \
+
+// hook a function at a given absolute constant address to be dispatched with AUTOHOOK_DISPATCH()
+#define AUTOHOOK_ABSOLUTEADDR(name, addr, type, callingConvention, args, func) \
+namespace { \
+type(*callingConvention name) args; \
+type callingConvention CONCAT2(__autohookfunc, name) args func \
+__autohook CONCAT2(__autohook, __LINE__)(&__FILEAUTOHOOK, __STR(name), addr, (LPVOID*)&name, (LPVOID)CONCAT2(__autohookfunc, name)); \
+} \
+
+// hook a function at a given module and exported function to be dispatched with AUTOHOOK_DISPATCH()
+#define AUTOHOOK_PROCADDRESS(name, moduleName, procName, type, callingConvention, args, func) \
+namespace { \
+type(*callingConvention name) args; \
+type callingConvention CONCAT2(__autohookfunc, name) args func \
+__autohook CONCAT2(__autohook, __LINE__)(&__FILEAUTOHOOK, __STR(name), __STR(moduleName), __STR(procName), (LPVOID*)&name, (LPVOID)CONCAT2(__autohookfunc, name)); \
+} \
+
+class ManualHook
+{
+ public:
+ char* pFuncName;
+
+ LPVOID pHookFunc;
+ LPVOID* ppOrigFunc;
+
+ public:
+ ManualHook() = delete;
+ ManualHook(const char* funcName, LPVOID func);
+ ManualHook(const char* funcName, LPVOID* orig, LPVOID func);
+ bool Dispatch(LPVOID addr, LPVOID* orig = nullptr);
+};
+
+// hook a function to be dispatched manually later
+#define HOOK(varName, originalFunc, type, callingConvention, args, func) \
+namespace { \
+type(*callingConvention originalFunc) args; \
+type callingConvention CONCAT2(__manualhookfunc, varName) args func \
+} \
+ManualHook varName = ManualHook(__STR(varName), (LPVOID*)&originalFunc, (LPVOID)CONCAT2(__manualhookfunc, varName)); \
+
+#define HOOK_NOORIG(varName, type, callingConvention, args, func) \
+namespace { \
+type callingConvention CONCAT2(__manualhookfunc, varName) args func \
+} \
+ManualHook varName = ManualHook(__STR(varName), (LPVOID)CONCAT2(__manualhookfunc, varName)); \
\ No newline at end of file
diff --git a/NorthstarDLL/hookutils.cpp b/NorthstarDLL/hookutils.cpp
new file mode 100644
index 00000000..f5df3996
--- /dev/null
+++ b/NorthstarDLL/hookutils.cpp
@@ -0,0 +1,44 @@
+#include "pch.h"
+#include "hookutils.h"
+
+#include
+
+void HookEnabler::CreateHook(LPVOID ppTarget, LPVOID ppDetour, LPVOID* ppOriginal, const char* targetName)
+{
+ // the macro for this uses ppTarget's name as targetName, and this typically starts with &
+ // targetname is used for debug stuff and debug output is nicer if we don't have this
+ if (*targetName == '&')
+ targetName++;
+
+ if (MH_CreateHook(ppTarget, ppDetour, ppOriginal) == MH_OK)
+ {
+ HookTarget* target = new HookTarget;
+ target->targetAddress = ppTarget;
+ target->targetName = (char*)targetName;
+
+ m_hookTargets.push_back(target);
+ }
+ else
+ {
+ if (targetName != nullptr)
+ spdlog::error("MH_CreateHook failed for function {}", targetName);
+ else
+ spdlog::error("MH_CreateHook failed for unknown function");
+ }
+}
+
+HookEnabler::~HookEnabler()
+{
+ for (auto& hook : m_hookTargets)
+ {
+ if (MH_EnableHook(hook->targetAddress) != MH_OK)
+ {
+ if (hook->targetName != nullptr)
+ spdlog::error("MH_EnableHook failed for function {}", hook->targetName);
+ else
+ spdlog::error("MH_EnableHook failed for unknown function");
+ }
+ else
+ spdlog::info("Enabling hook {}", hook->targetName);
+ }
+}
\ No newline at end of file
diff --git a/NorthstarDLL/hookutils.h b/NorthstarDLL/hookutils.h
new file mode 100644
index 00000000..a3846b51
--- /dev/null
+++ b/NorthstarDLL/hookutils.h
@@ -0,0 +1,22 @@
+#pragma once
+#include
+
+// Enables all hooks created with the HookEnabler object when it goes out of scope and handles hook errors
+class HookEnabler
+{
+ private:
+ struct HookTarget
+ {
+ char* targetName;
+ LPVOID targetAddress;
+ };
+
+ std::vector m_hookTargets;
+
+ public:
+ void CreateHook(LPVOID ppTarget, LPVOID ppDetour, LPVOID* ppOriginal, const char* targetName = nullptr);
+ ~HookEnabler();
+};
+
+// macro to call HookEnabler::CreateHook with the hook's name
+#define ENABLER_CREATEHOOK(enabler, ppTarget, ppDetour, ppOriginal) enabler.CreateHook(ppTarget, ppDetour, ppOriginal, #ppDetour)
diff --git a/NorthstarDLL/host.cpp b/NorthstarDLL/host.cpp
new file mode 100644
index 00000000..a1cb65ff
--- /dev/null
+++ b/NorthstarDLL/host.cpp
@@ -0,0 +1,71 @@
+#include "pch.h"
+#include "convar.h"
+#include "modmanager.h"
+#include "printcommand.h"
+#include "printmaps.h"
+#include "r2engine.h"
+
+AUTOHOOK_INIT()
+
+AUTOHOOK(Host_Init, engine.dll + 0x155EA0,
+void,, (bool bDedicated),
+{
+ spdlog::info("Host_Init()");
+ Host_Init(bDedicated);
+
+ // get all mod convars
+ std::vector vModConvarNames;
+ for (auto& mod : g_pModManager->m_loadedMods)
+ for (auto& cvar : mod.ConVars)
+ vModConvarNames.push_back(cvar->Name);
+
+ // strip hidden and devonly cvar flags
+ int iNumCvarsAltered = 0;
+ for (auto& pair : R2::g_pCVar->DumpToMap())
+ {
+ // don't remove from mod cvars
+ if (std::find(vModConvarNames.begin(), vModConvarNames.end(), pair.second->m_pszName) != vModConvarNames.end())
+ continue;
+
+ // strip flags
+ int flags = pair.second->GetFlags();
+ if (flags & FCVAR_DEVELOPMENTONLY)
+ {
+ flags &= ~FCVAR_DEVELOPMENTONLY;
+ iNumCvarsAltered++;
+ }
+
+ if (flags & FCVAR_HIDDEN)
+ {
+ flags &= ~FCVAR_HIDDEN;
+ iNumCvarsAltered++;
+ }
+
+ pair.second->m_nFlags = flags;
+ }
+
+ spdlog::info("Removed {} hidden/devonly cvar flags", iNumCvarsAltered);
+
+ // make servers able to run disconnect on clients
+ R2::g_pCVar->FindCommand("disconnect")->m_nFlags |= FCVAR_SERVER_CAN_EXECUTE;
+
+ // make clients able to run status and ping
+ R2::g_pCVar->FindCommand("status")->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS;
+ R2::g_pCVar->FindCommand("ping")->m_nFlags |= FCVAR_GAMEDLL_FOR_REMOTE_CLIENTS;
+
+ // need to initialise these after host_init since they do stuff to preexisting concommands/convars without being client/server specific
+ InitialiseCommandPrint();
+ InitialiseMapsPrint();
+
+ // client/server autoexecs on necessary platforms
+ // dedi needs autoexec_ns_server on boot, while non-dedi will run it on on listen server start
+ if (bDedicated)
+ R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "exec autoexec_ns_server", R2::cmd_source_t::kCommandSrcCode);
+ else
+ R2::Cbuf_AddText(R2::Cbuf_GetCurrentPlayer(), "exec autoexec_ns_client", R2::cmd_source_t::kCommandSrcCode);
+})
+
+ON_DLL_LOAD("engine.dll", Host_Init, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+})
\ No newline at end of file
diff --git a/NorthstarDLL/hoststate.cpp b/NorthstarDLL/hoststate.cpp
new file mode 100644
index 00000000..c3663a42
--- /dev/null
+++ b/NorthstarDLL/hoststate.cpp
@@ -0,0 +1,99 @@
+#include "pch.h"
+#include "hoststate.h"
+#include "masterserver.h"
+#include "serverauthentication.h"
+#include "playlist.h"
+#include "tier0.h"
+#include "r2engine.h"
+
+AUTOHOOK_INIT()
+
+using namespace R2;
+
+// use the R2 namespace for game funcs
+namespace R2
+{
+ CHostState* g_pHostState;
+} // namespace R2
+
+AUTOHOOK(CHostState__State_NewGame, engine.dll + 0x16E7D0,
+void,, (CHostState* hostState),
+{
+ spdlog::info("HostState: NewGame");
+
+ Cbuf_AddText(Cbuf_GetCurrentPlayer(), "exec autoexec_ns_server", cmd_source_t::kCommandSrcCode);
+ Cbuf_Execute();
+
+ // need to do this to ensure we don't go to private match
+ if (g_ServerAuthenticationManager->m_bNeedLocalAuthForNewgame)
+ SetCurrentPlaylist("tdm");
+
+ // net_data_block_enabled is required for sp, force it if we're on an sp map
+ // sucks for security but just how it be
+ if (!strncmp(g_pHostState->m_levelName, "sp_", 3))
+ g_pCVar->FindVar("net_data_block_enabled")->SetValue(true);
+
+ double dStartTime = Tier0::Plat_FloatTime();
+ CHostState__State_NewGame(hostState);
+ spdlog::info("loading took {}s", Tier0::Plat_FloatTime() - dStartTime);
+
+ int maxPlayers = 6;
+ const char* maxPlayersVar = GetCurrentPlaylistVar("max_players", false);
+ if (maxPlayersVar) // GetCurrentPlaylistVar can return null so protect against this
+ maxPlayers = std::stoi(maxPlayersVar);
+
+ // Copy new server name cvar to source
+ Cvar_hostname->SetValue(Cvar_ns_server_name->GetString());
+
+ g_MasterServerManager->AddSelfToServerList(
+ Cvar_hostport->GetInt(),
+ Cvar_ns_player_auth_port->GetInt(),
+ Cvar_ns_server_name->GetString(),
+ Cvar_ns_server_desc->GetString(),
+ hostState->m_levelName,
+ GetCurrentPlaylistName(),
+ maxPlayers,
+ Cvar_ns_server_password->GetString());
+ g_ServerAuthenticationManager->StartPlayerAuthServer();
+ g_ServerAuthenticationManager->m_bNeedLocalAuthForNewgame = false;
+})
+
+AUTOHOOK(CHostState__State_ChangeLevelMP, engine.dll + 0x16E520,
+void,, (CHostState* hostState),
+{
+ spdlog::info("HostState: ChangeLevelMP");
+
+ int maxPlayers = 6;
+ const char* maxPlayersVar = GetCurrentPlaylistVar("max_players", false);
+ if (maxPlayersVar) // GetCurrentPlaylistVar can return null so protect against this
+ maxPlayers = std::stoi(maxPlayersVar);
+
+ // net_data_block_enabled is required for sp, force it if we're on an sp map
+ // sucks for security but just how it be
+ if (!strncmp(g_pHostState->m_levelName, "sp_", 3))
+ g_pCVar->FindVar("net_data_block_enabled")->SetValue(true);
+
+ g_MasterServerManager->UpdateServerMapAndPlaylist(hostState->m_levelName, GetCurrentPlaylistName(), maxPlayers);
+
+ double dStartTime = Tier0::Plat_FloatTime();
+ CHostState__State_ChangeLevelMP(hostState);
+ spdlog::info("loading took {}s", Tier0::Plat_FloatTime() - dStartTime);
+})
+
+AUTOHOOK(CHostState__State_GameShutdown, engine.dll + 0x16E520,
+void,, (CHostState* hostState),
+{
+ spdlog::info("HostState: GameShutdown");
+
+ g_MasterServerManager->RemoveSelfFromServerList();
+ g_ServerAuthenticationManager->StopPlayerAuthServer();
+
+ CHostState__State_GameShutdown(hostState);
+})
+
+ON_DLL_LOAD_RELIESON("engine.dll", HostState, ConVar, [](HMODULE baseAddress)
+{
+ AUTOHOOK_DISPATCH()
+
+ g_pHostState = (CHostState*)((char*)baseAddress + 0x7CF180);
+})
\ No newline at end of file
diff --git a/NorthstarDLL/hoststate.h b/NorthstarDLL/hoststate.h
new file mode 100644
index 00000000..a77385ef
--- /dev/null
+++ b/NorthstarDLL/hoststate.h
@@ -0,0 +1,45 @@
+#pragma once
+
+// use the R2 namespace for game funxcs
+namespace R2
+{
+ enum class HostState_t
+ {
+ HS_NEW_GAME = 0,
+ HS_LOAD_GAME,
+ HS_CHANGE_LEVEL_SP,
+ HS_CHANGE_LEVEL_MP,
+ HS_RUN,
+ HS_GAME_SHUTDOWN,
+ HS_SHUTDOWN,
+ HS_RESTART,
+ };
+
+ struct CHostState
+ {
+ public:
+ HostState_t m_iCurrentState;
+ HostState_t m_iNextState;
+
+ float m_vecLocation[3];
+ float m_angLocation[3];
+
+ char m_levelName[32];
+ char m_mapGroupName[32];
+ char m_landmarkName[32];
+ char m_saveName[32];
+ float m_flShortFrameTime; // run a few one-tick frames to avoid large timesteps while loading assets
+
+ bool m_activeGame;
+ bool m_bRememberLocation;
+ bool m_bBackgroundLevel;
+ bool m_bWaitingForConnection;
+ bool m_bLetToolsOverrideLoadGameEnts; // During a load game, this tells Foundry to override ents that are selected in Hammer.
+ bool m_bSplitScreenConnect;
+ bool m_bGameHasShutDownAndFlushedMemory; // This is false once we load a map into memory, and set to true once the map is unloaded
+ // and all memory flushed
+ bool m_bWorkshopMapDownloadPending;
+ };
+
+ extern CHostState* g_pHostState;
+} // namespace R2
diff --git a/NorthstarDLL/include/MinHook.h b/NorthstarDLL/include/MinHook.h
new file mode 100644
index 00000000..15c0a875
--- /dev/null
+++ b/NorthstarDLL/include/MinHook.h
@@ -0,0 +1,186 @@
+/*
+ * MinHook - The Minimalistic API Hooking Library for x64/x86
+ * Copyright (C) 2009-2017 Tsuda Kageyu.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__)
+ #error MinHook supports only x86 and x64 systems.
+#endif
+
+#include
+
+// MinHook Error Codes.
+typedef enum MH_STATUS
+{
+ // Unknown error. Should not be returned.
+ MH_UNKNOWN = -1,
+
+ // Successful.
+ MH_OK = 0,
+
+ // MinHook is already initialized.
+ MH_ERROR_ALREADY_INITIALIZED,
+
+ // MinHook is not initialized yet, or already uninitialized.
+ MH_ERROR_NOT_INITIALIZED,
+
+ // The hook for the specified target function is already created.
+ MH_ERROR_ALREADY_CREATED,
+
+ // The hook for the specified target function is not created yet.
+ MH_ERROR_NOT_CREATED,
+
+ // The hook for the specified target function is already enabled.
+ MH_ERROR_ENABLED,
+
+ // The hook for the specified target function is not enabled yet, or already
+ // disabled.
+ MH_ERROR_DISABLED,
+
+ // The specified pointer is invalid. It points the address of non-allocated
+ // and/or non-executable region.
+ MH_ERROR_NOT_EXECUTABLE,
+
+ // The specified target function cannot be hooked.
+ MH_ERROR_UNSUPPORTED_FUNCTION,
+
+ // Failed to allocate memory.
+ MH_ERROR_MEMORY_ALLOC,
+
+ // Failed to change the memory protection.
+ MH_ERROR_MEMORY_PROTECT,
+
+ // The specified module is not loaded.
+ MH_ERROR_MODULE_NOT_FOUND,
+
+ // The specified function is not found.
+ MH_ERROR_FUNCTION_NOT_FOUND
+}
+MH_STATUS;
+
+// Can be passed as a parameter to MH_EnableHook, MH_DisableHook,
+// MH_QueueEnableHook or MH_QueueDisableHook.
+#define MH_ALL_HOOKS NULL
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ // Initialize the MinHook library. You must call this function EXACTLY ONCE
+ // at the beginning of your program.
+ MH_STATUS WINAPI MH_Initialize(VOID);
+
+ // Uninitialize the MinHook library. You must call this function EXACTLY
+ // ONCE at the end of your program.
+ MH_STATUS WINAPI MH_Uninitialize(VOID);
+
+ // Creates a Hook for the specified target function, in disabled state.
+ // Parameters:
+ // pTarget [in] A pointer to the target function, which will be
+ // overridden by the detour function.
+ // pDetour [in] A pointer to the detour function, which will override
+ // the target function.
+ // ppOriginal [out] A pointer to the trampoline function, which will be
+ // used to call the original target function.
+ // This parameter can be NULL.
+ MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);
+
+ // Creates a Hook for the specified API function, in disabled state.
+ // Parameters:
+ // pszModule [in] A pointer to the loaded module name which contains the
+ // target function.
+ // pszTarget [in] A pointer to the target function name, which will be
+ // overridden by the detour function.
+ // pDetour [in] A pointer to the detour function, which will override
+ // the target function.
+ // ppOriginal [out] A pointer to the trampoline function, which will be
+ // used to call the original target function.
+ // This parameter can be NULL.
+ MH_STATUS WINAPI MH_CreateHookApi(
+ LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal);
+
+ // Creates a Hook for the specified API function, in disabled state.
+ // Parameters:
+ // pszModule [in] A pointer to the loaded module name which contains the
+ // target function.
+ // pszTarget [in] A pointer to the target function name, which will be
+ // overridden by the detour function.
+ // pDetour [in] A pointer to the detour function, which will override
+ // the target function.
+ // ppOriginal [out] A pointer to the trampoline function, which will be
+ // used to call the original target function.
+ // This parameter can be NULL.
+ // ppTarget [out] A pointer to the target function, which will be used
+ // with other functions.
+ // This parameter can be NULL.
+ MH_STATUS WINAPI MH_CreateHookApiEx(
+ LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget);
+
+ // Removes an already created hook.
+ // Parameters:
+ // pTarget [in] A pointer to the target function.
+ MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);
+
+ // Enables an already created hook.
+ // Parameters:
+ // pTarget [in] A pointer to the target function.
+ // If this parameter is MH_ALL_HOOKS, all created hooks are
+ // enabled in one go.
+ MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);
+
+ // Disables an already created hook.
+ // Parameters:
+ // pTarget [in] A pointer to the target function.
+ // If this parameter is MH_ALL_HOOKS, all created hooks are
+ // disabled in one go.
+ MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);
+
+ // Queues to enable an already created hook.
+ // Parameters:
+ // pTarget [in] A pointer to the target function.
+ // If this parameter is MH_ALL_HOOKS, all created hooks are
+ // queued to be enabled.
+ MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);
+
+ // Queues to disable an already created hook.
+ // Parameters:
+ // pTarget [in] A pointer to the target function.
+ // If this parameter is MH_ALL_HOOKS, all created hooks are
+ // queued to be disabled.
+ MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);
+
+ // Applies all queued changes in one go.
+ MH_STATUS WINAPI MH_ApplyQueued(VOID);
+
+ // Translates the MH_STATUS to its name as a string.
+ const char * WINAPI MH_StatusToString(MH_STATUS status);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/NorthstarDLL/include/MinHook.x64.lib b/NorthstarDLL/include/MinHook.x64.lib
new file mode 100644
index 00000000..213df08f
Binary files /dev/null and b/NorthstarDLL/include/MinHook.x64.lib differ
diff --git a/NorthstarDLL/include/crypto/__DECC_INCLUDE_EPILOGUE.H b/NorthstarDLL/include/crypto/__DECC_INCLUDE_EPILOGUE.H
new file mode 100644
index 00000000..e57c0eab
--- /dev/null
+++ b/NorthstarDLL/include/crypto/__DECC_INCLUDE_EPILOGUE.H
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * This file is only used by HP C on VMS, and is included automatically
+ * after each header file from this directory
+ */
+
+/* restore state. Must correspond to the save in __decc_include_prologue.h */
+#pragma names restore
diff --git a/NorthstarDLL/include/crypto/__DECC_INCLUDE_PROLOGUE.H b/NorthstarDLL/include/crypto/__DECC_INCLUDE_PROLOGUE.H
new file mode 100644
index 00000000..a0139575
--- /dev/null
+++ b/NorthstarDLL/include/crypto/__DECC_INCLUDE_PROLOGUE.H
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * This file is only used by HP C on VMS, and is included automatically
+ * after each header file from this directory
+ */
+
+/* save state */
+#pragma names save
+/* have the compiler shorten symbols larger than 31 chars to 23 chars
+ * followed by a 8 hex char CRC
+ */
+#pragma names as_is,shortened
diff --git a/NorthstarDLL/include/crypto/aes_platform.h b/NorthstarDLL/include/crypto/aes_platform.h
new file mode 100644
index 00000000..e95ad5aa
--- /dev/null
+++ b/NorthstarDLL/include/crypto/aes_platform.h
@@ -0,0 +1,450 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_AES_PLATFORM_H
+# define OSSL_AES_PLATFORM_H
+# pragma once
+
+# include
+
+# ifdef VPAES_ASM
+int vpaes_set_encrypt_key(const unsigned char *userKey, int bits,
+ AES_KEY *key);
+int vpaes_set_decrypt_key(const unsigned char *userKey, int bits,
+ AES_KEY *key);
+void vpaes_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void vpaes_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void vpaes_cbc_encrypt(const unsigned char *in,
+ unsigned char *out,
+ size_t length,
+ const AES_KEY *key, unsigned char *ivec, int enc);
+# endif /* VPAES_ASM */
+
+# ifdef BSAES_ASM
+void ossl_bsaes_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char ivec[16], int enc);
+void ossl_bsaes_ctr32_encrypt_blocks(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const AES_KEY *key,
+ const unsigned char ivec[16]);
+void ossl_bsaes_xts_encrypt(const unsigned char *inp, unsigned char *out,
+ size_t len, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char iv[16]);
+void ossl_bsaes_xts_decrypt(const unsigned char *inp, unsigned char *out,
+ size_t len, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char iv[16]);
+# endif /* BSAES_ASM */
+
+# ifdef AES_CTR_ASM
+void AES_ctr32_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key,
+ const unsigned char ivec[AES_BLOCK_SIZE]);
+# endif /* AES_CTR_ASM */
+
+# ifdef AES_XTS_ASM
+void AES_xts_encrypt(const unsigned char *inp, unsigned char *out, size_t len,
+ const AES_KEY *key1, const AES_KEY *key2,
+ const unsigned char iv[16]);
+void AES_xts_decrypt(const unsigned char *inp, unsigned char *out, size_t len,
+ const AES_KEY *key1, const AES_KEY *key2,
+ const unsigned char iv[16]);
+# endif /* AES_XTS_ASM */
+
+# if defined(OPENSSL_CPUID_OBJ)
+# if (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC))
+# include "crypto/ppc_arch.h"
+# ifdef VPAES_ASM
+# define VPAES_CAPABLE (OPENSSL_ppccap_P & PPC_ALTIVEC)
+# endif
+# define HWAES_CAPABLE (OPENSSL_ppccap_P & PPC_CRYPTO207)
+# define HWAES_set_encrypt_key aes_p8_set_encrypt_key
+# define HWAES_set_decrypt_key aes_p8_set_decrypt_key
+# define HWAES_encrypt aes_p8_encrypt
+# define HWAES_decrypt aes_p8_decrypt
+# define HWAES_cbc_encrypt aes_p8_cbc_encrypt
+# define HWAES_ctr32_encrypt_blocks aes_p8_ctr32_encrypt_blocks
+# define HWAES_xts_encrypt aes_p8_xts_encrypt
+# define HWAES_xts_decrypt aes_p8_xts_decrypt
+# endif /* PPC */
+
+# if (defined(__arm__) || defined(__arm) || defined(__aarch64__))
+# include "arm_arch.h"
+# if __ARM_MAX_ARCH__>=7
+# if defined(BSAES_ASM)
+# define BSAES_CAPABLE (OPENSSL_armcap_P & ARMV7_NEON)
+# endif
+# if defined(VPAES_ASM)
+# define VPAES_CAPABLE (OPENSSL_armcap_P & ARMV7_NEON)
+# endif
+# define HWAES_CAPABLE (OPENSSL_armcap_P & ARMV8_AES)
+# define HWAES_set_encrypt_key aes_v8_set_encrypt_key
+# define HWAES_set_decrypt_key aes_v8_set_decrypt_key
+# define HWAES_encrypt aes_v8_encrypt
+# define HWAES_decrypt aes_v8_decrypt
+# define HWAES_cbc_encrypt aes_v8_cbc_encrypt
+# define HWAES_ecb_encrypt aes_v8_ecb_encrypt
+# if __ARM_MAX_ARCH__>=8 && defined(__aarch64__)
+# define HWAES_xts_encrypt aes_v8_xts_encrypt
+# define HWAES_xts_decrypt aes_v8_xts_decrypt
+# endif
+# define HWAES_ctr32_encrypt_blocks aes_v8_ctr32_encrypt_blocks
+# define AES_PMULL_CAPABLE ((OPENSSL_armcap_P & ARMV8_PMULL) && (OPENSSL_armcap_P & ARMV8_AES))
+# define AES_GCM_ENC_BYTES 512
+# define AES_GCM_DEC_BYTES 512
+# if __ARM_MAX_ARCH__>=8 && defined(__aarch64__)
+# define AES_gcm_encrypt armv8_aes_gcm_encrypt
+# define AES_gcm_decrypt armv8_aes_gcm_decrypt
+# define AES_GCM_ASM(gctx) ((gctx)->ctr==aes_v8_ctr32_encrypt_blocks && \
+ (gctx)->gcm.ghash==gcm_ghash_v8)
+size_t aes_gcm_enc_128_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+ uint64_t *Xi, unsigned char ivec[16], const void *key);
+size_t aes_gcm_enc_192_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+ uint64_t *Xi, unsigned char ivec[16], const void *key);
+size_t aes_gcm_enc_256_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+ uint64_t *Xi, unsigned char ivec[16], const void *key);
+size_t aes_gcm_dec_128_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+ uint64_t *Xi, unsigned char ivec[16], const void *key);
+size_t aes_gcm_dec_192_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+ uint64_t *Xi, unsigned char ivec[16], const void *key);
+size_t aes_gcm_dec_256_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+ uint64_t *Xi, unsigned char ivec[16], const void *key);
+size_t armv8_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len, const void *key,
+ unsigned char ivec[16], u64 *Xi);
+size_t armv8_aes_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len, const void *key,
+ unsigned char ivec[16], u64 *Xi);
+void gcm_ghash_v8(u64 Xi[2],const u128 Htable[16],const u8 *inp, size_t len);
+# endif
+# endif
+# endif
+# endif /* OPENSSL_CPUID_OBJ */
+
+# if defined(AES_ASM) && ( \
+ defined(__x86_64) || defined(__x86_64__) || \
+ defined(_M_AMD64) || defined(_M_X64) )
+# define AES_CBC_HMAC_SHA_CAPABLE 1
+# define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
+# endif
+
+# if defined(AES_ASM) && !defined(I386_ONLY) && ( \
+ ((defined(__i386) || defined(__i386__) || \
+ defined(_M_IX86)) && defined(OPENSSL_IA32_SSE2))|| \
+ defined(__x86_64) || defined(__x86_64__) || \
+ defined(_M_AMD64) || defined(_M_X64) )
+
+/* AES-NI section */
+
+# define AESNI_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32)))
+# ifdef VPAES_ASM
+# define VPAES_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(41-32)))
+# endif
+# ifdef BSAES_ASM
+# define BSAES_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(41-32)))
+# endif
+
+# define AES_GCM_ENC_BYTES 32
+# define AES_GCM_DEC_BYTES 16
+
+int aesni_set_encrypt_key(const unsigned char *userKey, int bits,
+ AES_KEY *key);
+int aesni_set_decrypt_key(const unsigned char *userKey, int bits,
+ AES_KEY *key);
+
+void aesni_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void aesni_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+
+void aesni_ecb_encrypt(const unsigned char *in,
+ unsigned char *out,
+ size_t length, const AES_KEY *key, int enc);
+void aesni_cbc_encrypt(const unsigned char *in,
+ unsigned char *out,
+ size_t length,
+ const AES_KEY *key, unsigned char *ivec, int enc);
+# ifndef OPENSSL_NO_OCB
+void aesni_ocb_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ size_t start_block_num,
+ unsigned char offset_i[16],
+ const unsigned char L_[][16],
+ unsigned char checksum[16]);
+void aesni_ocb_decrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ size_t start_block_num,
+ unsigned char offset_i[16],
+ const unsigned char L_[][16],
+ unsigned char checksum[16]);
+# endif /* OPENSSL_NO_OCB */
+
+void aesni_ctr32_encrypt_blocks(const unsigned char *in,
+ unsigned char *out,
+ size_t blocks,
+ const void *key, const unsigned char *ivec);
+
+void aesni_xts_encrypt(const unsigned char *in,
+ unsigned char *out,
+ size_t length,
+ const AES_KEY *key1, const AES_KEY *key2,
+ const unsigned char iv[16]);
+
+void aesni_xts_decrypt(const unsigned char *in,
+ unsigned char *out,
+ size_t length,
+ const AES_KEY *key1, const AES_KEY *key2,
+ const unsigned char iv[16]);
+
+void aesni_ccm64_encrypt_blocks(const unsigned char *in,
+ unsigned char *out,
+ size_t blocks,
+ const void *key,
+ const unsigned char ivec[16],
+ unsigned char cmac[16]);
+
+void aesni_ccm64_decrypt_blocks(const unsigned char *in,
+ unsigned char *out,
+ size_t blocks,
+ const void *key,
+ const unsigned char ivec[16],
+ unsigned char cmac[16]);
+
+# if defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
+size_t aesni_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len,
+ const void *key, unsigned char ivec[16], u64 *Xi);
+size_t aesni_gcm_decrypt(const unsigned char *in, unsigned char *out, size_t len,
+ const void *key, unsigned char ivec[16], u64 *Xi);
+void gcm_ghash_avx(u64 Xi[2], const u128 Htable[16], const u8 *in, size_t len);
+
+# define AES_gcm_encrypt aesni_gcm_encrypt
+# define AES_gcm_decrypt aesni_gcm_decrypt
+# define AES_GCM_ASM(ctx) (ctx->ctr == aesni_ctr32_encrypt_blocks && \
+ ctx->gcm.ghash == gcm_ghash_avx)
+# endif
+
+
+# elif defined(AES_ASM) && (defined(__sparc) || defined(__sparc__))
+
+/* Fujitsu SPARC64 X support */
+# include "crypto/sparc_arch.h"
+
+# define SPARC_AES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_AES)
+# define HWAES_CAPABLE (OPENSSL_sparcv9cap_P[0] & SPARCV9_FJAESX)
+# define HWAES_set_encrypt_key aes_fx_set_encrypt_key
+# define HWAES_set_decrypt_key aes_fx_set_decrypt_key
+# define HWAES_encrypt aes_fx_encrypt
+# define HWAES_decrypt aes_fx_decrypt
+# define HWAES_cbc_encrypt aes_fx_cbc_encrypt
+# define HWAES_ctr32_encrypt_blocks aes_fx_ctr32_encrypt_blocks
+
+void aes_t4_set_encrypt_key(const unsigned char *key, int bits, AES_KEY *ks);
+void aes_t4_set_decrypt_key(const unsigned char *key, int bits, AES_KEY *ks);
+void aes_t4_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void aes_t4_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+/*
+ * Key-length specific subroutines were chosen for following reason.
+ * Each SPARC T4 core can execute up to 8 threads which share core's
+ * resources. Loading as much key material to registers allows to
+ * minimize references to shared memory interface, as well as amount
+ * of instructions in inner loops [much needed on T4]. But then having
+ * non-key-length specific routines would require conditional branches
+ * either in inner loops or on subroutines' entries. Former is hardly
+ * acceptable, while latter means code size increase to size occupied
+ * by multiple key-length specific subroutines, so why fight?
+ */
+void aes128_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void aes128_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void aes192_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void aes192_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void aes256_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void aes256_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void aes128_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key,
+ unsigned char *ivec);
+void aes192_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key,
+ unsigned char *ivec);
+void aes256_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key,
+ unsigned char *ivec);
+void aes128_t4_xts_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char *ivec);
+void aes128_t4_xts_decrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char *ivec);
+void aes256_t4_xts_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char *ivec);
+void aes256_t4_xts_decrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char *ivec);
+
+# elif defined(OPENSSL_CPUID_OBJ) && defined(__s390__)
+/* IBM S390X support */
+# include "s390x_arch.h"
+
+
+/* Convert key size to function code: [16,24,32] -> [18,19,20]. */
+# define S390X_AES_FC(keylen) (S390X_AES_128 + ((((keylen) << 3) - 128) >> 6))
+
+/* Most modes of operation need km for partial block processing. */
+# define S390X_aes_128_CAPABLE (OPENSSL_s390xcap_P.km[0] & \
+ S390X_CAPBIT(S390X_AES_128))
+# define S390X_aes_192_CAPABLE (OPENSSL_s390xcap_P.km[0] & \
+ S390X_CAPBIT(S390X_AES_192))
+# define S390X_aes_256_CAPABLE (OPENSSL_s390xcap_P.km[0] & \
+ S390X_CAPBIT(S390X_AES_256))
+
+# define S390X_aes_128_cbc_CAPABLE 1 /* checked by callee */
+# define S390X_aes_192_cbc_CAPABLE 1
+# define S390X_aes_256_cbc_CAPABLE 1
+
+# define S390X_aes_128_ecb_CAPABLE S390X_aes_128_CAPABLE
+# define S390X_aes_192_ecb_CAPABLE S390X_aes_192_CAPABLE
+# define S390X_aes_256_ecb_CAPABLE S390X_aes_256_CAPABLE
+
+# define S390X_aes_128_ofb_CAPABLE (S390X_aes_128_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmo[0] & \
+ S390X_CAPBIT(S390X_AES_128)))
+# define S390X_aes_192_ofb_CAPABLE (S390X_aes_192_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmo[0] & \
+ S390X_CAPBIT(S390X_AES_192)))
+# define S390X_aes_256_ofb_CAPABLE (S390X_aes_256_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmo[0] & \
+ S390X_CAPBIT(S390X_AES_256)))
+
+# define S390X_aes_128_cfb_CAPABLE (S390X_aes_128_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmf[0] & \
+ S390X_CAPBIT(S390X_AES_128)))
+# define S390X_aes_192_cfb_CAPABLE (S390X_aes_192_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmf[0] & \
+ S390X_CAPBIT(S390X_AES_192)))
+# define S390X_aes_256_cfb_CAPABLE (S390X_aes_256_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmf[0] & \
+ S390X_CAPBIT(S390X_AES_256)))
+# define S390X_aes_128_cfb8_CAPABLE (OPENSSL_s390xcap_P.kmf[0] & \
+ S390X_CAPBIT(S390X_AES_128))
+# define S390X_aes_192_cfb8_CAPABLE (OPENSSL_s390xcap_P.kmf[0] & \
+ S390X_CAPBIT(S390X_AES_192))
+# define S390X_aes_256_cfb8_CAPABLE (OPENSSL_s390xcap_P.kmf[0] & \
+ S390X_CAPBIT(S390X_AES_256))
+# define S390X_aes_128_cfb1_CAPABLE 0
+# define S390X_aes_192_cfb1_CAPABLE 0
+# define S390X_aes_256_cfb1_CAPABLE 0
+
+# define S390X_aes_128_ctr_CAPABLE 1 /* checked by callee */
+# define S390X_aes_192_ctr_CAPABLE 1
+# define S390X_aes_256_ctr_CAPABLE 1
+
+# define S390X_aes_128_xts_CAPABLE 1 /* checked by callee */
+# define S390X_aes_256_xts_CAPABLE 1
+
+# define S390X_aes_128_gcm_CAPABLE (S390X_aes_128_CAPABLE && \
+ (OPENSSL_s390xcap_P.kma[0] & \
+ S390X_CAPBIT(S390X_AES_128)))
+# define S390X_aes_192_gcm_CAPABLE (S390X_aes_192_CAPABLE && \
+ (OPENSSL_s390xcap_P.kma[0] & \
+ S390X_CAPBIT(S390X_AES_192)))
+# define S390X_aes_256_gcm_CAPABLE (S390X_aes_256_CAPABLE && \
+ (OPENSSL_s390xcap_P.kma[0] & \
+ S390X_CAPBIT(S390X_AES_256)))
+
+# define S390X_aes_128_ccm_CAPABLE (S390X_aes_128_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmac[0] & \
+ S390X_CAPBIT(S390X_AES_128)))
+# define S390X_aes_192_ccm_CAPABLE (S390X_aes_192_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmac[0] & \
+ S390X_CAPBIT(S390X_AES_192)))
+# define S390X_aes_256_ccm_CAPABLE (S390X_aes_256_CAPABLE && \
+ (OPENSSL_s390xcap_P.kmac[0] & \
+ S390X_CAPBIT(S390X_AES_256)))
+# define S390X_CCM_AAD_FLAG 0x40
+
+# ifndef OPENSSL_NO_OCB
+# define S390X_aes_128_ocb_CAPABLE 0
+# define S390X_aes_192_ocb_CAPABLE 0
+# define S390X_aes_256_ocb_CAPABLE 0
+# endif /* OPENSSL_NO_OCB */
+
+# ifndef OPENSSL_NO_SIV
+# define S390X_aes_128_siv_CAPABLE 0
+# define S390X_aes_192_siv_CAPABLE 0
+# define S390X_aes_256_siv_CAPABLE 0
+# endif /* OPENSSL_NO_SIV */
+
+/* Convert key size to function code: [16,24,32] -> [18,19,20]. */
+# define S390X_AES_FC(keylen) (S390X_AES_128 + ((((keylen) << 3) - 128) >> 6))
+# endif
+
+# if defined(HWAES_CAPABLE)
+int HWAES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int HWAES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+void HWAES_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void HWAES_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void HWAES_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+void HWAES_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ const int enc);
+void HWAES_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ const unsigned char ivec[16]);
+void HWAES_xts_encrypt(const unsigned char *inp, unsigned char *out,
+ size_t len, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char iv[16]);
+void HWAES_xts_decrypt(const unsigned char *inp, unsigned char *out,
+ size_t len, const AES_KEY *key1,
+ const AES_KEY *key2, const unsigned char iv[16]);
+# ifndef OPENSSL_NO_OCB
+# ifdef HWAES_ocb_encrypt
+void HWAES_ocb_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ size_t start_block_num,
+ unsigned char offset_i[16],
+ const unsigned char L_[][16],
+ unsigned char checksum[16]);
+# else
+# define HWAES_ocb_encrypt ((ocb128_f)NULL)
+# endif
+# ifdef HWAES_ocb_decrypt
+void HWAES_ocb_decrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ size_t start_block_num,
+ unsigned char offset_i[16],
+ const unsigned char L_[][16],
+ unsigned char checksum[16]);
+# else
+# define HWAES_ocb_decrypt ((ocb128_f)NULL)
+# endif
+# endif /* OPENSSL_NO_OCB */
+
+# endif /* HWAES_CAPABLE */
+
+#endif /* OSSL_AES_PLATFORM_H */
diff --git a/NorthstarDLL/include/crypto/aria.h b/NorthstarDLL/include/crypto/aria.h
new file mode 100644
index 00000000..21a9932e
--- /dev/null
+++ b/NorthstarDLL/include/crypto/aria.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+ /* Copyright (c) 2017 National Security Research Institute. All rights reserved. */
+
+#ifndef OSSL_CRYPTO_ARIA_H
+# define OSSL_CRYPTO_ARIA_H
+# pragma once
+
+# include
+
+# ifdef OPENSSL_NO_ARIA
+# error ARIA is disabled.
+# endif
+
+# define ARIA_ENCRYPT 1
+# define ARIA_DECRYPT 0
+
+# define ARIA_BLOCK_SIZE 16 /* Size of each encryption/decryption block */
+# define ARIA_MAX_KEYS 17 /* Number of keys needed in the worst case */
+
+typedef union {
+ unsigned char c[ARIA_BLOCK_SIZE];
+ unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)];
+} ARIA_u128;
+
+typedef unsigned char ARIA_c128[ARIA_BLOCK_SIZE];
+
+struct aria_key_st {
+ ARIA_u128 rd_key[ARIA_MAX_KEYS];
+ unsigned int rounds;
+};
+typedef struct aria_key_st ARIA_KEY;
+
+
+int ossl_aria_set_encrypt_key(const unsigned char *userKey, const int bits,
+ ARIA_KEY *key);
+int ossl_aria_set_decrypt_key(const unsigned char *userKey, const int bits,
+ ARIA_KEY *key);
+
+void ossl_aria_encrypt(const unsigned char *in, unsigned char *out,
+ const ARIA_KEY *key);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/asn1.h b/NorthstarDLL/include/crypto/asn1.h
new file mode 100644
index 00000000..ec76ae6f
--- /dev/null
+++ b/NorthstarDLL/include/crypto/asn1.h
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ASN1_H
+# define OSSL_CRYPTO_ASN1_H
+# pragma once
+
+# include
+# include /* OSSL_FUNC_keymgmt_import() */
+
+/* Internal ASN1 structures and functions: not for application use */
+
+/* ASN1 public key method structure */
+
+#include
+
+struct evp_pkey_asn1_method_st {
+ int pkey_id;
+ int pkey_base_id;
+ unsigned long pkey_flags;
+ char *pem_str;
+ char *info;
+ int (*pub_decode) (EVP_PKEY *pk, const X509_PUBKEY *pub);
+ int (*pub_encode) (X509_PUBKEY *pub, const EVP_PKEY *pk);
+ int (*pub_cmp) (const EVP_PKEY *a, const EVP_PKEY *b);
+ int (*pub_print) (BIO *out, const EVP_PKEY *pkey, int indent,
+ ASN1_PCTX *pctx);
+ int (*priv_decode) (EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf);
+ int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk);
+ int (*priv_print) (BIO *out, const EVP_PKEY *pkey, int indent,
+ ASN1_PCTX *pctx);
+ int (*pkey_size) (const EVP_PKEY *pk);
+ int (*pkey_bits) (const EVP_PKEY *pk);
+ int (*pkey_security_bits) (const EVP_PKEY *pk);
+ int (*param_decode) (EVP_PKEY *pkey,
+ const unsigned char **pder, int derlen);
+ int (*param_encode) (const EVP_PKEY *pkey, unsigned char **pder);
+ int (*param_missing) (const EVP_PKEY *pk);
+ int (*param_copy) (EVP_PKEY *to, const EVP_PKEY *from);
+ int (*param_cmp) (const EVP_PKEY *a, const EVP_PKEY *b);
+ int (*param_print) (BIO *out, const EVP_PKEY *pkey, int indent,
+ ASN1_PCTX *pctx);
+ int (*sig_print) (BIO *out,
+ const X509_ALGOR *sigalg, const ASN1_STRING *sig,
+ int indent, ASN1_PCTX *pctx);
+ void (*pkey_free) (EVP_PKEY *pkey);
+ int (*pkey_ctrl) (EVP_PKEY *pkey, int op, long arg1, void *arg2);
+ /* Legacy functions for old PEM */
+ int (*old_priv_decode) (EVP_PKEY *pkey,
+ const unsigned char **pder, int derlen);
+ int (*old_priv_encode) (const EVP_PKEY *pkey, unsigned char **pder);
+ /* Custom ASN1 signature verification */
+ int (*item_verify) (EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *data,
+ const X509_ALGOR *a, const ASN1_BIT_STRING *sig,
+ EVP_PKEY *pkey);
+ int (*item_sign) (EVP_MD_CTX *ctx, const ASN1_ITEM *it, const void *data,
+ X509_ALGOR *alg1, X509_ALGOR *alg2,
+ ASN1_BIT_STRING *sig);
+ int (*siginf_set) (X509_SIG_INFO *siginf, const X509_ALGOR *alg,
+ const ASN1_STRING *sig);
+ /* Check */
+ int (*pkey_check) (const EVP_PKEY *pk);
+ int (*pkey_public_check) (const EVP_PKEY *pk);
+ int (*pkey_param_check) (const EVP_PKEY *pk);
+ /* Get/set raw private/public key data */
+ int (*set_priv_key) (EVP_PKEY *pk, const unsigned char *priv, size_t len);
+ int (*set_pub_key) (EVP_PKEY *pk, const unsigned char *pub, size_t len);
+ int (*get_priv_key) (const EVP_PKEY *pk, unsigned char *priv, size_t *len);
+ int (*get_pub_key) (const EVP_PKEY *pk, unsigned char *pub, size_t *len);
+
+ /* Exports and imports to / from providers */
+ size_t (*dirty_cnt) (const EVP_PKEY *pk);
+ int (*export_to) (const EVP_PKEY *pk, void *to_keydata,
+ OSSL_FUNC_keymgmt_import_fn *importer,
+ OSSL_LIB_CTX *libctx, const char *propq);
+ OSSL_CALLBACK *import_from;
+ int (*copy) (EVP_PKEY *to, EVP_PKEY *from);
+
+ int (*priv_decode_ex) (EVP_PKEY *pk,
+ const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx,
+ const char *propq);
+} /* EVP_PKEY_ASN1_METHOD */ ;
+
+DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD)
+
+extern const EVP_PKEY_ASN1_METHOD ossl_dh_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_dhx_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_dsa_asn1_meths[5];
+extern const EVP_PKEY_ASN1_METHOD ossl_eckey_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_ecx25519_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_ecx448_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_ed25519_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_ed448_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ossl_sm2_asn1_meth;
+
+extern const EVP_PKEY_ASN1_METHOD ossl_rsa_asn1_meths[2];
+extern const EVP_PKEY_ASN1_METHOD ossl_rsa_pss_asn1_meth;
+
+/*
+ * These are used internally in the ASN1_OBJECT to keep track of whether the
+ * names and data need to be free()ed
+ */
+# define ASN1_OBJECT_FLAG_DYNAMIC 0x01/* internal use */
+# define ASN1_OBJECT_FLAG_CRITICAL 0x02/* critical x509v3 object id */
+# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
+# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08/* internal use */
+struct asn1_object_st {
+ const char *sn, *ln;
+ int nid;
+ int length;
+ const unsigned char *data; /* data remains const after init */
+ int flags; /* Should we free this one */
+};
+
+/* ASN1 print context structure */
+
+struct asn1_pctx_st {
+ unsigned long flags;
+ unsigned long nm_flags;
+ unsigned long cert_flags;
+ unsigned long oid_flags;
+ unsigned long str_flags;
+} /* ASN1_PCTX */ ;
+
+/* ASN1 type functions */
+
+int ossl_asn1_type_set_octetstring_int(ASN1_TYPE *a, long num,
+ unsigned char *data, int len);
+int ossl_asn1_type_get_octetstring_int(const ASN1_TYPE *a, long *num,
+ unsigned char *data, int max_len);
+
+int ossl_x509_algor_new_from_md(X509_ALGOR **palg, const EVP_MD *md);
+const EVP_MD *ossl_x509_algor_get_md(X509_ALGOR *alg);
+X509_ALGOR *ossl_x509_algor_mgf1_decode(X509_ALGOR *alg);
+int ossl_x509_algor_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md);
+int ossl_asn1_time_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags);
+
+EVP_PKEY * ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a,
+ const unsigned char **pp, long length,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+#endif /* ndef OSSL_CRYPTO_ASN1_H */
diff --git a/NorthstarDLL/include/crypto/asn1_dsa.h b/NorthstarDLL/include/crypto/asn1_dsa.h
new file mode 100644
index 00000000..3eadb9ec
--- /dev/null
+++ b/NorthstarDLL/include/crypto/asn1_dsa.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ASN1_DSA_H
+# define OSSL_CRYPTO_ASN1_DSA_H
+# pragma once
+
+#include "internal/packet.h"
+
+int ossl_encode_der_length(WPACKET *pkt, size_t cont_len);
+int ossl_encode_der_integer(WPACKET *pkt, const BIGNUM *n);
+int ossl_encode_der_dsa_sig(WPACKET *pkt, const BIGNUM *r, const BIGNUM *s);
+int ossl_decode_der_length(PACKET *pkt, PACKET *subpkt);
+int ossl_decode_der_integer(PACKET *pkt, BIGNUM *n);
+size_t ossl_decode_der_dsa_sig(BIGNUM *r, BIGNUM *s, const unsigned char **ppin,
+ size_t len);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/asn1err.h b/NorthstarDLL/include/crypto/asn1err.h
new file mode 100644
index 00000000..6441386b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/asn1err.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ASN1ERR_H
+# define OSSL_CRYPTO_ASN1ERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_ASN1_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/async.h b/NorthstarDLL/include/crypto/async.h
new file mode 100644
index 00000000..7bc0dbb6
--- /dev/null
+++ b/NorthstarDLL/include/crypto/async.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ASYNC_H
+# define OSSL_CRYPTO_ASYNC_H
+# pragma once
+
+# include
+
+int async_init(void);
+void async_deinit(void);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/asyncerr.h b/NorthstarDLL/include/crypto/asyncerr.h
new file mode 100644
index 00000000..574e0af7
--- /dev/null
+++ b/NorthstarDLL/include/crypto/asyncerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ASYNCERR_H
+# define OSSL_CRYPTO_ASYNCERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_ASYNC_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/bioerr.h b/NorthstarDLL/include/crypto/bioerr.h
new file mode 100644
index 00000000..a0c06099
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bioerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_BIOERR_H
+# define OSSL_CRYPTO_BIOERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_BIO_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/bn.h b/NorthstarDLL/include/crypto/bn.h
new file mode 100644
index 00000000..cf69bea8
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bn.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_BN_H
+# define OSSL_CRYPTO_BN_H
+# pragma once
+
+# include
+# include
+
+BIGNUM *bn_wexpand(BIGNUM *a, int words);
+BIGNUM *bn_expand2(BIGNUM *a, int words);
+
+void bn_correct_top(BIGNUM *a);
+
+/*
+ * Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
+ * This is an array r[] of values that are either zero or odd with an
+ * absolute value less than 2^w satisfying scalar = \sum_j r[j]*2^j where at
+ * most one of any w+1 consecutive digits is non-zero with the exception that
+ * the most significant digit may be only w-1 zeros away from that next
+ * non-zero digit.
+ */
+signed char *bn_compute_wNAF(const BIGNUM *scalar, int w, size_t *ret_len);
+
+int bn_get_top(const BIGNUM *a);
+
+int bn_get_dmax(const BIGNUM *a);
+
+/* Set all words to zero */
+void bn_set_all_zero(BIGNUM *a);
+
+/*
+ * Copy the internal BIGNUM words into out which holds size elements (and size
+ * must be bigger than top)
+ */
+int bn_copy_words(BN_ULONG *out, const BIGNUM *in, int size);
+
+BN_ULONG *bn_get_words(const BIGNUM *a);
+
+/*
+ * Set the internal data words in a to point to words which contains size
+ * elements. The BN_FLG_STATIC_DATA flag is set
+ */
+void bn_set_static_words(BIGNUM *a, const BN_ULONG *words, int size);
+
+/*
+ * Copy words into the BIGNUM |a|, reallocating space as necessary.
+ * The negative flag of |a| is not modified.
+ * Returns 1 on success and 0 on failure.
+ */
+/*
+ * |num_words| is int because bn_expand2 takes an int. This is an internal
+ * function so we simply trust callers not to pass negative values.
+ */
+int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words);
+
+/*
+ * Some BIGNUM functions assume most significant limb to be non-zero, which
+ * is customarily arranged by bn_correct_top. Output from below functions
+ * is not processed with bn_correct_top, and for this reason it may not be
+ * returned out of public API. It may only be passed internally into other
+ * functions known to support non-minimal or zero-padded BIGNUMs. Even
+ * though the goal is to facilitate constant-time-ness, not each subroutine
+ * is constant-time by itself. They all have pre-conditions, consult source
+ * code...
+ */
+int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ BN_MONT_CTX *mont, BN_CTX *ctx);
+int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
+ BN_CTX *ctx);
+int bn_from_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
+ BN_CTX *ctx);
+int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m);
+int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m);
+int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+int bn_lshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n);
+int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n);
+int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
+ const BIGNUM *d, BN_CTX *ctx);
+
+#define BN_PRIMETEST_COMPOSITE 0
+#define BN_PRIMETEST_COMPOSITE_WITH_FACTOR 1
+#define BN_PRIMETEST_COMPOSITE_NOT_POWER_OF_PRIME 2
+#define BN_PRIMETEST_PROBABLY_PRIME 3
+
+int ossl_bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx,
+ BN_GENCB *cb, int enhanced, int *status);
+
+const BIGNUM *ossl_bn_get0_small_factors(void);
+
+int ossl_bn_rsa_fips186_4_gen_prob_primes(BIGNUM *p, BIGNUM *Xpout,
+ BIGNUM *p1, BIGNUM *p2,
+ const BIGNUM *Xp, const BIGNUM *Xp1,
+ const BIGNUM *Xp2, int nlen,
+ const BIGNUM *e, BN_CTX *ctx,
+ BN_GENCB *cb);
+
+int ossl_bn_rsa_fips186_4_derive_prime(BIGNUM *Y, BIGNUM *X, const BIGNUM *Xin,
+ const BIGNUM *r1, const BIGNUM *r2,
+ int nlen, const BIGNUM *e, BN_CTX *ctx,
+ BN_GENCB *cb);
+
+OSSL_LIB_CTX *ossl_bn_get_libctx(BN_CTX *ctx);
+
+extern const BIGNUM ossl_bn_inv_sqrt_2;
+
+#endif
diff --git a/NorthstarDLL/include/crypto/bn_conf.h b/NorthstarDLL/include/crypto/bn_conf.h
new file mode 100644
index 00000000..a6f73d4a
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bn_conf.h
@@ -0,0 +1,29 @@
+/* WARNING: do not edit! */
+/* Generated by makefile from include\crypto\bn_conf.h.in */
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_BN_CONF_H
+# define OSSL_CRYPTO_BN_CONF_H
+# pragma once
+
+/*
+ * The contents of this file are not used in the UEFI build, as
+ * both 32-bit and 64-bit builds are supported from a single run
+ * of the Configure script.
+ */
+
+/* Should we define BN_DIV2W here? */
+
+/* Only one for the following should be defined */
+#undef SIXTY_FOUR_BIT_LONG
+#define SIXTY_FOUR_BIT
+#undef THIRTY_TWO_BIT
+
+#endif
diff --git a/NorthstarDLL/include/crypto/bn_conf.h.in b/NorthstarDLL/include/crypto/bn_conf.h.in
new file mode 100644
index 00000000..dbc901b1
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bn_conf.h.in
@@ -0,0 +1,28 @@
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_BN_CONF_H
+# define OSSL_CRYPTO_BN_CONF_H
+# pragma once
+
+/*
+ * The contents of this file are not used in the UEFI build, as
+ * both 32-bit and 64-bit builds are supported from a single run
+ * of the Configure script.
+ */
+
+/* Should we define BN_DIV2W here? */
+
+/* Only one for the following should be defined */
+{- $config{b64l} ? "#define" : "#undef" -} SIXTY_FOUR_BIT_LONG
+{- $config{b64} ? "#define" : "#undef" -} SIXTY_FOUR_BIT
+{- $config{b32} ? "#define" : "#undef" -} THIRTY_TWO_BIT
+
+#endif
diff --git a/NorthstarDLL/include/crypto/bn_dh.h b/NorthstarDLL/include/crypto/bn_dh.h
new file mode 100644
index 00000000..6d12c20e
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bn_dh.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#define declare_dh_bn(x) \
+ extern const BIGNUM ossl_bignum_dh##x##_p; \
+ extern const BIGNUM ossl_bignum_dh##x##_q; \
+ extern const BIGNUM ossl_bignum_dh##x##_g; \
+
+declare_dh_bn(1024_160)
+declare_dh_bn(2048_224)
+declare_dh_bn(2048_256)
+
+extern const BIGNUM ossl_bignum_const_2;
+
+extern const BIGNUM ossl_bignum_ffdhe2048_p;
+extern const BIGNUM ossl_bignum_ffdhe3072_p;
+extern const BIGNUM ossl_bignum_ffdhe4096_p;
+extern const BIGNUM ossl_bignum_ffdhe6144_p;
+extern const BIGNUM ossl_bignum_ffdhe8192_p;
+extern const BIGNUM ossl_bignum_ffdhe2048_q;
+extern const BIGNUM ossl_bignum_ffdhe3072_q;
+extern const BIGNUM ossl_bignum_ffdhe4096_q;
+extern const BIGNUM ossl_bignum_ffdhe6144_q;
+extern const BIGNUM ossl_bignum_ffdhe8192_q;
+
+extern const BIGNUM ossl_bignum_modp_1536_p;
+extern const BIGNUM ossl_bignum_modp_2048_p;
+extern const BIGNUM ossl_bignum_modp_3072_p;
+extern const BIGNUM ossl_bignum_modp_4096_p;
+extern const BIGNUM ossl_bignum_modp_6144_p;
+extern const BIGNUM ossl_bignum_modp_8192_p;
+extern const BIGNUM ossl_bignum_modp_1536_q;
+extern const BIGNUM ossl_bignum_modp_2048_q;
+extern const BIGNUM ossl_bignum_modp_3072_q;
+extern const BIGNUM ossl_bignum_modp_4096_q;
+extern const BIGNUM ossl_bignum_modp_6144_q;
+extern const BIGNUM ossl_bignum_modp_8192_q;
diff --git a/NorthstarDLL/include/crypto/bn_srp.h b/NorthstarDLL/include/crypto/bn_srp.h
new file mode 100644
index 00000000..00b160aa
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bn_srp.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OPENSSL_NO_SRP
+
+extern const BIGNUM ossl_bn_group_1024;
+
+extern const BIGNUM ossl_bn_group_1536;
+
+extern const BIGNUM ossl_bn_group_2048;
+
+extern const BIGNUM ossl_bn_group_3072;
+
+extern const BIGNUM ossl_bn_group_4096;
+
+extern const BIGNUM ossl_bn_group_6144;
+
+extern const BIGNUM ossl_bn_group_8192;
+
+extern const BIGNUM ossl_bn_generator_19;
+
+extern const BIGNUM ossl_bn_generator_5;
+
+extern const BIGNUM ossl_bn_generator_2;
+
+#endif
diff --git a/NorthstarDLL/include/crypto/bnerr.h b/NorthstarDLL/include/crypto/bnerr.h
new file mode 100644
index 00000000..7282c915
--- /dev/null
+++ b/NorthstarDLL/include/crypto/bnerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_BNERR_H
+# define OSSL_CRYPTO_BNERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_BN_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/buffererr.h b/NorthstarDLL/include/crypto/buffererr.h
new file mode 100644
index 00000000..54976d95
--- /dev/null
+++ b/NorthstarDLL/include/crypto/buffererr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_BUFFERERR_H
+# define OSSL_CRYPTO_BUFFERERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_BUF_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/chacha.h b/NorthstarDLL/include/crypto/chacha.h
new file mode 100644
index 00000000..d29998ff
--- /dev/null
+++ b/NorthstarDLL/include/crypto/chacha.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CHACHA_H
+#define OSSL_CRYPTO_CHACHA_H
+# pragma once
+
+#include
+
+/*
+ * ChaCha20_ctr32 encrypts |len| bytes from |inp| with the given key and
+ * nonce and writes the result to |out|, which may be equal to |inp|.
+ * The |key| is not 32 bytes of verbatim key material though, but the
+ * said material collected into 8 32-bit elements array in host byte
+ * order. Same approach applies to nonce: the |counter| argument is
+ * pointer to concatenated nonce and counter values collected into 4
+ * 32-bit elements. This, passing crypto material collected into 32-bit
+ * elements as opposite to passing verbatim byte vectors, is chosen for
+ * efficiency in multi-call scenarios.
+ */
+void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp,
+ size_t len, const unsigned int key[8],
+ const unsigned int counter[4]);
+/*
+ * You can notice that there is no key setup procedure. Because it's
+ * as trivial as collecting bytes into 32-bit elements, it's reckoned
+ * that below macro is sufficient.
+ */
+#define CHACHA_U8TOU32(p) ( \
+ ((unsigned int)(p)[0]) | ((unsigned int)(p)[1]<<8) | \
+ ((unsigned int)(p)[2]<<16) | ((unsigned int)(p)[3]<<24) )
+
+#define CHACHA_KEY_SIZE 32
+#define CHACHA_CTR_SIZE 16
+#define CHACHA_BLK_SIZE 64
+
+#endif
diff --git a/NorthstarDLL/include/crypto/cmll_platform.h b/NorthstarDLL/include/crypto/cmll_platform.h
new file mode 100644
index 00000000..8cadadf6
--- /dev/null
+++ b/NorthstarDLL/include/crypto/cmll_platform.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CMLL_PLATFORM_H
+# define OSSL_CMLL_PLATFORM_H
+# pragma once
+
+# if defined(CMLL_ASM) && (defined(__sparc) || defined(__sparc__))
+
+/* Fujitsu SPARC64 X support */
+# include "crypto/sparc_arch.h"
+
+# ifndef OPENSSL_NO_CAMELLIA
+# define SPARC_CMLL_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_CAMELLIA)
+# include
+
+void cmll_t4_set_key(const unsigned char *key, int bits, CAMELLIA_KEY *ks);
+void cmll_t4_encrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key);
+void cmll_t4_decrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key);
+
+void cmll128_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void cmll128_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void cmll256_t4_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void cmll256_t4_cbc_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int /*unused*/);
+void cmll128_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const CAMELLIA_KEY *key,
+ unsigned char *ivec);
+void cmll256_t4_ctr32_encrypt(const unsigned char *in, unsigned char *out,
+ size_t blocks, const CAMELLIA_KEY *key,
+ unsigned char *ivec);
+# endif /* OPENSSL_NO_CAMELLIA */
+
+# endif /* CMLL_ASM && sparc */
+
+#endif /* OSSL_CRYPTO_CIPHERMODE_PLATFORM_H */
diff --git a/NorthstarDLL/include/crypto/cmperr.h b/NorthstarDLL/include/crypto/cmperr.h
new file mode 100644
index 00000000..ac61dd48
--- /dev/null
+++ b/NorthstarDLL/include/crypto/cmperr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CMPERR_H
+# define OSSL_CRYPTO_CMPERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_CMP
+
+int ossl_err_load_CMP_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/cmserr.h b/NorthstarDLL/include/crypto/cmserr.h
new file mode 100644
index 00000000..1de2f9c7
--- /dev/null
+++ b/NorthstarDLL/include/crypto/cmserr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CMSERR_H
+# define OSSL_CRYPTO_CMSERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_CMS
+
+int ossl_err_load_CMS_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/comperr.h b/NorthstarDLL/include/crypto/comperr.h
new file mode 100644
index 00000000..0fd9c6de
--- /dev/null
+++ b/NorthstarDLL/include/crypto/comperr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_COMPERR_H
+# define OSSL_CRYPTO_COMPERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_COMP
+
+int ossl_err_load_COMP_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/conferr.h b/NorthstarDLL/include/crypto/conferr.h
new file mode 100644
index 00000000..cb367e4f
--- /dev/null
+++ b/NorthstarDLL/include/crypto/conferr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CONFERR_H
+# define OSSL_CRYPTO_CONFERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_CONF_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/crmferr.h b/NorthstarDLL/include/crypto/crmferr.h
new file mode 100644
index 00000000..f1a27e04
--- /dev/null
+++ b/NorthstarDLL/include/crypto/crmferr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CRMFERR_H
+# define OSSL_CRYPTO_CRMFERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_CRMF
+
+int ossl_err_load_CRMF_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/cryptlib.h b/NorthstarDLL/include/crypto/cryptlib.h
new file mode 100644
index 00000000..39a956bf
--- /dev/null
+++ b/NorthstarDLL/include/crypto/cryptlib.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CRYPTLIB_H
+# define OSSL_CRYPTO_CRYPTLIB_H
+# pragma once
+
+# include
+# include "internal/cryptlib.h"
+
+/* This file is not scanned by mkdef.pl, whereas cryptlib.h is */
+
+int ossl_init_thread_start(const void *index, void *arg,
+ OSSL_thread_stop_handler_fn handfn);
+int ossl_init_thread_deregister(void *index);
+int ossl_init_thread(void);
+void ossl_cleanup_thread(void);
+void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx);
+
+/*
+ * OPENSSL_INIT flags. The primary list of these is in crypto.h. Flags below
+ * are those omitted from crypto.h because they are "reserved for internal
+ * use".
+ */
+# define OPENSSL_INIT_BASE_ONLY 0x00040000L
+
+void ossl_trace_cleanup(void);
+void ossl_malloc_setup_failures(void);
+
+int ossl_crypto_alloc_ex_data_intern(int class_index, void *obj,
+ CRYPTO_EX_DATA *ad, int idx);
+
+#endif /* OSSL_CRYPTO_CRYPTLIB_H */
diff --git a/NorthstarDLL/include/crypto/cryptoerr.h b/NorthstarDLL/include/crypto/cryptoerr.h
new file mode 100644
index 00000000..288b87ac
--- /dev/null
+++ b/NorthstarDLL/include/crypto/cryptoerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CRYPTOERR_H
+# define OSSL_CRYPTO_CRYPTOERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_CRYPTO_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/cterr.h b/NorthstarDLL/include/crypto/cterr.h
new file mode 100644
index 00000000..760bc796
--- /dev/null
+++ b/NorthstarDLL/include/crypto/cterr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_CTERR_H
+# define OSSL_CRYPTO_CTERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_CT
+
+int ossl_err_load_CT_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/ctype.h b/NorthstarDLL/include/crypto/ctype.h
new file mode 100644
index 00000000..a35c137e
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ctype.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * This version of ctype.h provides a standardised and platform
+ * independent implementation that supports seven bit ASCII characters.
+ * The specific intent is to not pass extended ASCII characters (> 127)
+ * even if the host operating system would.
+ *
+ * There is EBCDIC support included for machines which use this. However,
+ * there are a number of concerns about how well EBCDIC is supported
+ * throughout the rest of the source code. Refer to issue #4154 for
+ * details.
+ */
+#ifndef OSSL_CRYPTO_CTYPE_H
+# define OSSL_CRYPTO_CTYPE_H
+# pragma once
+
+# define CTYPE_MASK_lower 0x1
+# define CTYPE_MASK_upper 0x2
+# define CTYPE_MASK_digit 0x4
+# define CTYPE_MASK_space 0x8
+# define CTYPE_MASK_xdigit 0x10
+# define CTYPE_MASK_blank 0x20
+# define CTYPE_MASK_cntrl 0x40
+# define CTYPE_MASK_graph 0x80
+# define CTYPE_MASK_print 0x100
+# define CTYPE_MASK_punct 0x200
+# define CTYPE_MASK_base64 0x400
+# define CTYPE_MASK_asn1print 0x800
+
+# define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
+# define CTYPE_MASK_alnum (CTYPE_MASK_alpha | CTYPE_MASK_digit)
+
+/*
+ * The ascii mask assumes that any other classification implies that
+ * the character is ASCII and that there are no ASCII characters
+ * that aren't in any of the classifications.
+ *
+ * This assumption holds at the moment, but it might not in the future.
+ */
+# define CTYPE_MASK_ascii (~0)
+
+# ifdef CHARSET_EBCDIC
+int ossl_toascii(int c);
+int ossl_fromascii(int c);
+# else
+# define ossl_toascii(c) (c)
+# define ossl_fromascii(c) (c)
+# endif
+int ossl_ctype_check(int c, unsigned int mask);
+int ossl_tolower(int c);
+int ossl_toupper(int c);
+
+int ossl_ascii_isdigit(const char inchar);
+
+# define ossl_isalnum(c) (ossl_ctype_check((c), CTYPE_MASK_alnum))
+# define ossl_isalpha(c) (ossl_ctype_check((c), CTYPE_MASK_alpha))
+# ifdef CHARSET_EBCDIC
+# define ossl_isascii(c) (ossl_ctype_check((c), CTYPE_MASK_ascii))
+# else
+# define ossl_isascii(c) (((c) & ~127) == 0)
+# endif
+# define ossl_isblank(c) (ossl_ctype_check((c), CTYPE_MASK_blank))
+# define ossl_iscntrl(c) (ossl_ctype_check((c), CTYPE_MASK_cntrl))
+# define ossl_isdigit(c) (ossl_ctype_check((c), CTYPE_MASK_digit))
+# define ossl_isgraph(c) (ossl_ctype_check((c), CTYPE_MASK_graph))
+# define ossl_islower(c) (ossl_ctype_check((c), CTYPE_MASK_lower))
+# define ossl_isprint(c) (ossl_ctype_check((c), CTYPE_MASK_print))
+# define ossl_ispunct(c) (ossl_ctype_check((c), CTYPE_MASK_punct))
+# define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
+# define ossl_isupper(c) (ossl_ctype_check((c), CTYPE_MASK_upper))
+# define ossl_isxdigit(c) (ossl_ctype_check((c), CTYPE_MASK_xdigit))
+# define ossl_isbase64(c) (ossl_ctype_check((c), CTYPE_MASK_base64))
+# define ossl_isasn1print(c) (ossl_ctype_check((c), CTYPE_MASK_asn1print))
+
+#endif
diff --git a/NorthstarDLL/include/crypto/decoder.h b/NorthstarDLL/include/crypto/decoder.h
new file mode 100644
index 00000000..cc06ef29
--- /dev/null
+++ b/NorthstarDLL/include/crypto/decoder.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DECODER_H
+# define OSSL_CRYPTO_DECODER_H
+# pragma once
+
+# include
+
+OSSL_DECODER *ossl_decoder_fetch_by_number(OSSL_LIB_CTX *libctx,
+ int id,
+ const char *properties);
+
+/*
+ * These are specially made for the 'file:' provider-native loader, which
+ * uses this to install a DER to anything decoder, which doesn't do much
+ * except read a DER blob and pass it on as a provider object abstraction
+ * (provider-object(7)).
+ */
+void *ossl_decoder_from_algorithm(int id, const OSSL_ALGORITHM *algodef,
+ OSSL_PROVIDER *prov);
+
+OSSL_DECODER_INSTANCE *
+ossl_decoder_instance_new(OSSL_DECODER *decoder, void *decoderctx);
+void ossl_decoder_instance_free(OSSL_DECODER_INSTANCE *decoder_inst);
+int ossl_decoder_ctx_add_decoder_inst(OSSL_DECODER_CTX *ctx,
+ OSSL_DECODER_INSTANCE *di);
+
+int ossl_decoder_ctx_setup_for_pkey(OSSL_DECODER_CTX *ctx,
+ EVP_PKEY **pkey, const char *keytype,
+ OSSL_LIB_CTX *libctx,
+ const char *propquery);
+
+int ossl_decoder_get_number(const OSSL_DECODER *encoder);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/decodererr.h b/NorthstarDLL/include/crypto/decodererr.h
new file mode 100644
index 00000000..d7badc43
--- /dev/null
+++ b/NorthstarDLL/include/crypto/decodererr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DECODERERR_H
+# define OSSL_CRYPTO_DECODERERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_OSSL_DECODER_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/des_platform.h b/NorthstarDLL/include/crypto/des_platform.h
new file mode 100644
index 00000000..07ea1ddd
--- /dev/null
+++ b/NorthstarDLL/include/crypto/des_platform.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_DES_PLATFORM_H
+# define OSSL_DES_PLATFORM_H
+# pragma once
+
+# if defined(DES_ASM) && (defined(__sparc) || defined(__sparc__))
+
+/* Fujitsu SPARC64 X support */
+# include "crypto/sparc_arch.h"
+
+# ifndef OPENSSL_NO_DES
+# define SPARC_DES_CAPABLE (OPENSSL_sparcv9cap_P[1] & CFR_DES)
+# include
+void des_t4_key_expand(const void *key, DES_key_schedule *ks);
+void des_t4_ede3_cbc_encrypt(const void *inp, void *out, size_t len,
+ const DES_key_schedule ks[3], unsigned char iv[8]);
+void des_t4_ede3_cbc_decrypt(const void *inp, void *out, size_t len,
+ const DES_key_schedule ks[3], unsigned char iv[8]);
+void des_t4_cbc_encrypt(const void *inp, void *out, size_t len,
+ const DES_key_schedule *ks, unsigned char iv[8]);
+void des_t4_cbc_decrypt(const void *inp, void *out, size_t len,
+ const DES_key_schedule *ks, unsigned char iv[8]);
+# endif /* OPENSSL_NO_DES */
+
+# endif /* DES_ASM && sparc */
+
+#endif /* OSSL_CRYPTO_CIPHERMODE_PLATFORM_H */
diff --git a/NorthstarDLL/include/crypto/dh.h b/NorthstarDLL/include/crypto/dh.h
new file mode 100644
index 00000000..f6be4ae0
--- /dev/null
+++ b/NorthstarDLL/include/crypto/dh.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DH_H
+# define OSSL_CRYPTO_DH_H
+# pragma once
+
+# include
+# include
+# include
+# include "internal/ffc.h"
+
+DH *ossl_dh_new_by_nid_ex(OSSL_LIB_CTX *libctx, int nid);
+DH *ossl_dh_new_ex(OSSL_LIB_CTX *libctx);
+void ossl_dh_set0_libctx(DH *d, OSSL_LIB_CTX *libctx);
+int ossl_dh_generate_ffc_parameters(DH *dh, int type, int pbits, int qbits,
+ BN_GENCB *cb);
+int ossl_dh_generate_public_key(BN_CTX *ctx, const DH *dh,
+ const BIGNUM *priv_key, BIGNUM *pub_key);
+int ossl_dh_get_named_group_uid_from_size(int pbits);
+const char *ossl_dh_gen_type_id2name(int id);
+int ossl_dh_gen_type_name2id(const char *name, int type);
+void ossl_dh_cache_named_group(DH *dh);
+int ossl_dh_is_named_safe_prime_group(const DH *dh);
+
+FFC_PARAMS *ossl_dh_get0_params(DH *dh);
+int ossl_dh_get0_nid(const DH *dh);
+int ossl_dh_params_fromdata(DH *dh, const OSSL_PARAM params[]);
+int ossl_dh_key_fromdata(DH *dh, const OSSL_PARAM params[]);
+int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
+int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
+DH *ossl_dh_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
+
+int ossl_dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret);
+int ossl_dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret);
+int ossl_dh_check_pairwise(const DH *dh);
+
+const DH_METHOD *ossl_dh_get_method(const DH *dh);
+
+int ossl_dh_buf2key(DH *key, const unsigned char *buf, size_t len);
+size_t ossl_dh_key2buf(const DH *dh, unsigned char **pbuf, size_t size,
+ int alloc);
+
+int ossl_dh_kdf_X9_42_asn1(unsigned char *out, size_t outlen,
+ const unsigned char *Z, size_t Zlen,
+ const char *cek_alg,
+ const unsigned char *ukm, size_t ukmlen,
+ const EVP_MD *md,
+ OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_dh_is_foreign(const DH *dh);
+DH *ossl_dh_dup(const DH *dh, int selection);
+
+#endif /* OSSL_CRYPTO_DH_H */
diff --git a/NorthstarDLL/include/crypto/dherr.h b/NorthstarDLL/include/crypto/dherr.h
new file mode 100644
index 00000000..bb24d131
--- /dev/null
+++ b/NorthstarDLL/include/crypto/dherr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DHERR_H
+# define OSSL_CRYPTO_DHERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_DH
+
+int ossl_err_load_DH_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/dsa.h b/NorthstarDLL/include/crypto/dsa.h
new file mode 100644
index 00000000..eedbd8c7
--- /dev/null
+++ b/NorthstarDLL/include/crypto/dsa.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DSAERR_H
+# define OSSL_CRYPTO_DSAERR_H
+# pragma once
+
+# include
+# include
+# include "internal/ffc.h"
+
+#define DSA_PARAMGEN_TYPE_FIPS_186_4 0 /* Use FIPS186-4 standard */
+#define DSA_PARAMGEN_TYPE_FIPS_186_2 1 /* Use legacy FIPS186-2 standard */
+#define DSA_PARAMGEN_TYPE_FIPS_DEFAULT 2
+
+DSA *ossl_dsa_new(OSSL_LIB_CTX *libctx);
+void ossl_dsa_set0_libctx(DSA *d, OSSL_LIB_CTX *libctx);
+
+int ossl_dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits,
+ BN_GENCB *cb);
+
+int ossl_dsa_sign_int(int type, const unsigned char *dgst, int dlen,
+ unsigned char *sig, unsigned int *siglen, DSA *dsa);
+
+FFC_PARAMS *ossl_dsa_get0_params(DSA *dsa);
+int ossl_dsa_ffc_params_fromdata(DSA *dsa, const OSSL_PARAM params[]);
+int ossl_dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[]);
+DSA *ossl_dsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+int ossl_dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa,
+ const BIGNUM *priv_key, BIGNUM *pub_key);
+int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret);
+int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret);
+int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key,
+ int *ret);
+int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret);
+int ossl_dsa_check_pairwise(const DSA *dsa);
+int ossl_dsa_is_foreign(const DSA *dsa);
+DSA *ossl_dsa_dup(const DSA *dsa, int selection);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/dsaerr.h b/NorthstarDLL/include/crypto/dsaerr.h
new file mode 100644
index 00000000..9898097d
--- /dev/null
+++ b/NorthstarDLL/include/crypto/dsaerr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DSAERR_H
+# define OSSL_CRYPTO_DSAERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_DSA
+
+int ossl_err_load_DSA_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/dso_conf.h b/NorthstarDLL/include/crypto/dso_conf.h
new file mode 100644
index 00000000..99514321
--- /dev/null
+++ b/NorthstarDLL/include/crypto/dso_conf.h
@@ -0,0 +1,18 @@
+/* WARNING: do not edit! */
+/* Generated by makefile from include\crypto\dso_conf.h.in */
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DSO_CONF_H
+# define OSSL_CRYPTO_DSO_CONF_H
+# pragma once
+
+# define DSO_WIN32
+# define DSO_EXTENSION ".dll"
+#endif
diff --git a/NorthstarDLL/include/crypto/dso_conf.h.in b/NorthstarDLL/include/crypto/dso_conf.h.in
new file mode 100644
index 00000000..12de11ad
--- /dev/null
+++ b/NorthstarDLL/include/crypto/dso_conf.h.in
@@ -0,0 +1,33 @@
+{- join("\n",map { "/* $_ */" } @autowarntext) -}
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_DSO_CONF_H
+# define OSSL_CRYPTO_DSO_CONF_H
+# pragma once
+
+{- # The DSO code currently always implements all functions so that no
+ # applications will have to worry about that from a compilation point
+ # of view. However, the "method"s may return zero unless that platform
+ # has support compiled in for them. Currently each method is enabled
+ # by a define "DSO_" ... we translate the "dso_scheme" config
+ # string entry into using the following logic;
+ my $scheme = $disabled{dso} ? undef : uc $target{dso_scheme};
+ if (!$scheme) {
+ $scheme = "NONE";
+ }
+ my @macros = ( "DSO_$scheme" );
+ if ($scheme eq 'DLFCN') {
+ @macros = ( "DSO_DLFCN", "HAVE_DLFCN_H" );
+ } elsif ($scheme eq "DLFCN_NO_H") {
+ @macros = ( "DSO_DLFCN" );
+ }
+ join("\n", map { "# define $_" } @macros); -}
+# define DSO_EXTENSION "{- platform->dsoext() -}"
+#endif
diff --git a/NorthstarDLL/include/crypto/ec.h b/NorthstarDLL/include/crypto/ec.h
new file mode 100644
index 00000000..62163b31
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ec.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* Internal EC functions for other submodules: not for application use */
+
+#ifndef OSSL_CRYPTO_EC_H
+# define OSSL_CRYPTO_EC_H
+# pragma once
+
+# include
+# include
+
+int ossl_ec_curve_name2nid(const char *name);
+const char *ossl_ec_curve_nid2nist_int(int nid);
+int ossl_ec_curve_nist2nid_int(const char *name);
+int evp_pkey_ctx_set_ec_param_enc_prov(EVP_PKEY_CTX *ctx, int param_enc);
+
+# ifndef OPENSSL_NO_EC
+# include
+# include
+# include "crypto/types.h"
+
+/*-
+ * Computes the multiplicative inverse of x in the range
+ * [1,EC_GROUP::order), where EC_GROUP::order is the cardinality of the
+ * subgroup generated by the generator G:
+ *
+ * res := x^(-1) (mod EC_GROUP::order).
+ *
+ * This function expects the following two conditions to hold:
+ * - the EC_GROUP order is prime, and
+ * - x is included in the range [1, EC_GROUP::order).
+ *
+ * This function returns 1 on success, 0 on error.
+ *
+ * If the EC_GROUP order is even, this function explicitly returns 0 as
+ * an error.
+ * In case any of the two conditions stated above is not satisfied,
+ * the correctness of its output is not guaranteed, even if the return
+ * value could still be 1 (as primality testing and a conditional modular
+ * reduction round on the input can be omitted by the underlying
+ * implementations for better SCA properties on regular input values).
+ */
+__owur int ossl_ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,
+ const BIGNUM *x, BN_CTX *ctx);
+
+/*-
+ * ECDH Key Derivation Function as defined in ANSI X9.63
+ */
+int ossl_ecdh_kdf_X9_63(unsigned char *out, size_t outlen,
+ const unsigned char *Z, size_t Zlen,
+ const unsigned char *sinfo, size_t sinfolen,
+ const EVP_MD *md, OSSL_LIB_CTX *libctx,
+ const char *propq);
+
+int ossl_ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx);
+int ossl_ec_key_public_check_quick(const EC_KEY *eckey, BN_CTX *ctx);
+int ossl_ec_key_private_check(const EC_KEY *eckey);
+int ossl_ec_key_pairwise_check(const EC_KEY *eckey, BN_CTX *ctx);
+OSSL_LIB_CTX *ossl_ec_key_get_libctx(const EC_KEY *eckey);
+const char *ossl_ec_key_get0_propq(const EC_KEY *eckey);
+void ossl_ec_key_set0_libctx(EC_KEY *key, OSSL_LIB_CTX *libctx);
+
+/* Backend support */
+int ossl_ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl,
+ OSSL_PARAM params[], OSSL_LIB_CTX *libctx,
+ const char *propq,
+ BN_CTX *bnctx, unsigned char **genbuf);
+int ossl_ec_group_fromdata(EC_KEY *ec, const OSSL_PARAM params[]);
+int ossl_ec_group_set_params(EC_GROUP *group, const OSSL_PARAM params[]);
+int ossl_ec_key_fromdata(EC_KEY *ecx, const OSSL_PARAM params[],
+ int include_private);
+int ossl_ec_key_otherparams_fromdata(EC_KEY *ec, const OSSL_PARAM params[]);
+int ossl_ec_key_is_foreign(const EC_KEY *ec);
+EC_KEY *ossl_ec_key_dup(const EC_KEY *key, int selection);
+int ossl_x509_algor_is_sm2(const X509_ALGOR *palg);
+EC_KEY *ossl_ec_key_param_from_x509_algor(const X509_ALGOR *palg,
+ OSSL_LIB_CTX *libctx,
+ const char *propq);
+EC_KEY *ossl_ec_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+int ossl_ec_set_ecdh_cofactor_mode(EC_KEY *ec, int mode);
+int ossl_ec_encoding_name2id(const char *name);
+int ossl_ec_encoding_param2id(const OSSL_PARAM *p, int *id);
+int ossl_ec_pt_format_name2id(const char *name);
+int ossl_ec_pt_format_param2id(const OSSL_PARAM *p, int *id);
+char *ossl_ec_pt_format_id2name(int id);
+
+char *ossl_ec_check_group_type_id2name(int flags);
+int ossl_ec_set_check_group_type_from_name(EC_KEY *ec, const char *name);
+
+# endif /* OPENSSL_NO_EC */
+#endif
diff --git a/NorthstarDLL/include/crypto/ecerr.h b/NorthstarDLL/include/crypto/ecerr.h
new file mode 100644
index 00000000..07b6c7aa
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ecerr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ECERR_H
+# define OSSL_CRYPTO_ECERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_EC
+
+int ossl_err_load_EC_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/ecx.h b/NorthstarDLL/include/crypto/ecx.h
new file mode 100644
index 00000000..48b95fa5
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ecx.h
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* Internal EC functions for other submodules: not for application use */
+
+#ifndef OSSL_CRYPTO_ECX_H
+# define OSSL_CRYPTO_ECX_H
+# pragma once
+
+# include
+
+# ifndef OPENSSL_NO_EC
+
+# include
+# include
+# include
+# include "internal/refcount.h"
+# include "crypto/types.h"
+
+# define X25519_KEYLEN 32
+# define X448_KEYLEN 56
+# define ED25519_KEYLEN 32
+# define ED448_KEYLEN 57
+
+# define MAX_KEYLEN ED448_KEYLEN
+
+# define X25519_BITS 253
+# define X25519_SECURITY_BITS 128
+
+# define X448_BITS 448
+# define X448_SECURITY_BITS 224
+
+# define ED25519_BITS 256
+/* RFC8032 Section 8.5 */
+# define ED25519_SECURITY_BITS 128
+# define ED25519_SIGSIZE 64
+
+# define ED448_BITS 456
+/* RFC8032 Section 8.5 */
+# define ED448_SECURITY_BITS 224
+# define ED448_SIGSIZE 114
+
+
+typedef enum {
+ ECX_KEY_TYPE_X25519,
+ ECX_KEY_TYPE_X448,
+ ECX_KEY_TYPE_ED25519,
+ ECX_KEY_TYPE_ED448
+} ECX_KEY_TYPE;
+
+#define KEYTYPE2NID(type) \
+ ((type) == ECX_KEY_TYPE_X25519 \
+ ? EVP_PKEY_X25519 \
+ : ((type) == ECX_KEY_TYPE_X448 \
+ ? EVP_PKEY_X448 \
+ : ((type) == ECX_KEY_TYPE_ED25519 \
+ ? EVP_PKEY_ED25519 \
+ : EVP_PKEY_ED448)))
+
+struct ecx_key_st {
+ OSSL_LIB_CTX *libctx;
+ char *propq;
+ unsigned int haspubkey:1;
+ unsigned char pubkey[MAX_KEYLEN];
+ unsigned char *privkey;
+ size_t keylen;
+ ECX_KEY_TYPE type;
+ CRYPTO_REF_COUNT references;
+ CRYPTO_RWLOCK *lock;
+};
+
+size_t ossl_ecx_key_length(ECX_KEY_TYPE type);
+ECX_KEY *ossl_ecx_key_new(OSSL_LIB_CTX *libctx, ECX_KEY_TYPE type,
+ int haspubkey, const char *propq);
+void ossl_ecx_key_set0_libctx(ECX_KEY *key, OSSL_LIB_CTX *libctx);
+unsigned char *ossl_ecx_key_allocate_privkey(ECX_KEY *key);
+void ossl_ecx_key_free(ECX_KEY *key);
+int ossl_ecx_key_up_ref(ECX_KEY *key);
+ECX_KEY *ossl_ecx_key_dup(const ECX_KEY *key, int selection);
+
+int ossl_x25519(uint8_t out_shared_key[32], const uint8_t private_key[32],
+ const uint8_t peer_public_value[32]);
+void ossl_x25519_public_from_private(uint8_t out_public_value[32],
+ const uint8_t private_key[32]);
+
+int
+ossl_ed25519_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[32],
+ const uint8_t private_key[32],
+ const char *propq);
+int
+ossl_ed25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len,
+ const uint8_t public_key[32], const uint8_t private_key[32],
+ OSSL_LIB_CTX *libctx, const char *propq);
+int
+ossl_ed25519_verify(const uint8_t *message, size_t message_len,
+ const uint8_t signature[64], const uint8_t public_key[32],
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+int
+ossl_ed448_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[57],
+ const uint8_t private_key[57], const char *propq);
+int
+ossl_ed448_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t *message,
+ size_t message_len, const uint8_t public_key[57],
+ const uint8_t private_key[57], const uint8_t *context,
+ size_t context_len, const char *propq);
+
+int
+ossl_ed448_verify(OSSL_LIB_CTX *ctx, const uint8_t *message, size_t message_len,
+ const uint8_t signature[114], const uint8_t public_key[57],
+ const uint8_t *context, size_t context_len, const char *propq);
+
+int
+ossl_x448(uint8_t out_shared_key[56], const uint8_t private_key[56],
+ const uint8_t peer_public_value[56]);
+void
+ossl_x448_public_from_private(uint8_t out_public_value[56],
+ const uint8_t private_key[56]);
+
+
+/* Backend support */
+typedef enum {
+ KEY_OP_PUBLIC,
+ KEY_OP_PRIVATE,
+ KEY_OP_KEYGEN
+} ecx_key_op_t;
+
+ECX_KEY *ossl_ecx_key_op(const X509_ALGOR *palg,
+ const unsigned char *p, int plen,
+ int pkey_id, ecx_key_op_t op,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+int ossl_ecx_public_from_private(ECX_KEY *key);
+int ossl_ecx_key_fromdata(ECX_KEY *ecx, const OSSL_PARAM params[],
+ int include_private);
+ECX_KEY *ossl_ecx_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+ECX_KEY *ossl_evp_pkey_get1_X25519(EVP_PKEY *pkey);
+ECX_KEY *ossl_evp_pkey_get1_X448(EVP_PKEY *pkey);
+ECX_KEY *ossl_evp_pkey_get1_ED25519(EVP_PKEY *pkey);
+ECX_KEY *ossl_evp_pkey_get1_ED448(EVP_PKEY *pkey);
+# endif /* OPENSSL_NO_EC */
+#endif
diff --git a/NorthstarDLL/include/crypto/encoder.h b/NorthstarDLL/include/crypto/encoder.h
new file mode 100644
index 00000000..09d445d2
--- /dev/null
+++ b/NorthstarDLL/include/crypto/encoder.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include
+
+OSSL_ENCODER *ossl_encoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id,
+ const char *properties);
+int ossl_encoder_get_number(const OSSL_ENCODER *encoder);
diff --git a/NorthstarDLL/include/crypto/encodererr.h b/NorthstarDLL/include/crypto/encodererr.h
new file mode 100644
index 00000000..56c45823
--- /dev/null
+++ b/NorthstarDLL/include/crypto/encodererr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ENCODERERR_H
+# define OSSL_CRYPTO_ENCODERERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_OSSL_ENCODER_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/engine.h b/NorthstarDLL/include/crypto/engine.h
new file mode 100644
index 00000000..fac6ed09
--- /dev/null
+++ b/NorthstarDLL/include/crypto/engine.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include
+
+void engine_load_openssl_int(void);
+void engine_load_devcrypto_int(void);
+void engine_load_rdrand_int(void);
+void engine_load_dynamic_int(void);
+void engine_load_padlock_int(void);
+void engine_load_capi_int(void);
+void engine_load_dasync_int(void);
+void engine_load_afalg_int(void);
+void engine_cleanup_int(void);
diff --git a/NorthstarDLL/include/crypto/engineerr.h b/NorthstarDLL/include/crypto/engineerr.h
new file mode 100644
index 00000000..737c841d
--- /dev/null
+++ b/NorthstarDLL/include/crypto/engineerr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ENGINEERR_H
+# define OSSL_CRYPTO_ENGINEERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_ENGINE
+
+int ossl_err_load_ENGINE_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/err.h b/NorthstarDLL/include/crypto/err.h
new file mode 100644
index 00000000..15ec6fd0
--- /dev/null
+++ b/NorthstarDLL/include/crypto/err.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ERR_H
+# define OSSL_CRYPTO_ERR_H
+# pragma once
+
+int ossl_err_load_ERR_strings(void);
+int ossl_err_load_crypto_strings(void);
+void err_cleanup(void);
+int err_shelve_state(void **);
+void err_unshelve_state(void *);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/ess.h b/NorthstarDLL/include/crypto/ess.h
new file mode 100644
index 00000000..7acde5f8
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ess.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ESS_H
+# define OSSL_CRYPTO_ESS_H
+# pragma once
+
+/*-
+ * IssuerSerial ::= SEQUENCE {
+ * issuer GeneralNames,
+ * serialNumber CertificateSerialNumber
+ * }
+ */
+
+struct ESS_issuer_serial {
+ STACK_OF(GENERAL_NAME) *issuer;
+ ASN1_INTEGER *serial;
+};
+
+/*-
+ * ESSCertID ::= SEQUENCE {
+ * certHash Hash,
+ * issuerSerial IssuerSerial OPTIONAL
+ * }
+ */
+
+struct ESS_cert_id {
+ ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */
+ ESS_ISSUER_SERIAL *issuer_serial;
+};
+
+/*-
+ * SigningCertificate ::= SEQUENCE {
+ * certs SEQUENCE OF ESSCertID,
+ * policies SEQUENCE OF PolicyInformation OPTIONAL
+ * }
+ */
+
+struct ESS_signing_cert {
+ STACK_OF(ESS_CERT_ID) *cert_ids;
+ STACK_OF(POLICYINFO) *policy_info;
+};
+
+/*-
+ * ESSCertIDv2 ::= SEQUENCE {
+ * hashAlgorithm AlgorithmIdentifier DEFAULT id-sha256,
+ * certHash Hash,
+ * issuerSerial IssuerSerial OPTIONAL
+ * }
+ */
+
+struct ESS_cert_id_v2_st {
+ X509_ALGOR *hash_alg; /* Default: SHA-256 */
+ ASN1_OCTET_STRING *hash;
+ ESS_ISSUER_SERIAL *issuer_serial;
+};
+
+/*-
+ * SigningCertificateV2 ::= SEQUENCE {
+ * certs SEQUENCE OF ESSCertIDv2,
+ * policies SEQUENCE OF PolicyInformation OPTIONAL
+ * }
+ */
+
+struct ESS_signing_cert_v2_st {
+ STACK_OF(ESS_CERT_ID_V2) *cert_ids;
+ STACK_OF(POLICYINFO) *policy_info;
+};
+
+#endif /* OSSL_CRYPTO_ESS_H */
diff --git a/NorthstarDLL/include/crypto/esserr.h b/NorthstarDLL/include/crypto/esserr.h
new file mode 100644
index 00000000..8df2df11
--- /dev/null
+++ b/NorthstarDLL/include/crypto/esserr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_ESSERR_H
+# define OSSL_CRYPTO_ESSERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_ESS_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/evp.h b/NorthstarDLL/include/crypto/evp.h
new file mode 100644
index 00000000..c5d3a930
--- /dev/null
+++ b/NorthstarDLL/include/crypto/evp.h
@@ -0,0 +1,944 @@
+/*
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_EVP_H
+# define OSSL_CRYPTO_EVP_H
+# pragma once
+
+# include
+# include
+# include "internal/refcount.h"
+# include "crypto/ecx.h"
+
+/*
+ * Don't free up md_ctx->pctx in EVP_MD_CTX_reset, use the reserved flag
+ * values in evp.h
+ */
+#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX 0x0400
+
+#define evp_pkey_ctx_is_legacy(ctx) \
+ ((ctx)->keymgmt == NULL)
+#define evp_pkey_ctx_is_provided(ctx) \
+ (!evp_pkey_ctx_is_legacy(ctx))
+
+struct evp_pkey_ctx_st {
+ /* Actual operation */
+ int operation;
+
+ /*
+ * Library context, property query, keytype and keymgmt associated with
+ * this context
+ */
+ OSSL_LIB_CTX *libctx;
+ char *propquery;
+ const char *keytype;
+ /* If |pkey| below is set, this field is always a reference to its keymgmt */
+ EVP_KEYMGMT *keymgmt;
+
+ union {
+ struct {
+ void *genctx;
+ } keymgmt;
+
+ struct {
+ EVP_KEYEXCH *exchange;
+ /*
+ * Opaque ctx returned from a providers exchange algorithm
+ * implementation OSSL_FUNC_keyexch_newctx()
+ */
+ void *algctx;
+ } kex;
+
+ struct {
+ EVP_SIGNATURE *signature;
+ /*
+ * Opaque ctx returned from a providers signature algorithm
+ * implementation OSSL_FUNC_signature_newctx()
+ */
+ void *algctx;
+ } sig;
+
+ struct {
+ EVP_ASYM_CIPHER *cipher;
+ /*
+ * Opaque ctx returned from a providers asymmetric cipher algorithm
+ * implementation OSSL_FUNC_asym_cipher_newctx()
+ */
+ void *algctx;
+ } ciph;
+ struct {
+ EVP_KEM *kem;
+ /*
+ * Opaque ctx returned from a providers KEM algorithm
+ * implementation OSSL_FUNC_kem_newctx()
+ */
+ void *algctx;
+ } encap;
+ } op;
+
+ /*
+ * Cached parameters. Inits of operations that depend on these should
+ * call evp_pkey_ctx_use_delayed_data() when the operation has been set
+ * up properly.
+ */
+ struct {
+ /* Distinguishing Identifier, ISO/IEC 15946-3, FIPS 196 */
+ char *dist_id_name; /* The name used with EVP_PKEY_CTX_ctrl_str() */
+ void *dist_id; /* The distinguishing ID itself */
+ size_t dist_id_len; /* The length of the distinguishing ID */
+
+ /* Indicators of what has been set. Keep them together! */
+ unsigned int dist_id_set : 1;
+ } cached_parameters;
+
+ /* Application specific data, usually used by the callback */
+ void *app_data;
+ /* Keygen callback */
+ EVP_PKEY_gen_cb *pkey_gencb;
+ /* implementation specific keygen data */
+ int *keygen_info;
+ int keygen_info_count;
+
+ /* Legacy fields below */
+
+ /* EVP_PKEY identity */
+ int legacy_keytype;
+ /* Method associated with this operation */
+ const EVP_PKEY_METHOD *pmeth;
+ /* Engine that implements this method or NULL if builtin */
+ ENGINE *engine;
+ /* Key: may be NULL */
+ EVP_PKEY *pkey;
+ /* Peer key for key agreement, may be NULL */
+ EVP_PKEY *peerkey;
+ /* Algorithm specific data */
+ void *data;
+ /* Indicator if digest_custom needs to be called */
+ unsigned int flag_call_digest_custom:1;
+ /*
+ * Used to support taking custody of memory in the case of a provider being
+ * used with the deprecated EVP_PKEY_CTX_set_rsa_keygen_pubexp() API. This
+ * member should NOT be used for any other purpose and should be removed
+ * when said deprecated API is excised completely.
+ */
+ BIGNUM *rsa_pubexp;
+} /* EVP_PKEY_CTX */ ;
+
+#define EVP_PKEY_FLAG_DYNAMIC 1
+
+struct evp_pkey_method_st {
+ int pkey_id;
+ int flags;
+ int (*init) (EVP_PKEY_CTX *ctx);
+ int (*copy) (EVP_PKEY_CTX *dst, const EVP_PKEY_CTX *src);
+ void (*cleanup) (EVP_PKEY_CTX *ctx);
+ int (*paramgen_init) (EVP_PKEY_CTX *ctx);
+ int (*paramgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
+ int (*keygen_init) (EVP_PKEY_CTX *ctx);
+ int (*keygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
+ int (*sign_init) (EVP_PKEY_CTX *ctx);
+ int (*sign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs, size_t tbslen);
+ int (*verify_init) (EVP_PKEY_CTX *ctx);
+ int (*verify) (EVP_PKEY_CTX *ctx,
+ const unsigned char *sig, size_t siglen,
+ const unsigned char *tbs, size_t tbslen);
+ int (*verify_recover_init) (EVP_PKEY_CTX *ctx);
+ int (*verify_recover) (EVP_PKEY_CTX *ctx,
+ unsigned char *rout, size_t *routlen,
+ const unsigned char *sig, size_t siglen);
+ int (*signctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
+ int (*signctx) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
+ EVP_MD_CTX *mctx);
+ int (*verifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
+ int (*verifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
+ EVP_MD_CTX *mctx);
+ int (*encrypt_init) (EVP_PKEY_CTX *ctx);
+ int (*encrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
+ const unsigned char *in, size_t inlen);
+ int (*decrypt_init) (EVP_PKEY_CTX *ctx);
+ int (*decrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
+ const unsigned char *in, size_t inlen);
+ int (*derive_init) (EVP_PKEY_CTX *ctx);
+ int (*derive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
+ int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
+ int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value);
+ int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs, size_t tbslen);
+ int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig,
+ size_t siglen, const unsigned char *tbs,
+ size_t tbslen);
+ int (*check) (EVP_PKEY *pkey);
+ int (*public_check) (EVP_PKEY *pkey);
+ int (*param_check) (EVP_PKEY *pkey);
+
+ int (*digest_custom) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
+} /* EVP_PKEY_METHOD */ ;
+
+DEFINE_STACK_OF_CONST(EVP_PKEY_METHOD)
+
+void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
+
+const EVP_PKEY_METHOD *ossl_dh_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_dhx_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_dsa_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_ec_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_ecx25519_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_ecx448_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_ed25519_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_ed448_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_rsa_pkey_method(void);
+const EVP_PKEY_METHOD *ossl_rsa_pss_pkey_method(void);
+
+struct evp_mac_st {
+ OSSL_PROVIDER *prov;
+ int name_id;
+ char *type_name;
+ const char *description;
+
+ CRYPTO_REF_COUNT refcnt;
+ CRYPTO_RWLOCK *lock;
+
+ OSSL_FUNC_mac_newctx_fn *newctx;
+ OSSL_FUNC_mac_dupctx_fn *dupctx;
+ OSSL_FUNC_mac_freectx_fn *freectx;
+ OSSL_FUNC_mac_init_fn *init;
+ OSSL_FUNC_mac_update_fn *update;
+ OSSL_FUNC_mac_final_fn *final;
+ OSSL_FUNC_mac_gettable_params_fn *gettable_params;
+ OSSL_FUNC_mac_gettable_ctx_params_fn *gettable_ctx_params;
+ OSSL_FUNC_mac_settable_ctx_params_fn *settable_ctx_params;
+ OSSL_FUNC_mac_get_params_fn *get_params;
+ OSSL_FUNC_mac_get_ctx_params_fn *get_ctx_params;
+ OSSL_FUNC_mac_set_ctx_params_fn *set_ctx_params;
+};
+
+struct evp_kdf_st {
+ OSSL_PROVIDER *prov;
+ int name_id;
+ char *type_name;
+ const char *description;
+ CRYPTO_REF_COUNT refcnt;
+ CRYPTO_RWLOCK *lock;
+
+ OSSL_FUNC_kdf_newctx_fn *newctx;
+ OSSL_FUNC_kdf_dupctx_fn *dupctx;
+ OSSL_FUNC_kdf_freectx_fn *freectx;
+ OSSL_FUNC_kdf_reset_fn *reset;
+ OSSL_FUNC_kdf_derive_fn *derive;
+ OSSL_FUNC_kdf_gettable_params_fn *gettable_params;
+ OSSL_FUNC_kdf_gettable_ctx_params_fn *gettable_ctx_params;
+ OSSL_FUNC_kdf_settable_ctx_params_fn *settable_ctx_params;
+ OSSL_FUNC_kdf_get_params_fn *get_params;
+ OSSL_FUNC_kdf_get_ctx_params_fn *get_ctx_params;
+ OSSL_FUNC_kdf_set_ctx_params_fn *set_ctx_params;
+};
+
+#define EVP_ORIG_DYNAMIC 0
+#define EVP_ORIG_GLOBAL 1
+#define EVP_ORIG_METH 2
+
+struct evp_md_st {
+ /* nid */
+ int type;
+
+ /* Legacy structure members */
+ int pkey_type;
+ int md_size;
+ unsigned long flags;
+ int origin;
+ int (*init) (EVP_MD_CTX *ctx);
+ int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
+ int (*final) (EVP_MD_CTX *ctx, unsigned char *md);
+ int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);
+ int (*cleanup) (EVP_MD_CTX *ctx);
+ int block_size;
+ int ctx_size; /* how big does the ctx->md_data need to be */
+ /* control function */
+ int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
+
+ /* New structure members */
+ /* Above comment to be removed when legacy has gone */
+ int name_id;
+ char *type_name;
+ const char *description;
+ OSSL_PROVIDER *prov;
+ CRYPTO_REF_COUNT refcnt;
+ CRYPTO_RWLOCK *lock;
+ OSSL_FUNC_digest_newctx_fn *newctx;
+ OSSL_FUNC_digest_init_fn *dinit;
+ OSSL_FUNC_digest_update_fn *dupdate;
+ OSSL_FUNC_digest_final_fn *dfinal;
+ OSSL_FUNC_digest_digest_fn *digest;
+ OSSL_FUNC_digest_freectx_fn *freectx;
+ OSSL_FUNC_digest_dupctx_fn *dupctx;
+ OSSL_FUNC_digest_get_params_fn *get_params;
+ OSSL_FUNC_digest_set_ctx_params_fn *set_ctx_params;
+ OSSL_FUNC_digest_get_ctx_params_fn *get_ctx_params;
+ OSSL_FUNC_digest_gettable_params_fn *gettable_params;
+ OSSL_FUNC_digest_settable_ctx_params_fn *settable_ctx_params;
+ OSSL_FUNC_digest_gettable_ctx_params_fn *gettable_ctx_params;
+
+} /* EVP_MD */ ;
+
+struct evp_cipher_st {
+ int nid;
+
+ int block_size;
+ /* Default value for variable length ciphers */
+ int key_len;
+ int iv_len;
+
+ /* Legacy structure members */
+ /* Various flags */
+ unsigned long flags;
+ /* How the EVP_CIPHER was created. */
+ int origin;
+ /* init key */
+ int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
+ const unsigned char *iv, int enc);
+ /* encrypt/decrypt data */
+ int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, size_t inl);
+ /* cleanup ctx */
+ int (*cleanup) (EVP_CIPHER_CTX *);
+ /* how big ctx->cipher_data needs to be */
+ int ctx_size;
+ /* Populate a ASN1_TYPE with parameters */
+ int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
+ /* Get parameters from a ASN1_TYPE */
+ int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
+ /* Miscellaneous operations */
+ int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
+ /* Application data */
+ void *app_data;
+
+ /* New structure members */
+ /* Above comment to be removed when legacy has gone */
+ int name_id;
+ char *type_name;
+ const char *description;
+ OSSL_PROVIDER *prov;
+ CRYPTO_REF_COUNT refcnt;
+ CRYPTO_RWLOCK *lock;
+ OSSL_FUNC_cipher_newctx_fn *newctx;
+ OSSL_FUNC_cipher_encrypt_init_fn *einit;
+ OSSL_FUNC_cipher_decrypt_init_fn *dinit;
+ OSSL_FUNC_cipher_update_fn *cupdate;
+ OSSL_FUNC_cipher_final_fn *cfinal;
+ OSSL_FUNC_cipher_cipher_fn *ccipher;
+ OSSL_FUNC_cipher_freectx_fn *freectx;
+ OSSL_FUNC_cipher_dupctx_fn *dupctx;
+ OSSL_FUNC_cipher_get_params_fn *get_params;
+ OSSL_FUNC_cipher_get_ctx_params_fn *get_ctx_params;
+ OSSL_FUNC_cipher_set_ctx_params_fn *set_ctx_params;
+ OSSL_FUNC_cipher_gettable_params_fn *gettable_params;
+ OSSL_FUNC_cipher_gettable_ctx_params_fn *gettable_ctx_params;
+ OSSL_FUNC_cipher_settable_ctx_params_fn *settable_ctx_params;
+} /* EVP_CIPHER */ ;
+
+/* Macros to code block cipher wrappers */
+
+/* Wrapper functions for each cipher mode */
+
+#define EVP_C_DATA(kstruct, ctx) \
+ ((kstruct *)EVP_CIPHER_CTX_get_cipher_data(ctx))
+
+#define BLOCK_CIPHER_ecb_loop() \
+ size_t i, bl; \
+ bl = EVP_CIPHER_CTX_get0_cipher(ctx)->block_size; \
+ if (inl < bl) return 1;\
+ inl -= bl; \
+ for (i=0; i <= inl; i+=bl)
+
+#define BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
+static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
+{\
+ BLOCK_CIPHER_ecb_loop() \
+ cprefix##_ecb_encrypt(in + i, out + i, &EVP_C_DATA(kstruct,ctx)->ksched, EVP_CIPHER_CTX_is_encrypting(ctx)); \
+ return 1;\
+}
+
+#define EVP_MAXCHUNK ((size_t)1<<(sizeof(long)*8-2))
+
+#define BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched) \
+ static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
+{\
+ while(inl>=EVP_MAXCHUNK) {\
+ int num = EVP_CIPHER_CTX_get_num(ctx);\
+ cprefix##_ofb##cbits##_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, &num); \
+ EVP_CIPHER_CTX_set_num(ctx, num);\
+ inl-=EVP_MAXCHUNK;\
+ in +=EVP_MAXCHUNK;\
+ out+=EVP_MAXCHUNK;\
+ }\
+ if (inl) {\
+ int num = EVP_CIPHER_CTX_get_num(ctx);\
+ cprefix##_ofb##cbits##_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, &num); \
+ EVP_CIPHER_CTX_set_num(ctx, num);\
+ }\
+ return 1;\
+}
+
+#define BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
+static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
+{\
+ while(inl>=EVP_MAXCHUNK) \
+ {\
+ cprefix##_cbc_encrypt(in, out, (long)EVP_MAXCHUNK, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\
+ inl-=EVP_MAXCHUNK;\
+ in +=EVP_MAXCHUNK;\
+ out+=EVP_MAXCHUNK;\
+ }\
+ if (inl)\
+ cprefix##_cbc_encrypt(in, out, (long)inl, &EVP_C_DATA(kstruct,ctx)->ksched, ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx));\
+ return 1;\
+}
+
+#define BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
+static int cname##_cfb##cbits##_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) \
+{\
+ size_t chunk = EVP_MAXCHUNK;\
+ if (cbits == 1) chunk >>= 3;\
+ if (inl < chunk) chunk = inl;\
+ while (inl && inl >= chunk)\
+ {\
+ int num = EVP_CIPHER_CTX_get_num(ctx);\
+ cprefix##_cfb##cbits##_encrypt(in, out, (long) \
+ ((cbits == 1) \
+ && !EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS) \
+ ? chunk*8 : chunk), \
+ &EVP_C_DATA(kstruct, ctx)->ksched, ctx->iv,\
+ &num, EVP_CIPHER_CTX_is_encrypting(ctx));\
+ EVP_CIPHER_CTX_set_num(ctx, num);\
+ inl -= chunk;\
+ in += chunk;\
+ out += chunk;\
+ if (inl < chunk) chunk = inl;\
+ }\
+ return 1;\
+}
+
+#define BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
+ BLOCK_CIPHER_func_cbc(cname, cprefix, kstruct, ksched) \
+ BLOCK_CIPHER_func_cfb(cname, cprefix, cbits, kstruct, ksched) \
+ BLOCK_CIPHER_func_ecb(cname, cprefix, kstruct, ksched) \
+ BLOCK_CIPHER_func_ofb(cname, cprefix, cbits, kstruct, ksched)
+
+#define BLOCK_CIPHER_def1(cname, nmode, mode, MODE, kstruct, nid, block_size, \
+ key_len, iv_len, flags, init_key, cleanup, \
+ set_asn1, get_asn1, ctrl) \
+static const EVP_CIPHER cname##_##mode = { \
+ nid##_##nmode, block_size, key_len, iv_len, \
+ flags | EVP_CIPH_##MODE##_MODE, \
+ EVP_ORIG_GLOBAL, \
+ init_key, \
+ cname##_##mode##_cipher, \
+ cleanup, \
+ sizeof(kstruct), \
+ set_asn1, get_asn1,\
+ ctrl, \
+ NULL \
+}; \
+const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
+
+#define BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, \
+ iv_len, flags, init_key, cleanup, set_asn1, \
+ get_asn1, ctrl) \
+BLOCK_CIPHER_def1(cname, cbc, cbc, CBC, kstruct, nid, block_size, key_len, \
+ iv_len, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
+
+#define BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, \
+ iv_len, cbits, flags, init_key, cleanup, \
+ set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def1(cname, cfb##cbits, cfb##cbits, CFB, kstruct, nid, 1, \
+ key_len, iv_len, flags, init_key, cleanup, set_asn1, \
+ get_asn1, ctrl)
+
+#define BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, \
+ iv_len, cbits, flags, init_key, cleanup, \
+ set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def1(cname, ofb##cbits, ofb, OFB, kstruct, nid, 1, \
+ key_len, iv_len, flags, init_key, cleanup, set_asn1, \
+ get_asn1, ctrl)
+
+#define BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, \
+ flags, init_key, cleanup, set_asn1, \
+ get_asn1, ctrl) \
+BLOCK_CIPHER_def1(cname, ecb, ecb, ECB, kstruct, nid, block_size, key_len, \
+ 0, flags, init_key, cleanup, set_asn1, get_asn1, ctrl)
+
+#define BLOCK_CIPHER_defs(cname, kstruct, \
+ nid, block_size, key_len, iv_len, cbits, flags, \
+ init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_cbc(cname, kstruct, nid, block_size, key_len, iv_len, flags, \
+ init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_cfb(cname, kstruct, nid, key_len, iv_len, cbits, \
+ flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_ofb(cname, kstruct, nid, key_len, iv_len, cbits, \
+ flags, init_key, cleanup, set_asn1, get_asn1, ctrl) \
+BLOCK_CIPHER_def_ecb(cname, kstruct, nid, block_size, key_len, flags, \
+ init_key, cleanup, set_asn1, get_asn1, ctrl)
+
+/*-
+#define BLOCK_CIPHER_defs(cname, kstruct, \
+ nid, block_size, key_len, iv_len, flags,\
+ init_key, cleanup, set_asn1, get_asn1, ctrl)\
+static const EVP_CIPHER cname##_cbc = {\
+ nid##_cbc, block_size, key_len, iv_len, \
+ flags | EVP_CIPH_CBC_MODE,\
+ EVP_ORIG_GLOBAL,\
+ init_key,\
+ cname##_cbc_cipher,\
+ cleanup,\
+ sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
+ sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
+ set_asn1, get_asn1,\
+ ctrl, \
+ NULL \
+};\
+const EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\
+static const EVP_CIPHER cname##_cfb = {\
+ nid##_cfb64, 1, key_len, iv_len, \
+ flags | EVP_CIPH_CFB_MODE,\
+ EVP_ORIG_GLOBAL,\
+ init_key,\
+ cname##_cfb_cipher,\
+ cleanup,\
+ sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
+ sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
+ set_asn1, get_asn1,\
+ ctrl,\
+ NULL \
+};\
+const EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\
+static const EVP_CIPHER cname##_ofb = {\
+ nid##_ofb64, 1, key_len, iv_len, \
+ flags | EVP_CIPH_OFB_MODE,\
+ EVP_ORIG_GLOBAL,\
+ init_key,\
+ cname##_ofb_cipher,\
+ cleanup,\
+ sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
+ sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
+ set_asn1, get_asn1,\
+ ctrl,\
+ NULL \
+};\
+const EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\
+static const EVP_CIPHER cname##_ecb = {\
+ nid##_ecb, block_size, key_len, iv_len, \
+ flags | EVP_CIPH_ECB_MODE,\
+ EVP_ORIG_GLOBAL,\
+ init_key,\
+ cname##_ecb_cipher,\
+ cleanup,\
+ sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
+ sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
+ set_asn1, get_asn1,\
+ ctrl,\
+ NULL \
+};\
+const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
+*/
+
+#define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, \
+ block_size, key_len, iv_len, cbits, \
+ flags, init_key, \
+ cleanup, set_asn1, get_asn1, ctrl) \
+ BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \
+ BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \
+ cbits, flags, init_key, cleanup, set_asn1, \
+ get_asn1, ctrl)
+
+#define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len,fl) \
+ BLOCK_CIPHER_func_cfb(cipher##_##keysize,cprefix,cbits,kstruct,ksched) \
+ BLOCK_CIPHER_def_cfb(cipher##_##keysize,kstruct, \
+ NID_##cipher##_##keysize, keysize/8, iv_len, cbits, \
+ (fl)|EVP_CIPH_FLAG_DEFAULT_ASN1, \
+ cipher##_init_key, NULL, NULL, NULL, NULL)
+
+typedef struct {
+ unsigned char iv[EVP_MAX_IV_LENGTH];
+ unsigned int iv_len;
+ unsigned int tag_len;
+} evp_cipher_aead_asn1_params;
+
+int evp_cipher_param_to_asn1_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
+ evp_cipher_aead_asn1_params *params);
+
+int evp_cipher_asn1_to_param_ex(EVP_CIPHER_CTX *c, ASN1_TYPE *type,
+ evp_cipher_aead_asn1_params *params);
+
+/*
+ * To support transparent execution of operation in backends other
+ * than the "origin" key, we support transparent export/import to
+ * those providers, and maintain a cache of the imported keydata,
+ * so we don't need to redo the export/import every time we perform
+ * the same operation in that same provider.
+ * This requires that the "origin" backend (whether it's a legacy or a
+ * provider "origin") implements exports, and that the target provider
+ * has an EVP_KEYMGMT that implements import.
+ */
+typedef struct {
+ EVP_KEYMGMT *keymgmt;
+ void *keydata;
+} OP_CACHE_ELEM;
+
+DEFINE_STACK_OF(OP_CACHE_ELEM)
+
+/*
+ * An EVP_PKEY can have the following states:
+ *
+ * untyped & empty:
+ *
+ * type == EVP_PKEY_NONE && keymgmt == NULL
+ *
+ * typed & empty:
+ *
+ * (type != EVP_PKEY_NONE && pkey.ptr == NULL) ## legacy (libcrypto only)
+ * || (keymgmt != NULL && keydata == NULL) ## provider side
+ *
+ * fully assigned:
+ *
+ * (type != EVP_PKEY_NONE && pkey.ptr != NULL) ## legacy (libcrypto only)
+ * || (keymgmt != NULL && keydata != NULL) ## provider side
+ *
+ * The easiest way to detect a legacy key is:
+ *
+ * keymgmt == NULL && type != EVP_PKEY_NONE
+ *
+ * The easiest way to detect a provider side key is:
+ *
+ * keymgmt != NULL
+ */
+#define evp_pkey_is_blank(pk) \
+ ((pk)->type == EVP_PKEY_NONE && (pk)->keymgmt == NULL)
+#define evp_pkey_is_typed(pk) \
+ ((pk)->type != EVP_PKEY_NONE || (pk)->keymgmt != NULL)
+#ifndef FIPS_MODULE
+# define evp_pkey_is_assigned(pk) \
+ ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
+#else
+# define evp_pkey_is_assigned(pk) \
+ ((pk)->keydata != NULL)
+#endif
+#define evp_pkey_is_legacy(pk) \
+ ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
+#define evp_pkey_is_provided(pk) \
+ ((pk)->keymgmt != NULL)
+
+union legacy_pkey_st {
+ void *ptr;
+ struct rsa_st *rsa; /* RSA */
+# ifndef OPENSSL_NO_DSA
+ struct dsa_st *dsa; /* DSA */
+# endif
+# ifndef OPENSSL_NO_DH
+ struct dh_st *dh; /* DH */
+# endif
+# ifndef OPENSSL_NO_EC
+ struct ec_key_st *ec; /* ECC */
+ ECX_KEY *ecx; /* X25519, X448, Ed25519, Ed448 */
+# endif
+};
+
+struct evp_pkey_st {
+ /* == Legacy attributes == */
+ int type;
+ int save_type;
+
+# ifndef FIPS_MODULE
+ /*
+ * Legacy key "origin" is composed of a pointer to an EVP_PKEY_ASN1_METHOD,
+ * a pointer to a low level key and possibly a pointer to an engine.
+ */
+ const EVP_PKEY_ASN1_METHOD *ameth;
+ ENGINE *engine;
+ ENGINE *pmeth_engine; /* If not NULL public key ENGINE to use */
+
+ /* Union to store the reference to an origin legacy key */
+ union legacy_pkey_st pkey;
+
+ /* Union to store the reference to a non-origin legacy key */
+ union legacy_pkey_st legacy_cache_pkey;
+# endif
+
+ /* == Common attributes == */
+ CRYPTO_REF_COUNT references;
+ CRYPTO_RWLOCK *lock;
+#ifndef FIPS_MODULE
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+ int save_parameters;
+ unsigned int foreign:1; /* the low-level key is using an engine or an app-method */
+ CRYPTO_EX_DATA ex_data;
+#endif
+
+ /* == Provider attributes == */
+
+ /*
+ * Provider keydata "origin" is composed of a pointer to an EVP_KEYMGMT
+ * and a pointer to the provider side key data. This is never used at
+ * the same time as the legacy key data above.
+ */
+ EVP_KEYMGMT *keymgmt;
+ void *keydata;
+ /*
+ * If any libcrypto code does anything that may modify the keydata
+ * contents, this dirty counter must be incremented.
+ */
+ size_t dirty_cnt;
+
+ /*
+ * To support transparent execution of operation in backends other
+ * than the "origin" key, we support transparent export/import to
+ * those providers, and maintain a cache of the imported keydata,
+ * so we don't need to redo the export/import every time we perform
+ * the same operation in that same provider.
+ */
+ STACK_OF(OP_CACHE_ELEM) *operation_cache;
+
+ /*
+ * We keep a copy of that "origin"'s dirty count, so we know if the
+ * operation cache needs flushing.
+ */
+ size_t dirty_cnt_copy;
+
+ /* Cache of key object information */
+ struct {
+ int bits;
+ int security_bits;
+ int size;
+ } cache;
+} /* EVP_PKEY */ ;
+
+#define EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx) \
+ ((ctx)->operation == EVP_PKEY_OP_SIGN \
+ || (ctx)->operation == EVP_PKEY_OP_SIGNCTX \
+ || (ctx)->operation == EVP_PKEY_OP_VERIFY \
+ || (ctx)->operation == EVP_PKEY_OP_VERIFYCTX \
+ || (ctx)->operation == EVP_PKEY_OP_VERIFYRECOVER)
+
+#define EVP_PKEY_CTX_IS_DERIVE_OP(ctx) \
+ ((ctx)->operation == EVP_PKEY_OP_DERIVE)
+
+#define EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx) \
+ ((ctx)->operation == EVP_PKEY_OP_ENCRYPT \
+ || (ctx)->operation == EVP_PKEY_OP_DECRYPT)
+
+#define EVP_PKEY_CTX_IS_GEN_OP(ctx) \
+ ((ctx)->operation == EVP_PKEY_OP_PARAMGEN \
+ || (ctx)->operation == EVP_PKEY_OP_KEYGEN)
+
+#define EVP_PKEY_CTX_IS_FROMDATA_OP(ctx) \
+ ((ctx)->operation == EVP_PKEY_OP_FROMDATA)
+
+#define EVP_PKEY_CTX_IS_KEM_OP(ctx) \
+ ((ctx)->operation == EVP_PKEY_OP_ENCAPSULATE \
+ || (ctx)->operation == EVP_PKEY_OP_DECAPSULATE)
+
+void openssl_add_all_ciphers_int(void);
+void openssl_add_all_digests_int(void);
+void evp_cleanup_int(void);
+void evp_app_cleanup_int(void);
+void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx,
+ EVP_KEYMGMT **keymgmt,
+ const char *propquery);
+#ifndef FIPS_MODULE
+int evp_pkey_copy_downgraded(EVP_PKEY **dest, const EVP_PKEY *src);
+void *evp_pkey_get_legacy(EVP_PKEY *pk);
+void evp_pkey_free_legacy(EVP_PKEY *x);
+EVP_PKEY *evp_pkcs82pkey_legacy(const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx, const char *propq);
+#endif
+
+/*
+ * KEYMGMT utility functions
+ */
+
+/*
+ * Key import structure and helper function, to be used as an export callback
+ */
+struct evp_keymgmt_util_try_import_data_st {
+ EVP_KEYMGMT *keymgmt;
+ void *keydata;
+
+ int selection;
+};
+int evp_keymgmt_util_try_import(const OSSL_PARAM params[], void *arg);
+int evp_keymgmt_util_assign_pkey(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt,
+ void *keydata);
+EVP_PKEY *evp_keymgmt_util_make_pkey(EVP_KEYMGMT *keymgmt, void *keydata);
+
+int evp_keymgmt_util_export(const EVP_PKEY *pk, int selection,
+ OSSL_CALLBACK *export_cb, void *export_cbarg);
+void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
+OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
+ EVP_KEYMGMT *keymgmt);
+int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk, int locking);
+int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk,
+ EVP_KEYMGMT *keymgmt, void *keydata);
+void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
+void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
+ int selection, const OSSL_PARAM params[]);
+int evp_keymgmt_util_has(EVP_PKEY *pk, int selection);
+int evp_keymgmt_util_match(EVP_PKEY *pk1, EVP_PKEY *pk2, int selection);
+int evp_keymgmt_util_copy(EVP_PKEY *to, EVP_PKEY *from, int selection);
+void *evp_keymgmt_util_gen(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
+ void *genctx, OSSL_CALLBACK *cb, void *cbarg);
+int evp_keymgmt_util_get_deflt_digest_name(EVP_KEYMGMT *keymgmt,
+ void *keydata,
+ char *mdname, size_t mdname_sz);
+const char *evp_keymgmt_util_query_operation_name(EVP_KEYMGMT *keymgmt,
+ int op_id);
+
+/*
+ * KEYMGMT provider interface functions
+ */
+void *evp_keymgmt_newdata(const EVP_KEYMGMT *keymgmt);
+void evp_keymgmt_freedata(const EVP_KEYMGMT *keymgmt, void *keyddata);
+int evp_keymgmt_get_params(const EVP_KEYMGMT *keymgmt,
+ void *keydata, OSSL_PARAM params[]);
+int evp_keymgmt_set_params(const EVP_KEYMGMT *keymgmt,
+ void *keydata, const OSSL_PARAM params[]);
+void *evp_keymgmt_gen_init(const EVP_KEYMGMT *keymgmt, int selection,
+ const OSSL_PARAM params[]);
+int evp_keymgmt_gen_set_template(const EVP_KEYMGMT *keymgmt, void *genctx,
+ void *template);
+int evp_keymgmt_gen_set_params(const EVP_KEYMGMT *keymgmt, void *genctx,
+ const OSSL_PARAM params[]);
+void *evp_keymgmt_gen(const EVP_KEYMGMT *keymgmt, void *genctx,
+ OSSL_CALLBACK *cb, void *cbarg);
+void evp_keymgmt_gen_cleanup(const EVP_KEYMGMT *keymgmt, void *genctx);
+
+int evp_keymgmt_has_load(const EVP_KEYMGMT *keymgmt);
+void *evp_keymgmt_load(const EVP_KEYMGMT *keymgmt,
+ const void *objref, size_t objref_sz);
+
+int evp_keymgmt_has(const EVP_KEYMGMT *keymgmt, void *keyddata, int selection);
+int evp_keymgmt_validate(const EVP_KEYMGMT *keymgmt, void *keydata,
+ int selection, int checktype);
+int evp_keymgmt_match(const EVP_KEYMGMT *keymgmt,
+ const void *keydata1, const void *keydata2,
+ int selection);
+
+int evp_keymgmt_import(const EVP_KEYMGMT *keymgmt, void *keydata,
+ int selection, const OSSL_PARAM params[]);
+const OSSL_PARAM *evp_keymgmt_import_types(const EVP_KEYMGMT *keymgmt,
+ int selection);
+int evp_keymgmt_export(const EVP_KEYMGMT *keymgmt, void *keydata,
+ int selection, OSSL_CALLBACK *param_cb, void *cbarg);
+const OSSL_PARAM *evp_keymgmt_export_types(const EVP_KEYMGMT *keymgmt,
+ int selection);
+void *evp_keymgmt_dup(const EVP_KEYMGMT *keymgmt,
+ const void *keydata_from, int selection);
+
+/* Pulling defines out of C source files */
+
+# define EVP_RC4_KEY_SIZE 16
+# ifndef TLS1_1_VERSION
+# define TLS1_1_VERSION 0x0302
+# endif
+
+void evp_encode_ctx_set_flags(EVP_ENCODE_CTX *ctx, unsigned int flags);
+
+/* EVP_ENCODE_CTX flags */
+/* Don't generate new lines when encoding */
+#define EVP_ENCODE_CTX_NO_NEWLINES 1
+/* Use the SRP base64 alphabet instead of the standard one */
+#define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2
+
+const EVP_CIPHER *evp_get_cipherbyname_ex(OSSL_LIB_CTX *libctx,
+ const char *name);
+const EVP_MD *evp_get_digestbyname_ex(OSSL_LIB_CTX *libctx,
+ const char *name);
+
+int ossl_pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen,
+ const unsigned char *salt, int saltlen, int iter,
+ const EVP_MD *digest, int keylen,
+ unsigned char *out,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+# ifndef FIPS_MODULE
+/*
+ * Internal helpers for stricter EVP_PKEY_CTX_{set,get}_params().
+ *
+ * Return 1 on success, 0 or negative for errors.
+ *
+ * In particular they return -2 if any of the params is not supported.
+ *
+ * They are not available in FIPS_MODULE as they depend on
+ * - EVP_PKEY_CTX_{get,set}_params()
+ * - EVP_PKEY_CTX_{gettable,settable}_params()
+ *
+ */
+int evp_pkey_ctx_set_params_strict(EVP_PKEY_CTX *ctx, OSSL_PARAM *params);
+int evp_pkey_ctx_get_params_strict(EVP_PKEY_CTX *ctx, OSSL_PARAM *params);
+
+EVP_MD_CTX *evp_md_ctx_new_ex(EVP_PKEY *pkey, const ASN1_OCTET_STRING *id,
+ OSSL_LIB_CTX *libctx, const char *propq);
+int evp_pkey_name2type(const char *name);
+const char *evp_pkey_type2name(int type);
+
+int evp_pkey_ctx_set1_id_prov(EVP_PKEY_CTX *ctx, const void *id, int len);
+int evp_pkey_ctx_get1_id_prov(EVP_PKEY_CTX *ctx, void *id);
+int evp_pkey_ctx_get1_id_len_prov(EVP_PKEY_CTX *ctx, size_t *id_len);
+
+int evp_pkey_ctx_use_cached_data(EVP_PKEY_CTX *ctx);
+# endif /* !defined(FIPS_MODULE) */
+
+int evp_method_store_flush(OSSL_LIB_CTX *libctx);
+int evp_default_properties_enable_fips_int(OSSL_LIB_CTX *libctx, int enable,
+ int loadconfig);
+int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq,
+ int loadconfig, int mirrored);
+char *evp_get_global_properties_str(OSSL_LIB_CTX *libctx, int loadconfig);
+
+void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force);
+
+/* Three possible states: */
+# define EVP_PKEY_STATE_UNKNOWN 0
+# define EVP_PKEY_STATE_LEGACY 1
+# define EVP_PKEY_STATE_PROVIDER 2
+int evp_pkey_ctx_state(const EVP_PKEY_CTX *ctx);
+
+/* These two must ONLY be called for provider side operations */
+int evp_pkey_ctx_ctrl_to_param(EVP_PKEY_CTX *ctx,
+ int keytype, int optype,
+ int cmd, int p1, void *p2);
+int evp_pkey_ctx_ctrl_str_to_param(EVP_PKEY_CTX *ctx,
+ const char *name, const char *value);
+
+/* These two must ONLY be called for legacy operations */
+int evp_pkey_ctx_set_params_to_ctrl(EVP_PKEY_CTX *ctx, const OSSL_PARAM *params);
+int evp_pkey_ctx_get_params_to_ctrl(EVP_PKEY_CTX *ctx, OSSL_PARAM *params);
+
+/* This must ONLY be called for legacy EVP_PKEYs */
+int evp_pkey_get_params_to_ctrl(const EVP_PKEY *pkey, OSSL_PARAM *params);
+
+/* Same as the public get0 functions but are not const */
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+DH *evp_pkey_get0_DH_int(const EVP_PKEY *pkey);
+EC_KEY *evp_pkey_get0_EC_KEY_int(const EVP_PKEY *pkey);
+RSA *evp_pkey_get0_RSA_int(const EVP_PKEY *pkey);
+# endif
+
+/* Get internal identification number routines */
+int evp_asym_cipher_get_number(const EVP_ASYM_CIPHER *cipher);
+int evp_cipher_get_number(const EVP_CIPHER *cipher);
+int evp_kdf_get_number(const EVP_KDF *kdf);
+int evp_kem_get_number(const EVP_KEM *wrap);
+int evp_keyexch_get_number(const EVP_KEYEXCH *keyexch);
+int evp_keymgmt_get_number(const EVP_KEYMGMT *keymgmt);
+int evp_mac_get_number(const EVP_MAC *mac);
+int evp_md_get_number(const EVP_MD *md);
+int evp_rand_get_number(const EVP_RAND *rand);
+int evp_signature_get_number(const EVP_SIGNATURE *signature);
+
+#endif /* OSSL_CRYPTO_EVP_H */
diff --git a/NorthstarDLL/include/crypto/evperr.h b/NorthstarDLL/include/crypto/evperr.h
new file mode 100644
index 00000000..d90ba83f
--- /dev/null
+++ b/NorthstarDLL/include/crypto/evperr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_EVPERR_H
+# define OSSL_CRYPTO_EVPERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_EVP_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/httperr.h b/NorthstarDLL/include/crypto/httperr.h
new file mode 100644
index 00000000..969df17b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/httperr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_HTTPERR_H
+# define OSSL_CRYPTO_HTTPERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_HTTP_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/lhash.h b/NorthstarDLL/include/crypto/lhash.h
new file mode 100644
index 00000000..0f64869f
--- /dev/null
+++ b/NorthstarDLL/include/crypto/lhash.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_LHASH_H
+# define OSSL_CRYPTO_LHASH_H
+# pragma once
+
+unsigned long ossl_lh_strcasehash(const char *);
+
+#endif /* OSSL_CRYPTO_LHASH_H */
diff --git a/NorthstarDLL/include/crypto/md32_common.h b/NorthstarDLL/include/crypto/md32_common.h
new file mode 100644
index 00000000..3b16f1b7
--- /dev/null
+++ b/NorthstarDLL/include/crypto/md32_common.h
@@ -0,0 +1,256 @@
+/*
+ * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*-
+ * This is a generic 32 bit "collector" for message digest algorithms.
+ * Whenever needed it collects input character stream into chunks of
+ * 32 bit values and invokes a block function that performs actual hash
+ * calculations.
+ *
+ * Porting guide.
+ *
+ * Obligatory macros:
+ *
+ * DATA_ORDER_IS_BIG_ENDIAN or DATA_ORDER_IS_LITTLE_ENDIAN
+ * this macro defines byte order of input stream.
+ * HASH_CBLOCK
+ * size of a unit chunk HASH_BLOCK operates on.
+ * HASH_LONG
+ * has to be at least 32 bit wide.
+ * HASH_CTX
+ * context structure that at least contains following
+ * members:
+ * typedef struct {
+ * ...
+ * HASH_LONG Nl,Nh;
+ * either {
+ * HASH_LONG data[HASH_LBLOCK];
+ * unsigned char data[HASH_CBLOCK];
+ * };
+ * unsigned int num;
+ * ...
+ * } HASH_CTX;
+ * data[] vector is expected to be zeroed upon first call to
+ * HASH_UPDATE.
+ * HASH_UPDATE
+ * name of "Update" function, implemented here.
+ * HASH_TRANSFORM
+ * name of "Transform" function, implemented here.
+ * HASH_FINAL
+ * name of "Final" function, implemented here.
+ * HASH_BLOCK_DATA_ORDER
+ * name of "block" function capable of treating *unaligned* input
+ * message in original (data) byte order, implemented externally.
+ * HASH_MAKE_STRING
+ * macro converting context variables to an ASCII hash string.
+ *
+ * MD5 example:
+ *
+ * #define DATA_ORDER_IS_LITTLE_ENDIAN
+ *
+ * #define HASH_LONG MD5_LONG
+ * #define HASH_CTX MD5_CTX
+ * #define HASH_CBLOCK MD5_CBLOCK
+ * #define HASH_UPDATE MD5_Update
+ * #define HASH_TRANSFORM MD5_Transform
+ * #define HASH_FINAL MD5_Final
+ * #define HASH_BLOCK_DATA_ORDER md5_block_data_order
+ */
+
+#include
+
+#if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+# error "DATA_ORDER must be defined!"
+#endif
+
+#ifndef HASH_CBLOCK
+# error "HASH_CBLOCK must be defined!"
+#endif
+#ifndef HASH_LONG
+# error "HASH_LONG must be defined!"
+#endif
+#ifndef HASH_CTX
+# error "HASH_CTX must be defined!"
+#endif
+
+#ifndef HASH_UPDATE
+# error "HASH_UPDATE must be defined!"
+#endif
+#ifndef HASH_TRANSFORM
+# error "HASH_TRANSFORM must be defined!"
+#endif
+#ifndef HASH_FINAL
+# error "HASH_FINAL must be defined!"
+#endif
+
+#ifndef HASH_BLOCK_DATA_ORDER
+# error "HASH_BLOCK_DATA_ORDER must be defined!"
+#endif
+
+#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
+
+#if defined(DATA_ORDER_IS_BIG_ENDIAN)
+
+# define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \
+ l|=(((unsigned long)(*((c)++)))<<16), \
+ l|=(((unsigned long)(*((c)++)))<< 8), \
+ l|=(((unsigned long)(*((c)++))) ) )
+# define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16)&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
+ *((c)++)=(unsigned char)(((l) )&0xff), \
+ l)
+
+#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+
+# define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \
+ l|=(((unsigned long)(*((c)++)))<< 8), \
+ l|=(((unsigned long)(*((c)++)))<<16), \
+ l|=(((unsigned long)(*((c)++)))<<24) )
+# define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
+ *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>16)&0xff), \
+ *((c)++)=(unsigned char)(((l)>>24)&0xff), \
+ l)
+
+#endif
+
+/*
+ * Time for some action :-)
+ */
+
+int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
+{
+ const unsigned char *data = data_;
+ unsigned char *p;
+ HASH_LONG l;
+ size_t n;
+
+ if (len == 0)
+ return 1;
+
+ l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
+ if (l < c->Nl) /* overflow */
+ c->Nh++;
+ c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
+ * 16-bit */
+ c->Nl = l;
+
+ n = c->num;
+ if (n != 0) {
+ p = (unsigned char *)c->data;
+
+ if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
+ memcpy(p + n, data, HASH_CBLOCK - n);
+ HASH_BLOCK_DATA_ORDER(c, p, 1);
+ n = HASH_CBLOCK - n;
+ data += n;
+ len -= n;
+ c->num = 0;
+ /*
+ * We use memset rather than OPENSSL_cleanse() here deliberately.
+ * Using OPENSSL_cleanse() here could be a performance issue. It
+ * will get properly cleansed on finalisation so this isn't a
+ * security problem.
+ */
+ memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
+ } else {
+ memcpy(p + n, data, len);
+ c->num += (unsigned int)len;
+ return 1;
+ }
+ }
+
+ n = len / HASH_CBLOCK;
+ if (n > 0) {
+ HASH_BLOCK_DATA_ORDER(c, data, n);
+ n *= HASH_CBLOCK;
+ data += n;
+ len -= n;
+ }
+
+ if (len != 0) {
+ p = (unsigned char *)c->data;
+ c->num = (unsigned int)len;
+ memcpy(p, data, len);
+ }
+ return 1;
+}
+
+void HASH_TRANSFORM(HASH_CTX *c, const unsigned char *data)
+{
+ HASH_BLOCK_DATA_ORDER(c, data, 1);
+}
+
+int HASH_FINAL(unsigned char *md, HASH_CTX *c)
+{
+ unsigned char *p = (unsigned char *)c->data;
+ size_t n = c->num;
+
+ p[n] = 0x80; /* there is always room for one */
+ n++;
+
+ if (n > (HASH_CBLOCK - 8)) {
+ memset(p + n, 0, HASH_CBLOCK - n);
+ n = 0;
+ HASH_BLOCK_DATA_ORDER(c, p, 1);
+ }
+ memset(p + n, 0, HASH_CBLOCK - 8 - n);
+
+ p += HASH_CBLOCK - 8;
+#if defined(DATA_ORDER_IS_BIG_ENDIAN)
+ (void)HOST_l2c(c->Nh, p);
+ (void)HOST_l2c(c->Nl, p);
+#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
+ (void)HOST_l2c(c->Nl, p);
+ (void)HOST_l2c(c->Nh, p);
+#endif
+ p -= HASH_CBLOCK;
+ HASH_BLOCK_DATA_ORDER(c, p, 1);
+ c->num = 0;
+ OPENSSL_cleanse(p, HASH_CBLOCK);
+
+#ifndef HASH_MAKE_STRING
+# error "HASH_MAKE_STRING must be defined!"
+#else
+ HASH_MAKE_STRING(c, md);
+#endif
+
+ return 1;
+}
+
+#ifndef MD32_REG_T
+# if defined(__alpha) || defined(__sparcv9) || defined(__mips)
+# define MD32_REG_T long
+/*
+ * This comment was originally written for MD5, which is why it
+ * discusses A-D. But it basically applies to all 32-bit digests,
+ * which is why it was moved to common header file.
+ *
+ * In case you wonder why A-D are declared as long and not
+ * as MD5_LONG. Doing so results in slight performance
+ * boost on LP64 architectures. The catch is we don't
+ * really care if 32 MSBs of a 64-bit register get polluted
+ * with eventual overflows as we *save* only 32 LSBs in
+ * *either* case. Now declaring 'em long excuses the compiler
+ * from keeping 32 MSBs zeroed resulting in 13% performance
+ * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
+ * Well, to be honest it should say that this *prevents*
+ * performance degradation.
+ */
+# else
+/*
+ * Above is not absolute and there are LP64 compilers that
+ * generate better code if MD32_REG_T is defined int. The above
+ * pre-processor condition reflects the circumstances under which
+ * the conclusion was made and is subject to further extension.
+ */
+# define MD32_REG_T int
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/modes.h b/NorthstarDLL/include/crypto/modes.h
new file mode 100644
index 00000000..19f9d859
--- /dev/null
+++ b/NorthstarDLL/include/crypto/modes.h
@@ -0,0 +1,223 @@
+/*
+ * Copyright 2010-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* This header can move into provider when legacy support is removed */
+#include
+
+#if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+typedef __int64 i64;
+typedef unsigned __int64 u64;
+# define U64(C) C##UI64
+#elif defined(__arch64__)
+typedef long i64;
+typedef unsigned long u64;
+# define U64(C) C##UL
+#else
+typedef long long i64;
+typedef unsigned long long u64;
+# define U64(C) C##ULL
+#endif
+
+typedef unsigned int u32;
+typedef unsigned char u8;
+
+#define STRICT_ALIGNMENT 1
+#ifndef PEDANTIC
+# if defined(__i386) || defined(__i386__) || \
+ defined(__x86_64) || defined(__x86_64__) || \
+ defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
+ defined(__aarch64__) || \
+ defined(__s390__) || defined(__s390x__)
+# undef STRICT_ALIGNMENT
+# endif
+#endif
+
+#if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
+# if defined(__GNUC__) && __GNUC__>=2
+# if defined(__x86_64) || defined(__x86_64__)
+# define BSWAP8(x) ({ u64 ret_=(x); \
+ asm ("bswapq %0" \
+ : "+r"(ret_)); ret_; })
+# define BSWAP4(x) ({ u32 ret_=(x); \
+ asm ("bswapl %0" \
+ : "+r"(ret_)); ret_; })
+# elif (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)
+# define BSWAP8(x) ({ u32 lo_=(u64)(x)>>32,hi_=(x); \
+ asm ("bswapl %0; bswapl %1" \
+ : "+r"(hi_),"+r"(lo_)); \
+ (u64)hi_<<32|lo_; })
+# define BSWAP4(x) ({ u32 ret_=(x); \
+ asm ("bswapl %0" \
+ : "+r"(ret_)); ret_; })
+# elif defined(__aarch64__)
+# if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
+ __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
+# define BSWAP8(x) ({ u64 ret_; \
+ asm ("rev %0,%1" \
+ : "=r"(ret_) : "r"(x)); ret_; })
+# define BSWAP4(x) ({ u32 ret_; \
+ asm ("rev %w0,%w1" \
+ : "=r"(ret_) : "r"(x)); ret_; })
+# endif
+# elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT)
+# define BSWAP8(x) ({ u32 lo_=(u64)(x)>>32,hi_=(x); \
+ asm ("rev %0,%0; rev %1,%1" \
+ : "+r"(hi_),"+r"(lo_)); \
+ (u64)hi_<<32|lo_; })
+# define BSWAP4(x) ({ u32 ret_; \
+ asm ("rev %0,%1" \
+ : "=r"(ret_) : "r"((u32)(x))); \
+ ret_; })
+# endif
+# elif defined(_MSC_VER)
+# if _MSC_VER>=1300
+# include
+# pragma intrinsic(_byteswap_uint64,_byteswap_ulong)
+# define BSWAP8(x) _byteswap_uint64((u64)(x))
+# define BSWAP4(x) _byteswap_ulong((u32)(x))
+# elif defined(_M_IX86)
+__inline u32 _bswap4(u32 val)
+{
+_asm mov eax, val _asm bswap eax}
+# define BSWAP4(x) _bswap4(x)
+# endif
+# endif
+#endif
+#if defined(BSWAP4) && !defined(STRICT_ALIGNMENT)
+# define GETU32(p) BSWAP4(*(const u32 *)(p))
+# define PUTU32(p,v) *(u32 *)(p) = BSWAP4(v)
+#else
+# define GETU32(p) ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
+# define PUTU32(p,v) ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
+#endif
+/*- GCM definitions */ typedef struct {
+ u64 hi, lo;
+} u128;
+
+#ifdef TABLE_BITS
+# undef TABLE_BITS
+#endif
+/*
+ * Even though permitted values for TABLE_BITS are 8, 4 and 1, it should
+ * never be set to 8 [or 1]. For further information see gcm128.c.
+ */
+#define TABLE_BITS 4
+
+struct gcm128_context {
+ /* Following 6 names follow names in GCM specification */
+ union {
+ u64 u[2];
+ u32 d[4];
+ u8 c[16];
+ size_t t[16 / sizeof(size_t)];
+ } Yi, EKi, EK0, len, Xi, H;
+ /*
+ * Relative position of Xi, H and pre-computed Htable is used in some
+ * assembler modules, i.e. don't change the order!
+ */
+#if TABLE_BITS==8
+ u128 Htable[256];
+#else
+ u128 Htable[16];
+ void (*gmult) (u64 Xi[2], const u128 Htable[16]);
+ void (*ghash) (u64 Xi[2], const u128 Htable[16], const u8 *inp,
+ size_t len);
+#endif
+ unsigned int mres, ares;
+ block128_f block;
+ void *key;
+#if !defined(OPENSSL_SMALL_FOOTPRINT)
+ unsigned char Xn[48];
+#endif
+};
+
+/*
+ * The maximum permitted number of cipher blocks per data unit in XTS mode.
+ * Reference IEEE Std 1619-2018.
+ */
+#define XTS_MAX_BLOCKS_PER_DATA_UNIT (1<<20)
+
+struct xts128_context {
+ void *key1, *key2;
+ block128_f block1, block2;
+};
+
+struct ccm128_context {
+ union {
+ u64 u[2];
+ u8 c[16];
+ } nonce, cmac;
+ u64 blocks;
+ block128_f block;
+ void *key;
+};
+
+#ifndef OPENSSL_NO_OCB
+
+typedef union {
+ u64 a[2];
+ unsigned char c[16];
+} OCB_BLOCK;
+# define ocb_block16_xor(in1,in2,out) \
+ ( (out)->a[0]=(in1)->a[0]^(in2)->a[0], \
+ (out)->a[1]=(in1)->a[1]^(in2)->a[1] )
+# if STRICT_ALIGNMENT
+# define ocb_block16_xor_misaligned(in1,in2,out) \
+ ocb_block_xor((in1)->c,(in2)->c,16,(out)->c)
+# else
+# define ocb_block16_xor_misaligned ocb_block16_xor
+# endif
+
+struct ocb128_context {
+ /* Need both encrypt and decrypt key schedules for decryption */
+ block128_f encrypt;
+ block128_f decrypt;
+ void *keyenc;
+ void *keydec;
+ ocb128_f stream; /* direction dependent */
+ /* Key dependent variables. Can be reused if key remains the same */
+ size_t l_index;
+ size_t max_l_index;
+ OCB_BLOCK l_star;
+ OCB_BLOCK l_dollar;
+ OCB_BLOCK *l;
+ /* Must be reset for each session */
+ struct {
+ u64 blocks_hashed;
+ u64 blocks_processed;
+ OCB_BLOCK offset_aad;
+ OCB_BLOCK sum;
+ OCB_BLOCK offset;
+ OCB_BLOCK checksum;
+ } sess;
+};
+#endif /* OPENSSL_NO_OCB */
+
+#ifndef OPENSSL_NO_SIV
+
+#define SIV_LEN 16
+
+typedef union siv_block_u {
+ uint64_t word[SIV_LEN/sizeof(uint64_t)];
+ unsigned char byte[SIV_LEN];
+} SIV_BLOCK;
+
+struct siv128_context {
+ /* d stores intermediate results of S2V; it corresponds to D from the
+ pseudocode in section 2.4 of RFC 5297. */
+ SIV_BLOCK d;
+ SIV_BLOCK tag;
+ EVP_CIPHER_CTX *cipher_ctx;
+ EVP_MAC *mac;
+ EVP_MAC_CTX *mac_ctx_init;
+ int final_ret;
+ int crypto_ok;
+};
+
+#endif /* OPENSSL_NO_SIV */
diff --git a/NorthstarDLL/include/crypto/objects.h b/NorthstarDLL/include/crypto/objects.h
new file mode 100644
index 00000000..f22e9287
--- /dev/null
+++ b/NorthstarDLL/include/crypto/objects.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include
+
+void ossl_obj_cleanup_int(void);
diff --git a/NorthstarDLL/include/crypto/objectserr.h b/NorthstarDLL/include/crypto/objectserr.h
new file mode 100644
index 00000000..ec994824
--- /dev/null
+++ b/NorthstarDLL/include/crypto/objectserr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_OBJECTSERR_H
+# define OSSL_CRYPTO_OBJECTSERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_OBJ_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/ocsperr.h b/NorthstarDLL/include/crypto/ocsperr.h
new file mode 100644
index 00000000..f9529b2a
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ocsperr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_OCSPERR_H
+# define OSSL_CRYPTO_OCSPERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_OCSP
+
+int ossl_err_load_OCSP_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/pem.h b/NorthstarDLL/include/crypto/pem.h
new file mode 100644
index 00000000..840dc18f
--- /dev/null
+++ b/NorthstarDLL/include/crypto/pem.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_INTERNAL_PEM_H
+# define OSSL_INTERNAL_PEM_H
+# pragma once
+
+# include
+# include "crypto/types.h"
+
+/* Found in crypto/pem/pvkfmt.c */
+
+/* Maximum length of a blob after header */
+# define BLOB_MAX_LENGTH 102400
+
+int ossl_do_blob_header(const unsigned char **in, unsigned int length,
+ unsigned int *pmagic, unsigned int *pbitlen,
+ int *pisdss, int *pispub);
+unsigned int ossl_blob_length(unsigned bitlen, int isdss, int ispub);
+int ossl_do_PVK_header(const unsigned char **in, unsigned int length,
+ int skip_magic,
+ unsigned int *psaltlen, unsigned int *pkeylen);
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# ifndef OPENSSL_NO_DSA
+DSA *ossl_b2i_DSA_after_header(const unsigned char **in, unsigned int bitlen,
+ int ispub);
+# endif
+RSA *ossl_b2i_RSA_after_header(const unsigned char **in, unsigned int bitlen,
+ int ispub);
+# endif
+EVP_PKEY *ossl_b2i(const unsigned char **in, unsigned int length, int *ispub);
+EVP_PKEY *ossl_b2i_bio(BIO *in, int *ispub);
+
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# ifndef OPENSSL_NO_DSA
+DSA *b2i_DSA_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
+DSA *b2i_DSA_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
+ OSSL_LIB_CTX *libctx, const char *propq);
+# endif
+RSA *b2i_RSA_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
+RSA *b2i_RSA_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u,
+ OSSL_LIB_CTX *libctx, const char *propq);
+# endif
+
+#endif
diff --git a/NorthstarDLL/include/crypto/pemerr.h b/NorthstarDLL/include/crypto/pemerr.h
new file mode 100644
index 00000000..b255ff5c
--- /dev/null
+++ b/NorthstarDLL/include/crypto/pemerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_PEMERR_H
+# define OSSL_CRYPTO_PEMERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_PEM_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/pkcs12err.h b/NorthstarDLL/include/crypto/pkcs12err.h
new file mode 100644
index 00000000..662f412e
--- /dev/null
+++ b/NorthstarDLL/include/crypto/pkcs12err.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_PKCS12ERR_H
+# define OSSL_CRYPTO_PKCS12ERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_PKCS12_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/pkcs7.h b/NorthstarDLL/include/crypto/pkcs7.h
new file mode 100644
index 00000000..9caa9af4
--- /dev/null
+++ b/NorthstarDLL/include/crypto/pkcs7.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_PKCS7_H
+# define OSSL_CRYPTO_PKCS7_H
+# pragma once
+
+void ossl_pkcs7_resolve_libctx(PKCS7 *p7);
+
+void ossl_pkcs7_set0_libctx(PKCS7 *p7, OSSL_LIB_CTX *ctx);
+int ossl_pkcs7_set1_propq(PKCS7 *p7, const char *propq);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/pkcs7err.h b/NorthstarDLL/include/crypto/pkcs7err.h
new file mode 100644
index 00000000..c195190b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/pkcs7err.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_PKCS7ERR_H
+# define OSSL_CRYPTO_PKCS7ERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_PKCS7_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/poly1305.h b/NorthstarDLL/include/crypto/poly1305.h
new file mode 100644
index 00000000..ba54f3bd
--- /dev/null
+++ b/NorthstarDLL/include/crypto/poly1305.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_POLY1305_H
+# define OSSL_CRYPTO_POLY1305_H
+# pragma once
+
+#include
+
+#define POLY1305_BLOCK_SIZE 16
+#define POLY1305_DIGEST_SIZE 16
+#define POLY1305_KEY_SIZE 32
+
+typedef struct poly1305_context POLY1305;
+
+typedef void (*poly1305_blocks_f) (void *ctx, const unsigned char *inp,
+ size_t len, unsigned int padbit);
+typedef void (*poly1305_emit_f) (void *ctx, unsigned char mac[16],
+ const unsigned int nonce[4]);
+
+struct poly1305_context {
+ double opaque[24]; /* large enough to hold internal state, declared
+ * 'double' to ensure at least 64-bit invariant
+ * alignment across all platforms and
+ * configurations */
+ unsigned int nonce[4];
+ unsigned char data[POLY1305_BLOCK_SIZE];
+ size_t num;
+ struct {
+ poly1305_blocks_f blocks;
+ poly1305_emit_f emit;
+ } func;
+};
+
+size_t Poly1305_ctx_size(void);
+void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32]);
+void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len);
+void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]);
+
+#endif /* OSSL_CRYPTO_POLY1305_H */
diff --git a/NorthstarDLL/include/crypto/ppc_arch.h b/NorthstarDLL/include/crypto/ppc_arch.h
new file mode 100644
index 00000000..3b3ce4bf
--- /dev/null
+++ b/NorthstarDLL/include/crypto/ppc_arch.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_PPC_ARCH_H
+# define OSSL_CRYPTO_PPC_ARCH_H
+
+extern unsigned int OPENSSL_ppccap_P;
+
+/*
+ * Flags' usage can appear ambiguous, because they are set rather
+ * to reflect OpenSSL performance preferences than actual processor
+ * capabilities.
+ */
+# define PPC_FPU64 (1<<0)
+# define PPC_ALTIVEC (1<<1)
+# define PPC_CRYPTO207 (1<<2)
+# define PPC_FPU (1<<3)
+# define PPC_MADD300 (1<<4)
+# define PPC_MFTB (1<<5)
+# define PPC_MFSPR268 (1<<6)
+
+#endif
diff --git a/NorthstarDLL/include/crypto/punycode.h b/NorthstarDLL/include/crypto/punycode.h
new file mode 100644
index 00000000..133826d8
--- /dev/null
+++ b/NorthstarDLL/include/crypto/punycode.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_PUNYCODE_H
+# define OSSL_CRYPTO_PUNYCODE_H
+# pragma once
+
+int ossl_punycode_decode (
+ const char *pEncoded,
+ const size_t enc_len,
+ unsigned int *pDecoded,
+ unsigned int *pout_length
+);
+
+int ossl_a2ulabel(const char *in, char *out, size_t *outlen);
+
+int ossl_a2ucompare(const char *a, const char *u);
+#endif
diff --git a/NorthstarDLL/include/crypto/rand.h b/NorthstarDLL/include/crypto/rand.h
new file mode 100644
index 00000000..fa3b5b2b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/rand.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * Licensed under the Apache License 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * https://www.openssl.org/source/license.html
+ * or in the file LICENSE in the source distribution.
+ */
+
+#ifndef OSSL_CRYPTO_RAND_H
+# define OSSL_CRYPTO_RAND_H
+# pragma once
+
+# include
+# include "crypto/rand_pool.h"
+
+# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
+# include
+# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || \
+ (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
+# define OPENSSL_APPLE_CRYPTO_RANDOM 1
+# include
+# include
+# endif
+# endif
+
+/*
+ * Defines related to seed sources
+ */
+#ifndef DEVRANDOM
+/*
+ * set this to a comma-separated list of 'random' device files to try out. By
+ * default, we will try to read at least one of these files
+ */
+# define DEVRANDOM "/dev/urandom", "/dev/random", "/dev/hwrng", "/dev/srandom"
+# if defined(__linux) && !defined(__ANDROID__)
+# ifndef DEVRANDOM_WAIT
+# define DEVRANDOM_WAIT "/dev/random"
+# endif
+/*
+ * Linux kernels 4.8 and later changes how their random device works and there
+ * is no reliable way to tell that /dev/urandom has been seeded -- getentropy(2)
+ * should be used instead.
+ */
+# ifndef DEVRANDOM_SAFE_KERNEL
+# define DEVRANDOM_SAFE_KERNEL 4, 8
+# endif
+/*
+ * Some operating systems do not permit select(2) on their random devices,
+ * defining this to zero will force the use of read(2) to extract one byte
+ * from /dev/random.
+ */
+# ifndef DEVRANDM_WAIT_USE_SELECT
+# define DEVRANDM_WAIT_USE_SELECT 1
+# endif
+/*
+ * Define the shared memory identifier used to indicate if the operating
+ * system has properly seeded the DEVRANDOM source.
+ */
+# ifndef OPENSSL_RAND_SEED_DEVRANDOM_SHM_ID
+# define OPENSSL_RAND_SEED_DEVRANDOM_SHM_ID 114
+# endif
+
+# endif
+#endif
+
+#if !defined(OPENSSL_NO_EGD) && !defined(DEVRANDOM_EGD)
+/*
+ * set this to a comma-separated list of 'egd' sockets to try out. These
+ * sockets will be tried in the order listed in case accessing the device
+ * files listed in DEVRANDOM did not return enough randomness.
+ */
+# define DEVRANDOM_EGD "/var/run/egd-pool", "/dev/egd-pool", "/etc/egd-pool", "/etc/entropy"
+#endif
+
+void ossl_rand_cleanup_int(void);
+
+/*
+ * Initialise the random pool reseeding sources.
+ *
+ * Returns 1 on success and 0 on failure.
+ */
+int ossl_rand_pool_init(void);
+
+/*
+ * Finalise the random pool reseeding sources.
+ */
+void ossl_rand_pool_cleanup(void);
+
+/*
+ * Control the random pool use of open file descriptors.
+ */
+void ossl_rand_pool_keep_random_devices_open(int keep);
+
+/*
+ * Configuration
+ */
+void ossl_random_add_conf_module(void);
+
+/*
+ * Get and cleanup random seed material.
+ */
+size_t ossl_rand_get_entropy(ossl_unused OSSL_CORE_HANDLE *handle,
+ unsigned char **pout, int entropy,
+ size_t min_len, size_t max_len);
+void ossl_rand_cleanup_entropy(ossl_unused OSSL_CORE_HANDLE *handle,
+ unsigned char *buf, size_t len);
+size_t ossl_rand_get_nonce(ossl_unused OSSL_CORE_HANDLE *handle,
+ unsigned char **pout, size_t min_len, size_t max_len,
+ const void *salt, size_t salt_len);
+void ossl_rand_cleanup_nonce(ossl_unused OSSL_CORE_HANDLE *handle,
+ unsigned char *buf, size_t len);
+
+/*
+ * Get seeding material from the operating system sources.
+ */
+size_t ossl_pool_acquire_entropy(RAND_POOL *pool);
+int ossl_pool_add_nonce_data(RAND_POOL *pool);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/rand_pool.h b/NorthstarDLL/include/crypto/rand_pool.h
new file mode 100644
index 00000000..f4d1d954
--- /dev/null
+++ b/NorthstarDLL/include/crypto/rand_pool.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_PROVIDER_RAND_POOL_H
+# define OSSL_PROVIDER_RAND_POOL_H
+# pragma once
+
+# include
+# include
+
+/*
+ * Maximum allocation size for RANDOM_POOL buffers
+ *
+ * The max_len value for the buffer provided to the rand_drbg_get_entropy()
+ * callback is currently 2^31 bytes (2 gigabytes), if a derivation function
+ * is used. Since this is much too large to be allocated, the ossl_rand_pool_new()
+ * function chooses more modest values as default pool length, bounded
+ * by RAND_POOL_MIN_LENGTH and RAND_POOL_MAX_LENGTH
+ *
+ * The choice of the RAND_POOL_FACTOR is large enough such that the
+ * RAND_POOL can store a random input which has a lousy entropy rate of
+ * 8/256 (= 0.03125) bits per byte. This input will be sent through the
+ * derivation function which 'compresses' the low quality input into a
+ * high quality output.
+ *
+ * The factor 1.5 below is the pessimistic estimate for the extra amount
+ * of entropy required when no get_nonce() callback is defined.
+ */
+# define RAND_POOL_FACTOR 256
+# define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * \
+ 3 * (RAND_DRBG_STRENGTH / 16))
+/*
+ * = (RAND_POOL_FACTOR * \
+ * 1.5 * (RAND_DRBG_STRENGTH / 8))
+ */
+
+/*
+ * Initial allocation minimum.
+ *
+ * There is a distinction between the secure and normal allocation minimums.
+ * Ideally, the secure allocation size should be a power of two. The normal
+ * allocation size doesn't have any such restriction.
+ *
+ * The secure value is based on 128 bits of secure material, which is 16 bytes.
+ * Typically, the DRBGs will set a minimum larger than this so optimal
+ * allocation ought to take place (for full quality seed material).
+ *
+ * The normal value has been chosen by noticing that the rand_drbg_get_nonce
+ * function is usually the largest of the built in allocation (twenty four
+ * bytes and then appending another sixteen bytes). This means the buffer ends
+ * with 40 bytes. The value of forty eight is comfortably above this which
+ * allows some slack in the platform specific values used.
+ */
+# define RAND_POOL_MIN_ALLOCATION(secure) ((secure) ? 16 : 48)
+
+/*
+ * The 'random pool' acts as a dumb container for collecting random
+ * input from various entropy sources. It is the callers duty to 1) initialize
+ * the random pool, 2) pass it to the polling callbacks, 3) seed the RNG, and
+ * 4) cleanup the random pool again.
+ *
+ * The random pool contains no locking mechanism because its scope and
+ * lifetime is intended to be restricted to a single stack frame.
+ */
+typedef struct rand_pool_st {
+ unsigned char *buffer; /* points to the beginning of the random pool */
+ size_t len; /* current number of random bytes contained in the pool */
+
+ int attached; /* true pool was attached to existing buffer */
+ int secure; /* 1: allocated on the secure heap, 0: otherwise */
+
+ size_t min_len; /* minimum number of random bytes requested */
+ size_t max_len; /* maximum number of random bytes (allocated buffer size) */
+ size_t alloc_len; /* current number of bytes allocated */
+ size_t entropy; /* current entropy count in bits */
+ size_t entropy_requested; /* requested entropy count in bits */
+} RAND_POOL;
+
+RAND_POOL *ossl_rand_pool_new(int entropy_requested, int secure,
+ size_t min_len, size_t max_len);
+RAND_POOL *ossl_rand_pool_attach(const unsigned char *buffer, size_t len,
+ size_t entropy);
+void ossl_rand_pool_free(RAND_POOL *pool);
+
+const unsigned char *ossl_rand_pool_buffer(RAND_POOL *pool);
+unsigned char *ossl_rand_pool_detach(RAND_POOL *pool);
+void ossl_rand_pool_reattach(RAND_POOL *pool, unsigned char *buffer);
+
+size_t ossl_rand_pool_entropy(RAND_POOL *pool);
+size_t ossl_rand_pool_length(RAND_POOL *pool);
+
+size_t ossl_rand_pool_entropy_available(RAND_POOL *pool);
+size_t ossl_rand_pool_entropy_needed(RAND_POOL *pool);
+/* |entropy_factor| expresses how many bits of data contain 1 bit of entropy */
+size_t ossl_rand_pool_bytes_needed(RAND_POOL *pool, unsigned int entropy_factor);
+size_t ossl_rand_pool_bytes_remaining(RAND_POOL *pool);
+
+int ossl_rand_pool_add(RAND_POOL *pool,
+ const unsigned char *buffer, size_t len, size_t entropy);
+unsigned char *ossl_rand_pool_add_begin(RAND_POOL *pool, size_t len);
+int ossl_rand_pool_add_end(RAND_POOL *pool, size_t len, size_t entropy);
+
+#endif /* OSSL_PROVIDER_RAND_POOL_H */
diff --git a/NorthstarDLL/include/crypto/randerr.h b/NorthstarDLL/include/crypto/randerr.h
new file mode 100644
index 00000000..832a8b7d
--- /dev/null
+++ b/NorthstarDLL/include/crypto/randerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_RANDERR_H
+# define OSSL_CRYPTO_RANDERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_RAND_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/rsa.h b/NorthstarDLL/include/crypto/rsa.h
new file mode 100644
index 00000000..100e7ceb
--- /dev/null
+++ b/NorthstarDLL/include/crypto/rsa.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_INTERNAL_RSA_H
+# define OSSL_INTERNAL_RSA_H
+# pragma once
+
+# include
+# include
+# include "crypto/types.h"
+
+#define RSA_MIN_MODULUS_BITS 512
+
+typedef struct rsa_pss_params_30_st {
+ int hash_algorithm_nid;
+ struct {
+ int algorithm_nid; /* Currently always NID_mgf1 */
+ int hash_algorithm_nid;
+ } mask_gen;
+ int salt_len;
+ int trailer_field;
+} RSA_PSS_PARAMS_30;
+
+RSA_PSS_PARAMS_30 *ossl_rsa_get0_pss_params_30(RSA *r);
+int ossl_rsa_pss_params_30_set_defaults(RSA_PSS_PARAMS_30 *rsa_pss_params);
+int ossl_rsa_pss_params_30_copy(RSA_PSS_PARAMS_30 *to,
+ const RSA_PSS_PARAMS_30 *from);
+int ossl_rsa_pss_params_30_is_unrestricted(const RSA_PSS_PARAMS_30 *rsa_pss_params);
+int ossl_rsa_pss_params_30_set_hashalg(RSA_PSS_PARAMS_30 *rsa_pss_params,
+ int hashalg_nid);
+int ossl_rsa_pss_params_30_set_maskgenalg(RSA_PSS_PARAMS_30 *rsa_pss_params,
+ int maskgenalg_nid);
+int ossl_rsa_pss_params_30_set_maskgenhashalg(RSA_PSS_PARAMS_30 *rsa_pss_params,
+ int maskgenhashalg_nid);
+int ossl_rsa_pss_params_30_set_saltlen(RSA_PSS_PARAMS_30 *rsa_pss_params,
+ int saltlen);
+int ossl_rsa_pss_params_30_set_trailerfield(RSA_PSS_PARAMS_30 *rsa_pss_params,
+ int trailerfield);
+int ossl_rsa_pss_params_30_hashalg(const RSA_PSS_PARAMS_30 *rsa_pss_params);
+int ossl_rsa_pss_params_30_maskgenalg(const RSA_PSS_PARAMS_30 *rsa_pss_params);
+int ossl_rsa_pss_params_30_maskgenhashalg(const RSA_PSS_PARAMS_30 *rsa_pss_params);
+int ossl_rsa_pss_params_30_saltlen(const RSA_PSS_PARAMS_30 *rsa_pss_params);
+int ossl_rsa_pss_params_30_trailerfield(const RSA_PSS_PARAMS_30 *rsa_pss_params);
+
+const char *ossl_rsa_mgf_nid2name(int mgf);
+int ossl_rsa_oaeppss_md2nid(const EVP_MD *md);
+const char *ossl_rsa_oaeppss_nid2name(int md);
+
+RSA *ossl_rsa_new_with_ctx(OSSL_LIB_CTX *libctx);
+OSSL_LIB_CTX *ossl_rsa_get0_libctx(RSA *r);
+void ossl_rsa_set0_libctx(RSA *r, OSSL_LIB_CTX *libctx);
+
+int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
+ const STACK_OF(BIGNUM) *exps,
+ const STACK_OF(BIGNUM) *coeffs);
+int ossl_rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
+ STACK_OF(BIGNUM_const) *exps,
+ STACK_OF(BIGNUM_const) *coeffs);
+int ossl_rsa_is_foreign(const RSA *rsa);
+RSA *ossl_rsa_dup(const RSA *rsa, int selection);
+
+int ossl_rsa_todata(RSA *rsa, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
+int ossl_rsa_fromdata(RSA *rsa, const OSSL_PARAM params[]);
+int ossl_rsa_pss_params_30_todata(const RSA_PSS_PARAMS_30 *pss,
+ OSSL_PARAM_BLD *bld, OSSL_PARAM params[]);
+int ossl_rsa_pss_params_30_fromdata(RSA_PSS_PARAMS_30 *pss_params,
+ int *defaults_set,
+ const OSSL_PARAM params[],
+ OSSL_LIB_CTX *libctx);
+int ossl_rsa_set0_pss_params(RSA *r, RSA_PSS_PARAMS *pss);
+int ossl_rsa_pss_get_param_unverified(const RSA_PSS_PARAMS *pss,
+ const EVP_MD **pmd, const EVP_MD **pmgf1md,
+ int *psaltlen, int *ptrailerField);
+RSA_PSS_PARAMS *ossl_rsa_pss_decode(const X509_ALGOR *alg);
+int ossl_rsa_param_decode(RSA *rsa, const X509_ALGOR *alg);
+RSA *ossl_rsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
+ OSSL_LIB_CTX *libctx, const char *propq);
+
+int ossl_rsa_padding_check_PKCS1_type_2_TLS(OSSL_LIB_CTX *ctx, unsigned char *to,
+ size_t tlen,
+ const unsigned char *from,
+ size_t flen, int client_version,
+ int alt_version);
+int ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(OSSL_LIB_CTX *libctx,
+ unsigned char *to, int tlen,
+ const unsigned char *from, int flen,
+ const unsigned char *param,
+ int plen, const EVP_MD *md,
+ const EVP_MD *mgf1md);
+
+int ossl_rsa_validate_public(const RSA *key);
+int ossl_rsa_validate_private(const RSA *key);
+int ossl_rsa_validate_pairwise(const RSA *key);
+
+int ossl_rsa_verify(int dtype, const unsigned char *m,
+ unsigned int m_len, unsigned char *rm,
+ size_t *prm_len, const unsigned char *sigbuf,
+ size_t siglen, RSA *rsa);
+
+const unsigned char *ossl_rsa_digestinfo_encoding(int md_nid, size_t *len);
+
+extern const char *ossl_rsa_mp_factor_names[];
+extern const char *ossl_rsa_mp_exp_names[];
+extern const char *ossl_rsa_mp_coeff_names[];
+
+ASN1_STRING *ossl_rsa_ctx_to_pss_string(EVP_PKEY_CTX *pkctx);
+int ossl_rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx,
+ const X509_ALGOR *sigalg, EVP_PKEY *pkey);
+
+# if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
+int ossl_rsa_acvp_test_gen_params_new(OSSL_PARAM **dst, const OSSL_PARAM src[]);
+void ossl_rsa_acvp_test_gen_params_free(OSSL_PARAM *dst);
+
+int ossl_rsa_acvp_test_set_params(RSA *r, const OSSL_PARAM params[]);
+int ossl_rsa_acvp_test_get_params(RSA *r, OSSL_PARAM params[]);
+typedef struct rsa_acvp_test_st RSA_ACVP_TEST;
+void ossl_rsa_acvp_test_free(RSA_ACVP_TEST *t);
+# else
+# define RSA_ACVP_TEST void
+# endif
+
+RSA *evp_pkey_get1_RSA_PSS(EVP_PKEY *pkey);
+#endif
diff --git a/NorthstarDLL/include/crypto/rsaerr.h b/NorthstarDLL/include/crypto/rsaerr.h
new file mode 100644
index 00000000..9b23500b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/rsaerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_RSAERR_H
+# define OSSL_CRYPTO_RSAERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_RSA_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/security_bits.h b/NorthstarDLL/include/crypto/security_bits.h
new file mode 100644
index 00000000..58f49681
--- /dev/null
+++ b/NorthstarDLL/include/crypto/security_bits.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_SECURITY_BITS_H
+# define OSSL_SECURITY_BITS_H
+# pragma once
+
+uint16_t ossl_ifc_ffc_compute_security_bits(int n);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/sha.h b/NorthstarDLL/include/crypto/sha.h
new file mode 100644
index 00000000..64305d17
--- /dev/null
+++ b/NorthstarDLL/include/crypto/sha.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SHA_H
+# define OSSL_CRYPTO_SHA_H
+# pragma once
+
+# include
+
+int sha512_224_init(SHA512_CTX *);
+int sha512_256_init(SHA512_CTX *);
+int ossl_sha1_ctrl(SHA_CTX *ctx, int cmd, int mslen, void *ms);
+unsigned char *ossl_sha1(const unsigned char *d, size_t n, unsigned char *md);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/siphash.h b/NorthstarDLL/include/crypto/siphash.h
new file mode 100644
index 00000000..0d0767fc
--- /dev/null
+++ b/NorthstarDLL/include/crypto/siphash.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SIPHASH_H
+# define OSSL_CRYPTO_SIPHASH_H
+# pragma once
+
+# include
+
+# define SIPHASH_BLOCK_SIZE 8
+# define SIPHASH_KEY_SIZE 16
+# define SIPHASH_MIN_DIGEST_SIZE 8
+# define SIPHASH_MAX_DIGEST_SIZE 16
+
+typedef struct siphash_st SIPHASH;
+
+size_t SipHash_ctx_size(void);
+size_t SipHash_hash_size(SIPHASH *ctx);
+int SipHash_set_hash_size(SIPHASH *ctx, size_t hash_size);
+int SipHash_Init(SIPHASH *ctx, const unsigned char *k,
+ int crounds, int drounds);
+void SipHash_Update(SIPHASH *ctx, const unsigned char *in, size_t inlen);
+int SipHash_Final(SIPHASH *ctx, unsigned char *out, size_t outlen);
+
+/* Based on https://131002.net/siphash C reference implementation */
+
+struct siphash_st {
+ uint64_t total_inlen;
+ uint64_t v0;
+ uint64_t v1;
+ uint64_t v2;
+ uint64_t v3;
+ unsigned int len;
+ unsigned int hash_size;
+ unsigned int crounds;
+ unsigned int drounds;
+ unsigned char leavings[SIPHASH_BLOCK_SIZE];
+};
+
+/* default: SipHash-2-4 */
+# define SIPHASH_C_ROUNDS 2
+# define SIPHASH_D_ROUNDS 4
+
+#endif
diff --git a/NorthstarDLL/include/crypto/siv.h b/NorthstarDLL/include/crypto/siv.h
new file mode 100644
index 00000000..8dc58bd3
--- /dev/null
+++ b/NorthstarDLL/include/crypto/siv.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OPENSSL_NO_SIV
+
+typedef struct siv128_context SIV128_CONTEXT;
+
+SIV128_CONTEXT *ossl_siv128_new(const unsigned char *key, int klen,
+ EVP_CIPHER *cbc, EVP_CIPHER *ctr,
+ OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen,
+ const EVP_CIPHER *cbc, const EVP_CIPHER *ctr,
+ OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_siv128_copy_ctx(SIV128_CONTEXT *dest, SIV128_CONTEXT *src);
+int ossl_siv128_aad(SIV128_CONTEXT *ctx, const unsigned char *aad, size_t len);
+int ossl_siv128_encrypt(SIV128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out, size_t len);
+int ossl_siv128_decrypt(SIV128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out, size_t len);
+int ossl_siv128_finish(SIV128_CONTEXT *ctx);
+int ossl_siv128_set_tag(SIV128_CONTEXT *ctx, const unsigned char *tag,
+ size_t len);
+int ossl_siv128_get_tag(SIV128_CONTEXT *ctx, unsigned char *tag, size_t len);
+int ossl_siv128_cleanup(SIV128_CONTEXT *ctx);
+int ossl_siv128_speed(SIV128_CONTEXT *ctx, int arg);
+
+#endif /* OPENSSL_NO_SIV */
diff --git a/NorthstarDLL/include/crypto/sm2.h b/NorthstarDLL/include/crypto/sm2.h
new file mode 100644
index 00000000..9ab6c0b7
--- /dev/null
+++ b/NorthstarDLL/include/crypto/sm2.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017 Ribose Inc. All Rights Reserved.
+ * Ported from Ribose contributions from Botan.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SM2_H
+# define OSSL_CRYPTO_SM2_H
+# pragma once
+
+# include
+
+# if !defined(OPENSSL_NO_SM2) && !defined(FIPS_MODULE)
+
+# include
+# include "crypto/types.h"
+
+int ossl_sm2_key_private_check(const EC_KEY *eckey);
+
+/* The default user id as specified in GM/T 0009-2012 */
+# define SM2_DEFAULT_USERID "1234567812345678"
+
+int ossl_sm2_compute_z_digest(uint8_t *out,
+ const EVP_MD *digest,
+ const uint8_t *id,
+ const size_t id_len,
+ const EC_KEY *key);
+
+/*
+ * SM2 signature operation. Computes Z and then signs H(Z || msg) using SM2
+ */
+ECDSA_SIG *ossl_sm2_do_sign(const EC_KEY *key,
+ const EVP_MD *digest,
+ const uint8_t *id,
+ const size_t id_len,
+ const uint8_t *msg, size_t msg_len);
+
+int ossl_sm2_do_verify(const EC_KEY *key,
+ const EVP_MD *digest,
+ const ECDSA_SIG *signature,
+ const uint8_t *id,
+ const size_t id_len,
+ const uint8_t *msg, size_t msg_len);
+
+/*
+ * SM2 signature generation.
+ */
+int ossl_sm2_internal_sign(const unsigned char *dgst, int dgstlen,
+ unsigned char *sig, unsigned int *siglen,
+ EC_KEY *eckey);
+
+/*
+ * SM2 signature verification.
+ */
+int ossl_sm2_internal_verify(const unsigned char *dgst, int dgstlen,
+ const unsigned char *sig, int siglen,
+ EC_KEY *eckey);
+
+/*
+ * SM2 encryption
+ */
+int ossl_sm2_ciphertext_size(const EC_KEY *key, const EVP_MD *digest,
+ size_t msg_len, size_t *ct_size);
+
+int ossl_sm2_plaintext_size(const unsigned char *ct, size_t ct_size,
+ size_t *pt_size);
+
+int ossl_sm2_encrypt(const EC_KEY *key,
+ const EVP_MD *digest,
+ const uint8_t *msg, size_t msg_len,
+ uint8_t *ciphertext_buf, size_t *ciphertext_len);
+
+int ossl_sm2_decrypt(const EC_KEY *key,
+ const EVP_MD *digest,
+ const uint8_t *ciphertext, size_t ciphertext_len,
+ uint8_t *ptext_buf, size_t *ptext_len);
+
+const unsigned char *ossl_sm2_algorithmidentifier_encoding(int md_nid,
+ size_t *len);
+# endif /* OPENSSL_NO_SM2 */
+#endif
diff --git a/NorthstarDLL/include/crypto/sm2err.h b/NorthstarDLL/include/crypto/sm2err.h
new file mode 100644
index 00000000..706f4d69
--- /dev/null
+++ b/NorthstarDLL/include/crypto/sm2err.h
@@ -0,0 +1,49 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SM2ERR_H
+# define OSSL_CRYPTO_SM2ERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_SM2
+
+int ossl_err_load_SM2_strings(void);
+
+/*
+ * SM2 reason codes.
+ */
+# define SM2_R_ASN1_ERROR 100
+# define SM2_R_BAD_SIGNATURE 101
+# define SM2_R_BUFFER_TOO_SMALL 107
+# define SM2_R_DIST_ID_TOO_LARGE 110
+# define SM2_R_ID_NOT_SET 112
+# define SM2_R_ID_TOO_LARGE 111
+# define SM2_R_INVALID_CURVE 108
+# define SM2_R_INVALID_DIGEST 102
+# define SM2_R_INVALID_DIGEST_TYPE 103
+# define SM2_R_INVALID_ENCODING 104
+# define SM2_R_INVALID_FIELD 105
+# define SM2_R_INVALID_PRIVATE_KEY 113
+# define SM2_R_NO_PARAMETERS_SET 109
+# define SM2_R_USER_ID_TOO_LARGE 106
+
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/sm4.h b/NorthstarDLL/include/crypto/sm4.h
new file mode 100644
index 00000000..e21ec81c
--- /dev/null
+++ b/NorthstarDLL/include/crypto/sm4.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017 Ribose Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SM4_H
+# define OSSL_CRYPTO_SM4_H
+# pragma once
+
+# include
+# include
+
+# ifdef OPENSSL_NO_SM4
+# error SM4 is disabled.
+# endif
+
+# define SM4_ENCRYPT 1
+# define SM4_DECRYPT 0
+
+# define SM4_BLOCK_SIZE 16
+# define SM4_KEY_SCHEDULE 32
+
+typedef struct SM4_KEY_st {
+ uint32_t rk[SM4_KEY_SCHEDULE];
+} SM4_KEY;
+
+int ossl_sm4_set_key(const uint8_t *key, SM4_KEY *ks);
+
+void ossl_sm4_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks);
+
+void ossl_sm4_decrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/sparc_arch.h b/NorthstarDLL/include/crypto/sparc_arch.h
new file mode 100644
index 00000000..447e715b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/sparc_arch.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2012-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SPARC_ARCH_H
+# define OSSL_CRYPTO_SPARC_ARCH_H
+
+# define SPARCV9_TICK_PRIVILEGED (1<<0)
+# define SPARCV9_PREFER_FPU (1<<1)
+# define SPARCV9_VIS1 (1<<2)
+# define SPARCV9_VIS2 (1<<3)/* reserved */
+# define SPARCV9_FMADD (1<<4)
+# define SPARCV9_BLK (1<<5)/* VIS1 block copy */
+# define SPARCV9_VIS3 (1<<6)
+# define SPARCV9_RANDOM (1<<7)
+# define SPARCV9_64BIT_STACK (1<<8)
+# define SPARCV9_FJAESX (1<<9)/* Fujitsu SPARC64 X AES */
+# define SPARCV9_FJDESX (1<<10)/* Fujitsu SPARC64 X DES, reserved */
+# define SPARCV9_FJHPCACE (1<<11)/* Fujitsu HPC-ACE, reserved */
+# define SPARCV9_IMA (1<<13)/* reserved */
+# define SPARCV9_VIS4 (1<<14)/* reserved */
+
+/*
+ * OPENSSL_sparcv9cap_P[1] is copy of Compatibility Feature Register,
+ * %asr26, SPARC-T4 and later. There is no SPARCV9_CFR bit in
+ * OPENSSL_sparcv9cap_P[0], as %cfr copy is sufficient...
+ */
+# define CFR_AES 0x00000001/* Supports AES opcodes */
+# define CFR_DES 0x00000002/* Supports DES opcodes */
+# define CFR_KASUMI 0x00000004/* Supports KASUMI opcodes */
+# define CFR_CAMELLIA 0x00000008/* Supports CAMELLIA opcodes */
+# define CFR_MD5 0x00000010/* Supports MD5 opcodes */
+# define CFR_SHA1 0x00000020/* Supports SHA1 opcodes */
+# define CFR_SHA256 0x00000040/* Supports SHA256 opcodes */
+# define CFR_SHA512 0x00000080/* Supports SHA512 opcodes */
+# define CFR_MPMUL 0x00000100/* Supports MPMUL opcodes */
+# define CFR_MONTMUL 0x00000200/* Supports MONTMUL opcodes */
+# define CFR_MONTSQR 0x00000400/* Supports MONTSQR opcodes */
+# define CFR_CRC32C 0x00000800/* Supports CRC32C opcodes */
+# define CFR_XMPMUL 0x00001000/* Supports XMPMUL opcodes */
+# define CFR_XMONTMUL 0x00002000/* Supports XMONTMUL opcodes */
+# define CFR_XMONTSQR 0x00004000/* Supports XMONTSQR opcodes */
+
+# if defined(OPENSSL_PIC) && !defined(__PIC__)
+# define __PIC__
+# endif
+
+# if defined(__SUNPRO_C) && defined(__sparcv9) && !defined(__arch64__)
+# define __arch64__
+# endif
+
+# define SPARC_PIC_THUNK(reg) \
+ .align 32; \
+.Lpic_thunk: \
+ jmp %o7 + 8; \
+ add %o7, reg, reg;
+
+# define SPARC_PIC_THUNK_CALL(reg) \
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), reg; \
+ call .Lpic_thunk; \
+ or reg, %lo(_GLOBAL_OFFSET_TABLE_+4), reg;
+
+# if 1
+# define SPARC_SETUP_GOT_REG(reg) SPARC_PIC_THUNK_CALL(reg)
+# else
+# define SPARC_SETUP_GOT_REG(reg) \
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), reg; \
+ call .+8; \
+ or reg,%lo(_GLOBAL_OFFSET_TABLE_+4), reg; \
+ add %o7, reg, reg
+# endif
+
+# if defined(__arch64__)
+
+# define SPARC_LOAD_ADDRESS(SYM, reg) \
+ setx SYM, %o7, reg;
+# define LDPTR ldx
+# define SIZE_T_CC %xcc
+# define STACK_FRAME 192
+# define STACK_BIAS 2047
+# define STACK_7thARG (STACK_BIAS+176)
+
+# else
+
+# define SPARC_LOAD_ADDRESS(SYM, reg) \
+ set SYM, reg;
+# define LDPTR ld
+# define SIZE_T_CC %icc
+# define STACK_FRAME 112
+# define STACK_BIAS 0
+# define STACK_7thARG 92
+# define SPARC_LOAD_ADDRESS_LEAF(SYM,reg,tmp) SPARC_LOAD_ADDRESS(SYM,reg)
+
+# endif
+
+# ifdef __PIC__
+# undef SPARC_LOAD_ADDRESS
+# undef SPARC_LOAD_ADDRESS_LEAF
+# define SPARC_LOAD_ADDRESS(SYM, reg) \
+ SPARC_SETUP_GOT_REG(reg); \
+ sethi %hi(SYM), %o7; \
+ or %o7, %lo(SYM), %o7; \
+ LDPTR [reg + %o7], reg;
+# endif
+
+# ifndef SPARC_LOAD_ADDRESS_LEAF
+# define SPARC_LOAD_ADDRESS_LEAF(SYM, reg, tmp) \
+ mov %o7, tmp; \
+ SPARC_LOAD_ADDRESS(SYM, reg) \
+ mov tmp, %o7;
+# endif
+
+# ifndef __ASSEMBLER__
+extern unsigned int OPENSSL_sparcv9cap_P[2];
+# endif
+
+#endif /* OSSL_CRYPTO_SPARC_ARCH_H */
diff --git a/NorthstarDLL/include/crypto/sparse_array.h b/NorthstarDLL/include/crypto/sparse_array.h
new file mode 100644
index 00000000..7ef74283
--- /dev/null
+++ b/NorthstarDLL/include/crypto/sparse_array.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_SPARSE_ARRAY_H
+# define OSSL_CRYPTO_SPARSE_ARRAY_H
+# pragma once
+
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define SPARSE_ARRAY_OF(type) struct sparse_array_st_ ## type
+
+# define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype) \
+ SPARSE_ARRAY_OF(type); \
+ static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * \
+ ossl_sa_##type##_new(void) \
+ { \
+ return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
+ } \
+ static ossl_unused ossl_inline void \
+ ossl_sa_##type##_free(SPARSE_ARRAY_OF(type) *sa) \
+ { \
+ ossl_sa_free((OPENSSL_SA *)sa); \
+ } \
+ static ossl_unused ossl_inline void \
+ ossl_sa_##type##_free_leaves(SPARSE_ARRAY_OF(type) *sa) \
+ { \
+ ossl_sa_free_leaves((OPENSSL_SA *)sa); \
+ } \
+ static ossl_unused ossl_inline size_t \
+ ossl_sa_##type##_num(const SPARSE_ARRAY_OF(type) *sa) \
+ { \
+ return ossl_sa_num((OPENSSL_SA *)sa); \
+ } \
+ static ossl_unused ossl_inline void \
+ ossl_sa_##type##_doall(const SPARSE_ARRAY_OF(type) *sa, \
+ void (*leaf)(ossl_uintmax_t, type *)) \
+ { \
+ ossl_sa_doall((OPENSSL_SA *)sa, \
+ (void (*)(ossl_uintmax_t, void *))leaf); \
+ } \
+ static ossl_unused ossl_inline void \
+ ossl_sa_##type##_doall_arg(const SPARSE_ARRAY_OF(type) *sa, \
+ void (*leaf)(ossl_uintmax_t, type *, void *), \
+ void *arg) \
+ { \
+ ossl_sa_doall_arg((OPENSSL_SA *)sa, \
+ (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
+ } \
+ static ossl_unused ossl_inline ctype \
+ *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, ossl_uintmax_t n) \
+ { \
+ return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
+ } \
+ static ossl_unused ossl_inline int \
+ ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
+ ossl_uintmax_t n, ctype *val) \
+ { \
+ return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
+ } \
+ SPARSE_ARRAY_OF(type)
+
+# define DEFINE_SPARSE_ARRAY_OF(type) \
+ DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, type)
+# define DEFINE_SPARSE_ARRAY_OF_CONST(type) \
+ DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, const type)
+
+typedef struct sparse_array_st OPENSSL_SA;
+OPENSSL_SA *ossl_sa_new(void);
+void ossl_sa_free(OPENSSL_SA *sa);
+void ossl_sa_free_leaves(OPENSSL_SA *sa);
+size_t ossl_sa_num(const OPENSSL_SA *sa);
+void ossl_sa_doall(const OPENSSL_SA *sa, void (*leaf)(ossl_uintmax_t, void *));
+void ossl_sa_doall_arg(const OPENSSL_SA *sa,
+ void (*leaf)(ossl_uintmax_t, void *, void *), void *);
+void *ossl_sa_get(const OPENSSL_SA *sa, ossl_uintmax_t n);
+int ossl_sa_set(OPENSSL_SA *sa, ossl_uintmax_t n, void *val);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/store.h b/NorthstarDLL/include/crypto/store.h
new file mode 100644
index 00000000..13d2646b
--- /dev/null
+++ b/NorthstarDLL/include/crypto/store.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_STORE_H
+# define OSSL_CRYPTO_STORE_H
+# pragma once
+
+# include
+# include
+# include
+
+void ossl_store_cleanup_int(void);
+int ossl_store_loader_get_number(const OSSL_STORE_LOADER *loader);
+
+#endif
diff --git a/NorthstarDLL/include/crypto/storeerr.h b/NorthstarDLL/include/crypto/storeerr.h
new file mode 100644
index 00000000..c46d845f
--- /dev/null
+++ b/NorthstarDLL/include/crypto/storeerr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_STOREERR_H
+# define OSSL_CRYPTO_STOREERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_OSSL_STORE_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/tserr.h b/NorthstarDLL/include/crypto/tserr.h
new file mode 100644
index 00000000..2f34ba31
--- /dev/null
+++ b/NorthstarDLL/include/crypto/tserr.h
@@ -0,0 +1,30 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_TSERR_H
+# define OSSL_CRYPTO_TSERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# ifndef OPENSSL_NO_TS
+
+int ossl_err_load_TS_strings(void);
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/types.h b/NorthstarDLL/include/crypto/types.h
new file mode 100644
index 00000000..0d814040
--- /dev/null
+++ b/NorthstarDLL/include/crypto/types.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* When removal is simulated, we still need the type internally */
+
+#ifndef OSSL_CRYPTO_TYPES_H
+# define OSSL_CRYPTO_TYPES_H
+# pragma once
+
+# ifdef OPENSSL_NO_DEPRECATED_3_0
+typedef struct rsa_st RSA;
+typedef struct rsa_meth_st RSA_METHOD;
+# ifndef OPENSSL_NO_EC
+typedef struct ec_key_st EC_KEY;
+typedef struct ec_key_method_st EC_KEY_METHOD;
+# endif
+# endif
+
+# ifndef OPENSSL_NO_EC
+typedef struct ecx_key_st ECX_KEY;
+# endif
+
+#endif
diff --git a/NorthstarDLL/include/crypto/uierr.h b/NorthstarDLL/include/crypto/uierr.h
new file mode 100644
index 00000000..789077a8
--- /dev/null
+++ b/NorthstarDLL/include/crypto/uierr.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_UIERR_H
+# define OSSL_CRYPTO_UIERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_UI_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/x509.h b/NorthstarDLL/include/crypto/x509.h
new file mode 100644
index 00000000..1f00178e
--- /dev/null
+++ b/NorthstarDLL/include/crypto/x509.h
@@ -0,0 +1,367 @@
+/*
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_X509_H
+# define OSSL_CRYPTO_X509_H
+# pragma once
+
+# include "internal/refcount.h"
+# include
+# include
+# include
+# include "crypto/types.h"
+
+/* Internal X509 structures and functions: not for application use */
+
+/* Note: unless otherwise stated a field pointer is mandatory and should
+ * never be set to NULL: the ASN.1 code and accessors rely on mandatory
+ * fields never being NULL.
+ */
+
+/*
+ * name entry structure, equivalent to AttributeTypeAndValue defined
+ * in RFC5280 et al.
+ */
+struct X509_name_entry_st {
+ ASN1_OBJECT *object; /* AttributeType */
+ ASN1_STRING *value; /* AttributeValue */
+ int set; /* index of RDNSequence for this entry */
+ int size; /* temp variable */
+};
+
+/* Name from RFC 5280. */
+struct X509_name_st {
+ STACK_OF(X509_NAME_ENTRY) *entries; /* DN components */
+ int modified; /* true if 'bytes' needs to be built */
+ BUF_MEM *bytes; /* cached encoding: cannot be NULL */
+ /* canonical encoding used for rapid Name comparison */
+ unsigned char *canon_enc;
+ int canon_enclen;
+} /* X509_NAME */ ;
+
+/* Signature info structure */
+
+struct x509_sig_info_st {
+ /* NID of message digest */
+ int mdnid;
+ /* NID of public key algorithm */
+ int pknid;
+ /* Security bits */
+ int secbits;
+ /* Various flags */
+ uint32_t flags;
+};
+
+/* PKCS#10 certificate request */
+
+struct X509_req_info_st {
+ ASN1_ENCODING enc; /* cached encoding of signed part */
+ ASN1_INTEGER *version; /* version, defaults to v1(0) so can be NULL */
+ X509_NAME *subject; /* certificate request DN */
+ X509_PUBKEY *pubkey; /* public key of request */
+ /*
+ * Zero or more attributes.
+ * NB: although attributes is a mandatory field some broken
+ * encodings omit it so this may be NULL in that case.
+ */
+ STACK_OF(X509_ATTRIBUTE) *attributes;
+};
+
+struct X509_req_st {
+ X509_REQ_INFO req_info; /* signed certificate request data */
+ X509_ALGOR sig_alg; /* signature algorithm */
+ ASN1_BIT_STRING *signature; /* signature */
+ CRYPTO_REF_COUNT references;
+ CRYPTO_RWLOCK *lock;
+
+ /* Set on live certificates for authentication purposes */
+ ASN1_OCTET_STRING *distinguishing_id;
+ OSSL_LIB_CTX *libctx;
+ char *propq;
+};
+
+struct X509_crl_info_st {
+ ASN1_INTEGER *version; /* version: defaults to v1(0) so may be NULL */
+ X509_ALGOR sig_alg; /* signature algorithm */
+ X509_NAME *issuer; /* CRL issuer name */
+ ASN1_TIME *lastUpdate; /* lastUpdate field */
+ ASN1_TIME *nextUpdate; /* nextUpdate field: optional */
+ STACK_OF(X509_REVOKED) *revoked; /* revoked entries: optional */
+ STACK_OF(X509_EXTENSION) *extensions; /* extensions: optional */
+ ASN1_ENCODING enc; /* encoding of signed portion of CRL */
+};
+
+struct X509_crl_st {
+ X509_CRL_INFO crl; /* signed CRL data */
+ X509_ALGOR sig_alg; /* CRL signature algorithm */
+ ASN1_BIT_STRING signature; /* CRL signature */
+ CRYPTO_REF_COUNT references;
+ int flags;
+ /*
+ * Cached copies of decoded extension values, since extensions
+ * are optional any of these can be NULL.
+ */
+ AUTHORITY_KEYID *akid;
+ ISSUING_DIST_POINT *idp;
+ /* Convenient breakdown of IDP */
+ int idp_flags;
+ int idp_reasons;
+ /* CRL and base CRL numbers for delta processing */
+ ASN1_INTEGER *crl_number;
+ ASN1_INTEGER *base_crl_number;
+ STACK_OF(GENERAL_NAMES) *issuers;
+ /* hash of CRL */
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+ /* alternative method to handle this CRL */
+ const X509_CRL_METHOD *meth;
+ void *meth_data;
+ CRYPTO_RWLOCK *lock;
+
+ OSSL_LIB_CTX *libctx;
+ char *propq;
+};
+
+struct x509_revoked_st {
+ ASN1_INTEGER serialNumber; /* revoked entry serial number */
+ ASN1_TIME *revocationDate; /* revocation date */
+ STACK_OF(X509_EXTENSION) *extensions; /* CRL entry extensions: optional */
+ /* decoded value of CRLissuer extension: set if indirect CRL */
+ STACK_OF(GENERAL_NAME) *issuer;
+ /* revocation reason: set to CRL_REASON_NONE if reason extension absent */
+ int reason;
+ /*
+ * CRL entries are reordered for faster lookup of serial numbers. This
+ * field contains the original load sequence for this entry.
+ */
+ int sequence;
+};
+
+/*
+ * This stuff is certificate "auxiliary info": it contains details which are
+ * useful in certificate stores and databases. When used this is tagged onto
+ * the end of the certificate itself. OpenSSL specific structure not defined
+ * in any RFC.
+ */
+
+struct x509_cert_aux_st {
+ STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */
+ STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */
+ ASN1_UTF8STRING *alias; /* "friendly name" */
+ ASN1_OCTET_STRING *keyid; /* key id of private key */
+ STACK_OF(X509_ALGOR) *other; /* other unspecified info */
+};
+
+struct x509_cinf_st {
+ ASN1_INTEGER *version; /* [ 0 ] default of v1 */
+ ASN1_INTEGER serialNumber;
+ X509_ALGOR signature;
+ X509_NAME *issuer;
+ X509_VAL validity;
+ X509_NAME *subject;
+ X509_PUBKEY *key;
+ ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */
+ ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */
+ STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */
+ ASN1_ENCODING enc;
+};
+
+struct x509_st {
+ X509_CINF cert_info;
+ X509_ALGOR sig_alg;
+ ASN1_BIT_STRING signature;
+ X509_SIG_INFO siginf;
+ CRYPTO_REF_COUNT references;
+ CRYPTO_EX_DATA ex_data;
+ /* These contain copies of various extension values */
+ long ex_pathlen;
+ long ex_pcpathlen;
+ uint32_t ex_flags;
+ uint32_t ex_kusage;
+ uint32_t ex_xkusage;
+ uint32_t ex_nscert;
+ ASN1_OCTET_STRING *skid;
+ AUTHORITY_KEYID *akid;
+ X509_POLICY_CACHE *policy_cache;
+ STACK_OF(DIST_POINT) *crldp;
+ STACK_OF(GENERAL_NAME) *altname;
+ NAME_CONSTRAINTS *nc;
+# ifndef OPENSSL_NO_RFC3779
+ STACK_OF(IPAddressFamily) *rfc3779_addr;
+ struct ASIdentifiers_st *rfc3779_asid;
+# endif
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+ X509_CERT_AUX *aux;
+ CRYPTO_RWLOCK *lock;
+ volatile int ex_cached;
+
+ /* Set on live certificates for authentication purposes */
+ ASN1_OCTET_STRING *distinguishing_id;
+
+ OSSL_LIB_CTX *libctx;
+ char *propq;
+} /* X509 */ ;
+
+/*
+ * This is a used when verifying cert chains. Since the gathering of the
+ * cert chain can take some time (and have to be 'retried', this needs to be
+ * kept and passed around.
+ */
+struct x509_store_ctx_st { /* X509_STORE_CTX */
+ X509_STORE *store;
+ /* The following are set by the caller */
+ /* The cert to check */
+ X509 *cert;
+ /* chain of X509s - untrusted - passed in */
+ STACK_OF(X509) *untrusted;
+ /* set of CRLs passed in */
+ STACK_OF(X509_CRL) *crls;
+ X509_VERIFY_PARAM *param;
+ /* Other info for use with get_issuer() */
+ void *other_ctx;
+ /* Callbacks for various operations */
+ /* called to verify a certificate */
+ int (*verify) (X509_STORE_CTX *ctx);
+ /* error callback */
+ int (*verify_cb) (int ok, X509_STORE_CTX *ctx);
+ /* get issuers cert from ctx */
+ int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+ /* check issued */
+ int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+ /* Check revocation status of chain */
+ int (*check_revocation) (X509_STORE_CTX *ctx);
+ /* retrieve CRL */
+ int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+ /* Check CRL validity */
+ int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);
+ /* Check certificate against CRL */
+ int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
+ /* Check policy status of the chain */
+ int (*check_policy) (X509_STORE_CTX *ctx);
+ STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx,
+ const X509_NAME *nm);
+ /* cannot constify 'ctx' param due to lookup_certs_sk() in x509_vfy.c */
+ STACK_OF(X509_CRL) *(*lookup_crls) (const X509_STORE_CTX *ctx,
+ const X509_NAME *nm);
+ int (*cleanup) (X509_STORE_CTX *ctx);
+ /* The following is built up */
+ /* if 0, rebuild chain */
+ int valid;
+ /* number of untrusted certs */
+ int num_untrusted;
+ /* chain of X509s - built up and trusted */
+ STACK_OF(X509) *chain;
+ /* Valid policy tree */
+ X509_POLICY_TREE *tree;
+ /* Require explicit policy value */
+ int explicit_policy;
+ /* When something goes wrong, this is why */
+ int error_depth;
+ int error;
+ X509 *current_cert;
+ /* cert currently being tested as valid issuer */
+ X509 *current_issuer;
+ /* current CRL */
+ X509_CRL *current_crl;
+ /* score of current CRL */
+ int current_crl_score;
+ /* Reason mask */
+ unsigned int current_reasons;
+ /* For CRL path validation: parent context */
+ X509_STORE_CTX *parent;
+ CRYPTO_EX_DATA ex_data;
+ SSL_DANE *dane;
+ /* signed via bare TA public key, rather than CA certificate */
+ int bare_ta_signed;
+
+ OSSL_LIB_CTX *libctx;
+ char *propq;
+};
+
+/* PKCS#8 private key info structure */
+
+struct pkcs8_priv_key_info_st {
+ ASN1_INTEGER *version;
+ X509_ALGOR *pkeyalg;
+ ASN1_OCTET_STRING *pkey;
+ STACK_OF(X509_ATTRIBUTE) *attributes;
+};
+
+struct X509_sig_st {
+ X509_ALGOR *algor;
+ ASN1_OCTET_STRING *digest;
+};
+
+struct x509_object_st {
+ /* one of the above types */
+ X509_LOOKUP_TYPE type;
+ union {
+ char *ptr;
+ X509 *x509;
+ X509_CRL *crl;
+ EVP_PKEY *pkey;
+ } data;
+};
+
+int ossl_a2i_ipadd(unsigned char *ipout, const char *ipasc);
+int ossl_x509_set1_time(ASN1_TIME **ptm, const ASN1_TIME *tm);
+int ossl_x509_print_ex_brief(BIO *bio, X509 *cert, unsigned long neg_cflags);
+int ossl_x509v3_cache_extensions(X509 *x);
+int ossl_x509_init_sig_info(X509 *x);
+
+int ossl_x509_set0_libctx(X509 *x, OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_x509_crl_set0_libctx(X509_CRL *x, OSSL_LIB_CTX *libctx,
+ const char *propq);
+int ossl_x509_req_set0_libctx(X509_REQ *x, OSSL_LIB_CTX *libctx,
+ const char *propq);
+int ossl_asn1_item_digest_ex(const ASN1_ITEM *it, const EVP_MD *type,
+ void *data, unsigned char *md, unsigned int *len,
+ OSSL_LIB_CTX *libctx, const char *propq);
+int ossl_x509_add_cert_new(STACK_OF(X509) **sk, X509 *cert, int flags);
+int ossl_x509_add_certs_new(STACK_OF(X509) **p_sk, STACK_OF(X509) *certs,
+ int flags);
+
+STACK_OF(X509_ATTRIBUTE) *ossl_x509at_dup(const STACK_OF(X509_ATTRIBUTE) *x);
+
+int ossl_x509_PUBKEY_get0_libctx(OSSL_LIB_CTX **plibctx, const char **ppropq,
+ const X509_PUBKEY *key);
+/* Calculate default key identifier according to RFC 5280 section 4.2.1.2 (1) */
+ASN1_OCTET_STRING *ossl_x509_pubkey_hash(X509_PUBKEY *pubkey);
+
+X509_PUBKEY *ossl_d2i_X509_PUBKEY_INTERNAL(const unsigned char **pp,
+ long len, OSSL_LIB_CTX *libctx);
+void ossl_X509_PUBKEY_INTERNAL_free(X509_PUBKEY *xpub);
+
+RSA *ossl_d2i_RSA_PSS_PUBKEY(RSA **a, const unsigned char **pp, long length);
+int ossl_i2d_RSA_PSS_PUBKEY(const RSA *a, unsigned char **pp);
+# ifndef OPENSSL_NO_DH
+DH *ossl_d2i_DH_PUBKEY(DH **a, const unsigned char **pp, long length);
+int ossl_i2d_DH_PUBKEY(const DH *a, unsigned char **pp);
+DH *ossl_d2i_DHx_PUBKEY(DH **a, const unsigned char **pp, long length);
+int ossl_i2d_DHx_PUBKEY(const DH *a, unsigned char **pp);
+# endif /* OPENSSL_NO_DH */
+# ifndef OPENSSL_NO_EC
+ECX_KEY *ossl_d2i_ED25519_PUBKEY(ECX_KEY **a,
+ const unsigned char **pp, long length);
+int ossl_i2d_ED25519_PUBKEY(const ECX_KEY *a, unsigned char **pp);
+ECX_KEY *ossl_d2i_ED448_PUBKEY(ECX_KEY **a,
+ const unsigned char **pp, long length);
+int ossl_i2d_ED448_PUBKEY(const ECX_KEY *a, unsigned char **pp);
+ECX_KEY *ossl_d2i_X25519_PUBKEY(ECX_KEY **a,
+ const unsigned char **pp, long length);
+int ossl_i2d_X25519_PUBKEY(const ECX_KEY *a, unsigned char **pp);
+ECX_KEY *ossl_d2i_X448_PUBKEY(ECX_KEY **a,
+ const unsigned char **pp, long length);
+int ossl_i2d_X448_PUBKEY(const ECX_KEY *a, unsigned char **pp);
+# endif /* OPENSSL_NO_EC */
+EVP_PKEY *ossl_d2i_PUBKEY_legacy(EVP_PKEY **a, const unsigned char **pp,
+ long length);
+
+int x509v3_add_len_value_uchar(const char *name, const unsigned char *value,
+ size_t vallen, STACK_OF(CONF_VALUE) **extlist);
+#endif /* OSSL_CRYPTO_X509_H */
diff --git a/NorthstarDLL/include/crypto/x509err.h b/NorthstarDLL/include/crypto/x509err.h
new file mode 100644
index 00000000..53f567d9
--- /dev/null
+++ b/NorthstarDLL/include/crypto/x509err.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_X509ERR_H
+# define OSSL_CRYPTO_X509ERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_X509_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/crypto/x509v3err.h b/NorthstarDLL/include/crypto/x509v3err.h
new file mode 100644
index 00000000..66d3ad92
--- /dev/null
+++ b/NorthstarDLL/include/crypto/x509v3err.h
@@ -0,0 +1,27 @@
+/*
+ * Generated by util/mkerr.pl DO NOT EDIT
+ * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_CRYPTO_X509V3ERR_H
+# define OSSL_CRYPTO_X509V3ERR_H
+# pragma once
+
+# include
+# include
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+int ossl_err_load_X509V3_strings(void);
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/NorthstarDLL/include/httplib.h b/NorthstarDLL/include/httplib.h
new file mode 100644
index 00000000..2b52f0fc
--- /dev/null
+++ b/NorthstarDLL/include/httplib.h
@@ -0,0 +1,7832 @@
+//
+// httplib.h
+//
+// Copyright (c) 2021 Yuji Hirose. All rights reserved.
+// MIT License
+//
+
+#ifndef CPPHTTPLIB_HTTPLIB_H
+#define CPPHTTPLIB_HTTPLIB_H
+
+/*
+ * Configuration
+ */
+
+#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND
+#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND 5
+#endif
+
+#ifndef CPPHTTPLIB_KEEPALIVE_MAX_COUNT
+#define CPPHTTPLIB_KEEPALIVE_MAX_COUNT 5
+#endif
+
+#ifndef CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND
+#define CPPHTTPLIB_CONNECTION_TIMEOUT_SECOND 300
+#endif
+
+#ifndef CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND
+#define CPPHTTPLIB_CONNECTION_TIMEOUT_USECOND 0
+#endif
+
+#ifndef CPPHTTPLIB_READ_TIMEOUT_SECOND
+#define CPPHTTPLIB_READ_TIMEOUT_SECOND 5
+#endif
+
+#ifndef CPPHTTPLIB_READ_TIMEOUT_USECOND
+#define CPPHTTPLIB_READ_TIMEOUT_USECOND 0
+#endif
+
+#ifndef CPPHTTPLIB_WRITE_TIMEOUT_SECOND
+#define CPPHTTPLIB_WRITE_TIMEOUT_SECOND 5
+#endif
+
+#ifndef CPPHTTPLIB_WRITE_TIMEOUT_USECOND
+#define CPPHTTPLIB_WRITE_TIMEOUT_USECOND 0
+#endif
+
+#ifndef CPPHTTPLIB_IDLE_INTERVAL_SECOND
+#define CPPHTTPLIB_IDLE_INTERVAL_SECOND 0
+#endif
+
+#ifndef CPPHTTPLIB_IDLE_INTERVAL_USECOND
+#ifdef _WIN32
+#define CPPHTTPLIB_IDLE_INTERVAL_USECOND 10000
+#else
+#define CPPHTTPLIB_IDLE_INTERVAL_USECOND 0
+#endif
+#endif
+
+#ifndef CPPHTTPLIB_REQUEST_URI_MAX_LENGTH
+#define CPPHTTPLIB_REQUEST_URI_MAX_LENGTH 8192
+#endif
+
+#ifndef CPPHTTPLIB_REDIRECT_MAX_COUNT
+#define CPPHTTPLIB_REDIRECT_MAX_COUNT 20
+#endif
+
+#ifndef CPPHTTPLIB_PAYLOAD_MAX_LENGTH
+#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH ((std::numeric_limits::max)())
+#endif
+
+#ifndef CPPHTTPLIB_TCP_NODELAY
+#define CPPHTTPLIB_TCP_NODELAY false
+#endif
+
+#ifndef CPPHTTPLIB_RECV_BUFSIZ
+#define CPPHTTPLIB_RECV_BUFSIZ size_t(4096u)
+#endif
+
+#ifndef CPPHTTPLIB_COMPRESSION_BUFSIZ
+#define CPPHTTPLIB_COMPRESSION_BUFSIZ size_t(16384u)
+#endif
+
+#ifndef CPPHTTPLIB_THREAD_POOL_COUNT
+#define CPPHTTPLIB_THREAD_POOL_COUNT \
+ ((std::max)(8u, std::thread::hardware_concurrency() > 0 \
+ ? std::thread::hardware_concurrency() - 1 \
+ : 0))
+#endif
+
+#ifndef CPPHTTPLIB_RECV_FLAGS
+#define CPPHTTPLIB_RECV_FLAGS 0
+#endif
+
+#ifndef CPPHTTPLIB_SEND_FLAGS
+#define CPPHTTPLIB_SEND_FLAGS 0
+#endif
+
+/*
+ * Headers
+ */
+
+#ifdef _WIN32
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS
+#endif //_CRT_SECURE_NO_WARNINGS
+
+#ifndef _CRT_NONSTDC_NO_DEPRECATE
+#define _CRT_NONSTDC_NO_DEPRECATE
+#endif //_CRT_NONSTDC_NO_DEPRECATE
+
+#if defined(_MSC_VER)
+#ifdef _WIN64
+using ssize_t = __int64;
+#else
+using ssize_t = int;
+#endif
+
+#if _MSC_VER < 1900
+#define snprintf _snprintf_s
+#endif
+#endif // _MSC_VER
+
+#ifndef S_ISREG
+#define S_ISREG(m) (((m)&S_IFREG) == S_IFREG)
+#endif // S_ISREG
+
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m)&S_IFDIR) == S_IFDIR)
+#endif // S_ISDIR
+
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif // NOMINMAX
+
+#include
+#include
+
+#include
+#include
+
+#ifndef WSA_FLAG_NO_HANDLE_INHERIT
+#define WSA_FLAG_NO_HANDLE_INHERIT 0x80
+#endif
+
+#ifdef _MSC_VER
+#pragma comment(lib, "ws2_32.lib")
+#pragma comment(lib, "crypt32.lib")
+#pragma comment(lib, "cryptui.lib")
+#endif
+
+#ifndef strcasecmp
+#define strcasecmp _stricmp
+#endif // strcasecmp
+
+using socket_t = SOCKET;
+#ifdef CPPHTTPLIB_USE_POLL
+#define poll(fds, nfds, timeout) WSAPoll(fds, nfds, timeout)
+#endif
+
+#else // not _WIN32
+
+#include
+#include
+#include
+#include
+#include
+#ifdef __linux__
+#include
+#endif
+#include
+#ifdef CPPHTTPLIB_USE_POLL
+#include
+#endif
+#include