Xibalba Posted February 17, 2020 Share Posted February 17, 2020 I have a 11 GB file that I need to analyze. So my first step is reading the first 1 Mb of the file and look at it. I'm unable to make a working script. When running this script it crashes with message "Error allocating memory": $file_src="in.txt" ; source file $file_dest="out.txt" ; $size=1048576 ; $count=FileGetSize($file_src)-$size ; $handle_src=FileOpen($file_src,16) ; open in binary read mode $handle_dest=FileOpen($file_dest,16+2) ; open new file in binary WRITE mode - erase previous contents if they exist FileWrite($handle_dest,BinaryMid(FileRead($handle_src),1,$size)) ; ; close files after using them FileClose($handle_src) FileClose($handle_dest) Ideas? Link to comment Share on other sites More sharing options...
Danyfirex Posted February 17, 2020 Share Posted February 17, 2020 Hello. Use the number of bytes to be read in FileRead's second parameter, so that way you will not need binarymid. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now