Changeset 4813


Ignore:
Timestamp:
Jun 11, 2012, 7:05:19 PM (8 years ago)
Author:
Sam Hocevar
Message:

win32: add debug information to the function diversion code.

Location:
zzuf/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/msvc/zzat.vcxproj

    r4729 r4813  
    6464    </ClCompile>
    6565    <Link>
    66       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     66      <AdditionalDependencies>ws2_32.lib;..\..\libcaca\win32\Debug\Win32\libcaca.lib;%(AdditionalDependencies)</AdditionalDependencies>
    6767      <OutputFile>$(OutDir)zzat.exe</OutputFile>
    6868      <GenerateDebugInformation>true</GenerateDebugInformation>
     
    8484    </ClCompile>
    8585    <Link>
    86       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     86      <AdditionalDependencies>ws2_32.lib;..\..\libcaca\win32\Release\Win32\libcaca.lib;%(AdditionalDependencies)</AdditionalDependencies>
    8787      <OutputFile>$(OutDir)zzat.exe</OutputFile>
    8888      <GenerateDebugInformation>true</GenerateDebugInformation>
  • zzuf/trunk/msvc/zzuf.vcxproj

    r4729 r4813  
    6464    </ClCompile>
    6565    <Link>
    66       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     66      <AdditionalDependencies>ws2_32.lib;..\..\libcaca\win32\Debug\Win32\libcaca.lib;%(AdditionalDependencies)</AdditionalDependencies>
    6767      <OutputFile>$(OutDir)zzuf.exe</OutputFile>
    6868      <GenerateDebugInformation>true</GenerateDebugInformation>
     
    8484    </ClCompile>
    8585    <Link>
    86       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     86      <AdditionalDependencies>ws2_32.lib;..\..\libcaca\win32\Release\Win32\libcaca.lib;%(AdditionalDependencies)</AdditionalDependencies>
    8787      <OutputFile>$(OutDir)zzuf.exe</OutputFile>
    8888      <GenerateDebugInformation>true</GenerateDebugInformation>
  • zzuf/trunk/src/libzzuf/lib-win32.c

    r4684 r4813  
    4545                                             DWORD, DWORD, HANDLE);
    4646#endif
    47 #if defined HAVE_CREATEFILEA
     47#if defined HAVE_CREATEFILEW
    4848static HANDLE (__stdcall *ORIG(CreateFileW))(LPCWSTR, DWORD, DWORD,
    4949                                             LPSECURITY_ATTRIBUTES,
  • zzuf/trunk/src/libzzuf/sys.c

    r4809 r4813  
    7878    int k;
    7979
     80    /* Enumerate all loaded objects and overwrite some functions */
    8081    VirtualQuery(_zz_sys_init, &mbi, sizeof(mbi));
    8182    list = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
     
    8687            continue; /* Don't replace our own functions */
    8788
     89        fprintf(stderr, "diverting functions from %s\n", entry.szModule);
    8890        insert_funcs(entry.hModule);
    8991    }
     
    141143        }
    142144
     145        fprintf(stderr, "diverting method %s (from %s)\n",
     146                        diversion->name, diversion->lib);
     147
    143148        lib = GetModuleHandleA(diversion->lib);
    144149        *diversion->old = (void *)GetProcAddress(lib, diversion->name);
  • zzuf/trunk/src/myfork.c

    r4808 r4813  
    301301
    302302    if (!ret)
    303         return -1;
     303    {
     304        LPTSTR buf;
     305        DWORD err = GetLastError();
     306        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
     307                      FORMAT_MESSAGE_FROM_SYSTEM |
     308                      FORMAT_MESSAGE_IGNORE_INSERTS,
     309                      NULL, err, 0, (LPTSTR)&buf, 0, NULL);
     310        fprintf(stderr, "error launching `%s': %s\n", child->newargv[0], buf);
     311        LocalFree(buf);
     312        return -1;
     313    }
    304314
    305315    /* Insert the replacement code */
Note: See TracChangeset for help on using the changeset viewer.