es muss an einem String liegen, der größer ist als die Begrenzung.
Ich denke, das du mehr als ~85MB freien Ram hast
Ändere mal die Zahl 2147483646 an allen Stellen in 2147473646, dann trennt er 10000 Zeichen früher, vielleicht reicht das
--EDIT-- Achja, lass dir das Ergebnisarray nicht anzeigen, der lädt sich tot, weil es relativ groß ist
--EDIT2-- Ich habe grade nochmal getestet, bei mir hat Autoit beim durchlauf eine Auslastung von bis zu 4500MB RAM, ist wohl doch ein bisschen Viel rechnerei mit vielen großen Daten.
Vielleicht wäre es einfacher, die Daten nicht zu Speichern, sondern direkt in eine Datei zu schreiben, ich schau mal ob es damit besser klappt
--Edit3-- Probier es mal damit
Spoiler anzeigen
Func _Decodefile($s_FileName)
Local $a_AArr, $s_Mid, $read, $s_ret, $i_done, $len, $count, $exitdo = 0, $maxstringlenght = 2147483646, $pos = 0
$hFile = FileOpen($s_FileName, 16)
$hFile2 = FileOpen(@ScriptDir & "\extracted-vfiles\test-decoded.v", 17)
FileWrite($hFile2, "0x")
Do
$read = FileRead($hFile, $maxstringlenght)
$len = StringLen($read)
If $len < $maxstringlenght Then
$exitdo = 1
Else
If $pos = 0 Then
FileSetPos($hFile, $pos + 1, 0)
Else
FileSetPos($hFile, $pos, 0)
EndIf
$pos += $maxstringlenght
EndIf
$i_done = 1
$count = Ceiling($len / 16777215)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $len = ' & $len & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $count = ' & $count & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
For $k = 1 To $count
$s_ret = ""
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $k = ' & $k & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
$s_Mid = StringMid($read, $i_done, 16777215)
$a_AArr = StringSplit($s_Mid, "")
For $i = 1 To $a_AArr[0]
If IsInt($i/100000) Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $i = ' & $i & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
If $a_AArr[$i] = "0" And $a_AArr[$i + 1] = "x" Then ContinueLoop
If $a_AArr[$i] = "x" And $a_AArr[$i - 1] = "0" Then ContinueLoop
Switch $a_AArr[$i]
Case "5"
$s_ret &= "0"
Case "4"
$s_ret &= "1"
Case "7"
$s_ret &= "2"
Case "6"
$s_ret &= "3"
Case "1"
$s_ret &= "4"
Case "0"
$s_ret &= "5"
Case "3"
$s_ret &= "6"
Case "2"
$s_ret &= "7"
Case "D"
$s_ret &= "8"
Case "C"
$s_ret &= "9"
Case "F"
$s_ret &= "A"
Case "E"
$s_ret &= "B"
Case "9"
$s_ret &= "C"
Case "8"
$s_ret &= "D"
Case "B"
$s_ret &= "E"
Case "A"
$s_ret &= "F"
EndSwitch
Next
$i_done += 16777215
$t = FileWrite($hFile2, $s_ret)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $t = ' & $t & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Next
Until $exitdo = 1
FileClose($hFile)
FileClose($hFile2)
Return 1
EndFunc ;==>_Decodefile