Jump to content
Gonzalez

[C++] Create 1TB File

Recommended Posts

Posted
/////////////////////////////////////////////////////////////////
// R00TSECURITY.ORG - YOUR SECURITY COMMUNITY
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// [2008-07-15] Create 1 Terabyte File
// http://r00tsecurity.org/db/code/136
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// GENERATED ON: 2009-05-10 | 03:23:32
/////////////////////////////////////////////////////////////////


SOURCE CODE
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <stdio.h>
#include <Winioctl.h>//Dev C++ if use
int main(int argc, char* argv[])
{


HANDLE h = CreateFile("geek.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);

DWORD dw;
DeviceIoControl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dw, NULL);

LONG lDist = 4095;
SetFilePointer(h, 0, &lDist, FILE_BEGIN);
SetEndOfFile(h);

CloseHandle(h);
system("PAUSE");
return 0;
}

// http://r00tsecurity.org/db/code/136

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...