With MRs.exe C++

Results 1 to 1 of 1
  1. #1
    Account Upgraded | Title Enabled! Gosu[ru] is offline
    MemberRank
    Jan 2009 Join Date
    http://www.epicLocation
    359Posts

    With MRs.exe C++

    Guys please help me..

    Help me make

    Spoiler:

    #include <windows.h>
    #include <stdio.h>

    #include "Detour/CDetour.h"

    void create_subdirs (const char *path) {

    char *work = strdup(path), *ptr;

    for (ptr = work; *ptr; ++ ptr)
    if (*ptr == '\\') {
    *ptr = 0;
    printf("subdir: [%s]\n", work);
    CreateDirectory (work,NULL);
    *ptr = '\\';
    }

    free(work);

    }

    CDetour MZFile__ReadDet;
    void __stdcall MZFile__ReadHook (int i, void *lpBuffer, int nSize)
    {
    printf ("Hook?\n");
    char *lpFile;
    _asm mov lpFile, esi
    printf ("[I=%i] MZFile::Read [%s][\n", i, lpFile);
    char szPath[256];
    sprintf(szPath,"MRS\\%s", lpFile);
    for(int i =0; i <strlen(szPath); i++)
    if(szPath[i] == '/')
    szPath[i] = '\\';

    create_subdirs (szPath);
    MZFile__ReadDet.Org (i, lpBuffer, nSize);
    DWORD dwWrote;
    HANDLE hFile = CreateFile (szPath, GENERIC_WRITE,NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
    WriteFile (hFile, lpBuffer, nSize, &dwWrote, NULL);
    printf("%u]\n", dwWrote);

    }

    CDetour MZip__ReadFileDet;
    void __stdcall MZip__ReadFileHook (const char *szFile, void *lpBuffer, int nSize)
    {
    char szPath[256];
    sprintf(szPath,"MRS\\%s",szFile);

    for(int i =0; i <strlen(szPath); i++)
    if(szPath[i] == '/')
    szPath[i] = '\\';


    create_subdirs (szPath);
    MZip__ReadFileDet.Org (szFile, lpBuffer, nSize);

    printf ("%s (",szFile);
    DWORD dwWrote;
    HANDLE hFile = CreateFile (szPath, GENERIC_WRITE,NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
    WriteFile (hFile, lpBuffer, nSize, &dwWrote, NULL);
    printf("%u)\n", dwWrote);
    CloseHandle (hFile);
    }

    void Initialize ()
    {
    AllocConsole ( );
    freopen ( "CONOUT$", "wb", stdout );
    printf ("Testing..\n");
    MZip__ReadFileDet.Detour ((PBYTE)0x00538B40, (PBYTE)MZip__ReadFileHook, true);
    MZip__ReadFileDet.Apply ();

    MZFile__ReadDet2.Detour ((PBYTE)0x00538960, (PBYTE)MZFile__ReadHook2, true);
    MZFile__ReadDet2.Apply ();
    AllocConsole ( );
    freopen ( "CONOUT$", "wb", stdout );
    printf ("Detours applied.\n");
    }


    BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls ( hModule );
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    {
    Initialize( );
    break;
    }
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
    break;
    }
    return TRUE;
    }


    Please.. really need..

    I want repack how to ijji

    http://forum.ragezone.com/f311/mrs-e...s-ijji-610815/
    Last edited by Gosu[ru]; 02-10-09 at 07:15 PM.




Advertisement