- 668
- 294
выводит иероглифы вместо ссылки
пишет*
main.cpp:
SAMPFUNCS *SF = new SAMPFUNCS();
void WriteMemory(void* address, void* bytes, int byteSize)
{
DWORD NewProtection;
VirtualProtect(address, byteSize, PAGE_EXECUTE_READWRITE, &NewProtection);
memcpy(address, bytes, byteSize);
VirtualProtect(address, byteSize, NewProtection, &NewProtection);
}
void CALLBACK surl(std::string param)
{
SF->getSAMP()->getPlayers()->pLocalPlayer->Say((char*)(GetModuleHandle("samp.dll") + 0x11A508));
};
void __stdcall mainloop()
{
static bool initialized = false;
if (!initialized)
{
if (GAME && GAME->GetSystemState() == eSystemState::GS_PLAYING_GAME && SF->getSAMP()->IsInitialized())
{
initialized = true;
SF->getSAMP()->registerChatCommand("getsongurl", surl);
}
}
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved)
{
if (dwReasonForCall == DLL_PROCESS_ATTACH)
SF->initPlugin(mainloop, hModule);
return TRUE;
}
пишет*