Exemplo n.º 1
0
        public static void LoadRetail()
        {
            if (RealHandler != IntPtr.Zero)
            {
                return;
            }

            try {
                StringReloader.ProcessReal(IntPtr.Zero);
            } catch { }

            RealHandler = LoadLibrary("dinput8.dll");

            if (RealHandler == IntPtr.Zero)
            {
                Environment.Exit(0x505);//ERROR_DELAY_LOAD_FAILED
            }
            Create      = GetDelegate <RET_5>(RealHandler, "DirectInput8Create", false);
            GetJoystick = GetDelegate <RET_0>(RealHandler, "GetdfDIJoystick", false);

            CanUnload   = GetDelegate <RET_0>(RealHandler, "DllCanUnloadNow");
            GetClassObj = GetDelegate <RET_3>(RealHandler, "DllGetClassObject");
            Register    = GetDelegate <RET_0>(RealHandler, "DllRegisterServer");
            Unregister  = GetDelegate <RET_0>(RealHandler, "DllUnregisterServer");
        }
Exemplo n.º 2
0
        public static void LoadRetail()
        {
            if (RealHandler != IntPtr.Zero)
            {
                return;
            }

            try {
                StringReloader.ProcessReal(IntPtr.Zero);
            } catch { }

            RealHandler = LoadLibrary(CurrentDllName);

            if (RealHandler == IntPtr.Zero)
            {
                Environment.Exit(0x505);//ERROR_DELAY_LOAD_FAILED
            }
            Link   = GetDelegate <RET_1>(RealHandler, "V2Link", false);
            Unlink = GetDelegate <RET_0>(RealHandler, "V2Unlink", false);
        }
Exemplo n.º 3
0
        public static void LoadRetail()
        {
            if (RealHandler != IntPtr.Zero)
            {
                return;
            }

            try
            {
                StringReloader.ProcessReal(IntPtr.Zero);
            }
            catch { }

            RealHandler = LoadLibrary("d3d9.dll");

            if (RealHandler == IntPtr.Zero)
            {
                Environment.Exit(0x505);//ERROR_DELAY_LOAD_FAILED
            }
            Create   = GetDelegate <RET_1>(RealHandler, "Direct3DCreate9", false);
            CreateEx = GetDelegate <RET_2>(RealHandler, "Direct3DCreate9Ex", false);


            BeginEvent       = GetDelegate <RET_2>(RealHandler, "D3DPERF_BeginEvent");
            EndEvent         = GetDelegate <RET_0>(RealHandler, "D3DPERF_EndEvent");
            SetMarker        = GetDelegate <NULL_2>(RealHandler, "D3DPERF_SetMarker");
            SetRegion        = GetDelegate <NULL_2>(RealHandler, "D3DPERF_SetRegion");
            QueryRepeatFrame = GetDelegate <RET_0>(RealHandler, "D3DPERF_QueryRepeatFrame");
            SetOptions       = GetDelegate <NULL_1>(RealHandler, "D3DPERF_SetOptions");
            GetStatus        = GetDelegate <RET_0>(RealHandler, "D3DPERF_GetStatus");
            DbgSetLevel      = GetDelegate <RET_0>(RealHandler, "DebugSetLevel");
            DbgSetMute       = GetDelegate <RET_1>(RealHandler, "DebugSetMute");
            PSampleTexture   = GetDelegate <RET_0>(RealHandler, "PSGPSampleTexture");
            PError           = GetDelegate <RET_0>(RealHandler, "PSGPError");
            ShaderValidator  = GetDelegate <RET_0>(RealHandler, "Direct3DShaderValidatorCreate9");
            EnableMaximizedWindowedModeShim = GetDelegate <RET_1>(RealHandler, "EnableMaximizedWindowedModeShim");
        }
