Advertisement
Guest User

Untitled

a guest
Nov 12th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <Windows.h>
  2.  
  3.  
  4. int main()
  5. {
  6.     byte buffer[1] = { '\0' };
  7.     auto hFile = CreateFileW(L"c:\\temp\\extracted-file", GENERIC_WRITE, FILE_SHARE_DELETE,
  8.         NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
  9.  
  10.     SetFilePointer(hFile, 999999, NULL, FILE_BEGIN);
  11.     WriteFile(hFile, buffer, 1, NULL, NULL);
  12.     SetFilePointer(hFile, 0, NULL, FILE_BEGIN);
  13.     // do real extraction here
  14.  
  15.     CloseHandle(hFile);
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement