Skip to content

Commit

Permalink
Stop backing up xmm registers
Browse files Browse the repository at this point in the history
The game will clobber them anyway
  • Loading branch information
Sirius902 committed Aug 15, 2021
1 parent f224ae3 commit adcffb5
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions LuaBackendDLL/main_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#include <string_view>
#include <vector>

#include <condition_variable>
#include <thread>
#include <mutex>
#include <unordered_map>
#include <optional>

Expand Down Expand Up @@ -269,15 +266,8 @@ void hookGame(uint64_t moduleAddress) {
std::vector<uint8_t> func{
PushRbx,
PUSHF_1, PUSHF_2,
0x48, 0x89, 0xE3, // mov rbx, rsp
0x48, 0x83, 0xE4, 0xF0, // and rsp, -0x10
0x48, 0x83, 0xEC, 0x60, // sub rsp, 0x60
0x66, 0x0F, 0x7F, 0x04, 0x24, // movdqa [rsp], xmm0
0x66, 0x0F, 0x7F, 0x4C, 0x24, 0x10, // movdqa [rsp+0x10], xmm1
0x66, 0x0F, 0x7F, 0x54, 0x24, 0x20, // movdqa [rsp+0x20], xmm2
0x66, 0x0F, 0x7F, 0x5C, 0x24, 0x30, // movdqa [rsp+0x30], xmm3
0x66, 0x0F, 0x7F, 0x64, 0x24, 0x40, // movdqa [rsp+0x40], xmm4
0x66, 0x0F, 0x7F, 0x6C, 0x24, 0x50, // movdqa [rsp+0x50], xmm5
0x48, 0x89, 0xE3, // mov rbx, rsp
0x48, 0x83, 0xE4, 0xF0, // and rsp, -0x10
PushRax,
PushRcx,
PushRdx,
Expand All @@ -295,13 +285,7 @@ void hookGame(uint64_t moduleAddress) {
PopRdx,
PopRcx,
PopRax,
0x66, 0x0F, 0x6F, 0x6C, 0x24, 0x50, // movdqa xmm5, [rsp+0x50]
0x66, 0x0F, 0x6F, 0x64, 0x24, 0x40, // movdqa xmm4, [rsp+0x40]
0x66, 0x0F, 0x6F, 0x5C, 0x24, 0x30, // movdqa xmm3, [rsp+0x30]
0x66, 0x0F, 0x6F, 0x54, 0x24, 0x20, // movdqa xmm2, [rsp+0x20]
0x66, 0x0F, 0x6F, 0x4C, 0x24, 0x10, // movdqa xmm1, [rsp+0x10]
0x66, 0x0F, 0x6F, 0x04, 0x24, // movdqa xmm0, [rsp]
0x48, 0x89, 0xDC, // mov rsp, rbx
0x48, 0x89, 0xDC, // mov rsp, rbx
POPF_1, POPF_2,
PopRbx,
};
Expand Down

0 comments on commit adcffb5

Please sign in to comment.