Setup file name.
444{
446 DWORD FileLocLen = 0;
447 HMODULE ProcHandle = GetModuleHandle(NULL);
448 char * Pos;
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469 GetModuleFileName(ProcHandle, FileLocation, BufferLength);
470
471 Pos = strrchr(FileLocation, '\\');
472 if (Pos != NULL)
473 {
474
475
476
477
478 *Pos = '\0';
479 }
480
481
482
483
484 if (FAILED(
485 StringCbCat(FileLocation, BufferLength, "\\")))
486 {
488 }
489 if (FAILED(
490 StringCbCat(FileLocation, BufferLength, FileName)))
491 {
493 }
494
495 if (CheckFileExists)
496 {
497
498
499
500 if ((
FileHandle = CreateFile(FileLocation, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
501 {
503
504
505
506
508 }
509
510
511
512
514 {
516 }
517 }
518
519
520
521
523}
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned long DWORD
Definition BasicTypes.h:22
PHANDLE FileHandle
Definition Hooks.h:129
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96