Exemplo n.º 4
0
        public static void LoadRetail()
        {
            if (RealHandler != IntPtr.Zero)
            {
                return;
            }

            try {
                StringReloader.ProcessReal(IntPtr.Zero);
            } catch { }

            RealHandler = LoadLibrary(Environment.Is64BitProcess ? "bink2w64.dll" : "bink2w32.dll");

            if (RealHandler == IntPtr.Zero)
            {
                Environment.Exit(0x505);//ERROR_DELAY_LOAD_FAILED
            }
            _BinkFreeGlobals0 = GetDelegate <NULL_0>(RealHandler, "_BinkFreeGlobals@0");

            _BinkLoadUnload1    = GetDelegate <NULL_1>(RealHandler, "_BinkLoadUnload@1");
            _BinkSetError1      = GetDelegate <NULL_1>(RealHandler, "_BinkSetError@1");
            _BinkNextFrame1     = GetDelegate <NULL_1>(RealHandler, "_BinkNextFrame@1");
            _BinkClose1         = GetDelegate <NULL_1>(RealHandler, "_BinkClose@1");
            _BinkService1       = GetDelegate <NULL_1>(RealHandler, "_BinkService@1");
            _BinkGetPalette1    = GetDelegate <NULL_1>(RealHandler, "_BinkGetPalette@1");
            _BinkCloseTrack1    = GetDelegate <NULL_1>(RealHandler, "_BinkCloseTrack@1");
            _BinkSetIO1         = GetDelegate <NULL_1>(RealHandler, "_BinkSetIO@1");
            _BinkSetSimulate1   = GetDelegate <NULL_1>(RealHandler, "_BinkSetSimulate@1");
            _BinkSetIOSize1     = GetDelegate <NULL_1>(RealHandler, "_BinkSetIOSize@1");
            _BinkBufferClose1   = GetDelegate <NULL_1>(RealHandler, "_BinkBufferClose@1");
            _BinkRestoreCursor1 = GetDelegate <NULL_1>(RealHandler, "_BinkRestoreCursor@1");

            _BinkLoadUnloadConverter2  = GetDelegate <NULL_2>(RealHandler, "_BinkLoadUnloadConverter@2");
            _BinkGetFrameBuffersInfo2  = GetDelegate <NULL_2>(RealHandler, "_BinkGetFrameBuffersInfo@2");
            _BinkRegisterFrameBuffers2 = GetDelegate <NULL_2>(RealHandler, "_BinkRegisterFrameBuffers@2");
            _BinkGetSummary2           = GetDelegate <NULL_2>(RealHandler, "_BinkGetSummary@2");
            _BinkSetSoundTrack2        = GetDelegate <NULL_2>(RealHandler, "_BinkSetSoundTrack@2");
            _BinkSetFrameRate2         = GetDelegate <NULL_2>(RealHandler, "_BinkSetFrameRate@2");
            _BinkSetMemory2            = GetDelegate <NULL_2>(RealHandler, "_BinkSetMemory@2");
            _BinkGoto3 = GetDelegate <NULL_3>(RealHandler, "_BinkGoto@3");

            _BinkSetVolume3           = GetDelegate <NULL_3>(RealHandler, "_BinkSetVolume@3");
            _BinkSetPan3              = GetDelegate <NULL_3>(RealHandler, "_BinkSetPan@3");
            _BinkGetRealtime3         = GetDelegate <NULL_3>(RealHandler, "_BinkGetRealtime@3");
            _BinkBufferSetResolution3 = GetDelegate <NULL_3>(RealHandler, "_BinkBufferSetResolution@3");
            _BinkBufferCheckWinPos3   = GetDelegate <NULL_3>(RealHandler, "_BinkBufferCheckWinPos@3");
            _BinkBufferBlit3          = GetDelegate <NULL_3>(RealHandler, "_BinkBufferBlit@3");

            _BinkSetMixBins4       = GetDelegate <NULL_4>(RealHandler, "_BinkSetMixBins@4");
            _BinkSetMixBinVolumes5 = GetDelegate <NULL_5>(RealHandler, "_BinkSetMixBinVolumes@5");


            _BinkLogoAddress0    = GetDelegate <RET_0>(RealHandler, "_BinkLogoAddress@0");
            _BinkGetError0       = GetDelegate <RET_0>(RealHandler, "_BinkGetError@0");
            _BinkBufferGetError0 = GetDelegate <RET_0>(RealHandler, "_BinkBufferGetError@0");

            _BinkDoFrame1              = GetDelegate <RET_1>(RealHandler, "_BinkDoFrame@1");
            _BinkWait1                 = GetDelegate <RET_1>(RealHandler, "_BinkWait@1");
            _BinkShouldSkip1           = GetDelegate <RET_1>(RealHandler, "_BinkShouldSkip@1");
            _BinkOpenDirectSound1      = GetDelegate <RET_1>(RealHandler, "_BinkOpenDirectSound@1");
            _BinkOpenWaveOut1          = GetDelegate <RET_1>(RealHandler, "_BinkOpenWaveOut@1");
            _BinkOpenXAudio1           = GetDelegate <RET_1>(RealHandler, "_BinkOpenXAudio@1");
            _BinkOpenMiles1            = GetDelegate <RET_1>(RealHandler, "_BinkOpenMiles@1");
            _BinkOpenSoundManager1     = GetDelegate <RET_1>(RealHandler, "_BinkOpenSoundManager@1");
            _BinkOpenSDLMixer1         = GetDelegate <RET_1>(RealHandler, "_BinkOpenSDLMixer@1");
            _BinkOpenAX1               = GetDelegate <RET_1>(RealHandler, "_BinkOpenAX@1");
            _BinkOpenMusyXSound1       = GetDelegate <RET_1>(RealHandler, "_BinkOpenMusyXSound@1");
            _BinkOpenRAD_IOP1          = GetDelegate <RET_1>(RealHandler, "_BinkOpenRAD_IOP@1");
            _BinkOpenLibAudio1         = GetDelegate <RET_1>(RealHandler, "_BinkOpenLibAudio@1");
            _BinkOpenPSPSound1         = GetDelegate <RET_1>(RealHandler, "_BinkOpenPSPSound@1");
            _BinkOpenNDSSound1         = GetDelegate <RET_1>(RealHandler, "_BinkOpenNDSSound@1");
            _BinkGDSurfaceType1        = GetDelegate <RET_1>(RealHandler, "_BinkGDSurfaceType@1");
            _BinkIsSoftwareCursor1     = GetDelegate <RET_1>(RealHandler, "_BinkIsSoftwareCursor@1");
            _BinkDDSurfaceType1        = GetDelegate <RET_1>(RealHandler, "_BinkDDSurfaceType@1");
            _BinkDX8SurfaceType1       = GetDelegate <RET_1>(RealHandler, "_BinkDX8SurfaceType@1");
            _BinkDX9SurfaceType1       = GetDelegate <RET_1>(RealHandler, "_BinkDX9SurfaceType@1");
            _BinkBufferLock1           = GetDelegate <RET_1>(RealHandler, "_BinkBufferLock@1");
            _BinkBufferUnlock1         = GetDelegate <RET_1>(RealHandler, "_BinkBufferUnlock@1");
            _BinkBufferGetDescription1 = GetDelegate <RET_1>(RealHandler, "_BinkBufferGetDescription@1");
            _BinkWaitStopAsyncThread1  = GetDelegate <RET_1>(RealHandler, "_BinkWaitStopAsyncThread@1");

            _BinkMacOpen2                 = GetDelegate <RET_2>(RealHandler, "_BinkMacOpen@2");
            _BinkNDSOpen2                 = GetDelegate <RET_2>(RealHandler, "_BinkNDSOpen@2");
            _BinkOpen2                    = GetDelegate <RET_2>(RealHandler, "_BinkOpen@2");
            _BinkPause2                   = GetDelegate <RET_2>(RealHandler, "_BinkPause@2");
            _BinkGetRects2                = GetDelegate <RET_2>(RealHandler, "_BinkGetRects@2");
            _BinkSetVideoOnOff2           = GetDelegate <RET_2>(RealHandler, "_BinkSetVideoOnOff@2");
            _BinkSetSoundOnOff2           = GetDelegate <RET_2>(RealHandler, "_BinkSetSoundOnOff@2");
            _BinkControlBackgroundIO2     = GetDelegate <RET_2>(RealHandler, "_BinkControlBackgroundIO@2");
            _BinkOpenTrack2               = GetDelegate <RET_2>(RealHandler, "_BinkOpenTrack@2");
            _BinkGetTrackData2            = GetDelegate <RET_2>(RealHandler, "_BinkGetTrackData@2");
            _BinkGetTrackType2            = GetDelegate <RET_2>(RealHandler, "_BinkGetTrackType@2");
            _BinkGetTrackMaxSize2         = GetDelegate <RET_2>(RealHandler, "_BinkGetTrackMaxSize@2");
            _BinkGetTrackID2              = GetDelegate <RET_2>(RealHandler, "_BinkGetTrackID@2");
            _BinkSetSoundSystem2          = GetDelegate <RET_2>(RealHandler, "_BinkSetSoundSystem@2");
            _BinkControlPlatformFeatures2 = GetDelegate <RET_2>(RealHandler, "_BinkControlPlatformFeatures@2");
            _BinkBufferSetHWND2           = GetDelegate <RET_2>(RealHandler, "_BinkBufferSetHWND@2");
            _BinkIsSoftwareCursor2        = GetDelegate <RET_2>(RealHandler, "_BinkIsSoftwareCursor@2");
            _BinkBufferSetDirectDraw2     = GetDelegate <RET_2>(RealHandler, "_BinkBufferSetDirectDraw@2");
            _BinkBufferClear2             = GetDelegate <RET_2>(RealHandler, "_BinkBufferClear@2");

            _BinkGetKeyFrame3     = GetDelegate <RET_3>(RealHandler, "_BinkGetKeyFrame@3");
            _BinkBufferSetOffset3 = GetDelegate <RET_3>(RealHandler, "_BinkBufferSetOffset@3");
            _BinkBufferSetScale3  = GetDelegate <RET_3>(RealHandler, "_BinkBufferSetScale@3");

            _BinkOpenXAudio24 = GetDelegate <RET_4>(RealHandler, "_BinkOpenXAudio2@4");
            _BinkBufferOpen4  = GetDelegate <RET_4>(RealHandler, "_BinkBufferOpen@4");

            _BinkRequestStopAsyncThreadsMulti8 = GetDelegate <RET_8>(RealHandler, "_BinkRequestStopAsyncThreadsMulti@8");
            _BinkWaitStopAsyncThreadsMulti8    = GetDelegate <RET_8>(RealHandler, "_BinkWaitStopAsyncThreadsMulti@8");
            _BinkDoFrameAsyncWait8             = GetDelegate <RET_8>(RealHandler, "_BinkDoFrameAsyncWait@8");
            _BinkSetSoundSystem8   = GetDelegate <RET_8>(RealHandler, "_BinkSetSoundSystem@8");
            _BinkStartAsyncThread8 = GetDelegate <RET_8>(RealHandler, "_BinkStartAsyncThread@8");

            _BinkCheckCursor5       = GetDelegate <RET_5>(RealHandler, "_BinkCheckCursor@5");
            _BinkCopyToBuffer7      = GetDelegate <RET_7>(RealHandler, "_BinkCopyToBuffer@7");
            _BinkCopyToBufferRect11 = GetDelegate <RET_11>(RealHandler, "_BinkCopyToBufferRect@11");

            //Bink2 - Undocumented
            _BinkClose4              = GetDelegate <NULL_4>(RealHandler, "_BinkClose@4");
            _BinkUtilCPUs0           = GetDelegate <RET_0>(RealHandler, "_BinkUtilCPUs@0");
            _BinkNextFrame4          = GetDelegate <RET_4>(RealHandler, "_BinkNextFrame@4");
            _BinkShouldSkip4         = GetDelegate <RET_4>(RealHandler, "_BinkShouldSkip@4");
            _BinkWait4               = GetDelegate <RET_4>(RealHandler, "_BinkWait@4");
            _BinkOpen8               = GetDelegate <RET_8>(RealHandler, "_BinkOpen@8");
            _BinkDoFrameAsyncMulti12 = GetDelegate <RET_12>(RealHandler, "_BinkDoFrameAsyncMulti@12");
            _BinkSetVolume12         = GetDelegate <NULL_12>(RealHandler, "_BinkSetVolume@12");
            _BinkCopyToBuffer28      = GetDelegate <RET_28>(RealHandler, "_BinkCopyToBuffer@28");
        }