Claude to the rescue

An area for people to discuss Scope related problems, issues, etc.

Moderators: valis, garyb

Post Reply
pranza
Posts: 170
Joined: Sun Dec 14, 2008 1:22 pm
Location: Vilnius, Lithuania
Contact:

Claude to the rescue

Post by pranza »

heya!

after building a BIOS for the motherboard to support a CPU that it does not support 'yet' ...

it's time for Scope or so i thought – and handed Claude v5.1 driver - as we know it gives bluescreens with VDAT, samplers and what not, also it fails to pass Windows audio (garbage on inputs), and XTC mode is very, very temperamental - like, works 1 time out of 10 - yes, nine bluescreens, you're right.

that's what Claude said:

I disassembled the driver and found a genuine bug — and confirmed it isn't just "compiled 32-bit" (it's a real PE32+/x86-64 binary, machine type AMD64, built 2010-11-23). Embedded debug strings identify it as Sonic Core's SCOPE/Pulsar Multichannel audio driver, built from d:\scope 5.1 source\Src\vxd\win2k\x64\Release\scScope.pdb — a Win2K/VXD-era codebase later ported to x64, which lines up with your "ported and patched over the years" description.

The good news first: the parts that talk directly to the hardware are done right. MmAllocateContiguousMemorySpecifyCache (the card's DMA buffer) is explicitly capped to physical addresses below 4 GB, which is exactly correct for a card whose DMA engine only understands 32-bit bus addresses. MmMapIoSpace for the PCI BAR also uses a proper full 64-bit physical address. So the hardware-facing DMA logic isn't your problem.

The actual bug: in the per-channel/stream buffer setup routine (around VA 0x180008675, tagged with pool tag 'GSIF'), the driver calls ExAllocatePoolWithTag, gets back a real 64-bit kernel pointer in RAX — then stores only the low 32 bits of it into a 4-byte-wide array slot in its device extension (mov DWORD PTR [ctx+i*4+0x100], edx — a *4 stride, i.e. a leftover ULONG[] array that should be a pointer-sized array on x64). It then reads that same slot back, zero-extends the truncated value into a 64-bit register, and immediately does a rep stos (a memset/RtlZeroMemory) to that bogus reconstructed address. Since NonPagedPool addresses on x64 always live way up in the high canonical range, truncating to 32 bits never gives you the real buffer — it gives you an essentially arbitrary low address. Whether that write immediately faults (instant BSOD) or happens to land on other mapped memory (silent corruption → a random, delayed BSOD later) depends on the pool layout at that moment, which is exactly why it happens "sometimes" rather than every time. The same truncation happens a second time nearby and also leaks into another table used elsewhere in the driver. Interestingly, other parts of this same driver correctly use 8-byte-stride pointer arrays — so this looks like one specific spot that got missed during the x86→x64 port, not a systemic "still 32-bit" design.

I put the full technical write-up (exact addresses, disassembly excerpts, and a fix recommendation) in the file above. Short version of the fix: if you have the source, find the device-extension field around offset 0x100 that's declared ULONG/DWORD but holds a pointer from that 'GSIF' allocation, retype it to PVOID/ULONG_PTR, and audit the sibling MIDI/wave/topology allocation paths for the same pattern — it's a struct-layout issue, so it isn't something that can be safely binary-patched without the source.

the complete analysis: https://audiomastering.lt/scScope_x64_analysis.md

---

why not version 7 you may ask? well, i found it decapitated - XTC broken completely, some other 'old stuff' is also broken - and not sure what's the positive takeaway from that version. maybe it's possible to fix even that but anyways --- we need source code rather than doing random binary patches :) !!!
User avatar
dante
Posts: 5089
Joined: Sat Nov 24, 2001 4:00 pm
Location: Melbourne Australia
Contact:

Re: Claude to the rescue

Post by dante »

Sounds like someone just recompiled the code x64 without changing any of the relevant declarations. So - does Holger have the source code ?
User avatar
valis
Posts: 8031
Joined: Sun Sep 23, 2001 4:00 pm
Location: West Coast USA
Contact:

Re: Claude to the rescue

Post by valis »

This is known, just not discussed externally. We have a private discussion for a community effort, I'm sending you a pm.

Also: https://x.com/ChrisGPT/status/2096150666066432157 < Binaries are now editable code for all of the frontier models, or will be by end of month. As you also discovered with Claude.
pranza
Posts: 170
Joined: Sun Dec 14, 2008 1:22 pm
Location: Vilnius, Lithuania
Contact:

Re: Claude to the rescue

Post by pranza »

a few days of tinkering has shown to me that actually not - there was quite an amount of proper effort into that x64 release, just as there are many things going on, some stuff is done 'old style', there are also some bugs which now get triggered way easier than before due to OS changes; i've been bragging about some 'nasty' windows update that uprooted scope back in windows 8.1 / server 2012r2 days - turns out that update was carrying this change: https://www.alex-ionescu.com/windows-8- ... r-changes/

now i managed to do this funny thing with Claude - a test which reports if it's gonna crash and then i can refrain from launching XTC mode or VDAT that boot - as the assigned memory area for scope is above what certain scope modules can reach and they still attempt to (they somehow see just half of the address), so if it's all zeroes in the 'unseen zone', it ends up being correct and it works, but if not then goes bluescreen..
to work around it properly, one surely needs source code.

as per Claude:

"a 32-bit value only reconstructs correctly into a 64-bit pointer by sign-extension if the real address's upper 33 bits happen to already be all-1s (or all-0s) — i.e. the real address sits in a narrow ~2GB sliver right at the very top of the address space. On older, less-randomized kernels, nonpaged pool allocations landed inside or near that sliver often enough that this broken code usually "just worked" by luck."
User avatar
valis
Posts: 8031
Joined: Sun Sep 23, 2001 4:00 pm
Location: West Coast USA
Contact:

Re: Claude to the rescue

Post by valis »

Yes, the correct (AI assisted) workflow at present is debugging along with source code access. For things that are more common, AI is already able to do them with ease. But decompiling and debugging a custom codebase that interfaces with more obscure DSP products... I have no idea what the models know about ADA Sharcs and Analog Devices SDK, you might try injecting that into the chat as well as asking it to help look up some of the larger ICs, PLCs etc to help map the driver functions out.

It's still possible to feed specific crash and memory error information back to Holger, hence that other forum area (which is not publicly visible) to discuss paths to supporting Holger as a community for a v8 upgrade. I'm sure you contributing data collection potentially goes towards beta participating if not more. As for the implementation, the issues overall are known, the job I suspect is just very time consuming based on those established development paths and his existing implementation of whatever dev / build process he uses.

The QA side of things is where I've been bogged down, getting explicit info on just Win7/10/11 of the various crashes for 5.1 & 7 across both PCI & Xite boxes so that we're not just giving Holger links to forum posts is one of the blockers right now. If you have time to tinker, I want to collect the data.
Jerryrew
Posts: 12
Joined: Fri Sep 04, 2026 3:00 am

Topic

Post by Jerryrew »

You topic read?
Jerryrew
Posts: 12
Joined: Fri Sep 04, 2026 3:00 am

Topic

Post by Jerryrew »

It agree
Jerryrew
Posts: 12
Joined: Fri Sep 04, 2026 3:00 am

Topic

Post by Jerryrew »

You topic read?
Post Reply