Skip to content

Instantly share code, notes, and snippets.

@startergo
startergo / extract-firmware.md
Last active May 2, 2024 12:08
Extract Firmware from OS X installer
  • Download the full installer:
softwareupdate --list-full-installers
Finding available software
Software Update found the following full installers:
* Title: macOS Ventura, Version: 13.1, Size: 11931164KiB, Build: 22C65
* Title: macOS Ventura, Version: 13.0.1, Size: 11866460KiB, Build: 22A400
* Title: macOS Ventura, Version: 13.0, Size: 11866804KiB, Build: 22A380
* Title: macOS Monterey, Version: 12.6.2, Size: 12104568KiB, Build: 21G320
* Title: macOS Monterey, Version: 12.6.1, Size: 12108491KiB, Build: 21G217
@startergo
startergo / MBR_boot_GPT.md
Created April 11, 2024 19:12
Boot Windows 7/8 from GPT on BIOS system : No hybrid MBRs or DUET!

The principle here is simple: Have a ready Windows installation on a partition on a GPT disk. Then add the boot files and boot record to an MBR disk, and add a bootloader entry to the BCD pointing to the Windows installation (more precisely, winload.exe) Install in BIOS mode on MBR and then convert using gptgen Install in UEFI mode using DUET. (ONLY for 64-bit!) Apply the windows install image (install.wim) using ImageX (Windows 7) or DISM (Windows 8+)on the GPT disk (best)

Next insert the Windows DVD, and that small disk, whatever it may be. Open the command prompt.

Use diskpart to verify for yourself which drives are data drives, and which is your windows boot drive. For safety, I recommend removing the drive letters of all other drives except the windows boot drive, which I'll refer to as C:, using the command :

@startergo
startergo / Startup.nsh.md
Last active April 11, 2024 17:05
enable the registers on the Macbook Pro 5,3

Put the EFI Shell as EFI_System_Partition/EFI/BOOT/Bootx64.efi and the following script as EFI_System_Partition/EFI/BOOT/Startup.nsh

REM Enabling VGA on the PCI Bridge that the NVidia card is connected to
REM Setting Bridge Control Register (0x3e) to 8
mm 0010003E 8 -PCI

REM Enabling NVidia Card "I/O Space Access" and setting it as Bus Master
REM Setting Command Register (0x04) to 7
mm 03000004 7 -PCI
@startergo
startergo / Vmware_cpuid.md
Last active April 8, 2024 10:16
VMware core 2 duo processor emulation

https://forums.macrumors.com/threads/mac-os-x-10-4-tiger-on-a-modern-intel-mac-virtualization.2162582/ Vmware version has to be downgraded to less than 19 virtualHW.version = "18"

virtualHW.version = "18"
cpuid.inhibitDarwinMasks = "TRUE"
monitor_control.enable_fullcpuid = "TRUE"
cpuid.0.eax = "0000:0000:0000:0000:0000:0000:0000:1010"
cpuid.0.ebx = "0111:0101:0110:1110:0110:0101:0100:0111"
cpuid.0.ecx = "0110:1100:0110:0101:0111:0100:0110:1110"
cpuid.0.edx = "0100:1001:0110:0101:0110:1110:0110:1001"
@startergo
startergo / bypass_server.md
Last active April 7, 2024 17:54
Bypass Server system restrictions Virtualizing Snow Leopard

For 10.4-10.6 systems, VMware restricts the installation to only the server version. Installing the client version requires some modifications. There are two methods:

Method 1: Modify the installation image:

Add the /System/Library/CoreServices/ServerVersion.plist empty file, pretending that the server system is installing in VMware. You can use the snowyhack.sh script to process images in macOS.

#!/bin/bash
# Copyright Dave Parsons 2016
#set -x
set -e
@startergo
startergo / workaround.md
Last active March 25, 2024 11:05
Workaround for 0x80300024 Error In Windows 10/11 Setup

Workaround for 0x80300024 Error In Windows 10/11 Setup

During the installation of Windows 10 or Windows 11, on the partition creation and formatting page, you may encounter error 0x80300024. This error occurs on hardware configurations with multiple hard drives or SSDs. It is caused by inability of Windows Setup to correctly recognize which internal storage device is bootable.

But there is a workaround for error 0x80300024: by manually transferring the bootloader, BCD registry hive and bootable ramdisk to internal bootable storage device and booting from that device, we can hint Windows Setup which of the multiple internal storage devices is bootable. Windows installation will then proceed as usual.

Contents

  1. Symptoms of the problem
  2. Cause of this problem
  3. Solution in a nutshell
@startergo
startergo / mas-cli.md
Last active March 9, 2024 16:19
Find Application ID's for mas-cli (Mac App Store) download

In systems up to 10.11.6 you can save the "Purchased" page as html file to disk:

  • Quit App Store.app
  • Open Terminal.app in /Applications/Utilities
  • Enter:
defaults write com.apple.appstore ShowDebugMenu -bool true

and hit the Return/⏎ key to show the debug menu in App Store.app.

  • Open App Store.app (check that the Debug menu is available!)
@startergo
startergo / macOS_dmg_create.md
Last active February 24, 2024 05:01
macOS DMG Deployment Workflow
  • Create a sparse image:
hdiutil create -size 32g -type SPARSE -fs HFS+J -volname "Macintosh HD" ~/Desktop/mountainlion_12f37_user.sparseimage
  • Mount the image:
hdiutil attach -owners on -noverify ~/Desktop/mountainlion_12f37_user.sparseimage
  • Mount the Installer:
@startergo
startergo / appstore_downlload.md
Created February 24, 2024 02:50
Command to open the App Store Download folder
  • On Mojave use this command to open the App Store Download folder:
open $TMPDIR../C/com.apple.appstore/
  • On Catalina use this command to open the App Store Download folder:
open $TMPDIR../C/com.apple.appstoreagent/com.apple.appstore/
  • Script for automation:
@startergo
startergo / Wazuh_macos.md
Last active February 16, 2024 20:19
Remove Wazuh client agent
  • Remove agent:
pkgutil --pkgs | grep wazuh
com.wazuh.pkg.wazuh-agent-etc
com.wazuh.pkg.wazuh-agent 
rm -rf /Library/Ossec
rm -rf /Library/StartupItems/WAZUH
rm -f /Library/LaunchDaemons/com.wazuh.agent.plist
rm -f /private/etc/ossec-init.conf
pkgutil --forget com.wazuh.pkg.wazuh-agent-etc