/* These work differently. We are in a new function.
* We have to parse a lea opcode to find the adress of
- * the jump target. This is the reference to find the
+ * the jump target. This is the reference to find the
* appropriate C_SCOPE_TABLE. */
case 6: /* Filter func */
// printf("Found a filter func at 0x%lx\n", State->Location);
fprintf(stderr, "unknown instruction 0x%x at 0x%p\n", Code, pc);
exit(1);
}
-
+
State->FramePtrDiff = State->FramePtr - PrevFramePtr;
- DPRINT("@%p: code=%x, Loc=%lx, offset=%lx, reg=0x%lx:%s\n",
+ DPRINT("@%p: code=%x, Loc=%lx, offset=%lx, reg=0x%lx:%s\n",
(void*)((ULONG)pc - g_ehframep), Code, State->Location, State->Offset, State->Reg, regs[State->Reg].name);
return Length;
}
ULONG *pExceptionHandler;
PC_SCOPE_TABLE pScopeTable;
- /* Set flag for exception handler */
+ /* Set flag for exception handler */
Info->Flags |= UNW_FLAG_EHANDLER;
/* Store address of handler and number of scope tables */
pScopeTable->Entry[i].Handler = 1;//State.SehBlock[i].Handler;
pScopeTable->Entry[i].Target = State.SehBlock[i].Target;
}
-
+
/* Update size */
cbSize += 8 + State.cScopes * sizeof(C_SCOPE_TABLE_ENTRY);
}
/* Get sizes */
CountUnwindData(File);
-// printf("cFuncs = %ld, cUWOPS = %ld, cScopes = %ld\n",
+// printf("cFuncs = %ld, cUWOPS = %ld, cScopes = %ld\n",
// File->cFuncs, File->cUWOP, File->cScopes);
/* Initialize section header for .pdata */
/* Check if MZ header exists */
File->DosHeader = (PIMAGE_DOS_HEADER)File->FilePtr;
- if ((File->DosHeader->e_magic != IMAGE_DOS_MAGIC) ||
+ if ((File->DosHeader->e_magic != IMAGE_DOS_MAGIC) ||
(File->DosHeader->e_lfanew == 0L))
{
perror("Input file is not a PE image.\n");
}
/* Locate PE file header */
- File->FileHeader = (PIMAGE_FILE_HEADER)(File->FilePtr +
+ File->FileHeader = (PIMAGE_FILE_HEADER)(File->FilePtr +
File->DosHeader->e_lfanew + sizeof(ULONG));
/* Check for x64 image */
{
unsigned long index = strtoul(pName+1, 0, 10);
pName = File->Strings + index;
-
+
// Hack, simply remove all sections with long names
File->UseSection[i] = 0;
}
File->eh_frame.idx = i;
File->eh_frame.p = File->FilePtr + File->eh_frame.psh->PointerToRawData;
}
-
+
/* Increase number of used sections */
if (File->UseSection[i])
File->UsedSections = i+1;
}
/* This is the actual size of the new section headers */
- File->NewSectionHeaderSize =
+ File->NewSectionHeaderSize =
(File->UsedSections+2) * sizeof(IMAGE_SECTION_HEADER);
/* Calculate the position to start writing the sections to */