Fix a pile of identBuf parsing issues that occur if you forget an argument for a specific buf type
git-svn-id: file:///home/svn/framework3/trunk@6970 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
1bfd5a1cd6
commit
56881d35d2
Binary file not shown.
Binary file not shown.
|
@ -194,6 +194,9 @@ HRESULT CALLBACK jutsu(PDEBUG_CLIENT4 Client, PCSTR args) {
|
|||
dprintf("[Byakugan] This command requires a buffer type, name, (sometimes) value, and size\n");
|
||||
return (S_OK);
|
||||
}
|
||||
if (bufSize == NULL)
|
||||
identBufJutsu(bufType, bufName, bufPatt, 0);
|
||||
else
|
||||
identBufJutsu(bufType, bufName, bufPatt, strtoul(bufSize, NULL, 10));
|
||||
return (S_OK);
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -533,6 +533,7 @@ void identBufJutsu(char *inputType, char *bufName, char *bufPatt, DWORD size) {
|
|||
readSize = readFileIntoBuf(bufPatt, size, &(newTrackedBuf->bufPatt));
|
||||
if ((size && readSize != size) || readSize == 0) {
|
||||
dprintf("[J] Unable to read %d bytes from %s\n", size, bufName);
|
||||
dprintf("\nThis command requires a buffer type, name, (sometimes) value, and size - maybe you forgot one?\n");
|
||||
return;
|
||||
}
|
||||
size = (size ? size : readSize);
|
||||
|
|
|
@ -297,7 +297,7 @@ DWORD readFileIntoBuf(char *path, DWORD size, char **output) {
|
|||
if((inputFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) {
|
||||
dprintf("[S] Unable to open file: %s\n", path);
|
||||
return (-1);
|
||||
return (0);
|
||||
}
|
||||
if (size == 0)
|
||||
size = GetFileSize(inputFile, NULL) - 1;
|
||||
|
|
Loading…
Reference in New Issue