Link to home
Start Free TrialLog in
Avatar of bigstyle
bigstyle

asked on

How to manually modify a size of a file ?

Hi,

First of all,sorry if I make mistakes but I am not english :)
I have found  a floppy disk with a file of 750Mo.
It sounds like the cd-protection.

I am verry curious and I would like to know how is it possible.
I think it s an hexa value to modify in the structure of a little file but how can we do ?

Thanks for your responses.

Avatar of sunnycoder
sunnycoder
Flag of India image

Hi bigstyle,

you cannot modify the file size except by actually increasing it ... The file size is stored in system variables (or calculated from them depending on fs and implementation )

Cheers!
Sunny:o)
Avatar of jhance
jhance

The file's size is stored in the DIRECTORY of the storage device.  Windows 2000 does not go out and calculate the size of every file on the media when you list the directory.  It merely uses the size stored in the directory.

A corrupted (or intentionally modified) directory could display an invalid file size.  This is commonly done by software protection schemes for games and the like.  By misrepresnting the size of files on a CD, copying is made more difficult since CD copying programs can be fooled.

You could certainly do (or correct) this yourself but the details depend on the FILE SYSTEM used on your media.  If indeed this is a floppy, the filesystem is likely FAT.  The details of the FAT file system and its directory structure are well documented.

http://www.pcguide.com/ref/hdd/file/fat.htm
Avatar of bigstyle

ASKER

Thanks you both for your answers.

I would like to try to increase the file Sunny;

Jhance,I visited your website but I didnt have seen something interesting.

I remember a method that was to modify the header of an image file (iso file ?) but I dont remember how,and moreover I would like to know how it is possible for every kind of files.
>The file's size is stored in the DIRECTORY of the storage device.  Windows 2000 does not go out and calculate the size of
>every file on the media when you list the directory.  It merely uses the size stored in the directory.
jhance, if you meant total disk space occupied by the directory, then I am inclined to disbelieve this ... if you meant individual file, I agree.

bigstyle
you can increase file size by appending any data to it ... just that you will end up trashing the file but file size will increase.

While it is possible to modify the values of filesize stored on a floppy, it should not be so trivial for files on your hard disk (if it is, virii and worms would have a ball) ....
sunny...,

No you can modify the apparent size of any file on the disk by messing with the directory information in the filesystem's directory.

As I already said, this is commonly done as an [easily circumvented] copy protection scheme for CDs.  It was also done in the past with floppies.

Doing this on a hard drive, however, is NOT recommended as you risk trashing the entire filesystem.
>on the disk
floppy disk easy ... but with hard disk I am not so sure ... I know it is possible on linux by overwriting inodes and other data structures (as a super user) but windows ... ????
Same technique, just different details due to different filesystem.  But all of these work in generally the same way.
But nobody said how it is concretely possible to modify the size of a file in a floppy :/

jhance it seems you know how to do in every situation,could you please be more precise ?

Thanks
1) You valued this question at 100 pts.  That means, in effect, "I need only a pointer in the right direction and can take it from there..."
2) I posted you a URL to a full description of the FAT16 filesystem format that is used on floppies under Windows 2000.  The information is right there even though you claim otherwise.
3) If you need more assistance or a complete solution, please value this question appropriately.
lol jhance,
i didnt know that the rules were so weerd there.

Here is 200 points more,that s enough for having more knowledge ? :)
450 points sorry for the bad manipulation
ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Any further questions?  Comments?
Hello???
Weel I have tried this code but it doesnt work so the question is still opened.
Sorry
I second the recommendation
jhance had pinged the asker twice
ok give him the points if you want, even if for me the answer is uncomplete.
bigstyle == bigstyler

Holding multiple accounts is voilation of membership agreement
https://www.experts-exchange.com/memberAgreement.jsp
Erf sorry I have an account for my job and one for my personal use :/
Ok you can delete bigstyle account ...
doesnt matter.

I have more points in bigstyle account but I have lost my password and the "Forgot Password" method doesn't work.
Give him the points if you want.
Thank you for the points report