How are .dsk images stored/read?
Noob question from an amateur Apple II enthusiast. I've been emulating some old Apple IIe .dsk files and I've used some hex editor programs to explore them. I want to modify a few bytes on the disk, but when I try to read it in as binary, it's compressed somehow and I can't find the information I'm looking for. When I load the image with my program it takes up the same space that the hex editor says it should, but most of it is blank, and all of the data is stored at the front instead of being distributed evenly throughout the disk.
I know there are a host of utilities that can modify individual bytes on a disk image, but I'm interested in creating my own (for fun). Are there any good manuals for how a .dsk image can be unpacked? I want to access the information in the same way that a hex editor can. The hex dump that I'm using contains actual plain ASCII text, while loading the binary from the file gives compressed gibberish. I'm looking for a way to load the disk as this plaintext, edit it, and save it again.
EDIT: I'm stupid, when I was loading the file I forgot to set the binary tag LOL
EDIT2: Using the binary tag actually gives me access to the data, but the formatting is screwed up. I'll check out "Beneath Apple DOS" to see if it's because of the actual format of the .dsk file or something else. I was expecting it to look just like the hex dump, but it's cutting out/shuffling around the tracks. CiderPress says this is a Pascal disk so that's probably part of it.