#
✕ nick:Jamie[m]
#asahi-re · 2022-10-06 10:01
Jamie[m]btw have i got my offsets wrong or is DMACFGMEMSRC serving a dual purpose where it seems to be read from as a "is the dma currently busy" register?
#asahi-re · 2022-10-06 10:01
Jamie[m]sweet
#asahi-re · 2022-10-06 10:01
Jamie[m]awesome i hadn't seen this stuff
#asahi-re · 2022-10-06 10:00
Jamie[m]oh sweeet
#asahi-re · 2022-10-06 09:58
Jamie[m](part of my reason for doing this was to isolate and understand the behaviour of the DMA peripherals, but I get the impression that you already understand them much more than I do)
#asahi-re · 2022-10-06 09:57
Jamie[m]i guess that is easier than REing the firmware with all the dynamic varaiables that actually just point to 0x10000000 haha :P:P
#asahi-re · 2022-10-06 09:53
Jamie[m]**todo: figure out how to make the real-device exception handlers not interfere with the sram by putting stuff on the stack
#asahi-re · 2022-10-06 09:53
Jamie[m]+ run the whole thing under hv'd macos, watching using hooks on the peripherals etc
#asahi-re · 2022-10-06 09:52
Jamie[m]+ double-check that there's memory barrier stuff to ensure all the sram region accesses are immediately reflected (if necessary?)
#asahi-re · 2022-10-06 09:52
Jamie[m]+ hook it up so that the sram region is backed by the actual real sram region, as are the decoder/dma/etc peripherals
#asahi-re · 2022-10-06 09:52
Jamie[m]+ use hv to override writes to the firmware region, instead writing a firmware where all the exception vectors just go to a while(true) {} that doesn't touch memory*
#asahi-re · 2022-10-06 09:52
Jamie[m]so the strategy i had in mind is:
#asahi-re · 2022-10-06 09:46
Jamie[m]niceee
#asahi-re · 2022-10-06 09:43
Jamie[m]oh good haha
#asahi-re · 2022-10-06 09:42
Jamie[m]oh cool
#asahi-re · 2022-10-06 09:41
Jamie[m]awesome
#asahi-re · 2022-10-06 09:41
Jamie[m]yeah you must be if mailbox is working right?
#asahi-re · 2022-10-06 09:41
Jamie[m]are you forwarding peripheral register access to the real peripherals?
#asahi-re · 2022-10-06 09:40
Jamie[m]that does not convey the evilness of my :3
#asahi-re · 2022-10-06 09:40
Jamie[m]hey matrix turned my > : 3 into a :3
#asahi-re · 2022-10-06 09:40
Jamie[m]>:3
#asahi-re · 2022-10-06 09:35
Jamie[m]but wasn't sure what to use for actually running the code, unicorn is probably what i would have begrudgingly settled on
#asahi-re · 2022-10-06 09:34
Jamie[m])
#asahi-re · 2022-10-06 09:34
Jamie[m](basically just the nvic i think?
#asahi-re · 2022-10-06 09:34
Jamie[m]m3 is tiny enough that I was thinking of emulating the periphals used (basically nothing) myself
#asahi-re · 2022-10-06 09:33
Jamie[m]rqou_: awesome haha
#asahi-re · 2022-10-06 07:18
Jamie[m]i think the awful/amazing verdict will probably be decided by whether i do this in c in m1n1 or as a proxyclient script
#asahi-re · 2022-10-06 07:08
Jamie[m]and feed video in -> watch register accesses come out
#asahi-re · 2022-10-06 07:08
Jamie[m]so we can treat all of macos PLUS the firmware as a single black box
#asahi-re · 2022-10-06 07:07
Jamie[m]and interrupts from the hardware
#asahi-re · 2022-10-06 07:07
Jamie[m]on the assumption that it's sane to try doing AVD just with direct register poking and maybe a little custom firmware, I'm gonna see if I can get the firmware running in an emulated cortex-m3, proxying peripheral read/writes back to the hardware
#asahi-re · 2022-10-06 07:05
Jamie[m]alright, i'm going to do something awful
#asahi-re · 2022-10-06 02:52
Jamie[m]oh yeah i see
#asahi-re · 2022-10-06 02:43
Jamie[m]by firmware properties you mean the things set with command 6?
#asahi-re · 2022-10-05 09:06
Jamie[m]pretty sure i was definitely reing appleavd.kext straight out of /system/library/extensions though
#asahi-re · 2022-10-05 09:05
Jamie[m]hm perhaps i had that before and forgot about it
#asahi-re · 2022-10-05 01:08
Jamie[m]are they only stored in the kernelcache now?
#asahi-re · 2022-10-05 01:08
Jamie[m]mine all just have signatures and plists, no binary
#asahi-re · 2022-10-05 01:08
Jamie[m]uh, what happened to kexts on ventura
#asahi-re · 2022-10-05 01:06
Jamie[m]lmao
#asahi-re · 2022-10-04 13:39
Jamie[m]and the result is one big framebuffer containing the entire pieced-together frame
#asahi-re · 2022-10-04 13:39
Jamie[m]yes. the submission from kernel->firmware (one mailbox message pointing to one small SRAM buffer pointing to one 0xB7504 DMA buffer) is a request to decode one frame. There are two arrays inside the 0xB7504 which grow with the number of slices in the frame, and there are numbers in the buffer which equal the number of slices in the frame
#asahi-re · 2022-10-04 13:21
Jamie[m]maybe the actual decoding hardware is operating at a per-slice level and the per-frame stuff is just the firmware interface, that'd be nice i guess
#asahi-re · 2022-10-04 13:17
Jamie[m](idk enough about h.264 to know if that's an easy/efficient/possible transformation)
#asahi-re · 2022-10-04 13:16
Jamie[m]whereas this api involves userspace separately requesting decoding of each slice
#asahi-re · 2022-10-04 13:15
Jamie[m]idk if the api maps correctly? in h.264, macos submits one frame at a time, referencing all the slices of the frame
#asahi-re · 2022-10-04 13:14
Jamie[m]hmm
#asahi-re · 2022-10-04 13:07
Jamie[m]so yeah uh if we wanna use v4l m2m it'd better be written in rust
#asahi-re · 2022-10-04 13:06
Jamie[m]an 0day no less :/ https://googleprojectzero.github.io/0days-in-the-wild/0day-RCAs/2022/CVE-2022-22675.html
#asahi-re · 2022-10-04 13:05
Jamie[m]oh is chadmed not in this channel?

plus ›