Jump to content

ololo_user

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. hi developers thanks for nice program please add native support song for Wise Reminder temporary i written hook dll add it in import table (lord pe) and strip reloc table // fhgfvgghfgh.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "MinHook.h" #if defined _M_X64 #pragma comment(lib, "libMinHook.x64.lib") #elif defined _M_IX86 #pragma comment(lib, "libMinHook.x86.lib") #endif void middle_volume() { MMRESULT result; HMIXER hMixer; result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0); MIXERLINE ml = {0}; ml.cbStruct = sizeof(MIXERLINE); ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; result = mixerGetLineInfo((HMIXEROBJ) hMixer, &ml, MIXER_GETLINEINFOF_COMPONENTTYPE); MIXERLINECONTROLS mlc = {0}; MIXERCONTROL mc = {0}; mlc.cbStruct = sizeof(MIXERLINECONTROLS); mlc.dwLineID = ml.dwLineID; mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; mlc.cControls = 1; mlc.pamxctrl = &mc; mlc.cbmxctrl = sizeof(MIXERCONTROL); result = mixerGetLineControls((HMIXEROBJ) hMixer, &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); MIXERCONTROLDETAILS mcd = {0}; MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; mcdu.dwValue = 20767; // the volume is a number between 0 and 65535 mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); mcd.hwndOwner = 0; mcd.dwControlID = mc.dwControlID; mcd.paDetails = &mcdu; mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); mcd.cChannels = 1; result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE); mcd.dwControlID = 3; result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE); mcd.dwControlID = 7; result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE); mixerClose(hMixer); } void mute_off() { MMRESULT result; HMIXER hMixer; result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0); MIXERLINE ml = {0}; ml.cbStruct = sizeof(MIXERLINE); ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS; result = mixerGetLineInfo((HMIXEROBJ) hMixer, &ml, MIXER_GETLINEINFOF_COMPONENTTYPE); MIXERLINECONTROLS mlc = {0}; MIXERCONTROL mc = {0}; mlc.cbStruct = sizeof(MIXERLINECONTROLS); mlc.dwLineID = ml.dwLineID; mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME; mlc.cControls = 1; mlc.pamxctrl = &mc; mlc.cbmxctrl = sizeof(MIXERCONTROL); result = mixerGetLineControls((HMIXEROBJ) hMixer, &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE; result = mixerGetLineControls((HMIXEROBJ) hMixer, &mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE); MIXERCONTROLDETAILS mcd = {0}; MIXERCONTROLDETAILS_UNSIGNED mcdu = {0}; mcdu.dwValue = 32767; // the volume is a number between 0 and 65535 mcd.cbStruct = sizeof(MIXERCONTROLDETAILS); mcd.hwndOwner = 0; mcd.dwControlID = mc.dwControlID; mcd.paDetails = &mcdu; mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED); mcd.cChannels = 1; MIXERCONTROLDETAILS_BOOLEAN mcb = {0}; mcb.fValue = false; mcd.paDetails = &mcb; mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN); result = mixerSetControlDetails((HMIXEROBJ) hMixer, &mcd, MIXER_SETCONTROLDETAILSF_VALUE); mixerClose(hMixer); } HSTREAM stream; void play_sound(PCH song) { BASS_ChannelStop(stream); BASS_StreamFree(stream); stream = BASS_StreamCreateFile(FALSE, song, 0, 0, BASS_SAMPLE_LOOP); BASS_ChannelSetAttribute((DWORD)stream, BASS_ATTRIB_VOL, (float)100 / 100.f); BASS_ChannelPlay(stream, FALSE); } typedef BOOL WINAPI DestroyWindow_t( __in HWND hWnd); DestroyWindow_t* pfnDestroyWindow; BOOL WINAPI DestroyWindow_Hook( __in HWND hWnd) { BASS_ChannelStop(stream); BASS_StreamFree(stream); stream = 0; return pfnDestroyWindow(hWnd); } typedef WINUSERAPI BOOL WINAPI MessageBeep_t( __in UINT uType); MessageBeep_t* pfnMessageBeep; bool inited; BOOL WINAPI MessageBeep_Hook( __in UINT uType) { void* p =_ReturnAddress(); if (p >= PVOID(0x400000) && p < PVOID(0x400000 + 0x1ce000)) { if (!inited) { BASS_Init(1, 44100, 0, 0, NULL); inited = true; } middle_volume(); mute_off(); play_sound("c:/wapres.wav"); return TRUE; } return pfnMessageBeep(uType); } void splice() { MH_Initialize(); HMODULE mod = LoadLibrary(TEXT("user32")); void* ptr = GetProcAddress(mod, "MessageBeep"); MH_CreateHook(ptr, MessageBeep_Hook, reinterpret_cast<void**>(&pfnMessageBeep)); MH_EnableHook(ptr); ptr = GetProcAddress(mod, "DestroyWindow"); MH_CreateHook(ptr, DestroyWindow_Hook, reinterpret_cast<void**>(&pfnDestroyWindow)); MH_EnableHook(ptr); } BOOL CALLBACK DllMain(HINSTANCE, DWORD reason, LPVOID) { if (DLL_PROCESS_ATTACH == reason) { splice(); } return TRUE; } extern "C" __declspec(dllexport) void lock() { }
×
×
  • Create New...