ReactOS  0.4.15-dev-440-g5f37b68
main.c File Reference
#include "stdinc.h"
#include <wchar.h>
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define ACTION_NONE   0
 
#define ACTION_LOAD   1
 
#define ACTION_UNLOAD   2
 
#define ACTION_TRANS   3
 
#define ACTION_RELOAD   4
 
#define ACTION_INSTALL   5
 
#define ACTION_UNINSTALL   6
 
#define ACTION_STATUS   7
 
#define ACTION_BREAK   8
 
#define ACTION_TERMINAL   9
 

Functions

void process_stabs (char *pExeName, HANDLE fileout, PIMAGE_SECTION_HEADER section, int sectionHeadersSize, void *p, PSTAB_ENTRY pStab, int nStabLen, char *pStr, int nStrLen, char *pGlobals, int nGlobalLen, char *pGlobalsStr, int nGlobalStrLen)
 
void find_stab_sections (void *p, PIMAGE_SECTION_HEADER section, unsigned cSections, PSTAB_ENTRY *ppStab, int *pLen, char **ppStr, int *pnStabStrLen)
 
int process_pe (char *filename, int file, void *p, int len)
 
int process_file (char *filename)
 
HANDLE open_debugger (void)
 
void close_debugger (void)
 
int ioctl (HANDLE device, DWORD ioctrlcode, PDEBUGGER_STATUS_BLOCK psb)
 
void banner (void)
 
void change_symbols (int action, char *pfilename)
 
void showstatus (void)
 
void dobreak (void)
 
int process_switches (int argc, char *argv[])
 
void showhelp (void)
 
void showpermission (void)
 
int main (int argc, char *argv[])
 

Variables

char SrcFileNames [2048][2048]
 
ULONG ulCurrentSrcFile = 0
 
HANDLE debugger_file
 
ULONG ulGlobalVerbose = 0
 

Macro Definition Documentation

◆ ACTION_BREAK

#define ACTION_BREAK   8

Definition at line 556 of file main.c.

◆ ACTION_INSTALL

#define ACTION_INSTALL   5

Definition at line 553 of file main.c.

◆ ACTION_LOAD

#define ACTION_LOAD   1

Definition at line 549 of file main.c.

◆ ACTION_NONE

#define ACTION_NONE   0

Definition at line 548 of file main.c.

◆ ACTION_RELOAD

#define ACTION_RELOAD   4

Definition at line 552 of file main.c.

◆ ACTION_STATUS

#define ACTION_STATUS   7

Definition at line 555 of file main.c.

◆ ACTION_TERMINAL

#define ACTION_TERMINAL   9

Definition at line 557 of file main.c.

◆ ACTION_TRANS

#define ACTION_TRANS   3

Definition at line 551 of file main.c.

◆ ACTION_UNINSTALL

#define ACTION_UNINSTALL   6

Definition at line 554 of file main.c.

◆ ACTION_UNLOAD

#define ACTION_UNLOAD   2

Definition at line 550 of file main.c.

Function Documentation

◆ banner()

void banner ( void  )

Definition at line 541 of file main.c.

542 {
543  printf("#########################################################\n");
544  printf("#### Symbols LOADER/TRANSLATOR for PICE ####\n");
545  printf("#########################################################\n");
546 }
#define printf
Definition: config.h:203

Referenced by check_banner(), showhelp(), and showpermission().

◆ change_symbols()

void change_symbols ( int  action,
char pfilename 
)

Definition at line 563 of file main.c.

564 {
565  int iRetVal = 0;
567 
568  strcpy(sb.filename, pfilename);
569 
570  switch(action)
571  {
572  case ACTION_LOAD:
573  printf("LOADER: loading symbols from %s\n",pfilename);
575  {
577  close_debugger();
578  }
579  break;
580  case ACTION_UNLOAD:
581  printf("LOADER: unloading symbols from %s\n",pfilename);
583  {
585  close_debugger();
586  }
587  break;
588  case ACTION_RELOAD:
589  printf("LOADER: reloading all symbols\n");
591  {
593  close_debugger();
594  printf("LOADER: reloading DONE!\n");
595  }
596  break;
597  default :
598  printf("LOADER: an internal error has occurred at change_symbols\n");
599  }
600 
601  switch( iRetVal )
602  {
603  case -EINVAL :
604  printf("LOADER: debugger return value = -EINVAL, operation has failed\n");
605  break;
606  case 0 :
607  // success - silently proceed
608  break;
609  default :
610  printf("LOADER: debugger return value = %i, operation possibly failed\n",iRetVal);
611  }
612 }
#define PICE_IOCTL_UNLOAD
Definition: shared.h:60
#define PICE_IOCTL_RELOAD
Definition: shared.h:61
superblock * sb
Definition: btrfs.c:4220
Definition: arc.h:39
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
HANDLE debugger_file
Definition: main.c:47
#define ACTION_RELOAD
Definition: main.c:552
HANDLE open_debugger(void)
Definition: main.c:500
smooth NULL
Definition: ftsmooth.c:416
#define ACTION_UNLOAD
Definition: main.c:550
int ioctl(HANDLE device, DWORD ioctrlcode, PDEBUGGER_STATUS_BLOCK psb)
Definition: main.c:522
void close_debugger(void)
Definition: main.c:515
const WCHAR * action
Definition: action.c:7783
#define ACTION_LOAD
Definition: main.c:549
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define PICE_IOCTL_LOAD
Definition: shared.h:59
#define printf
Definition: config.h:203

