This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_gcc_m64() { | |
if test `echo $CFLAGS | grep "\-m64" -c` -eq 1 ; then echo ppc64; | |
else | |
if test `echo $CC | grep "\-m64" -c` -eq 1 ; then echo ppc64; else echo ppc32; fi; | |
fi; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pid = proc->pid; | |
int n, m; | |
int started = 0; | |
union { | |
long val; | |
char x[sizeof(long)]; | |
} u; | |
if (addr & (sizeof(long) - 1)) { | |
/* addr not a multiple of sizeof(long) */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns number of bytes used, including *data. | |
int DisassemblerX64::JumpConditionalShort(byte* data) { | |
byte cond = *data & 0x0F; | |
byte b = *(data + 1); | |
byte* dest = data + static_cast<int8_t>(b) + 2; | |
const char* mnem = conditional_code_suffix[cond]; | |
AppendToBuffer("j%s %s", mnem, NameOfAddress(dest)); | |
return 2; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x48 0x89 0x5C 0x24 0xF0 0x48 0x89 0x6C 0x24 0xF8 0x48 0x83 0xEC 0x28 0x85 0xD2 0x48 0x89 0xFB 0x74 0x58 0x48 0x8B 0x7F 0x18 0x48 0x83 0xFF 0x04 0x74 0x19 0x48 0x8B 0x5C 0x24 0x18 0x48 0x8B 0x6C 0x24 0x20 0x89 0xD2 0x48 0x83 0xC4 0x28 0xE9 0x00 0x00 0x00 0x00 0xEB 0x02 0x90 0x90 0x89 0xD5 0x48 0x89 0x74 0x24 0x08 0x48 0x89 0xEF 0xE8 0x00 0x00 0x00 0x00 0x48 0x89 0x43 0x18 0xE8 0x00 0x00 0x00 0x00 0x48 0x8B 0x7B 0x18 0x48 0x8B 0x74 0x24 0x08 0x48 0x89 0xEA 0xE8 0x00 0x00 0x00 0x00 0x48 0x8B 0x43 0x18 0x48 0xC7 0x40 0x08 0x00 0x00 0x00 0x00 0x48 0x8B 0x5C 0x24 0x18 0x48 0x8B 0x6C 0x24 0x20 0x48 0x83 0xC4 0x28 0xC3 0xEB 0x02 0x90 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> I am trying to patch an executable with does not link to Lua (script library) yet includes the source. The function luaL_newstate is the | |
> one wanted, which is present in the mach-o and I can see the instruction address and the displacement to the function. | |
so you have a binary which does not link to lua_whatever.so ? ok... | |
> I have tried numerous methods of inserting the hook displacement for the displacement in the binary of interest. I would assume it requires | |
> using execve to run the binary of interest yet that will overwrite the address space of the patcher. I have tried fork -> ptrace | |
> PT_TRACE_ME execve and then trying dlsym(RTLD_DEFAULT, "luaL_newstate"); after a signal with the intention of overwriting memory with the | |
> hook. I tested this by not including the Lua lib in the patcher and it does not find the symbol. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On Thu, Jun 16, 2011 at 09:15, H.J. Lu <[email protected]> wrote: | |
> On another platform, bad atexit implementation called from DSO caused | |
> weird run-time problems. The same problem can happen with glibc. The | |
> worse thing can happen with my patch is people will old compilers will | |
> get a link-time error, instead of strange run-time problems. | |
No. If there is no __dso_handle symbol the reference is NULL and | |
therefore atexit can work nicely when used in programs. It doesn't | |
work in DSOs but that was always the case before the introduction of | |
__dso_handle. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_______________________ | |
< welcome to the future > | |
----------------------- | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ | |
||----w | | |
|| || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make an initial call to GetIfTable to get the | |
// necessary size into dwSize | |
dwSize = sizeof (MIB_IFTABLE); | |
if (GetIfTable(pIfTable, &dwSize, FALSE) == ERROR_INSUFFICIENT_BUFFER) { | |
FREE(pIfTable); | |
pIfTable = (MIB_IFTABLE *) MALLOC(dwSize); | |
if (pIfTable == NULL) { | |
printf("Error allocating memory needed to call GetIfTable\n"); | |
return 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 7def9e7f9b8738201677a9fa8d3f0bbe4c881b9a | |
Author: Joe Damato <[email protected]> | |
Date: Tue Sep 20 17:32:20 2011 +0000 | |
Fix for igb 2 second reporting bug and ioctl/stats race condition. | |
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h | |
index b1c1eb8..ce42798 100644 | |
--- a/drivers/net/igb/igb.h | |
+++ b/drivers/net/igb/igb.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/elfcore.c b/src/elfcore.c | |
index 4304770..598f5dc 100644 | |
--- a/src/elfcore.c | |
+++ b/src/elfcore.c | |
@@ -856,13 +856,8 @@ static int CreateElfCore(void *handle, | |
mappings[i].start_address += zeros; | |
} | |
- /* Do not write contents for memory segments that are read-only */ | |
- if ((mappings[i].flags & (PF_ANONYMOUS|PF_W)) == 0) { |