Message from @Goz3rr
Discord ID: 473822119264780299
So that is fine
But then putting that into the file gives a corrupted file that is the same file size
How corrupted
the file size is the same
so the data is certainly there
it's literally supposed to be backwards
Did you check the data in the program?
yes, that's what I see with the write() command in the code
it's prints that all out backwards in the terminal
You could've also somehow messed up the params?
looks like your encoding is wack
But I want that in a plain text
Or it could be UTF8
if it's anything except ASCII you can't just reverse the bytes and have it work
Or whatever utf
@Goz3rr no no
```
void reverseArray(char* mmappedData, int start, int end) {
int tmp;
while(start < end) {
tmp = mmappedData[start];
mmappedData[start] = mmappedData[end];
mmappedData[end] = tmp;
start++;
end--;
}
}
```
In place reversal
a char is a byte
No bits were turned in reverse
Pass me the fwrite incantation you use
incantation lol
```
fwrite(mmappedData, 1, filesize, f);
```
im stealing that
Can't fuck that up lmao
mmapedData is a char* array from a mmap() command
1 is the start of the array
Give it a simple file first
compare your two files in a hex editor
ah ok sorry
one moment
instead of a text editor
to begin with
Tru
hav no idea
you probably succesfully reversed all bytes, but your text editor is interpreting it as the wrong encoding
so that's the result of the write
And here's what happens in fwrite