Jump To Content

LearnHub




How to create file of reqd size

Yes it's possible to create a file of required size without writing a single word in it.

Does that sound interesting?

Let's do this.

First of go the start-->run-->cmd

Now go to the C prompt.

Let's us suppose I want of create a file of 967 Kb

Type the following as it is

c:\> debug bigfile.dat \\ it will give u a error message o file not found. do not worry about that.

- rcx
cx 0000
: 4240
- rbx
ex 0000
: 000F // it is zero
- w
writing file f4240 bytes
- q

c:\> this wil creat the file of required size.

// now I will ask few question to u

First what is 4240 stand for.

and why I have add 000F .

and I will soon reply u in the form of a lesson

  1. chandra_avinash saidWed, 03 Sep 2008 07:25:49 -0000 ( Link )

    this is interesting – however, a bit unreadable for those who are not “into” computers

    i would suggest that you structure it a little differently and it would be great if you have screenshots

    cheers!

    avinash

    Actions
    Vote
    Current Rating
    0
    Rate Up
    Rate Down
    No Votes

    Post Comments

  2. mittal08 saidMon, 22 Sep 2008 08:24:30 -0000 ( Link )

    I agree with you

    Actions
    Vote
    Current Rating
    1
    Rate Up
    Rate Down
    1 Total Vote

    Post Comments

  3. hardeep_3 saidWed, 05 Nov 2008 15:44:09 -0000 ( Link )

    sir this is really a fantastic work….and it really works, first of all thanks for such a rare thing…..by using this coding i created a file, as u wrote, is of 976 kb.
    now thing i wanna ask, what will be the change in coding if i want to create a file of any desired size.let us say file of size 1000 kb……

    regards
    hardeep.

    Actions
    Vote
    Current Rating
    1
    Rate Up
    Rate Down
    1 Total Vote

    Post Comments

  4. mehulbatra saidThu, 23 Apr 2009 07:53:28 -0000 ( Link )

    Correct me if I am wrong:

    cx and ex are generally registers..

    Hers cx contins lower byte values and ex contaings lower byte values.

    So final hex value is 000F 4240,

    if you convert to decimal and divide by 1024 it will give 976.

    So if you want any XX KB size, follow:

    XX multiply by 1024
    convert that value to hex and divide into chunks of 4 letters.

    Example: 1000 KB size

    1000 * 1024 = 1024000

    Hex is FA000

    So 000F and A000

    Regards,
    Mehul.

    Actions
    Vote
    Current Rating
    0
    Rate Up
    Rate Down
    No Votes

    Post Comments

Your Comment
Textile is Enabled (View Reference)