#include <errno.h>
#include <string.h>
#include <rsym.h>
#include "compat.h"
#include "util.h"
#include "options.h"
#include "log2lines.h"
#include <sys/types.h>
Go to the source code of this file.
◆ find_offset()
Definition at line 39 of file image.c.
40{
45
46 for (
i = 0;
i < symbols;
i++)
47 {
49 {
52 else
54 }
55 }
57}
static const ENTRY Entries[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
struct _ROSSYM_ENTRY * PROSSYM_ENTRY
struct _ROSSYM_ENTRY ROSSYM_ENTRY
struct _SYMBOLFILE_HEADER * PSYMBOLFILE_HEADER
Referenced by print_offset().
◆ find_rossym_section()
Definition at line 19 of file image.c.
20{
23 {
24 if (0 ==
strcmp((
char *)PESectionHeaders[
i].
Name,
".rossym"))
25 return &PESectionHeaders[
i];
26 }
28}
int strcmp(const char *String1, const char *String2)
Referenced by get_sectionheader().
◆ fixup_offset()
◆ get_ImageBase()
Definition at line 102 of file image.c.
103{
107
111
113 fr =
fopen(fname,
"rb");
114 if (!fr)
115 {
117 return 1;
118 }
119
121 if (1 != readLen)
122 {
125 return 2;
126 }
127
128
130 {
131 l2l_dbg(2,
"get_ImageBase %s, MZ header missing\n", fname);
133 return 3;
134 }
135
136
139 if (1 != readLen)
140 {
143 return 4;
144 }
145
146
148 if (1 != readLen)
149 {
150 l2l_dbg(1,
"get_ImageBase %s, read error IMAGE_OPTIONAL_HEADER (%s)\n", fname,
strerror(
errno));
152 return 5;
153 }
154
155
158 {
159 l2l_dbg(2,
"get_ImageBase %s, not an IMAGE_NT_OPTIONAL_HDR 32/64 bit\n", fname);
161 return 6;
162 }
163
166 return 0;
167}
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
const char * strerror(int err)
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
Referenced by create_cache(), and translate_file().
◆ get_sectionheader()
Definition at line 60 of file image.c.
61{
67 size_t ImageBase;
68
69
72 {
73 l2l_dbg(0,
"Input file is not a PE image.\n");
76 }
77
78
79
81
82
85
86
88
89
91 if (!PERosSymSectionHeader)
92 {
93 l2l_dbg(0,
"Couldn't find rossym section in executable\n");
96 }
97
98 return PERosSymSectionHeader;
99}
static FILEDATA FileData[MAX_FDS]
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
struct _IMAGE_FILE_HEADER * PIMAGE_FILE_HEADER
struct _IMAGE_SECTION_HEADER * PIMAGE_SECTION_HEADER
struct _IMAGE_OPTIONAL_HEADER * PIMAGE_OPTIONAL_HEADER
Referenced by process_data().