Skip to content

Commit

Permalink
Fixed PE section sanity check derp.
Browse files Browse the repository at this point in the history
Accidentally checking for bounds of offset + offset instead of offset + size.
  • Loading branch information
0xnobody committed Aug 21, 2020
1 parent 04fa2b5 commit 30cba9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VMPAttack/vmpattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace vmpattack
{
// Sanity check for potentially broken PEs.
//
if ( image.raw_bytes.size() >= section.physical_address + section.physical_address )
if ( image.raw_bytes.size() >= section.physical_address + section.physical_size )
memcpy( &mapped_buffer[ section.virtual_address ], &image.raw_bytes[ section.physical_address ], section.physical_size );
}

Expand Down
4 changes: 2 additions & 2 deletions VMPAttack_Tester/VMPAttack_Tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ struct much_complex_object
};
#pragma pack(pop)

int main()
int main( int argc, const char* args[] )
{
char r = getchar();


while ( r >= 0x50 )
{
Expand Down

0 comments on commit 30cba9b

Please sign in to comment.