News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

File editing

Started by UPucker, December 15, 2005, 11:02:25 AM

Previous topic - Next topic

UPucker

OK heres the problem. I want to open a file, read from a specific location in the file, then modify the data at that location, and write it back to the file. The file can be quite large(8mb). Can someone point me in the right direction, or simply post an example?

thanks in advance.


Tedd

CreateFile..... GENERIC_READ or GENERIC_WRITE...
SetFilePointer
ReadFile
SetFilePointer
WriteFile
CloseHandle


PS Patching files is a grey area for legality :8)
No snowflake in an avalanche feels responsible.

sluggy

What sort of file is it?

hutch--

It sounds something like reading records in a large database file. Let us know how the file is layed out as there are some very good techniques if the data is regular.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

UPucker

thanks for the replies. I figured it out using...
invoke createfile, invoke readfile, and invoke writefile