Contribute
Register

Changing wifi country code in clover patch?

Joined
Nov 25, 2015
Messages
39
Motherboard
Asus UX32LN (Laptop)
CPU
i5-4210U
Graphics
HD Graphics 4400, GeForce 840M, 1920x1080
Mac
Classic Mac
Mobile Phone
Android
How would I go about changing the country code in this clover patch?
I understand I have to edit the <data> field, but all examples I can find describe the string encoded in HEX.

Code:
<dict>                    
  <key>Comment</key>
  <string>10.10.2+ 5Ghz US FCC, the-darkvoid</string>
  <key>Enabled</key>
  <true/>
  <key>Find</key>
  <data>QYP8/3QsSA==</data>
  <key>Name</key>
  <string>AirPortBrcm4360</string>
  <key>Replace</key>
  <data>ZscGVVPrKw==</data>
</dict>
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,927
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
How would I go about changing the country code in this clover patch?
I understand I have to edit the <data> field, but all examples I can find describe the string encoded in HEX.

Code:
<dict>                    
  <key>Comment</key>
  <string>10.10.2+ 5Ghz US FCC, the-darkvoid</string>
  <key>Enabled</key>
  <true/>
  <key>Find</key>
  <data>QYP8/3QsSA==</data>
  <key>Name</key>
  <string>AirPortBrcm4360</string>
  <key>Replace</key>
  <data>ZscGVVPrKw==</data>
</dict>
If you open your plist in Xcode (or PlistEdit Pro), you will see how the find/replace are hex, but you can see what they are at Terminal too:
Code:
A???t,HSPEEDY-OSX:~ RehabMan$ echo -n QYP8/3QsSA==|base64 --decode|xxd
0000000: 4183 fcff 742c 48                        A...t,H
SPEEDY-OSX:~ RehabMan$ echo -n ZscGVVPrKw==|base64 --decode|xxd
0000000: 66c7 06[B]55 53[/B]eb 2b                        f..US.+
According to the guide, you replace the 55 53 (US) in Replace with the desired country code.

This post has details on country codes: http://www.tonymacx86.com/network/104850-guide-airport-pcie-half-mini-v2-117.html#post1027194

Simple matter of finding the country code you want, converting from ASCII to hex, and making the change in Replace.

For example, FR (France) would be:
Code:
SPEEDY-OSX:~ RehabMan$ echo -n FR|xxd
0000000: 4652
So you would set Replace: 66c7 0646 52eb 2b
 
Joined
Nov 25, 2015
Messages
39
Motherboard
Asus UX32LN (Laptop)
CPU
i5-4210U
Graphics
HD Graphics 4400, GeForce 840M, 1920x1080
Mac
Classic Mac
Mobile Phone
Android
Very clear explanation, thanks. Keyword here was base64.

So you would set Replace: 66c7 0646 52eb 2b
So once the country code is replaced in the hex string, convert it back to base64 like so:
$ echo "66c7 0646 52eb 2b" | xxd -r -p | base64
ZscGRlLrKw==
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,927
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Very clear explanation, thanks. Keyword here was base64.



So once the country code is replaced in the hex string, convert it back to base64 like so:
$ echo "66c7 0646 52eb 2b" | xxd -r -p | base64
ZscGRlLrKw==
Use a plist editor so you don't have to convert between hex and base64.
 
Joined
Oct 20, 2011
Messages
112
Motherboard
Asus P8C WS
CPU
Xeon E3-1245v2
Graphics
Asus GeForce GT 640
Classic Mac
LC
Mobile Phone
iOS
For some reason, the thing hates FI as a country code. Can anyone deny or verify this? Symptoms seen are that in System Information there are listed all the supported channels. But once I attempt to connect, with FI set as a country code, I get the dialog about being unable to connect (and that I need to move closer to the AP). Then the 5 GHz channels disappear from System Information.

After that I will not see any 5 GHz access points until I reboot the hackintosh. If I stick with US, everything works fine, even though my AP is set to FI. The AP is set to use a fixed channel common to both country codes.
Code:
$ echo FI | hexdump
0000000 46 49 0a
0000003
$ echo 66c7064649eb2b | xxd -r -p | base64
ZscGRknrKw==
This with El Capitan running on GA-H170N-WIFI.
 
Last edited:
Top