Message from @why am I 𝓐𝓛𝓘𝓥𝓔

Discord ID: 473826467818635265


2018-07-31 12:10:54 UTC  

but the file displayed is still corrupted chink runes

2018-07-31 12:11:19 UTC  

you have a null byte at the start

2018-07-31 12:11:21 UTC  

that might be a reason

2018-07-31 12:11:29 UTC  

because your input string is probably null terminated

2018-07-31 12:11:33 UTC  

that ends up at the start of the string

2018-07-31 12:12:51 UTC  

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

2018-07-31 12:13:04 UTC  

if that second statement is zero, then nothing will printout

2018-07-31 12:13:31 UTC  

if it's one, it misses the first character, but is reversed, but is corrupted

2018-07-31 12:13:45 UTC  

well, the second argument is size isn't it

2018-07-31 12:14:20 UTC  

if you set it to 0 then it would indeed write fuck all

2018-07-31 12:14:59 UTC  

oh cool

2018-07-31 12:15:11 UTC  

setting it to 2 gives the output, but loads of nulls

2018-07-31 12:15:26 UTC  

this is great news

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

2018-07-31 12:15:44 UTC  

because now you've told fwrite that each of your items to write is 2 bytes long

2018-07-31 12:15:48 UTC  

when it is infact 1 byte long

2018-07-31 12:16:03 UTC  

indeed

2018-07-31 12:16:03 UTC  

and you're reading outside the bounds of your mmapped array

2018-07-31 12:16:07 UTC  

output is now 2x larger

2018-07-31 12:16:13 UTC  

which happens to be 0x0

2018-07-31 12:17:08 UTC  

changing your reverse array function should work

2018-07-31 12:17:13 UTC  

almost got it

2018-07-31 12:17:19 UTC  

bizzare

2018-07-31 12:17:23 UTC  

last tizen phonmem was last year

2018-07-31 12:17:24 UTC  

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

2018-07-31 12:17:42 UTC  

just an extra null at the beginning

2018-07-31 12:20:43 UTC  

yes

2018-07-31 12:20:50 UTC  

get rid of the null byte and it'll work probably

2018-07-31 12:21:09 UTC  

how would I do that whilst writing?

2018-07-31 12:21:16 UTC  

to skip the first byte?

2018-07-31 12:21:48 UTC  

dont do it while writing

2018-07-31 12:21:50 UTC  

do it before that

2018-07-31 12:22:06 UTC  

or i guess you could increment your mmap array pointer by one

2018-07-31 12:22:11 UTC  

and decrease length by one

2018-07-31 12:23:37 UTC  

I think that did it

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

2018-07-31 12:23:52 UTC  

let me check

2018-07-31 12:23:54 UTC  

google did some Embrace, Extend, and Extinguish on firefox

2018-07-31 12:24:03 UTC  

and rip fox

2018-07-31 12:24:17 UTC  

woohoo

2018-07-31 12:24:21 UTC  

it's perfect now

2018-07-31 12:24:52 UTC  

I think the reason why it looks like that is because of a hidden line break

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