Skip to content

Commit 527b127

Browse files
committed
fix: old interface method
at some point the symbol search got inverted (totally wasnt me mhm)
1 parent 232f606 commit 527b127

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/Interface.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ void *Interface::GetPtr(const char *filename, const char *interfaceSymbol) {
101101
}
102102

103103
for (auto &current = s_pInterfaceRegs; current; current = current->m_pNext) {
104-
if (!std::strncmp(current->m_pName, interfaceSymbol, std::strlen(interfaceSymbol)) == 0) {
104+
if (!std::strncmp(current->m_pName, interfaceSymbol, std::strlen(interfaceSymbol))) {
105105
fn = current->m_CreateFn();
106+
// console->DevMsg("SAR: Found interface %s at %p in %s!\n", current->m_pName, fn, filename);
106107
break;
107108
}
108109
}
@@ -111,6 +112,8 @@ void *Interface::GetPtr(const char *filename, const char *interfaceSymbol) {
111112
console->DevWarning("SAR: Failed to find interface with symbol %s in %s!\n", interfaceSymbol, filename);
112113
return nullptr;
113114
}
115+
} else {
116+
// console->DevMsg("SAR: Found interface %s (the easy way) at %p in %s!\n", interfaceSymbol, fn, filename);
114117
}
115118
return fn;
116119
}

src/Offsets.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,33 @@ namespace Offsets {
1616
}
1717

1818
#undef OFFSET_DEFAULT
19+
#undef OFFSET_EMPTY
1920
#undef OFFSET_WINDOWS
2021
#undef OFFSET_LINUX
2122

2223
#undef SIGSCAN_DEFAULT
24+
#undef SIGSCAN_EMPTY
2325
#undef SIGSCAN_WINDOWS
2426
#undef SIGSCAN_LINUX
2527

2628
#ifdef _WIN32
2729
#define OFFSET_DEFAULT(name, win, linux) name = win;
30+
#define OFFSET_EMPTY(name) name = 0;
2831
#define OFFSET_WINDOWS(name, off) name = off;
2932
#define OFFSET_LINUX(name, off);
3033

3134
#define SIGSCAN_DEFAULT(name, win, linux) name = win;
35+
#define SIGSCAN_EMPTY(name) name = "";
3236
#define SIGSCAN_WINDOWS(name, sig) name = sig;
3337
#define SIGSCAN_LINUX(name, sig)
3438
#else
3539
#define OFFSET_DEFAULT(name, win, linux) name = linux;
40+
#define OFFSET_EMPTY(name) name = 0;
3641
#define OFFSET_WINDOWS(name, off);
3742
#define OFFSET_LINUX(name, off) name = off;
3843

3944
#define SIGSCAN_DEFAULT(name, win, linux) name = linux;
45+
#define SIGSCAN_EMPTY(name) name = "";
4046
#define SIGSCAN_WINDOWS(name, sig);
4147
#define SIGSCAN_LINUX(name, sig) name = sig;
4248
#endif

src/Offsets/Portal 2 9568.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,12 @@ OFFSET_DEFAULT(portalsThruPortals, 391, 388)
381381
// clang-format off
382382

383383
// Pathmatch
384-
SIGSCAN_DEFAULT(PathMatch, "", "55 57 56 53 83 EC 0C 8B 6C 24 28 8B 5C 24 2C 0F B6 05 ? ? ? ? 84 C0 0F 84 ? ? ? ?")
384+
SIGSCAN_DEFAULT(PathMatch, "", "55 57 56 53 83 EC 0C 8B 6C 24 28 8B 5C 24 2C 0F B6 05 ? ? ? ? 84 C0 0F 84 ? ? ? ?") // "DBG_PATHMATCH"
385385

386386

