Message from @spaqin

Discord ID: 473821957377490955


Mr hairdresser?

2018-07-31 11:31:24 UTC  

I didn't want to call him a fag outright

Anyone who knows C can help me right now with fwrite?

2018-07-31 11:39:28 UTC  

let's encrypt ded

2018-07-31 11:46:40 UTC  
2018-07-31 11:52:39 UTC  

hello dear am C programmer too

2018-07-31 11:55:58 UTC  

why use dead language

@spaqin So when using the write function it returned the mmapedData backwards after the reverseArray function

So that is fine

But then putting that into the file gives a corrupted file that is the same file size

2018-07-31 11:58:05 UTC  

How corrupted

2018-07-31 11:58:14 UTC  

@bentech because we make embedded devices

the file size is the same

so the data is certainly there

it's literally supposed to be backwards

https://cdn.discordapp.com/attachments/189467888657235970/473821849327763456/unknown.png

2018-07-31 11:58:52 UTC  

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

2018-07-31 11:59:17 UTC  

You could've also somehow messed up the params?

2018-07-31 11:59:19 UTC  

looks like your encoding is wack

But I want that in a plain text

2018-07-31 11:59:28 UTC  

Or it could be UTF8

2018-07-31 11:59:31 UTC  

if it's anything except ASCII you can't just reverse the bytes and have it work

2018-07-31 11:59:33 UTC  

Or whatever utf

```
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

2018-07-31 11:59:56 UTC  

you are reading bytes

2018-07-31 11:59:57 UTC  

a char is a byte

No bits were turned in reverse

2018-07-31 12:00:23 UTC  

Pass me the fwrite incantation you use

2018-07-31 12:00:35 UTC  

incantation lol

```
fwrite(mmappedData, 1, filesize, f);
```

2018-07-31 12:00:37 UTC  

im stealing that

2018-07-31 12:00:44 UTC  

Can't fuck that up lmao

mmapedData is a char* array from a mmap() command

1 is the start of the array

2018-07-31 12:01:03 UTC  

Give it a simple file first

2018-07-31 12:01:11 UTC  

compare your two files in a hex editor