From 46b0d2cae34f355adf1c68614d95c24a3c78866d Mon Sep 17 00:00:00 2001 From: Nguyen12345tt Date: Mon, 22 Dec 2025 23:31:01 +0700 Subject: [PATCH 1/9] Feat: Add Windows 11 bypass options (TPM, MS Account, BitLocker) to GUI --- WoeUSB/core.py | 60 ++++++++++++++++++++++--- WoeUSB/gui.py | 117 ++++++++++++++++++++++++++++++++++++++---------- WoeUSB/utils.py | 68 ++++++++++++++++++++++++++++ 3 files changed, 216 insertions(+), 29 deletions(-) diff --git a/WoeUSB/core.py b/WoeUSB/core.py index 1392b2f..f258011 100644 --- a/WoeUSB/core.py +++ b/WoeUSB/core.py @@ -40,7 +40,8 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, workaround_bios_boot_flag=False, - target_filesystem_type="FAT", filesystem_label=DEFAULT_NEW_FS_LABEL): + target_filesystem_type="FAT", filesystem_label=DEFAULT_NEW_FS_LABEL, + bypass_workaround=False, bypass_ms_account=False, disable_bitlocker=False): """ :param from_cli: :type from_cli: bool @@ -50,6 +51,9 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, :param workaround_bios_boot_flag: :param target_filesystem_type: :param filesystem_label: + :param bypass_workaround: Bypass TPM/SecureBoot/RAM + :param bypass_ms_account: Bypass Microsoft Account Requirement + :param disable_bitlocker: Disable BitLocker Device Encryption :return: List """ source_fs_mountpoint = "/media/woeusb_source_" + str( @@ -66,6 +70,11 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, debug = False parser = None + + # Initialize default flags + bypass_workaround_flag = bypass_workaround + bypass_ms_account_flag = bypass_ms_account + disable_bitlocker_flag = disable_bitlocker if from_cli: parser = setup_arguments() @@ -95,6 +104,11 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, target_filesystem_type = args.target_filesystem filesystem_label = args.label + + # Capture CLI arguments for Windows 11 tweaks + bypass_workaround_flag = args.bypass_workaround + bypass_ms_account_flag = args.bypass_ms_account + disable_bitlocker_flag = args.disable_bitlocker verbose = args.verbose @@ -107,14 +121,17 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, utils.gui = gui if from_cli: + # Added new flags to the return list return [source_fs_mountpoint, target_fs_mountpoint, temp_directory, install_mode, source_media, target_media, - workaround_bios_boot_flag, skip_legacy_bootloader, target_filesystem_type, filesystem_label, verbose, debug, parser] + workaround_bios_boot_flag, skip_legacy_bootloader, target_filesystem_type, filesystem_label, verbose, debug, parser, + bypass_workaround_flag, bypass_ms_account_flag, disable_bitlocker_flag] else: return [source_fs_mountpoint, target_fs_mountpoint, temp_directory, target_media] def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, install_mode, temp_directory, - target_filesystem_type, workaround_bios_boot_flag, parser=None, skip_legacy_bootloader=False): + target_filesystem_type, workaround_bios_boot_flag, parser=None, skip_legacy_bootloader=False, + bypass_workaround_flag=False, bypass_ms_account_flag=False, disable_bitlocker_flag=False): """ :param parser: :param source_fs_mountpoint: @@ -125,6 +142,9 @@ def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, :param temp_directory: :param target_filesystem_type: :param workaround_bios_boot_flag: + :param bypass_workaround_flag: Hardware bypass + :param bypass_ms_account_flag: MS Account bypass + :param disable_bitlocker_flag: BitLocker disable :return: 0 - succes; 1 - failure """ global debug @@ -193,6 +213,20 @@ def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, copy_filesystem_files(source_fs_mountpoint, target_fs_mountpoint) + # --- START WINDOWS 11 TWEAKS LOGIC --- + if bypass_workaround_flag or bypass_ms_account_flag or disable_bitlocker_flag: + utils.print_with_color(_("Applying Windows 11 customizations..."), "green") + if hasattr(utils, 'write_win11_bypass'): + utils.write_win11_bypass( + target_fs_mountpoint, + bypass_hardware=bypass_workaround_flag, + bypass_ms_account=bypass_ms_account_flag, + disable_bitlocker=disable_bitlocker_flag + ) + else: + utils.print_with_color(_("Error: write_win11_bypass function not found in utils!"), "red") + # --- END WINDOWS 11 TWEAKS LOGIC --- + workaround.support_windows_7_uefi_boot(source_fs_mountpoint, target_fs_mountpoint) if not skip_legacy_bootloader: install_legacy_pc_bootloader_grub(target_fs_mountpoint, target_device, command_grubinstall) @@ -648,6 +682,16 @@ def setup_arguments(): help="This will skip the legacy grub bootloader creation step.") parser.add_argument("--target-filesystem", "--tgt-fs", choices=["FAT", "NTFS"], default="FAT", type=str.upper, help="Specify the filesystem to use as the target partition's filesystem.") + + # --- NEW ARGUMENTS --- + parser.add_argument("--bypass-workaround", action="store_true", + help="Bypass Windows 11 TPM 2.0 / Secure Boot requirements.") + parser.add_argument("--bypass-ms-account", action="store_true", + help="Bypass Microsoft Account Requirement (allows offline account creation).") + parser.add_argument("--disable-bitlocker", action="store_true", + help="Disable automatic BitLocker device encryption.") + # -------------------- + parser.add_argument('--for-gui', action="store_true", help=argparse.SUPPRESS) return parser @@ -709,14 +753,18 @@ def run(): if isinstance(result, list) is False: return + # Updated unpacking to include new flags source_fs_mountpoint, target_fs_mountpoint, temp_directory, \ install_mode, source_media, target_media, \ workaround_bios_boot_flag, skip_legacy_bootloader, target_filesystem_type, \ - new_file_system_label, verbose, debug, parser = result + new_file_system_label, verbose, debug, parser, \ + bypass_workaround_flag, bypass_ms_account_flag, disable_bitlocker_flag = result try: + # Updated main call to include new flags main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, install_mode, temp_directory, - target_filesystem_type, workaround_bios_boot_flag, parser, skip_legacy_bootloader) + target_filesystem_type, workaround_bios_boot_flag, parser, skip_legacy_bootloader, + bypass_workaround_flag, bypass_ms_account_flag, disable_bitlocker_flag) except KeyboardInterrupt: pass except Exception as error: @@ -728,4 +776,4 @@ def run(): if __name__ == "__main__": - run() + run() \ No newline at end of file diff --git a/WoeUSB/gui.py b/WoeUSB/gui.py index 538e1b8..e7d9f79 100644 --- a/WoeUSB/gui.py +++ b/WoeUSB/gui.py @@ -19,11 +19,62 @@ _ = miscellaneous.i18n +# --- NEW CLASS: Cửa sổ chọn tùy chọn Windows 11 --- +class Win11TweaksDialog(wx.Dialog): + def __init__(self, parent): + super().__init__(parent, title=_("Windows Installation Tweaks"), size=(400, 250)) + + panel = wx.Panel(self) + vbox = wx.BoxSizer(wx.VERTICAL) + + lbl = wx.StaticText(panel, label=_("Select customization options:")) + lbl.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) + vbox.Add(lbl, flag=wx.LEFT|wx.TOP, border=10) + + vbox.AddSpacer(10) + + self.cb_hardware = wx.CheckBox(panel, label=_("Bypass Windows 11 Hardware Check\n(TPM 2.0, Secure Boot, RAM)")) + self.cb_ms_account = wx.CheckBox(panel, label=_("Bypass Microsoft Account Requirement\n(Allows creating local account offline)")) + self.cb_bitlocker = wx.CheckBox(panel, label=_("Disable BitLocker Device Encryption")) + + # Mặc định có thể để check hoặc uncheck tùy ý + self.cb_hardware.SetValue(True) + self.cb_ms_account.SetValue(True) + self.cb_bitlocker.SetValue(True) + + vbox.Add(self.cb_hardware, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=15) + vbox.AddSpacer(10) + vbox.Add(self.cb_ms_account, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=15) + vbox.AddSpacer(10) + vbox.Add(self.cb_bitlocker, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=15) + + vbox.AddSpacer(20) + + hbox_btn = wx.BoxSizer(wx.HORIZONTAL) + btn_ok = wx.Button(panel, wx.ID_OK, label=_("OK")) + btn_cancel = wx.Button(panel, wx.ID_CANCEL, label=_("Cancel")) + + hbox_btn.Add(btn_ok, flag=wx.RIGHT, border=10) + hbox_btn.Add(btn_cancel) + + vbox.Add(hbox_btn, flag=wx.ALIGN_RIGHT|wx.ALL, border=10) + + panel.SetSizer(vbox) + self.CenterOnParent() + + def get_values(self): + return (self.cb_hardware.GetValue(), + self.cb_ms_account.GetValue(), + self.cb_bitlocker.GetValue()) +# ---------------------------------------------------- + + class MainFrame(wx.Frame): __MainPanel = None __MenuBar = None __menuItemShowAll = None + # Đã xóa các biến option menu cũ def __init__(self, title, pos, size, style=wx.DEFAULT_FRAME_STYLE): super(MainFrame, self).__init__(None, -1, title, pos, size, style) @@ -52,6 +103,9 @@ def __init__(self, title, pos, size, style=wx.DEFAULT_FRAME_STYLE): self.options_skip_grub = wx.MenuItem(options_menu, wx.ID_ANY, _("Skip legacy grub bootloader"), _("No legacy grub bootloader will be created. NOTE: It will only boot on system with UEFI support."), wx.ITEM_CHECK) + + # Đã xóa các menu item Bypass ở đây để chuyển sang popup + options_menu.Append(self.options_boot) options_menu.Append(self.options_filesystem) options_menu.Append(self.options_skip_grub) @@ -70,9 +124,7 @@ def __init__(self, title, pos, size, style=wx.DEFAULT_FRAME_STYLE): self.SetSizer(main_sizer) - # self.Connect(self.__menuItemShowAll.GetId(), wx.EVT_MENU, MainPanel.on_show_all_drive, None, self.__MainPanel) self.Bind(wx.EVT_MENU, self.__MainPanel.on_show_all_drive) - self.Bind(wx.EVT_MENU, self.on_quit, exit_item) self.Bind(wx.EVT_MENU, self.on_about, help_item) @@ -89,20 +141,14 @@ def is_show_all_checked(self): class MainPanel(wx.Panel): __parent = None - __dvdDriveList = None __usbStickList = wx.ListBox - __dvdDriveDevList = [] __usbStickDevList = [] - __isoFile = wx.FilePickerCtrl - __parentFrame = None - __btInstall = None __btRefresh = None - __isoChoice = None __dvdChoice = None @@ -180,22 +226,16 @@ def refresh_list_content(self): # USB self.__usbStickDevList = [] self.__usbStickList.Clear() - show_all_checked = self.__parent.is_show_all_checked() - device_list = list_devices.usb_drive(show_all_checked) - for device in device_list: self.__usbStickDevList.append(device[0]) self.__usbStickList.Append(device[1]) # ISO - self.__dvdDriveDevList = [] self.__dvdDriveList.Clear() - drive_list = list_devices.dvd_drive() - for drive in drive_list: self.__dvdDriveDevList.append(drive[0]) self.__dvdDriveList.Append(drive[1]) @@ -204,10 +244,8 @@ def refresh_list_content(self): def on_source_option_changed(self, __): is_iso = self.__isoChoice.GetValue() - self.__isoFile.Enable(is_iso) self.__dvdDriveList.Enable(not is_iso) - self.__btInstall.Enable(self.is_install_ok()) def is_install_ok(self): @@ -218,7 +256,6 @@ def is_install_ok(self): def on_list_or_file_modified(self, event): if event.GetEventType() == wx.EVT_LISTBOX and not event.IsSelection(): return - self.__btInstall.Enable(self.is_install_ok()) def on_refresh(self, __): @@ -226,15 +263,34 @@ def on_refresh(self, __): def on_install(self, __): global woe + + # 1. Cảnh báo xóa dữ liệu if wx.MessageBox( _("Are you sure? This will delete all your files and wipe out the selected partition."), _("Cancel"), wx.YES_NO | wx.ICON_QUESTION | wx.NO_DEFAULT, self) != wx.YES: return + if self.is_install_ok(): - is_iso = self.__isoChoice.GetValue() + + # 2. HIỆN POPUP CHỌN TÙY CHỌN WIN 11 --- + bypass_hw = False + bypass_ms = False + no_bitlocker = False + + # Bạn có thể thêm logic kiểm tra nếu là file ISO Windows 11 mới hiện, + # nhưng hiện tại ta cứ hiện luôn cho tiện. + tweak_dlg = Win11TweaksDialog(self) + if tweak_dlg.ShowModal() == wx.ID_OK: + bypass_hw, bypass_ms, no_bitlocker = tweak_dlg.get_values() + tweak_dlg.Destroy() + else: + tweak_dlg.Destroy() + return # Người dùng bấm Cancel ở popup thì hủy cài đặt + # --------------------------------------- + is_iso = self.__isoChoice.GetValue() device = self.__usbStickDevList[self.__usbStickList.GetSelection()] if is_iso: @@ -246,8 +302,18 @@ def on_install(self, __): filesystem = "NTFS" else: filesystem = "FAT" - - woe = WoeUSB_handler(iso, device, boot_flag=self.__parent.options_boot.IsChecked(), filesystem=filesystem, skip_grub=self.__parent.options_skip_grub.IsChecked()) + + woe = WoeUSB_handler( + iso, + device, + boot_flag=self.__parent.options_boot.IsChecked(), + filesystem=filesystem, + skip_grub=self.__parent.options_skip_grub.IsChecked(), + # Truyền các giá trị từ Popup xuống Handler + bypass_workaround=bypass_hw, + bypass_ms_account=bypass_ms, + disable_bitlocker=no_bitlocker + ) woe.start() dialog = wx.ProgressDialog(_("Installing"), _("Please wait..."), 101, self.GetParent(), @@ -387,7 +453,8 @@ class WoeUSB_handler(threading.Thread): error = "" kill = False - def __init__(self, source, target, boot_flag, filesystem, skip_grub=False): + def __init__(self, source, target, boot_flag, filesystem, skip_grub=False, + bypass_workaround=False, bypass_ms_account=False, disable_bitlocker=False): threading.Thread.__init__(self) core.gui = self @@ -396,6 +463,9 @@ def __init__(self, source, target, boot_flag, filesystem, skip_grub=False): self.boot_flag = boot_flag self.filesystem = filesystem self.skip_grub = skip_grub + self.bypass_workaround = bypass_workaround + self.bypass_ms_account = bypass_ms_account + self.disable_bitlocker = disable_bitlocker def run(self): source_fs_mountpoint, target_fs_mountpoint, temp_directory, target_media = core.init( @@ -406,7 +476,8 @@ def run(self): ) try: core.main(source_fs_mountpoint, target_fs_mountpoint, self.source, self.target, "device", temp_directory, - self.filesystem, self.boot_flag , None, self.skip_grub) + self.filesystem, self.boot_flag , None, self.skip_grub, + self.bypass_workaround, self.bypass_ms_account, self.disable_bitlocker) except SystemExit: pass @@ -424,4 +495,4 @@ def run(): if __name__ == "__main__": - run() + run() \ No newline at end of file diff --git a/WoeUSB/utils.py b/WoeUSB/utils.py index 85a75c8..27aeaaf 100644 --- a/WoeUSB/utils.py +++ b/WoeUSB/utils.py @@ -384,3 +384,71 @@ def update_policy_to_allow_for_running_gui_as_root(path): with open("/usr/share/polkit-1/actions/com.github.woeusb.woeusb-ng.policy", "w") as file: file.write(dom.toxml()) + +def write_win11_bypass(target_mountpoint, bypass_hardware=False, bypass_ms_account=False, disable_bitlocker=False): + """ + Tạo file autounattend.xml dựa trên các tùy chọn được bật. + """ + check_kill_signal() + + if not (bypass_hardware or bypass_ms_account or disable_bitlocker): + return True # Không làm gì nếu không có tùy chọn nào được bật + + print_with_color(_("Writing Windows 11 custom configuration (autounattend.xml)..."), "green") + + # Danh sách các lệnh Registry cần thêm + reg_commands = [] + + # 1. Bypass Hardware (TPM, SecureBoot, RAM) + if bypass_hardware: + base_path = r"HKLM\SYSTEM\Setup\LabConfig" + reg_commands.append(f"reg add {base_path} /v BypassTPMCheck /t REG_DWORD /d 1 /f") + reg_commands.append(f"reg add {base_path} /v BypassSecureBootCheck /t REG_DWORD /d 1 /f") + reg_commands.append(f"reg add {base_path} /v BypassRAMCheck /t REG_DWORD /d 1 /f") + reg_commands.append(f"reg add {base_path} /v BypassCPUCheck /t REG_DWORD /d 1 /f") + reg_commands.append(f"reg add {base_path} /v BypassStorageCheck /t REG_DWORD /d 1 /f") + + # 2. Bypass Microsoft Account (Network Requirement) + if bypass_ms_account: + reg_commands.append(r"reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE /v BypassNRO /t REG_DWORD /d 1 /f") + + # 3. Disable BitLocker (Prevent Device Encryption) + if disable_bitlocker: + reg_commands.append(r"reg add HKLM\SYSTEM\CurrentControlSet\Control\BitLocker /v PreventDeviceEncryption /t REG_DWORD /d 1 /f") + + # Tạo nội dung XML động + xml_commands = "" + for index, cmd in enumerate(reg_commands, start=1): + xml_commands += f""" + + {index} + {cmd} + """ + + xml_content = f""" + + + + + {xml_commands} + + + + OnError + + true + + + +""" + + target_file = os.path.join(target_mountpoint, "autounattend.xml") + + try: + with open(target_file, "w") as f: + f.write(xml_content) + print_with_color(_("Success: autounattend.xml created at {0}").format(target_file), "green") + return True + except IOError as e: + print_with_color(_("Error: Failed to write bypass file: {0}").format(e), "red") + return False \ No newline at end of file From 08fed0ff622da94750d53ea9cab5db54befa02a7 Mon Sep 17 00:00:00 2001 From: Nguyen12345tt Date: Mon, 22 Dec 2025 23:37:17 +0700 Subject: [PATCH 2/9] chore: Bump version to 0.2.13-alpha --- WoeUSB/miscellaneous.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WoeUSB/miscellaneous.py b/WoeUSB/miscellaneous.py index de034e8..a4220bf 100644 --- a/WoeUSB/miscellaneous.py +++ b/WoeUSB/miscellaneous.py @@ -2,7 +2,7 @@ import locale import os -__version__ = "0.2.12" +__version__ = "0.2.13-alpha" translation = gettext.translation("woeusb", os.path.dirname(__file__) + "/locale", [locale.getlocale()[0]], fallback=True) translation.install() diff --git a/setup.py b/setup.py index abbf1ca..8f80126 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ def run(self): setup( name='WoeUSB-ng', - version='0.2.12', + version='0.2.13-alpha', description='WoeUSB-ng is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD. This is a rewrite of original WoeUSB. ', long_description=long_description, long_description_content_type='text/markdown', From e00ea4c8d50a277bf752e936ff638c3a8e186edd Mon Sep 17 00:00:00 2001 From: Play <165183773+Nguyen12345tt@users.noreply.github.com> Date: Tue, 23 Dec 2025 00:04:16 +0700 Subject: [PATCH 3/9] Update README.md --- README.md | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 1835f2d..aa52b74 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This package contains two programs: Supported images: -Windows Vista, Windows 7, Window 8.x, Windows 10. All languages and any version (home, pro...) and Windows PE are supported. +Windows Vista, Windows 7, Window 8.x, Windows 10, Windows 11. All languages and any version (home, pro...) and Windows PE are supported. Supported bootmodes: @@ -21,32 +21,6 @@ Supported bootmodes: This project rewrite of original [WoeUSB](https://github.com/slacka/WoeUSB) -## Installation - -### Arch -```shell -yay -S woeusb-ng -``` - -### For other distributions - -### 1. Install WoeUSB-ng's Dependencies -#### Ubuntu - -```shell -sudo apt install git p7zip-full python3-pip python3-wxgtk4.0 grub2-common grub-pc-bin parted dosfstools ntfs-3g -``` - -#### Fedora (tested on: Fedora Workstation 33) -```shell -sudo dnf install git p7zip p7zip-plugins python3-pip python3-wxpython4 -``` - -### 2. Install WoeUSB-ng -```shell -sudo pip3 install WoeUSB-ng -``` - ## Installation from source code ### 1. Install WoeUSB-ng's Build Dependencies @@ -83,9 +57,11 @@ Please note that this will not create menu shortcut and you may need to run gui To remove WoeUSB-ng completely run (needed only when using installation from source code): ```shell sudo pip3 uninstall WoeUSB-ng + sudo rm /usr/share/icons/WoeUSB-ng/icon.ico \ /usr/share/applications/WoeUSB-ng.desktop \ /usr/local/bin/woeusbgui + sudo rmdir /usr/share/icons/WoeUSB-ng/ ``` From 52be10dc8daa681508f51eb8df27debc4c5ed97d Mon Sep 17 00:00:00 2001 From: Play <165183773+Nguyen12345tt@users.noreply.github.com> Date: Wed, 24 Dec 2025 19:51:04 +0700 Subject: [PATCH 4/9] Update repository URL in installation instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa52b74..5d66a4d 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ sudo pip3 install . ## Installation from source code locally or in virtual environment ```shell -git clone https://github.com/WoeUSB/WoeUSB-ng.git +git clone https://github.com/Nguyen12345tt/WoeUSB-ng.git cd WoeUSB-ng git apply development.patch sudo pip3 install -e . From c1dd5d12febfe588082c59d135cb2e2c9ebed994 Mon Sep 17 00:00:00 2001 From: Play <165183773+Nguyen12345tt@users.noreply.github.com> Date: Wed, 24 Dec 2025 19:52:13 +0700 Subject: [PATCH 5/9] Update WoeUSB-ng repository link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d66a4d..8ebf1ef 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ sudo dnf install git p7zip p7zip-plugins python3-pip python3-wxpython4 ``` ### 2. Install WoeUSB-ng ```shell -git clone https://github.com/WoeUSB/WoeUSB-ng.git +git clone https://github.com/Nguyen12345tt/WoeUSB-ng.git cd WoeUSB-ng sudo pip3 install . ``` From c048828d36c697742584ccceed9383f4cf4d8281 Mon Sep 17 00:00:00 2001 From: Nguyen12345tt Date: Wed, 24 Dec 2025 22:02:54 +0700 Subject: [PATCH 6/9] Bump version to Alpha --- WoeUSB/miscellaneous.py | 2 +- doc/conf.py | 12 ++++++------ setup.py | 20 +++++++++++++++----- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/WoeUSB/miscellaneous.py b/WoeUSB/miscellaneous.py index a4220bf..f9f818e 100644 --- a/WoeUSB/miscellaneous.py +++ b/WoeUSB/miscellaneous.py @@ -2,7 +2,7 @@ import locale import os -__version__ = "0.2.13-alpha" +__version__ = "0.2.14-alpha" translation = gettext.translation("woeusb", os.path.dirname(__file__) + "/locale", [locale.getlocale()[0]], fallback=True) translation.install() diff --git a/doc/conf.py b/doc/conf.py index 9760f1d..c828911 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -19,14 +19,14 @@ # -- Project information ----------------------------------------------------- -project = 'WoeUSB' -copyright = '2018, congelli501, slacka and WaxyMocha et. al.' -author = 'congelli501, slacka and WaxyMocha et. al.' +project = 'WoeUSB+' +copyright = '2018-2026, congelli501, slacka, WaxyMocha, Nguyen12345tt, et. al.' +author = 'Nguyen12345tt, based on work by congelli501, slacka and WaxyMocha et. al.' # The short X.Y version -version = '' +version = '0.2' # The full version, including alpha/beta/rc tags -release = '1.0.0' +release = '0.2.14-alpha' # -- General configuration --------------------------------------------------- @@ -131,7 +131,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'WoeUSB.tex', 'WoeUSB Documentation', - 'congelli501, slacka and WaxyMocha et. al.', 'manual'), + 'Nguyen12345tt, congelli501, slacka and WaxyMocha et. al.', 'manual'), ] diff --git a/setup.py b/setup.py index 8f80126..351fc61 100644 --- a/setup.py +++ b/setup.py @@ -48,13 +48,23 @@ def run(self): setup( name='WoeUSB-ng', - version='0.2.13-alpha', - description='WoeUSB-ng is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD. This is a rewrite of original WoeUSB. ', + version='0.2.14-alpha', + + # Add + description='WoeUSB-ng fork with Windows 11 Bypass (TPM, SecureBoot, MS Account) & BitLocker fix. Originally by congelli501 & slacka.', + long_description=long_description, long_description_content_type='text/markdown', - url='https://github.com/WoeUSB/WoeUSB-ng', - author='Jakub Szymański', - author_email='jakubmateusz@poczta.onet.pl', + + # SỬA DÒNG NÀY: Link về kho GitHub của bạn + url='https://github.com/Nguyen12345tt/WoeUSB-ng', + + # SỬA DÒNG NÀY: Để khẳng định chủ quyền + author='Nguyen12345tt', + + # SỬA DÒNG NÀY: Email của bạn (để trống hoặc điền email thật) + author_email='thanhnguyennguyen496@gmail.com', + license='GPL-3', zip_safe=False, packages=['WoeUSB'], From 7de76787960d1f46c080d927202566d5f4cedfc9 Mon Sep 17 00:00:00 2001 From: Nguyen12345tt Date: Wed, 24 Dec 2025 22:03:12 +0700 Subject: [PATCH 7/9] Clean code --- WoeUSB/core.py | 28 ++++++++++++++-------------- WoeUSB/gui.py | 12 ++++++------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/WoeUSB/core.py b/WoeUSB/core.py index f258011..6743ef6 100644 --- a/WoeUSB/core.py +++ b/WoeUSB/core.py @@ -22,8 +22,8 @@ application_version = miscellaneous.__version__ DEFAULT_NEW_FS_LABEL = 'Windows USB' -application_site_url = 'https://github.com/slacka/WoeUSB' -application_copyright_declaration = "Copyright © Colin GILLE / congelli501 2013\\nCopyright © slacka et.al. 2017" +application_site_url = 'https://github.com/Nguyen12345tt/WoeUSB' +application_copyright_declaration = "Copyright © Colin GILLE / congelli501 2013\\nCopyright © slacka et.al. 2017\\nCopyright © Nguyen12345tt" application_copyright_notice = application_name + " is free software licensed under the GNU General Public License version 3(or any later version of your preference) that gives you THE 4 ESSENTIAL FREEDOMS\\nhttps://www.gnu.org/philosophy/" #: Increase verboseness, provide more information when required @@ -41,7 +41,7 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, workaround_bios_boot_flag=False, target_filesystem_type="FAT", filesystem_label=DEFAULT_NEW_FS_LABEL, - bypass_workaround=False, bypass_ms_account=False, disable_bitlocker=False): + bypass_hardware_check = False, bypass_ms_account = False, disable_bitlocker=False): """ :param from_cli: :type from_cli: bool @@ -51,7 +51,7 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, :param workaround_bios_boot_flag: :param target_filesystem_type: :param filesystem_label: - :param bypass_workaround: Bypass TPM/SecureBoot/RAM + :param bypass_hardware_check: Bypass TPM/SecureBoot/RAM :param bypass_ms_account: Bypass Microsoft Account Requirement :param disable_bitlocker: Disable BitLocker Device Encryption :return: List @@ -72,7 +72,7 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, parser = None # Initialize default flags - bypass_workaround_flag = bypass_workaround + bypass_hardware_check_flag = bypass_hardware_check bypass_ms_account_flag = bypass_ms_account disable_bitlocker_flag = disable_bitlocker @@ -106,7 +106,7 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, filesystem_label = args.label # Capture CLI arguments for Windows 11 tweaks - bypass_workaround_flag = args.bypass_workaround + bypass_hardware_check_flag = args.bypass_hardware_check bypass_ms_account_flag = args.bypass_ms_account disable_bitlocker_flag = args.disable_bitlocker @@ -124,14 +124,14 @@ def init(from_cli=True, install_mode=None, source_media=None, target_media=None, # Added new flags to the return list return [source_fs_mountpoint, target_fs_mountpoint, temp_directory, install_mode, source_media, target_media, workaround_bios_boot_flag, skip_legacy_bootloader, target_filesystem_type, filesystem_label, verbose, debug, parser, - bypass_workaround_flag, bypass_ms_account_flag, disable_bitlocker_flag] + bypass_hardware_check_flag, bypass_ms_account_flag, disable_bitlocker_flag] else: return [source_fs_mountpoint, target_fs_mountpoint, temp_directory, target_media] def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, install_mode, temp_directory, target_filesystem_type, workaround_bios_boot_flag, parser=None, skip_legacy_bootloader=False, - bypass_workaround_flag=False, bypass_ms_account_flag=False, disable_bitlocker_flag=False): + bypass_hardware_check_flag=False, bypass_ms_account_flag=False, disable_bitlocker_flag=False): """ :param parser: :param source_fs_mountpoint: @@ -142,7 +142,7 @@ def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, :param temp_directory: :param target_filesystem_type: :param workaround_bios_boot_flag: - :param bypass_workaround_flag: Hardware bypass + :param bypass_hardware_check_flag: Hardware bypass :param bypass_ms_account_flag: MS Account bypass :param disable_bitlocker_flag: BitLocker disable :return: 0 - succes; 1 - failure @@ -214,12 +214,12 @@ def main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, copy_filesystem_files(source_fs_mountpoint, target_fs_mountpoint) # --- START WINDOWS 11 TWEAKS LOGIC --- - if bypass_workaround_flag or bypass_ms_account_flag or disable_bitlocker_flag: + if bypass_hardware_check_flag or bypass_ms_account_flag or disable_bitlocker_flag: utils.print_with_color(_("Applying Windows 11 customizations..."), "green") if hasattr(utils, 'write_win11_bypass'): utils.write_win11_bypass( target_fs_mountpoint, - bypass_hardware=bypass_workaround_flag, + bypass_hardware=bypass_hardware_check_flag, bypass_ms_account=bypass_ms_account_flag, disable_bitlocker=disable_bitlocker_flag ) @@ -684,7 +684,7 @@ def setup_arguments(): help="Specify the filesystem to use as the target partition's filesystem.") # --- NEW ARGUMENTS --- - parser.add_argument("--bypass-workaround", action="store_true", + parser.add_argument("--bypass_hardware_check", action="store_true", help="Bypass Windows 11 TPM 2.0 / Secure Boot requirements.") parser.add_argument("--bypass-ms-account", action="store_true", help="Bypass Microsoft Account Requirement (allows offline account creation).") @@ -758,13 +758,13 @@ def run(): install_mode, source_media, target_media, \ workaround_bios_boot_flag, skip_legacy_bootloader, target_filesystem_type, \ new_file_system_label, verbose, debug, parser, \ - bypass_workaround_flag, bypass_ms_account_flag, disable_bitlocker_flag = result + bypass_hardware_check_flag, bypass_ms_account_flag, disable_bitlocker_flag = result try: # Updated main call to include new flags main(source_fs_mountpoint, target_fs_mountpoint, source_media, target_media, install_mode, temp_directory, target_filesystem_type, workaround_bios_boot_flag, parser, skip_legacy_bootloader, - bypass_workaround_flag, bypass_ms_account_flag, disable_bitlocker_flag) + bypass_hardware_check_flag, bypass_ms_account_flag, disable_bitlocker_flag) except KeyboardInterrupt: pass except Exception as error: diff --git a/WoeUSB/gui.py b/WoeUSB/gui.py index e7d9f79..18a27fc 100644 --- a/WoeUSB/gui.py +++ b/WoeUSB/gui.py @@ -310,7 +310,7 @@ def on_install(self, __): filesystem=filesystem, skip_grub=self.__parent.options_skip_grub.IsChecked(), # Truyền các giá trị từ Popup xuống Handler - bypass_workaround=bypass_hw, + bypass_hardware_check=bypass_hw, bypass_ms_account=bypass_ms, disable_bitlocker=no_bitlocker ) @@ -384,8 +384,8 @@ def __init__(self, parent, ID=wx.ID_ANY, title=_("About"), pos=wx.DefaultPositio self.__NotebookAutorLicence = wx.Notebook(self, wx.ID_ANY) self.__NotebookAutorLicence.AddPage( - PanelNoteBookAutors(self.__NotebookAutorLicence, wx.ID_ANY, "slacka \nLin-Buo-Ren\nWaxyMocha", data_directory + "woeusb-logo.png", - "github.com/WoeUSB/WoeUSB-ng"), _("Authors"), True) + PanelNoteBookAutors(self.__NotebookAutorLicence, wx.ID_ANY, "Nguyen12345tt\n (Based on work by slacka \nLin-Buo-Ren\nWaxyMocha)", data_directory + "woeusb-logo.png", + "github.com/Nguyen12345tt/WoeUSB-ng"), _("Authors"), True) self.__NotebookAutorLicence.AddPage( PanelNoteBookAutors(self.__NotebookAutorLicence, wx.ID_ANY, "Colin GILLE / Congelli501", data_directory + "c501-logo.png", "www.congelli.eu"), _("Original WinUSB Developer"), False) @@ -454,7 +454,7 @@ class WoeUSB_handler(threading.Thread): kill = False def __init__(self, source, target, boot_flag, filesystem, skip_grub=False, - bypass_workaround=False, bypass_ms_account=False, disable_bitlocker=False): + bypass_hardware_check=False, bypass_ms_account=False, disable_bitlocker=False): threading.Thread.__init__(self) core.gui = self @@ -463,7 +463,7 @@ def __init__(self, source, target, boot_flag, filesystem, skip_grub=False, self.boot_flag = boot_flag self.filesystem = filesystem self.skip_grub = skip_grub - self.bypass_workaround = bypass_workaround + self.bypass_hardware_check = bypass_hardware_check self.bypass_ms_account = bypass_ms_account self.disable_bitlocker = disable_bitlocker @@ -477,7 +477,7 @@ def run(self): try: core.main(source_fs_mountpoint, target_fs_mountpoint, self.source, self.target, "device", temp_directory, self.filesystem, self.boot_flag , None, self.skip_grub, - self.bypass_workaround, self.bypass_ms_account, self.disable_bitlocker) + self.bypass_hardware_check, self.bypass_ms_account, self.disable_bitlocker) except SystemExit: pass From 5212b55b4778435eff1a0071e2c1ae87f9d77fe9 Mon Sep 17 00:00:00 2001 From: Nguyen12345tt Date: Thu, 1 Jan 2026 17:16:12 +0700 Subject: [PATCH 8/9] feat: Add Windows 11 Bypass (TPM, SecureBoot, MS Account) [UNTESTED] --- WoeUSB/utils.py | 171 ++++++++++++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 70 deletions(-) diff --git a/WoeUSB/utils.py b/WoeUSB/utils.py index 27aeaaf..b857c51 100644 --- a/WoeUSB/utils.py +++ b/WoeUSB/utils.py @@ -331,49 +331,47 @@ def update_policy_to_allow_for_running_gui_as_root(path): dom = parseString( "" "\n" - " The WoeUSB Project\n" - " https://github.com/slacka/WoeUSB\n" - " woeusbgui-icon\n" + "'http://www.freedesktop.org/software/polkit/policyconfig-1.dtd'>\n" + " The WoeUSB Project\n" + " https://github.com/slacka/WoeUSB\n" + " woeusbgui-icon\n" "\n" - " \n" - " Run `woeusb` as SuperUser\n" - " 以超級使用者(SuperUser)身份執行 `woeusb`\n" - " Uruchom `woeusb` jako root\n" - " \n" - " Authentication is required to run `woeusb` as SuperUser.\n" - " 以超級使用者(SuperUser)身份執行 `woeusb` 需要通過身份驗證。\n" - " Wymagana jest autoryzacja do uruchomienia `woeusb` jako root\n" - " \n" - " \n" - " auth_admin\n" - " auth_admin\n" - " auth_admin_keep\n" - " \n" - " \n" - " /usr/local/bin/woeusbgui\n" - " true\n" - " \n" - " \n" - " Run `woeusb` as SuperUser\n" - " 以超級使用者(SuperUser)身份執行 `woeusb`\n" - " Uruchom `woeusb` jako root\n" + " \n" + " Run `woeusb` as SuperUser\n" + " 以超級使用者(SuperUser)身份執行 `woeusb`\n" + " Uruchom `woeusb` jako root\n" + " \n" + " Authentication is required to run `woeusb` as SuperUser.\n" + " 以超級使用者(SuperUser)身份執行 `woeusb` 需要通過身份驗證。\n" + " Wymagana jest autoryzacja do uruchomienia `woeusb` jako root\n" + " \n" + " \n" + " auth_admin\n" + " auth_admin\n" + " auth_admin_keep\n" + " \n" + " \n" + " /usr/local/bin/woeusbgui\n" + " true\n" + " \n" + " \n" + " Run `woeusb` as SuperUser\n" + " 以超級使用者(SuperUser)身份執行 `woeusb`\n" + " Uruchom `woeusb` jako root\n" "\n" - " Authentication is required to run `woeusb` as SuperUser.\n" - " 以超級使用者(SuperUser)身份執行 `woeusb` 需要通過身份驗證。\n" - " Wymagana jest autoryzacja do uruchomienia `woeusb` jako root\n" + " Authentication is required to run `woeusb` as SuperUser.\n" + " 以超級使用者(SuperUser)身份執行 `woeusb` 需要通過身份驗證。\n" + " Wymagana jest autoryzacja do uruchomienia `woeusb` jako root\n" "\n" - " \n" - " auth_admin\n" - " auth_admin\n" - " auth_admin_keep\n" - " \n" + " \n" + " auth_admin\n" + " auth_admin\n" + " auth_admin_keep\n" + " \n" "\n" - " /usr/local/bin/woeusbgui\n" - " true\n" - " \n" + " /usr/local/bin/woeusbgui\n" + " true\n" + " \n" "" ) for action in dom.getElementsByTagName('action'): @@ -387,50 +385,44 @@ def update_policy_to_allow_for_running_gui_as_root(path): def write_win11_bypass(target_mountpoint, bypass_hardware=False, bypass_ms_account=False, disable_bitlocker=False): """ - Tạo file autounattend.xml dựa trên các tùy chọn được bật. + Tạo file autounattend.xml với 2 giai đoạn (passes): + 1. windowsPE: Để bypass kiểm tra phần cứng (Hardware Check). + 2. specialize: Để bypass tài khoản MS và Bitlocker (Tác động vào hệ điều hành đã cài). """ check_kill_signal() if not (bypass_hardware or bypass_ms_account or disable_bitlocker): - return True # Không làm gì nếu không có tùy chọn nào được bật + return True print_with_color(_("Writing Windows 11 custom configuration (autounattend.xml)..."), "green") - # Danh sách các lệnh Registry cần thêm - reg_commands = [] - - # 1. Bypass Hardware (TPM, SecureBoot, RAM) + # --- GIAI ĐOẠN 1: windowsPE (Chạy TRƯỚC khi cài đặt) --- + # Dùng để lừa bộ cài (Setup) bỏ qua kiểm tra phần cứng + pe_commands = [] if bypass_hardware: base_path = r"HKLM\SYSTEM\Setup\LabConfig" - reg_commands.append(f"reg add {base_path} /v BypassTPMCheck /t REG_DWORD /d 1 /f") - reg_commands.append(f"reg add {base_path} /v BypassSecureBootCheck /t REG_DWORD /d 1 /f") - reg_commands.append(f"reg add {base_path} /v BypassRAMCheck /t REG_DWORD /d 1 /f") - reg_commands.append(f"reg add {base_path} /v BypassCPUCheck /t REG_DWORD /d 1 /f") - reg_commands.append(f"reg add {base_path} /v BypassStorageCheck /t REG_DWORD /d 1 /f") - - # 2. Bypass Microsoft Account (Network Requirement) - if bypass_ms_account: - reg_commands.append(r"reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE /v BypassNRO /t REG_DWORD /d 1 /f") - - # 3. Disable BitLocker (Prevent Device Encryption) - if disable_bitlocker: - reg_commands.append(r"reg add HKLM\SYSTEM\CurrentControlSet\Control\BitLocker /v PreventDeviceEncryption /t REG_DWORD /d 1 /f") - - # Tạo nội dung XML động - xml_commands = "" - for index, cmd in enumerate(reg_commands, start=1): - xml_commands += f""" + pe_commands.append(f"reg add {base_path} /v BypassTPMCheck /t REG_DWORD /d 1 /f") + pe_commands.append(f"reg add {base_path} /v BypassSecureBootCheck /t REG_DWORD /d 1 /f") + pe_commands.append(f"reg add {base_path} /v BypassRAMCheck /t REG_DWORD /d 1 /f") + pe_commands.append(f"reg add {base_path} /v BypassCPUCheck /t REG_DWORD /d 1 /f") + pe_commands.append(f"reg add {base_path} /v BypassStorageCheck /t REG_DWORD /d 1 /f") + + # Tạo nội dung XML cho windowsPE + xml_pe_content = "" + if pe_commands: + xml_pe_cmds = "" + for index, cmd in enumerate(pe_commands, start=1): + xml_pe_cmds += f""" {index} - {cmd} + cmd /c {cmd} """ - - xml_content = f""" - + + xml_pe_content = f""" - {xml_commands} + {xml_pe_cmds} @@ -439,14 +431,53 @@ def write_win11_bypass(target_mountpoint, bypass_hardware=False, bypass_ms_accou true - + """ + + # --- GIAI ĐOẠN 2: specialize (Chạy SAU khi cài, trước khi vào User) --- + # Dùng để tác động vào Windows thật trên ổ cứng (Bypass Account, BitLocker) + specialize_commands = [] + + # 2. Bypass Microsoft Account (Network Requirement) + if bypass_ms_account: + # Quan trọng: Lệnh này phải chạy trên OS thật + specialize_commands.append(r"reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE /v BypassNRO /t REG_DWORD /d 1 /f") + + # 3. Disable BitLocker + if disable_bitlocker: + specialize_commands.append(r"reg add HKLM\SYSTEM\CurrentControlSet\Control\BitLocker /v PreventDeviceEncryption /t REG_DWORD /d 1 /f") + + # Tạo nội dung XML cho specialize + xml_specialize_content = "" + if specialize_commands: + xml_specialize_cmds = "" + for index, cmd in enumerate(specialize_commands, start=1): + xml_specialize_cmds += f""" + + {index} + cmd /c {cmd} + """ + + xml_specialize_content = f""" + + + + {xml_specialize_cmds} + + + """ + + # Gộp toàn bộ file XML + full_xml_content = f""" + + {xml_pe_content} + {xml_specialize_content} """ target_file = os.path.join(target_mountpoint, "autounattend.xml") try: with open(target_file, "w") as f: - f.write(xml_content) + f.write(full_xml_content) print_with_color(_("Success: autounattend.xml created at {0}").format(target_file), "green") return True except IOError as e: From 048846335483b59704c11c5050707c9583a94360 Mon Sep 17 00:00:00 2001 From: Play <165183773+Nguyen12345tt@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:04:08 +0700 Subject: [PATCH 9/9] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here.