- Joined
- Dec 3, 2010
- Messages
- 460
- Motherboard
- Gigabyte GA-H55M-S2V
- CPU
- Intel i3-530
- Graphics
- HIS HD 6570
- Mac
- Mobile Phone
The following PHP scripts extract the framebuffers in OS X Mavericks kernel extensions and print them out with the connector types for each, for use with Chimera/Chameleon. The scripts are enclosed along with their output.
AMD / ATI
Note that this script requires `otool` for disassembly. Mavericks will automatically prompt you to download and install the command line tools, but Mountain Lion or earlier will require an installation of Xcode and its Command Line Tools package (see Preferences > Downloads).
AMD / ATI
Note that this script requires `otool` for disassembly. Mavericks will automatically prompt you to download and install the command line tools, but Mountain Lion or earlier will require an installation of Xcode and its Command Line Tools package (see Preferences > Downloads).
Code:
<?php
function padHex($d,$l) {return str_pad(dechex($d),$l,'0',STR_PAD_LEFT);}
function toHex($s){$i=0;$t='';while(isset($s[$i])){$t.=padHex(ord($s[$i++]),2);}return $t;}
function toStr($h){$s='';$i=4;while($i-->0){$s.=chr($h>>(8*$i)&0xFF);}return $s;}
$ctype=array('02000000'=>'LVDS','04000000'=>'DDVI','80000000'=>'SVIDEO','10000000'=>'VGA','00020000'=>'SDVI','00040000'=>'DP','00080000'=>'HDMI','00100000'=>'????');
foreach(glob('/System/Library/Extensions/'.(file_exists('/System/Library/Extensions/AMD6000Controller.kext') ? 'AMD' : 'ATI').'*Controller.kext') as $file) {
echo str_pad(substr(strrchr($file,'/'),1),72,'-',STR_PAD_BOTH)."\n\n";
$file=array_pop(glob("$file/Contents/MacOS/*"));
$a=popen("otool -XvQt $file",'r');
$b=fopen($file,'r');
while ($l=fgets($a)) {
if (strncmp($l,'__ZN',4)!=0 || ($i=strpos($l,'Info10createInfo'))===false) continue;
$f=new stdClass();
$f->name=substr($l,5+is_numeric($l[5]),$i-5-is_numeric($l[5]));
while(($l=fgets($a)) && strpos($l,'ret')===false) {
if (strpos($l,'leaq')!==false) $f->addr=hexdec(substr($l,6,strpos($l,'(')-6));
if (!isset($f->ports) && strpos($l,"movb\t$")!==false) $f->ports=hexdec(substr($l,strpos($l,'$'),strpos($l,',')-strpos($l,'$')))&0xFF;
if (strpos($l,'jl')!==false) $i=hexdec(substr($l,4));
if (strpos($l,'jmp')!==false) $i=hexdec(substr($l,4)) + 0x1A;
}
$f->addr+=$i;
echo "$f->name ($f->ports) @ 0x".dechex($f->addr)."\n";
$t=$p=array();
fseek($b,$f->addr);
while($f->ports-- > 0) $p[]=$ctype[substr($t[]=toHex(fread($b,16)),0,8)];
echo implode(', ',$p)."\n";
echo implode("\n",$t)."\n\n";
}
pclose($a);
fclose($b);
}
Code:
-------------------------ATI2400Controller.kext-------------------------
Iago (2) @ 0x83b80
LVDS, ????
02000000400000000900000000010012
0010000016000000c400000010000111
-------------------------ATI2600Controller.kext-------------------------
Hypoprion (2) @ 0x83b60
LVDS, ????
02000000400000000900000000010012
0010000016000000c400000010000111
Lamna (2) @ 0x83b80
SDVI, DDVI
00020000140000008000000000010211
04000000160000008000000000100112
-------------------------ATI3800Controller.kext-------------------------
Megalodon (3) @ 0x83b50
SDVI, DDVI, SVIDEO
00020000140000000000000000010211
04000000160000000000000000100112
80000000020000000400000000100000
Triakis (2) @ 0x83b80
SDVI, DDVI
00020000140000000000000000010211
04000000160000000000000000100112
-------------------------ATI4600Controller.kext-------------------------
Flicker (3) @ 0x82b10
DP, DP, SDVI
00040000000400000001000002010305
00040000000400000001000001000202
00020000140200000001000000100104
Gliff (3) @ 0x82b40
LVDS, LVDS, DP
02000000400000000901000002010003
02000000000100000901000020010202
00040000040600000001000010000101
Shrike (3) @ 0x82b70
LVDS, LVDS, DP
02000000400000000901000002010003
02000000000100000901000020010202
00040000040300000001000010000101
-------------------------ATI4800Controller.kext-------------------------
Cardinal (2) @ 0x81b30
SDVI, DDVI
00020000140200000001000001010104
04000000140200000001000000100203
MotMot (2) @ 0x81b50
DP, DDVI
00040000040100000001000010000203
04000000140200000001000001110104
Quail (3) @ 0x81b70
LVDS, LVDS, DP
02000000400000000901000022010007
02000000000100000901000020010304
00040000040300000001000010000203
-------------------------ATI5000Controller.kext-------------------------
Douc (2) @ 0x9b1a0
LVDS, DP
02000000000500000903000021030202
00040000040200000003000011020101
Langur (3) @ 0x9b1d0
DP, DP, DDVI
00040000040600000001000021030402
00040000040600000001000011020101
04000000140200000001000002040503
Uakari (4) @ 0x9b200
DP, DDVI, SDVI, HDMI
00040000000400000071000012040401
04000000140000000071000001120103
00020000140000000071000000000605
00080000000200000071000022050504
Zonalis (6) @ 0x9b240
DP, DP, DP, DP, DP, DP
00040000040600000071000020010606
00040000040600000071000010000505
00040000040600000071000021030204
00040000040600000071000011020103
00040000040600000071000022050402
00040000040600000071000012040301
Alouatta (4) @ 0x9b2a0
LVDS, DP, DP, DP
02000000000100000901000012040303
00040000040600000071000011020101
00040000040600000071000021030202
00040000040600000071000022050404
Hoolock (3) @ 0x9b2e0
DP, DP, DDVI
00040000040600000001000021030501
00040000040600000001000011020402
04000000140200000001000002040103
Vervet (4) @ 0x9b310
DP, DDVI, SDVI, HDMI
00040000000400000071000012040402
04000000140000000071000001120104
00020000140000000071000000000603
00080000000200000071000022050501
Baboon (3) @ 0x9b350
DDVI, HDMI, VGA
04000000140000000001000001020103
00080000000200000071000022050201
10000000100000000001000000100002
Eulemur (3) @ 0x9b380
DDVI, HDMI, VGA
04000000140000000001000001020104
00080000000200000071000012040402
10000000100000000000000000100001
Galago (2) @ 0x9b3b0
LVDS, DP
02000000000100000903000021030202
00040000040600000073000011020101
Colobus (2) @ 0x9b3e0
LVDS, DP
02000000000100000903000021030202
00040000040600000073000011020101
Mangabey (2) @ 0x9b410
LVDS, DP
02000000400000000901000000000003
00040000040600000073000011020101
Nomascus (4) @ 0x9b440
LVDS, LVDS, DP, DP
02000000400000000901000000000005
02000000000100000903000012040303
00040000040600000073000011020101
00040000040700000073000021030202
Orangutan (2) @ 0x9b490
LVDS, DP
02000000400000000901000000000005
00040000040600000073000011020101
-------------------------ATI6000Controller.kext-------------------------
Pithecia (2) @ 0x9e6c0
DP, DDVI
00040000040300000001000021030204
04000000140200000001000000000403
Bulrushes (6) @ 0x9e6e0
DP, DP, DP, DP, DP, DP
00040000040300000001000011020101
00040000040300000001000021030202
00040000040300000001000012040303
00040000040300000001000022050404
00040000040300000001000010000505
00040000040300000001000020010606
Cattail (4) @ 0x9e740
LVDS, DP, DP, DP
02000000400000002905000000000005
00040000040300000001000011020101
00040000000100000009100021030202
00040000000100000009100012040303
Hydrilla (5) @ 0x9e780
LVDS, DP, DP, DP, DP
02000000000100000901000012040303
00040000040300000001000011020101
00040000000100000009100021030202
00040000000100000009100022050504
00040000040300000001000010000405
Duckweed (4) @ 0x9e7d0
DP, DP, HDMI, SDVI
00040000040300000001000012040401
00040000040300000001000022050502
00080000040200000001000011020304
00020000140200000001000000000605
Fanwort (4) @ 0x9e810
LVDS, DP, DP, DP
02000000400000002905000000000004
00040000040300000001000011020101
00040000000100000009100021030202
00040000000100000009100012040303
Elodea (5) @ 0x9e850
LVDS, DP, DP, DP, DP
02000000000100000901000012040303
00040000040300000001000010000505
00040000040300000001000011020101
00040000000100000009100021030202
00040000000100000009100022050404
Kudzu (2) @ 0x9e8a0
DP, HDMI
00040000040300000001000012040303
00080000040200000001000011020101
Gibba (5) @ 0x9e8c0
DP, DP, HDMI, SDVI, DDVI
00040000040300000001000012040501
00040000040300000001000022050402
00080000040200000001000011020604
00020000140200000001000000000305
04000000040200000001000011020103
Lotus (3) @ 0x9e910
DP, HDMI, DP
00040000040300000001000011020101
00080000040200000001000022050404
00040000000100000001000021030202
Ipomoea (3) @ 0x9e940
DP, HDMI, VGA
00040000040300000001000012040105
00080000040200000001000011020403
10000000100000000001000000000002
Muskgrass (4) @ 0x9e970
DP, DP, DP, HDMI
00040000040300000001010011020101
00040000000100000009120021030202
00040000000100000009130022050404
00080000040200000001040012040303
Juncus (4) @ 0x9e9b0
DP, DP, DP, DP
00040000040300000001000012040303
00040000040300000001000010000405
00040000040300000001000011020101
00040000040300000001000021030202
Osmunda (4) @ 0x9e9f0
LVDS, DP, DP, HDMI
02000000000100002905010010000505
00040000040300000009020011020101
00040000040300000009030021030202
00080000040200000001040012040303
Pondweed (3) @ 0x9ea30
LVDS, DP, DP
02000000000100000901010010000505
00040000040300000001020011020101
00040000040300000001030021030202
Spikerush (4) @ 0x9ea60
LVDS, DP, DP, DP
02000000400000002905010000000005
00040000040300000001020011020101
00040000000100000009020021030202
00040000000100000009030012040303
Typha (5) @ 0x9eaa0
DP, DP, DP, DP, DDVI
00040000040300000001010011020401
00040000040300000001020021030502
00040000000100000009030010000205
00040000000100000009040020010306
04000000140200000001050002040103
-------------------------ATI7000Controller.kext-------------------------
Aji (4) @ 0xa1c60
DP, DP, DDVI, HDMI
00040000040300000001010012040501
00040000040300000001020022050402
04000000140200000001030000000306
00080000040200000001040011020104
Buri (4) @ 0xa1ca0
LVDS, DP, DP, HDMI
02000000000100002905010010000505
00040000040300000009020011020101
00040000040300000009030021030202
00080000040200000001040012040303
Chutoro (5) @ 0xa1ce0
LVDS, DP, DP, DP, DP
02000000000100000901010012040303
00040000040300000001020011020101
00040000000100000009030021030202
00040000000100000009040022050404
00040000040300000001050010000505
Dashimaki (4) @ 0xa1d30
DP, DP, DDVI, HDMI
00040000040300000001010012040202
00040000040300000001020022050305
04000000140200000001030000000404
00080000040200000001040011020101
Ebi (5) @ 0xa1d70
LVDS, DP, DP, DP, DP
02000000000100000901010012040303
00040000040300000001020011020101
00040000000100000009030021030202
00040000000100000009040022050404
00040000040300000001050010000505
Gari (5) @ 0xa1dc0
LVDS, DP, DP, DP, DP
02000000000100000901010012040303
00040000040300000001020011020101
00040000000100000009030021030202
00040000000100000009040022050404
00040000040300000001050010000505
Futomaki (4) @ 0xa1e10
DP, DP, DDVI, HDMI
00040000040300000001010012040401
00040000040300000001020022050502
04000000140200000001030000000606
00080000040200000001040011020103
Hamachi (4) @ 0xa1e50
DP, DP, DDVI, HDMI
00040000040300000001010012040501
00040000040300000001020022050402
04000000140200000001030000000306
00080000040200000001040011020104
OPM (6) @ 0xa1e90
DP, DP, DP, DP, DP, DP
00040000040300000001000011020101
00040000040300000001000021030202
00040000040300000001000012040303
00040000040300000001000022050404
00040000040300000001000010000505
00040000140300000001000020010606
Ikura (1) @ 0xa1ef0
HDMI
00080000040200000001010012040301
IkuraS (6) @ 0xa1f00
DP, DP, DP, DP, DP, DP
00040000040300000001010011020103
00040000040300000001020021030204
00040000040300000001830012040301
00040000040300000001040022050402
00040000040300000001050010000505
00040000040300000001060020010606
Junsai (6) @ 0xa1f60
DP, DP, DP, DP, DP, DP
00040000040300000001000012040301
00040000040300000001000022050402
00040000040300000001000011020103
00040000040300000001000021030204
00040000040300000001000010000505
00040000040300000001000020010606
Kani (1) @ 0xa1fc0
HDMI
00080000040200000001010012040301
KaniS (6) @ 0xa1fd0
DP, DP, DP, DP, DP, DP
00040000040300000001010011020103
00040000040300000001020021030204
00040000040300000001830012040301
00040000040300000001040022050402
00040000040300000001050010000505
00040000040300000001060020010606
DashimakiS (4) @ 0xa2030
DP, DP, DDVI, HDMI
00040000040300000001010012040202
00040000040300000001020022050305
04000000140200000001030000000404
00080000040200000001040011020101
Maguro (1) @ 0xa2070
HDMI
00080000040200000001010012040301
MaguroS (6) @ 0xa2080
DP, DP, DP, DP, DP, DP
00040000040300000001010011020103
00040000040300000001020021030204
00040000040300000001830012040301
00040000040300000001040022050402
00040000040300000001050010000505
00040000040300000001060020010606