void toggle_sound ( bool toggle ) { DWORD Protect = PAGE_EXECUTE_READWRITE ; VirtualProtect ( reinterpret_cast ( 0x4D86B0 ) , 8 , Protect , & Protect ) ; memcpy ( reinterpret_cast ( 0x4D86B0 ) , ( toggle ? "\xB8\x00\x00\x00\x00\xC2\x1C\x00" : "\x51\x56\x57\x8B\x7C\x24\x10\x66" ) , 8 ) ; VirtualProtect ( reinterpret_cast ( 0x4D86B0 ) , 8 , Protect , & Protect ) ; }