Referenced by process_switches().

◆ close_debugger()

void close_debugger ( void  )

Definition at line 515 of file main.c.

516 {
517  if( !CloseHandle(debugger_file) ){
518  printf("Error closing debugger handle: %ld\n", GetLastError());
519  }
520 }
#define CloseHandle
Definition: compat.h:407
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HANDLE debugger_file
Definition: main.c:47
#define printf
Definition: config.h:203

Referenced by change_symbols(), dobreak(), process_switches(), and showstatus().

◆ dobreak()

void dobreak ( void  )

Definition at line 766 of file main.c.

767 {
768  int iRetVal;
769 
771  {
773  close_debugger();
774  }
775 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
HANDLE debugger_file
Definition: main.c:47
#define PICE_IOCTL_BREAK
Definition: shared.h:62
HANDLE open_debugger(void)
Definition: main.c:500
smooth NULL
Definition: ftsmooth.c:416
int ioctl(HANDLE device, DWORD ioctrlcode, PDEBUGGER_STATUS_BLOCK psb)
Definition: main.c:522
void close_debugger(void)
Definition: main.c:515

Referenced by process_switches().

◆ find_stab_sections()

void find_stab_sections ( void p,
PIMAGE_SECTION_HEADER  section,
unsigned  cSections,
PSTAB_ENTRY ppStab,
int pLen,
char **  ppStr,
int pnStabStrLen 
)

Definition at line 303 of file main.c.

305 {
306  unsigned i;
307  //printf("LOADER: enter find_stab_sections()\n");
308  *ppStab = 0;
309  *ppStr = 0;
310 
311  for ( i=1; i <= cSections; i++, section++ )
312  {
313 
314  if(strcmp(section->Name,".stab") == 0)
315  {
316  *ppStab = (PSTAB_ENTRY)((int)p + section->PointerToRawData);
317  *pLen = section->SizeOfRawData;
318  printf("LOADER: .stab @ %x (offset %x) len = %x\n",*ppStab,section->PointerToRawData,section->SizeOfRawData);
319  }
320  else if(strncmp(section->Name,".stabstr",strlen(".stabstr")) == 0)
321  {
322  *ppStr = (char*)((int)p + section->PointerToRawData);
323  *pnStabStrLen = section->SizeOfRawData;
324  printf("LOADER: .stabstr @ %x (offset %x) len = %x\n",*ppStab,section->PointerToRawData,section->SizeOfRawData);
325  }
326  }
327 
328  //printf("LOADER: leave find_stab_sections()\n");
329 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: parser.c:55
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct _STAB_ENTRY * PSTAB_ENTRY
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLfloat GLfloat p
Definition: glext.h:8902
#define printf
Definition: config.h:203

Referenced by process_pe().

◆ ioctl()

int ioctl ( HANDLE  device,
DWORD  ioctrlcode,
PDEBUGGER_STATUS_BLOCK  psb 
)

Definition at line 522 of file main.c.

523 {
525  DWORD bytesreturned;
526  if( !DeviceIoControl( device, ioctrlcode, psb, sizeof(DEBUGGER_STATUS_BLOCK),
527  &tsb, sizeof(DEBUGGER_STATUS_BLOCK),&bytesreturned, NULL) ){
528  printf("Error in DeviceIoControl: %ld\n", GetLastError());
529  return -EINVAL;
530  }
531  else{
532  memcpy( psb, &tsb, sizeof(DEBUGGER_STATUS_BLOCK) );
533  }
534  return 0;
535 }
Definition: arc.h:39
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define printf
Definition: config.h:203

Referenced by change_symbols(), dobreak(), and showstatus().

◆ main()

int main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 991 of file main.c.

992 {
993  if(argc==1 || argc>3)
994  {
995  showhelp();
996 
997  return 1;
998  }
999 
1000  return process_switches(argc,argv);
1001 }
static int argc
Definition: ServiceArgs.c:12
#define argv
Definition: mplay32.c:18
void showhelp(void)
Definition: main.c:960
int process_switches(int argc, char *argv[])
Definition: main.c:798

◆ open_debugger()

HANDLE open_debugger ( void  )

Definition at line 500 of file main.c.

501 {
504  {
505  printf("LOADER: debugger is not loaded. Last Error: %ld\n", GetLastError());
506  }
507 
508  return debugger_file;
509 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HANDLE debugger_file
Definition: main.c:47
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:435
#define GENERIC_READ
Definition: compat.h:124
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
#define printf
Definition: config.h:203

Referenced by change_symbols(), dobreak(), and showstatus().

◆ process_file()

int process_file ( char filename)

Definition at line 454 of file main.c.

455 {
456  int file;
457  void* p;
458  off_t len;
459  int iRetVal=0;
460 
461  //printf("LOADER: enter process_file()\n");
463  if(file>0)
464  {
465  //printf("LOADER: opened %s as FD %x\n",filename,file);
466 
467  len = _lseek(file,0,SEEK_END);
468  printf("LOADER: file %s is %u bytes\n",filename,(int)len);
469 
470  _lseek(file,0,SEEK_SET);
471 
472  p = malloc(len+16);
473  if(p)
474  {
475  long count;
476  //printf("LOADER: malloc'd @ %x\n",p);
477  memset(p,0,len+16);
478  if(len == (count = _read(file,p,len)))
479  {
480  //printf("LOADER: trying ELF format\n");
481  iRetVal = process_pe(filename,file,p,len);
482  }
483  }
484  _close(file);
485  }
486  else
487  {
488  printf("LOADER: file %s could not be opened\n",filename);
489  iRetVal = 1;
490  }
491 
492  //printf("LOADER: leave process_file()\n");
493  return iRetVal;
494 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
__kernel_off_t off_t
Definition: linux.h:201
const char * filename
Definition: ioapi.h:135
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
#define SEEK_SET
Definition: jmemansi.c:26
_Check_return_ _CRTIMP int __cdecl _read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
const char file[]
Definition: icontest.c:11
#define _O_BINARY
Definition: cabinet.h:51
GLenum GLsizei len
Definition: glext.h:6722
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
Definition: file.c:2001
#define SEEK_END
Definition: cabinet.c:27
#define malloc
Definition: debug_ros.c:4
_Check_return_opt_ _CRTIMP long __cdecl _lseek(_In_ int _FileHandle, _In_ long _Offset, _In_ int _Origin)
GLfloat GLfloat p
Definition: glext.h:8902
int process_pe(char *filename, int file, void *p, int len)
Definition: main.c:335
#define memset(x, y, z)
Definition: compat.h:39
#define printf
Definition: config.h:203
#define O_RDONLY
Definition: acwin.h:108
Definition: fci.c:126

Referenced by process_switches().

◆ process_pe()

int process_pe ( char filename,
int  file,
void p,
int  len 
)

Definition at line 335 of file main.c.

336 {
337 
338  PIMAGE_DOS_HEADER pDosHeader;
339  PIMAGE_NT_HEADERS pNTHeaders;
340 
341  char* pStr;
342  PSTAB_ENTRY pStab;
343  DWORD nStabLen,nSym;
344  char* pStrTab;
345  char* pSymTab;
346 
347  char szSymName[2048];
348  HANDLE fileout;
349  int nSymStrLen,nStabStrLen;
350  int iRetVal = 0;
351 
352  pDosHeader = (PIMAGE_DOS_HEADER)p;
353  pNTHeaders = (PIMAGE_NT_HEADERS)((DWORD)p + pDosHeader->e_lfanew);
354 
355  if ((pDosHeader->e_magic == IMAGE_DOS_SIGNATURE)
356  && (pDosHeader->e_lfanew != 0L)
357  && (pNTHeaders->Signature == IMAGE_NT_SIGNATURE))
358  {
359  if( pNTHeaders->FileHeader.PointerToSymbolTable ){
360 
361  pSymTab = (char*)((DWORD)p + pNTHeaders->FileHeader.PointerToSymbolTable);
362  nSym = pNTHeaders->FileHeader.NumberOfSymbols;
363  //string table follows immediately after symbol table. first 4 bytes give the length of the table
364  //references to string table include the first 4 bytes.
365  pStrTab = (char*)((PIMAGE_SYMBOL)pSymTab + nSym);
366  nSymStrLen = *((DWORD*)pStrTab);
368  &pStab,&nStabLen,&pStr,&nStabStrLen);
369 
370  if(pStab && nStabLen && pStr && nStabStrLen)
371  {
372  LPSTR pDot;
373 
374  strcpy(szSymName,filename);
375  //printf("LOADER: file name = %s\n",szSymName);
376  if((pDot = strchr(szSymName,'.')))
377  {
378  *pDot = 0;
379  strcat(pDot,".dbg");
380  }
381  else
382  {
383  strcat(szSymName,".dbg");
384  }
385  //printf("LOADER: symbol file name = %s\n",szSymName);
386  printf("LOADER: creating symbol file %s for %s\n",szSymName,filename);
387 
388  fileout = CreateFile(szSymName,
390  0,
391  NULL,
393  0,
394  0);
395 
396  if(fileout != INVALID_HANDLE_VALUE)
397  {
398  printf("NumberOfSections: %d, size: %d\n", pNTHeaders->FileHeader.NumberOfSections,sizeof(IMAGE_SECTION_HEADER));
399  process_stabs(szSymName,
400  fileout,
401  IMAGE_FIRST_SECTION(pNTHeaders),
403  p,
404  pStab,
405  nStabLen,
406  pStr,
407  nStabStrLen,
408  (char*)pSymTab,
409  nSym*sizeof(IMAGE_SYMBOL),
410  pStrTab,
411  nSymStrLen);
412 
413  CloseHandle(fileout);
414  }
415  else
416  {
417  printf("LOADER: creation of symbol file %s failed\n",szSymName);
418  iRetVal = 2;
419  }
420 
421  }
422  else
423  {
424  printf("LOADER: file %s has no data inside symbol tables\n",filename);
425  if( ulGlobalVerbose )
426  {
427  if( !pStab || !nStabLen )
428  printf("LOADER: - symbol table is empty or not present\n");
429  if( !pStr || !nStabStrLen )
430  printf("LOADER: - string table is empty or not present\n");
431  }
432  iRetVal = 2;
433  }
434  }
435  else{
436  printf("LOADER: file %s does not have a symbol table\n",filename);
437  iRetVal = 2;
438  }
439  }
440  else
441  {
442  printf("LOADER: file %s is not an ELF binary\n",filename);
443  iRetVal = 1;
444  }
445 
446  //printf("LOADER: leave process_pe()\n");
447  return iRetVal;
448 }
#define CloseHandle
Definition: compat.h:407
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
void find_stab_sections(void *p, PIMAGE_SECTION_HEADER section, unsigned cSections, PSTAB_ENTRY *ppStab, int *pLen, char **ppStr, int *pnStabStrLen)
Definition: main.c:303
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
char * LPSTR
Definition: xmlstorage.h:182
const char * filename
Definition: ioapi.h:135
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
#define IMAGE_FIRST_SECTION(NtHeader)
Definition: ntimage.h:427
#define GENERIC_WRITE
Definition: nt_native.h:90
void process_stabs(char *pExeName, HANDLE fileout, PIMAGE_SECTION_HEADER section, int sectionHeadersSize, void *p, PSTAB_ENTRY pStab, int nStabLen, char *pStr, int nStrLen, char *pGlobals, int nGlobalLen, char *pGlobalsStr, int nGlobalStrLen)
Definition: main.c:56
smooth NULL
Definition: ftsmooth.c:416
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
DWORD NumberOfSymbols
Definition: ntddk_ex.h:126
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
Definition: shared.h:92
#define CREATE_ALWAYS
Definition: disk.h:72
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
DWORD PointerToSymbolTable
Definition: ntddk_ex.h:125
char * strchr(const char *String, int ch)
Definition: utclib.c:501
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ULONG ulGlobalVerbose
Definition: main.c:49
GLfloat GLfloat p
Definition: glext.h:8902
#define printf
Definition: config.h:203
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
Definition: ntddk_ex.h:187
struct _IMAGE_SYMBOL UNALIGNED * PIMAGE_SYMBOL
Definition: pecoff.h:241

Referenced by process_file().

◆ process_stabs()

void process_stabs ( char pExeName,
HANDLE  fileout,
PIMAGE_SECTION_HEADER  section,
int  sectionHeadersSize,
void p,
PSTAB_ENTRY  pStab,
int  nStabLen,
char pStr,
int  nStrLen,
char pGlobals,
int  nGlobalLen,
char pGlobalsStr,
int  nGlobalStrLen 
)

Definition at line 56 of file main.c.

70 {
71  unsigned i,strLen;
72  int nOffset=0,nNextOffset=0;
73  PSTAB_ENTRY pStabCopy = pStab;
74  char* pName,szCurrentPath[2048];
75  PICE_SYMBOLFILE_HEADER SymbolFileHeader;
76  LPSTR pSlash,pDot;
77  char temp[2048];
78  char* pCopyExeName = temp;
79  WCHAR tempstr[64];
80  DWORD wrote;
81 
82  //printf("LOADER: enter process_stabs()\n");
83 
84  //get the name of the executable file
85  memset((void*)&SymbolFileHeader,0,sizeof(SymbolFileHeader));
86  SymbolFileHeader.magic = PICE_MAGIC;
87  strcpy(temp,pExeName);
88  pSlash = strrchr(temp,'\\');
89  pDot = strchr(temp,'.');
90  if(pDot)
91  {
92  *pDot = 0;
93  }
94  if(pSlash)
95  {
96  pCopyExeName = pSlash+1;
97  }
98  strLen = MultiByteToWideChar(CP_ACP, NULL, pCopyExeName, -1, tempstr, 64 );
99  if( !strLen )
100  printf("Cannot convert string to multibyte: %s\n", pCopyExeName );
101  wcscpy(SymbolFileHeader.name,tempstr);
102 
103  for(i=0;i<(nStabLen/sizeof(STAB_ENTRY));i++)
104  {
105  pName = &pStr[pStabCopy->n_strx + nOffset];
106 
107 #if 0
108  //printf("LOADER: \n%.8x %.2x %.2x %.4x %.8x %s\n",
109  pStabCopy->n_strx,
110  pStabCopy->n_type,
111  pStabCopy->n_other,
112  pStabCopy->n_desc,
113  pStabCopy->n_value,
114  pName
115  );
116 #endif
117  switch(pStabCopy->n_type)
118  {
119  case N_UNDF:
120  nOffset += nNextOffset;
121  nNextOffset = pStabCopy->n_value;
122  //printf("LOADER: changing string offset %x %x\n",nOffset,nNextOffset);
123  break;
124  case N_SO:
125  if((strLen = strlen(pName)))
126  {
127  if(pName[strLen-1]!='/')
128  {
129  if(strlen(szCurrentPath))
130  {
131  //printf("LOADER: ###########################################################################\n");
132  strcat(szCurrentPath,pName);
133  //printf("LOADER: changing source file %s\n",szCurrentPath);
134  strcpy(SrcFileNames[ulCurrentSrcFile++],szCurrentPath);
135  szCurrentPath[0]=0;
136  }
137  else
138  {
139  //printf("LOADER: ###########################################################################\n");
140  //printf("LOADER: changing source file %s\n",pName);
142  }
143  }
144  else
145  strcpy(szCurrentPath,pName);
146  }
147  else
148  {
149  //printf("LOADER: END source file\n");
150  //printf("LOADER: ###########################################################################\n");
151  }
152  break;
153 /* case N_SLINE:
154  //printf("LOADER: code source line number #%u for addr. %x\n",pStabCopy->n_desc,pStabCopy->n_value);
155  break;
156  case N_DSLINE:
157  //printf("LOADER: data source line number #%u for addr. %x\n",pStabCopy->n_desc,pStabCopy->n_value);
158  break;
159  case N_BSLINE:
160  //printf("LOADER: BSS source line number #%u for addr. %x\n",pStabCopy->n_desc,pStabCopy->n_value);
161  break;
162  case N_GSYM:
163  //printf("LOADER: global symbol %s @ addr. %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
164  break;
165  case N_BINCL:
166  //printf("LOADER: include file %s\n",pName);
167  break;
168  case N_EINCL:
169  break;
170  case N_FUN:
171  if(strlen(pName))
172  //printf("LOADER: function %s @ addr. %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
173  else
174  //printf("LOADER: text segment %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
175  break;
176  case N_PSYM:
177  //printf("LOADER: parameter %s @ [EBP%+d] (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
178  break;
179  case N_RSYM:
180  //printf("LOADER: register variable %s @ reg. %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
181  break;
182  case N_LBRAC:
183  //printf("LOADER: lexical block %s @ reg. %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
184  break;
185  case N_RBRAC:
186  //printf("LOADER: END of lexical block %s @ reg. %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
187  break;
188  case N_STSYM:
189  //printf("LOADER: static variable %s @ %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
190  break;
191  case N_LCSYM:
192  //printf("LOADER: BSS variable %s @ %x (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
193  break;
194  case N_LSYM:
195  if(pStabCopy->n_value)
196  {
197  //printf("LOADER: stack variable %s @ [EBP%+d] (%x)\n",pName,pStabCopy->n_value,pStabCopy->n_desc);
198  }
199  else
200  {
201  //printf("LOADER: global variable %s \n",pName);
202  }
203  break;
204 */
205  }
206 
207  pStabCopy++;
208  }
209 
210  //printf("LOADER: SymbolFileHeader.ulSizeOfHeader= %x (%x)\n",nSHdrSize,(LPSTR)pSHdr-(LPSTR)p);
211  //printf("LOADER: SymbolFileHeader.ulSizeOfGlobals = %x (%x)\n",nGlobalLen,(LPSTR)pGlobals-(LPSTR)p);
212  //printf("LOADER: SymbolFileHeader.ulSizeOfGlobalsStrings = %x (%x)\n",nGlobalStrLen,(LPSTR)pGlobalsStr-(LPSTR)p);
213  //printf("LOADER: SymbolFileHeader.ulSizeOfStabs = %x (%x)\n",nStabLen,(LPSTR)pStab-(LPSTR)p);
214  //printf("LOADER: SymbolFileHeader.ulSizeOfStabsStrings = %x (%x)\n",nStrLen,(LPSTR)pStr-(LPSTR)p);
215 
216  SymbolFileHeader.ulOffsetToHeaders = sizeof(PICE_SYMBOLFILE_HEADER);
217  SymbolFileHeader.ulSizeOfHeader = sectionHeadersSize;
218  SymbolFileHeader.ulOffsetToGlobals = sizeof(PICE_SYMBOLFILE_HEADER)+sectionHeadersSize;
219  SymbolFileHeader.ulSizeOfGlobals = nGlobalLen;
220  SymbolFileHeader.ulOffsetToGlobalsStrings = sizeof(PICE_SYMBOLFILE_HEADER)+sectionHeadersSize+nGlobalLen;
221  SymbolFileHeader.ulSizeOfGlobalsStrings = nGlobalStrLen;
222  SymbolFileHeader.ulOffsetToStabs = sizeof(PICE_SYMBOLFILE_HEADER)+sectionHeadersSize+nGlobalLen+nGlobalStrLen;
223  SymbolFileHeader.ulSizeOfStabs = nStabLen;
224  SymbolFileHeader.ulOffsetToStabsStrings = sizeof(PICE_SYMBOLFILE_HEADER)+sectionHeadersSize+nGlobalLen+nGlobalStrLen+nStabLen;
225  SymbolFileHeader.ulSizeOfStabsStrings = nStrLen;
226  SymbolFileHeader.ulOffsetToSrcFiles = sizeof(PICE_SYMBOLFILE_HEADER)+sectionHeadersSize+nGlobalLen+nGlobalStrLen+nStabLen+nStrLen;
227  SymbolFileHeader.ulNumberOfSrcFiles = ulCurrentSrcFile;
228 
229  printf("sectionHeaderSize: %ld, nGlobalLen: %ld, nGlobalStrLen: %ld, nStabLen: %ld, "
230  "nStrLen: %ld, ulCurrentSrcFile: %ld, ulOffsetToStabs: %ld\n",
231  sectionHeadersSize, nGlobalLen, nGlobalStrLen,
232  nStabLen, nStrLen, ulCurrentSrcFile, SymbolFileHeader.ulOffsetToStabs);
233 
234  WriteFile(fileout,&SymbolFileHeader,sizeof(PICE_SYMBOLFILE_HEADER),&wrote, NULL);
235  WriteFile(fileout,section,sectionHeadersSize,&wrote, NULL);
236  WriteFile(fileout,pGlobals,nGlobalLen,&wrote, NULL);
237  WriteFile(fileout,pGlobalsStr,nGlobalStrLen,&wrote, NULL);
238  WriteFile(fileout,pStab,nStabLen,&wrote, NULL);
239  WriteFile(fileout,pStr,nStrLen,&wrote, NULL);
240 
241  for(i=0;i<ulCurrentSrcFile;i++)
242  {
243  HANDLE file;
244  int len;
245  PVOID pFile;
247 
249  //printf("Trying To Open: %s, result: %x\n", SrcFileNames[i], file );
250 
251 
252  if( file == INVALID_HANDLE_VALUE ){
253  //let's try win format drive:/file
254  char srctmp[2048];
255  strcpy(srctmp, SrcFileNames[i] );
256  if(strncmp(srctmp,"//",2)==0){
257  *(srctmp) = *(srctmp+2);
258  *(srctmp+1) = ':';
259  *(srctmp+2) = '/';
260  file = CreateFile(srctmp,GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
261  //printf("Trying To Open: %s, handle: %x\n", srctmp, file );
262  if( file == INVALID_HANDLE_VALUE )
263  printf("Can't open file: %s\n", srctmp );
264  }
265  }
267  {
268  //printf("LOADER: [%u] opened %s as FD %x\n",i,SrcFileNames[i],file);
269 
271  //printf("LOADER: length = %d\n",(int)len);
272 
274 
277 
278  pFile = malloc(len+1);
279  //printf("LOADER: memory for file @ %x\n",pFile);
280  if(pFile)
281  {
282  //printf("LOADER: reading file...\n");
283  ReadFile(file,pFile,len+1,&wrote,NULL);
284  //printf("read: %d, error: %d\n", wrote, GetLastError());
285  WriteFile(fileout,&pss,sizeof(PICE_SYMBOLFILE_SOURCE),&wrote, NULL);
286  WriteFile(fileout,pFile,len,&wrote, NULL);
287  //printf("LOADER: writing file...%d\n%s\n",wrote,pFile );
288  free(pFile);
289  }
290 
291  CloseHandle(file);
292  }
293 
294  }
295 
296  //printf("LOADER: leave process_stabs()\n");
297 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:407
unsigned short n_desc
Definition: shared.h:97
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
#define free
Definition: debug_ros.c:5
#define PICE_MAGIC
Definition: shared.h:77
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
Definition: parser.c:55
char * LPSTR
Definition: xmlstorage.h:182
unsigned long n_value
Definition: shared.h:98
DWORD WINAPI DECLSPEC_HOTPATCH SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
Definition: fileinfo.c:204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
char SrcFileNames[2048][2048]
Definition: main.c:44
struct _STAB_ENTRY STAB_ENTRY
char filename[256]
Definition: shared.h:103
smooth NULL
Definition: ftsmooth.c:416
#define N_UNDF
Definition: stabs.c:88
#define OPEN_EXISTING
Definition: compat.h:435
unsigned char n_other
Definition: shared.h:96
static LPSTR pName
Definition: security.c:75
#define FILE_END
Definition: winbase.h:114
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct _PICE_SYMBOLFILE_HEADER PICE_SYMBOLFILE_HEADER
const char file[]
Definition: icontest.c:11
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG ulCurrentSrcFile
Definition: main.c:45
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
unsigned long n_strx
Definition: shared.h:94
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:124
Definition: shared.h:92
#define FILE_BEGIN
Definition: winbase.h:112
#define N_SO
Definition: stabs.c:105
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:913
static calc_node_t temp
Definition: rpn_ieee.c:38
struct _PICE_SYMBOLFILE_SOURCE PICE_SYMBOLFILE_SOURCE
#define MultiByteToWideChar
Definition: compat.h:100
char * strchr(const char *String, int ch)
Definition: utclib.c:501
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define malloc
Definition: debug_ros.c:4
unsigned char n_type
Definition: shared.h:95
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
#define memset(x, y, z)
Definition: compat.h:39
#define printf
Definition: config.h:203
Definition: fci.c:126

Referenced by process_pe().

◆ process_switches()

int process_switches ( int  argc,
char argv[] 
)

Definition at line 798 of file main.c.

799 {
800  int i;
801  char* parg,*pfilename = NULL;
802  int action = ACTION_NONE;
803  int error = 0;
804 
805  // parse commandline arguments
806  for(i=1;i<argc;i++)
807  {
808  parg = argv[i];
809  if(*parg == '-')
810  {
811  int new_action=ACTION_NONE;
812 
813  parg++;
814  if(strcmp(parg,"load")==0 || strcmp(parg,"l")==0)
815  {
816  new_action = ACTION_LOAD;
817  }
818  else if(strcmp(parg,"unload")==0 || strcmp(parg,"u")==0)
819  {
820  new_action = ACTION_UNLOAD;
821  }
822  else if(strcmp(parg,"trans")==0 || strcmp(parg,"t")==0)
823  {
824  new_action = ACTION_TRANS;
825  }
826  else if(strcmp(parg,"reload")==0 || strcmp(parg,"r")==0)
827  {
828  new_action = ACTION_RELOAD;
829  }
830  else if(strcmp(parg,"verbose")==0 || strcmp(parg,"v")==0)
831  {
833  ulGlobalVerbose++;
834  }
835  else if(strcmp(parg,"install")==0 || strcmp(parg,"i")==0)
836  {
837  new_action = ACTION_INSTALL;
838  }
839  else if(strcmp(parg,"uninstall")==0 || strcmp(parg,"x")==0)
840  {
841  new_action = ACTION_UNINSTALL;
842  }
843  else if(strcmp(parg,"status")==0 || strcmp(parg,"s")==0)
844  {
845  new_action = ACTION_STATUS;
846  }
847  else if(strcmp(parg,"break")==0 || strcmp(parg,"b")==0)
848  {
849  new_action = ACTION_BREAK;
850  }
851  else if(strcmp(parg,"serial")==0 || strcmp(parg,"ser")==0)
852  {
853  new_action = ACTION_TERMINAL;
854  }
855  else
856  {
857  printf("LOADER: error: unknown switch %s", argv[i]);
858  error = 1;
859  }
860 
861  if( new_action != ACTION_NONE )
862  {
863  if( action == ACTION_NONE )
864  action = new_action;
865  else
866  if( action == new_action )
867  {
868  // identical, just ignore
869  }
870  else
871  {
872  printf("LOADER: error: conflicting switch %s", argv[i]);
873  error = 1;
874  }
875  }
876  }
877  else
878  {
879  if( pfilename )
880  {
881  printf("LOADER: error: additional filename %s", parg);
882  error = 1;
883  }
884  pfilename = parg;
885  }
886  }
887 
888  // check number of required parameters
889  switch( action )
890  {
891  case ACTION_TRANS :
892  case ACTION_LOAD :
893  case ACTION_UNLOAD :
894  if( !pfilename )
895  {
896  printf("LOADER: error: missing filename\n");
897  error = 1;
898  }
899  break;
900  case ACTION_RELOAD :
901  /* filename parameter is optional */
902  break;
903 #if 0
904  case ACTION_UNINSTALL:
905  close_debugger();
906  tryuninstall();
907  break;
908  case ACTION_INSTALL:
909  tryinstall();
910  break;
911 #endif
912  case ACTION_STATUS:
913  showstatus();
914  break;
915  case ACTION_BREAK:
916  dobreak();
917  break;
918 #if 0
919  case ACTION_TERMINAL:
920  doterminal();
921  break;
922 #endif
923  case ACTION_NONE :
924  printf("LOADER: no action specified specifed on commandline\n");
925  error = 1;
926 
927  break;
928  default :
929  printf("LOADER: an internal error has occurred at commandline parsing\n");
930  error = 1;
931  }
932 
933  if( !error ) // commandline was fine, now start processing
934  {
935  switch( action )
936  {
937  case ACTION_TRANS :
938  printf("LOADER: trying to translate file %s...\n",pfilename);
939  if( process_file(pfilename)==0 )
940  printf("LOADER: file %s has been translated\n",pfilename);
941  else
942  printf("LOADER: error while translating file %s\n",pfilename);
943  break;
944  case ACTION_LOAD :
945  case ACTION_UNLOAD :
946  case ACTION_RELOAD :
947  change_symbols(action,pfilename);
948  break;
949  }
950  }
951 
952  return error;
953 }
static int argc
Definition: ServiceArgs.c:12
void dobreak(void)
Definition: main.c:766
#define error(str)
Definition: mkdosfs.c:1605
#define ACTION_NONE
Definition: main.c:548
#define ACTION_RELOAD
Definition: main.c:552
#define argv
Definition: mplay32.c:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ACTION_STATUS
Definition: main.c:555
void showstatus(void)
Definition: main.c:748
smooth NULL
Definition: ftsmooth.c:416
int process_file(char *filename)
Definition: main.c:454
#define ACTION_TRANS
Definition: main.c:551
#define ACTION_TERMINAL
Definition: main.c:557
#define ACTION_UNINSTALL
Definition: main.c:554
#define ACTION_BREAK
Definition: main.c:556
#define ACTION_UNLOAD
Definition: main.c:550
void close_debugger(void)
Definition: main.c:515
const WCHAR * action
Definition: action.c:7783
#define ACTION_INSTALL
Definition: main.c:553
#define ACTION_LOAD
Definition: main.c:549
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ULONG ulGlobalVerbose
Definition: main.c:49
void change_symbols(int action, char *pfilename)
Definition: main.c:563
#define printf
Definition: config.h:203

Referenced by main().

◆ showhelp()

void showhelp ( void  )

Definition at line 960 of file main.c.

961 {
962  banner();
963  printf("LOADER: Syntax:\n");
964  printf("LOADER: loader [switches] [executable/object file path]\n");
965  printf("LOADER: Switches:\n");
966  printf("LOADER: -trans (-t): translate from exe to sym\n");
967  printf("LOADER: -load (-l): load symbols\n");
968  printf("LOADER: -unload (-u): unload symbols\n");
969  printf("LOADER: -reload (-r): reload some/all symbols\n");
970  printf("LOADER: -verbose (-v): be a bit more verbose\n");
971  printf("LOADER: -install (-i): install pICE debugger\n");
972  printf("LOADER: -uninstall (-x): uninstall pICE debugger\n");
973  printf("LOADER: -break (-b): break into debugger\n");
974  printf("LOADER: -serial (-ser): start serial line terminal\n");
975 }
void banner(void)
Definition: main.c:541
#define printf
Definition: config.h:203

Referenced by main().

◆ showpermission()

void showpermission ( void  )

Definition at line 981 of file main.c.

982 {
983  banner();
984  printf("LOADER: You must be superuser!\n");
985 }
void banner(void)
Definition: main.c:541
#define printf
Definition: config.h:203

◆ showstatus()

void showstatus ( void  )

Definition at line 748 of file main.c.

749 {
751  int iRetVal;
752 
754  {
756 
757  //printf("LOADER: Test = %X\n",sb.Test);
758  close_debugger();
759  }
760 }
superblock * sb
Definition: btrfs.c:4220
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
HANDLE debugger_file
Definition: main.c:47
HANDLE open_debugger(void)
Definition: main.c:500
int ioctl(HANDLE device, DWORD ioctrlcode, PDEBUGGER_STATUS_BLOCK psb)
Definition: main.c:522
void close_debugger(void)
Definition: main.c:515
#define PICE_IOCTL_STATUS
Definition: shared.h:63

Referenced by process_switches().

Variable Documentation

◆ debugger_file

HANDLE debugger_file

Definition at line 47 of file main.c.

Referenced by change_symbols(), close_debugger(), dobreak(), open_debugger(), and showstatus().

◆ SrcFileNames

char SrcFileNames[2048][2048]

Definition at line 44 of file main.c.

Referenced by process_stabs().

◆ ulCurrentSrcFile

ULONG ulCurrentSrcFile = 0

Definition at line 45 of file main.c.

Referenced by process_stabs().

◆ ulGlobalVerbose

ULONG ulGlobalVerbose = 0

Definition at line 49 of file main.c.

Referenced by process_pe(), and process_switches().