diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2022-04-24 03:27:35 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2022-04-24 03:43:26 +0100 |
commit | 7b12eb811ff62d9d14ccb7c152a9821796efe9a5 (patch) | |
tree | de95be73de40e732d8bbd002b721b4683fbf12c0 /compile.bat | |
parent | 99e9a6765a9a358987c062ec4a251f8254581933 (diff) |
Replace udis86 with a very small x86 decoder
hook_inline() uses the new x86_len() function to get instruction lengths
instead of doing full-blown disassembly, which should be a tiny bit
quicker, and also removes the next for about 90KiB of lookup tables and
such in the final binary. The code-digging logic in demorecord is also
rewritten to be opcode-based rather than mnenmonic based. In general,
going forward the plan is to always rely on opcodes and thus avoid a
bunch of disassembly work every plugin load.
udis86 is still in the tree for now to provide dbg_asmdump(), but it's
only compiled into debug builds and left out of releases completely. As
such, the whole BSD licence statement is also gone from the distribution
LICENCE files. There's now also a dbg_toghidra() which spits out a
rebased address to look stuff up for proper reverse engineering, which
might be more useful than dbg_asmdump() anyway. If nobody ends up using
the latter ever again, udis86 could get chucked completely. We'll see.
Also shoehorned into this commit are a couple more forgotten copyright
year bumps and some general minor cleanup here and there, because I
couldn't be bothered wading through all the diff hunks. Oh, and
makebindist.bat now makes an effort to make the zip file timestamps
predictable/reproducible. That should be a different commit for sure,
but oh well too bad.
Diffstat (limited to 'compile.bat')
-rw-r--r-- | compile.bat | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compile.bat b/compile.bat index f363eef..faef34f 100644 --- a/compile.bat +++ b/compile.bat @@ -39,15 +39,14 @@ goto :eof -o .build/codegen.exe src/build/codegen.c src/build/cmeta.c || exit /b
%HOSTCC% -municode -O2 %warnings% -D_CRT_SECURE_NO_WARNINGS -ladvapi32 ^
-o .build/mkgamedata.exe src/build/mkgamedata.c src/kv.c || exit /b
-.build\codegen.exe src/autojump.c src/con_.c src/dbg.c src/demorec.c src/extmalloc.c ^
-src/fixes.c src/gamedata.c src/gameinfo.c src/hook.c src/kv.c src/rinput.c src/sst.c src/udis86.c || exit /b
+.build\codegen.exe src/autojump.c src/con_.c src/demorec.c src/extmalloc.c src/fixes.c ^
+src/gamedata.c src/gameinfo.c src/hook.c src/kv.c src/rinput.c src/sst.c src/x86.c || exit /b
.build\mkgamedata.exe gamedata/engine.kv gamedata/gamelib.kv || exit /b
llvm-rc /FO .build\dll.res src\dll.rc || exit /b
%CC% -shared -O0 -w -o .build/tier0.dll src/stubs/tier0.c
%CC% -shared -O0 -w -o .build/vstdlib.dll src/stubs/vstdlib.c
call :cc src/autojump.c || exit /b
call :cc src/con_.c || exit /b
-call :cc src/dbg.c || exit /b
call :cc src/demorec.c || exit /b
call :cc src/extmalloc.c || exit /b
call :cc src/fixes.c || exit /b
@@ -57,7 +56,11 @@ call :cc src/hook.c || exit /b call :cc src/kv.c || exit /b
call :cc src/rinput.c || exit /b
call :cc src/sst.c || exit /b
-call :cc src/udis86.c || exit /b
+call :cc src/x86.c || exit /b
+if "%dbg%"=="1" (
+ call :cc src/dbg.c || exit /b
+ call :cc src/udis86.c || exit /b
+)
%CC% -shared -flto %ldflags% -Wl,/IMPLIB:.build/sst.lib,/Brepro ^
-L.build -luser32 -ladvapi32 -lshlwapi -ltier0 -lvstdlib -o sst.dll%objs% .build/dll.res || exit /b
:: get rid of another useless file (can we just not create this???)
|