387387
// Renderer
388388
SIGSCAN_DEFAULT(SND_RecordBuffer, "55 8B EC 80 3D ? ? ? ? 00 53 56 57 0F 84 15 01 00 00 E8 ? ? ? ? 84 C0 0F 85 08 01 00 00 A1 ? ? ? ? 3B 05",
389-
"80 3D ? ? ? ? 00 75 07 C3 ? ? ? ? ? ? 55 89 E5 57 56 53 83 EC 1C E8 ? ? ? ? 84 C0 0F 85 ? ? ? ?") // "DS_STEREO" -> CAudioDirectSound::TransferSamples -> S_TransferStereo16 -> SND_RecordBuffer
390-
389+
"80 3D ? ? ? ? 00 75 07 C3 ? ? ? ? ? ? 55 89 E5 57 56 53 83 EC 1C E8 ? ? ? ? 84 C0 0F 85 ? ? ? ?") // "WaveFixupTmpFile( '%s' ) failed to open file for editing\n" -> WaveFixupTmpFile -> ".WAV" xref[1] -> WaveAppendTmpFile -> usage -> SND_RecordBuffer
391390

392391
// Client
393392
SIGSCAN_DEFAULT(MatrixBuildRotationAboutAxis, "55 8B EC 51 F3 0F 10 45 ? 0F 5A C0 F2 0F 59 05 ? ? ? ? 66 0F 5A C0 F3 0F 11 45 ? E8 ? ? ? ? F3 0F 11 45 ? F3 0F 10 45 ? E8 ? ? ? ? 8B 45 ? F3 0F 10 08",
@@ -404,7 +403,7 @@ SIGSCAN_DEFAULT(DrawPortalGhost, "55 8B EC A1 ? ? ? ? 83 EC 24 83 78 ? ? 0F 84 1
404403
SIGSCAN_DEFAULT(DrawPortalGhostSpBranch, "0F 84 ? ? ? ? 8B 90 ? ? ? ? FF D2 50 33 C0 38 86 ? ? ? ? 8D 4D ? 0F 95 C0",
405404
"0F 84 ? ? ? ? 8B 03 83 EC 0C 53 FF 90 ? ? ? ? 83 C4 10 80 BB ? ? ? ? 01")
406405
SIGSCAN_DEFAULT(DrawOpaqueRenderables, "55 8B EC 83 EC 54 83 7D 0C 00 A1 ? ? ? ? 53 56 0F 9F 45 EC 83 78 30 00 57 8B F1 0F 84 BA 03 00 00",
407-
"55 89 E5 57 56 53 83 EC 7C A1 ? ? ? ? 8B 5D 08 89 45 90 85 C0 0F 85 34 04 00 00 A1 ? ? ? ? 8B 40 30 85 C0") // DrawTranslucentRenderables usage -> 2nd prior function call -> CRendering3dView::DrawOpaqueRenderables
406+
"55 89 E5 57 56 53 83 EC 7C A1 ? ? ? ? 8B 5D 08 89 45 90 85 C0 0F 85 34 04 00 00 A1 ? ? ? ? 8B 40 30 85 C0") // DrawTranslucentRenderables usage -> 2nd prior function call -> CRendering3dView::DrawOpaqueRenderables OR vprof "CViewRender::DrawOpaqueRenderables"
408407
SIGSCAN_DEFAULT(MsgPreSkipToNextLevel, "57 8B F9 E8 ? ? ? ? 8B C8 E8 ? ? ? ? 0B C2",
409408
"53 83 EC 08 E8 ? ? ? ? 83 EC 0C 50 E8 ? ? ? ? 83 C4 10 09 C2")
410409
SIGSCAN_DEFAULT(CalcViewModelLag, "53 8B DC 83 EC 08 83 E4 F0 83 C4 04 55 8B 6B 04 89 6C 24 04 8B EC 83 EC 1C 56 6A 00 6A 00 8D 45 F4 8B F1 8B 4B 0C 50 51 E8 ? ? ? ?",

0 commit comments

Comments
 (0)