Changeset 9536
- Timestamp:
- Dec 20, 2002, 12:38:55 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/peldr/pe.cpp ¶
r8911 r9536 1 /* $Id: pe.cpp,v 1.3 4 2002-07-23 13:26:10sandervl Exp $ */1 /* $Id: pe.cpp,v 1.35 2002-12-20 11:38:55 sandervl Exp $ */ 2 2 3 3 /* … … 32 32 #include <wprocess.h> 33 33 #include <win\peexe.h> 34 #include <odinpe.h> 34 35 #include "pe.h" 35 36 36 37 char INFO_BANNER[] = "Usage: PE winexe commandline"; 37 38 char szErrorTitle[] = "Odin"; 38 char szLoadErrorMsg[] = "Can't load executable ";39 char szLoadErrorMsg[] = "Can't load executable %s"; 39 40 char szFileNotFound[] = "File not found."; 40 41 char szFileErrorMsg[] = "File IO error"; 41 42 char szPEErrorMsg[] = "Not a valid win32 exe. (perhaps 16 bits windows)"; 42 char szCPUErrorMsg[] = " Executabledoesn't run on x86 machines";43 char szExeErrorMsg[] = " Fileisn't an executable";44 char szInteralErrorMsg[]= "Internal Error ";43 char szCPUErrorMsg[] = "%s doesn't run on x86 machines"; 44 char szExeErrorMsg[] = "%s isn't an executable"; 45 char szInteralErrorMsg[]= "Internal Error while loading %s"; 45 46 char szNoKernel32Msg[] = "Can't load/find kernel32.dll (rc=%d, module %s)"; 46 47 char szDosInfoBlocks[] = "DosInfoBlocks failed!"; 48 char szErrorExports[] = "Unable to process exports of %s"; 49 char szErrorMemory[] = "Memory allocation failure while loading %s"; 50 char szErrorImports[] = "Failure to load \"%s\" due to bad or missing %s"; 51 47 52 char szErrDosStartSession[] = "Failed to start win16 session (rc=%d)"; 48 53 … … 69 74 KRNL32EXCEPTPROC Krnl32UnsetExceptionHandler = 0; 70 75 71 //should be the same as in ..\kernel32\winexepeldr.h72 typedef BOOL (* WIN32API WIN32CTOR)(char *, char *, char *, ULONG, ULONG, BOOL, BOOL);73 76 74 77 WIN32CTOR CreateWin32Exe = 0; … … 258 261 goto fail; 259 262 } 260 rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@ 28", (PFN *)&CreateWin32Exe);263 rc = DosQueryProcAddr(hmodKernel32, 0, "_CreateWin32PeLdrExe@36", (PFN *)&CreateWin32Exe); 261 264 262 265 #ifdef COMMAND_LINE_VERSION … … 265 268 fVioConsole = FALSE; 266 269 #endif 267 if(CreateWin32Exe(exeName, win32cmdline, peoptions, reservedMemory, 0, fConsoleApp, fVioConsole) == FALSE) { 270 rc = CreateWin32Exe(exeName, win32cmdline, peoptions, reservedMemory, 0, 271 fConsoleApp, fVioConsole, errorMod, sizeof(errorMod)); 272 if(rc != LDRERROR_SUCCESS) 273 { 274 char szErrorMsg[512]; 275 276 switch(rc) { 277 case LDRERROR_INVALID_MODULE: 278 sprintf(szErrorMsg, szLoadErrorMsg, exeName); 279 break; 280 case LDRERROR_INVALID_CPU: 281 sprintf(pszErrorMsg, szCPUErrorMsg, exeName); 282 break; 283 case LDRERROR_FILE_SYSTEM: 284 sprintf(szErrorMsg, szExeErrorMsg, exeName); 285 break; 286 case LDRERROR_MEMORY: 287 sprintf(szErrorMsg, szErrorMemory, exeName); 288 break; 289 case LDRERROR_EXPORTS: 290 sprintf(szErrorMsg, szErrorExports, exeName); 291 break; 292 case LDRERROR_IMPORTS: 293 sprintf(szErrorMsg, szErrorImports, exeName, errorMod); 294 break; 295 case LDRERROR_INVALID_SECTION: 296 default: 297 sprintf(szErrorMsg, szInteralErrorMsg, exeName); 298 break; 299 } 300 301 WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE); 268 302 goto fail; 269 303 }
Note:
See TracChangeset
for help on using the changeset viewer.