The answer is quite simple. After some coding testing around using Masm and creating my own custom packages using pony's c-ffi and packing it in a pony way. The solution became quite clear. I took the ptr wrote the string to a file and then just read the file as a string. Now you will need to do some stuff to make this work because you can't pass a ptr to the write function. I'll add the code tomorrow and explain it in detail if this ever might become usefull