Skip to content

Commit

Permalink
fix bitwise extended type, fixed memleaks, remove excess else and cmp…
Browse files Browse the repository at this point in the history
… int with EOF
  • Loading branch information
GermanAizek committed Apr 5, 2024
1 parent 103874d commit 7bcf1e5
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ ScriptEngineWrapperTestParser(const string & Expr)
if (RspReg == NULL)
{
ShowMessages("err, unable to allocate stack for script engine tests");
free(TestStruct);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion hyperdbg/hprdbghv/code/common/Common.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CommonAffinityBroadcastToProcessors(ULONG ProcessorNumber, RunOnLogicalCoreFunc
{
KIRQL OldIrql;

KeSetSystemAffinityThread((KAFFINITY)(1 << ProcessorNumber));
KeSetSystemAffinityThread((KAFFINITY)(1ULL << ProcessorNumber));

OldIrql = KeRaiseIrqlToDpcLevel();

Expand Down
2 changes: 1 addition & 1 deletion hyperdbg/hprdbghv/code/vmm/vmx/Vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ VmxGetSegmentDescriptor(PUCHAR GdtBase, UINT16 Selector, PVMX_SEGMENT_SELECTOR S

SegmentSelector->Selector = Selector;
SegmentSelector->Limit = __segmentlimit(Selector);
SegmentSelector->Base = (Descriptor32->BaseAddressLow | Descriptor32->BaseAddressMiddle << 16 | Descriptor32->BaseAddressHigh << 24);
SegmentSelector->Base = ((UINT64)Descriptor32->BaseAddressLow | (UINT64)Descriptor32->BaseAddressMiddle << 16 | (UINT64)Descriptor32->BaseAddressHigh << 24);

SegmentSelector->Attributes.AsUInt = (AsmGetAccessRights(Selector) >> 8);

Expand Down
3 changes: 3 additions & 0 deletions hyperdbg/script-engine/code/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ NewUnknownToken()
//
// There was an error allocating buffer
//
free(Token);
return NULL;
}

Expand Down Expand Up @@ -85,6 +86,7 @@ NewToken(TOKEN_TYPE Type, char * Value)
//
// There was an error allocating buffer
//
free(Token);
return NULL;
}

Expand Down Expand Up @@ -329,6 +331,7 @@ CopyToken(PTOKEN Token)
//
// There was an error allocating buffer
//
free(TokenCopy);
return NULL;
}

Expand Down
3 changes: 1 addition & 2 deletions hyperdbg/script-engine/code/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ GetToken(char * c, char * str)
*c = sgetc(str);
return Token;
}
else

default:
if (*c >= '0' && *c <= '9')
Expand Down Expand Up @@ -898,7 +897,7 @@ Scan(char * str, char * c)

Token = GetToken(c, str);

if ((char)*c == EOF)
if ((int)*c == EOF)
{
ReturnEndOfString = TRUE;
}
Expand Down
2 changes: 2 additions & 0 deletions hyperdbg/script-engine/code/script-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -2373,6 +2373,7 @@ NewFunctionSymbol(char * FunctionName, VARIABLE_TYPE * VariableType)
//
// There was an error allocating buffer
//
free(Symbol);
return NULL;
}

Expand All @@ -2383,6 +2384,7 @@ NewFunctionSymbol(char * FunctionName, VARIABLE_TYPE * VariableType)
//
// There was an error allocating buffer
//
free(Symbol);
return NULL;
}

Expand Down
1 change: 1 addition & 0 deletions hyperdbg/symbol-parser/code/symbol-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ SymGetFieldOffset(CHAR * TypeName, CHAR * FieldName, UINT32 * FieldOffset)
if (FieldNameW == NULL)
{
printf("err, could not allocate buffer");
free(TypeNameW);
return FALSE;
}

Expand Down

0 comments on commit 7bcf1e5

Please sign in to comment.