Add files via upload

This commit is contained in:
ChrisMiuchiz 2018-11-14 20:33:55 -05:00 committed by GitHub
parent 98a7853422
commit cbf06a2185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 1 deletions

View File

@ -304,7 +304,7 @@ _declspec(naked) void __declspec(dllexport) ASMHandlePacket(){
}
//ready to send a packet
MakeCallback(ReadyToSendCallback, void, RegisterReadyToSendCallback, ready_to_send_callbacks);
void __stdcall no_shenanigans HandleReadyToSend(SOCKET s){
for (ReadyToSendCallback func : ready_to_send_callbacks){
@ -332,7 +332,30 @@ void no_shenanigans ASMHandleReadyToSend(){
}
//Finish crafting
MakeCallback(FinishCraftingCallback, void, RegisterFinishCraftingCallback, finish_crafting_callbacks);
void __stdcall no_shenanigans HandleFinishCrafting(){
for (FinishCraftingCallback func : finish_crafting_callbacks){
func();
}
}
DWORD HandleFinishCrafting_ptr = (DWORD)&HandleFinishCrafting;
unsigned int ASMHandleFinishCrafting_JMP_Back;
void no_shenanigans ASMHandleFinishCrafting(){
asm("pushad");
asm("call [_HandleFinishCrafting_ptr]");
asm("popad");
asm("mov ecx, [ebp-0xC]"); //original code
asm("mov dword ptr fs:[0], ecx");
asm("jmp [_ASMHandleFinishCrafting_JMP_Back]");
}
void WriteJMP(BYTE* location, BYTE* newFunction){
@ -384,6 +407,9 @@ extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
ASMHandleReadyToSend_JMP_Back = base + 0x69C92;
WriteJMP((BYTE*)(base + 0x69C88), (BYTE*)&ASMHandleReadyToSend);
ASMHandleFinishCrafting_JMP_Back = base + 0x70D6B;
WriteJMP((BYTE*)(base + 0x70D61), (BYTE*)&ASMHandleFinishCrafting);
break;
}
return true;