Hi Mario
To write a single sector one sends CMD24, followed by the 512 bytes of data. CMD12 is used only to terminate a multiple block write (CMD25).
You can download the open source uTasker project from GITHUB for a FRDM-K64F project which allows you to test writing (command "sectw" command) and display sectors (with command "sect" in the debug menu). It also shows how to use the card with utFAT:
http://www.utasker.com/docs/uTasker/uTasker_utFAT.PDF
on a DOS like interface, with FTP and web server or via USB-MSD. You can use it also on memory sticks or in internal Flash or external SPI flash.
You will be able to copy the methods if you need to write the code again yourself and simulate the SDHC and SD card in its simulator with Visual Studio.
To see some parts in action check out the video: https://www.youtube.com/watch?v=VJ7YveF4_8g&index=26&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q
Regards
Mark
For some FRDM-K64F binaries: http://www.utasker.com/kinetis/FRDM-K64F.html