uwpinject.c
/*
 * using the local LoadLibraryA address might seem wrong,
 * but in practice kernel32 is mapped to the same address in all processes
 * so it works
 */
using the local LoadLibraryA address might seem wrong,
but in practice kernel32 is mapped to the same address in all processes
so it works
using the local LoadLibraryA address might seem wrong but in practice kernel32 is mapped to the same address in all processes so it works
int win32_inject(int pid, wchar_t* path) {
  void* pfnLoadLibraryW;
  void *remote_path;
  int res;
  if (!win32_addr("kernel32.dll", "LoadLibraryW", &pfnLoadLibraryW)) {
    return 0;
  }
  remote_path = win32_rwstrdup(pid, path);
  if (!remote_path) {
    return 0;
  }
  res = win32_wait_for_remote_thread(pid, pfnLoadLibraryW, remote_path);
  win32_rfree(pid, remote_path);
  return res;
}
int win32_inject ( int pid , wchar_t * path ) { void * pfnLoadLibraryW ; void * remote_path ; int res ; if ( ! win32_addr ( " " , " " , & pfnLoadLibraryW ) ) { return 0 ; } remote_path = win32_rwstrdup ( pid , path ) ; if ( ! remote_path ) { return 0 ; } res = win32_wait_for_remote_thread ( pid , pfnLoadLibraryW , remote_path ) ; win32_rfree ( pid , remote_path ) ; return res ; }
using the local LoadLibraryA address might seem wrong,
 but in practice kernel32 is mapped to the same address in all processes
 so it works
using the local LoadLibraryA address might seem wrong but in practice kernel32 is mapped to the same address in all processes so it works