Quantcast
Channel: New Topics
Viewing all articles
Browse latest Browse all 4617

Adding null bytes at append exe file in another way?

$
0
0

Hi, as title said, i wanna adding just number of 0x0 bytes at EOF and i just know 2 ways:

1. Use API func:

   ... -> MapViewOfFile (hFile...) (Mapping file)

       -> SetFilePointer(hFile, ..., FILE_END) (set hFile to end of file)

       -> WriteFile(hFile, &buff...) ("adding" bytes at end of file)

 

-> i dont want use this method cuz:

i must initialize BYTE buffer[100] = "", if not new bytes added would contain "trash strings".

 

2. use C STL func:

 

   ... -> FILE *fs = fopen("myfile.exe", "ab")

       -> fwrite(....)

 

-> i dont want use this method cuz i wanna use API func ... :D

 

 

so, having a method can use API and no contain "trash strings" ?

sorry a bout my english

and thanks for reading... :D


Viewing all articles
Browse latest Browse all 4617

Latest Images

Trending Articles



Latest Images