• 0

Replacing a file in a CAB file


Question

Does anyone know how to replace a file in a CAB file without corrupting the CAB file?

I want to install a program using a setup.exe file. It uses a CAB file as part of installtion. However, I need to change one of the INF files inside the CAB file to make the program work for my hardware. Now, I can use PowerArchiver to extract the files from the CAB file, edit and replace the INF file that I want to change, and then repack all the files back to a CAB file (I've tried using CABARC.EXE but it doesn't support long file names/extensions.)

However, when I run setup.exe again, it gives me an error that the CAB file is corrupt because it can't find a file inside the CAB file. (The file it refers to is not the INF file that I editted but the first file in the list when sorted in alphabetical order).

How can I edit a CAB file and still make it valid for installation??? :unsure:

Edited by Conquerz
Link to comment
https://www.neowin.net/forum/topic/563204-replacing-a-file-in-a-cab-file/
Share on other sites

3 answers to this question

Recommended Posts

  • 0

There's really no context here, so this could be either of three errors - either you didn't edit the INF properly (there should be at least three references to the file in question, IIRC), or you've just invalidated a security signature, or you've saved it out as the wrong CAB subtype. That's just guessing based upon my experience in this field.

  • 0
  zachdms said:
There's really no context here, so this could be either of three errors - either you didn't edit the INF properly (there should be at least three references to the file in question, IIRC), or you've just invalidated a security signature, or you've saved it out as the wrong CAB subtype. That's just guessing based upon my experience in this field.

Thanks for the response zachdms. I don't think editing the INF could have caused such a big problem as not being able to find files in the CAB. I only made minor changes to the INF. I just changed the name of the driver ID, that?s all. The setup.exe file is supposed to extract the files inside the CAB and then deal with them. But it seems that it can't even extract them. So the problem is with the CAB file and not the INF.

As for the CAB file itself, I did repack it using the same compression type as it was originally compressed with (i.e. LZX:21).

One thing I've noticed however is that the size of the repacked CAB file is smaller than the size of the original CAB file. I am not sure why there has been a size difference. Maybe some data was lost during the repacking process? All the files are still there.

Maybe a signature issue?

Do you know of any method where I could extract a file, edit it, and put it back into the CAB file without corrupting it???

Thanks.

  • 0

I can pretty easily get that exact type of error to occur via taking a valid CAB and modifying the associated INF - it's not difficult, and I recognize the message you get can be confusing. You may want to check your %temp% directory to see whether it is actually extracted, which would give you an actual answer on that end.

There's cab subtypes that have different headers - I wasn't referring to LZX/Diamond/etc compression, but rather that the same basic CAB format gets reused by various companies with specific extensions. Again, you have provided zero details, so we're all guessing.

Since there's no details here and this isn't a valid product on the market, just an attempt to hack something together, I think I'm done with this. Talk to the manufacturer. :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • qBittorrent 5.1.1 by Razvan Serea The qBittorrent project aims to provide a Free Software alternative to µtorrent. qBittorrent is an advanced and multi-platform BitTorrent client with a nice user interface as well as a Web UI for remote control and an integrated search engine. qBittorrent aims to meet the needs of most users while using as little CPU and memory as possible. qBittorrent is a truly Open Source project, and as such, anyone can and should contribute to it. qBittorrent features: Polished µTorrent-like User Interface Well-integrated and extensible Search Engine Simultaneous search in most famous BitTorrent search sites Per-category-specific search requests (e.g. Books, Music, Movies) All Bittorrent extensions DHT, Peer Exchange, Full encryption, Magnet/BitComet URIs, ... Remote control through a Web user interface Nearly identical to the regular UI, all in Ajax Advanced control over trackers, peers and torrents Torrents queueing and prioritizing Torrent content selection and prioritizing UPnP / NAT-PMP port forwarding support Available in ~25 languages (Unicode support) Torrent creation tool Advanced RSS support with download filters (inc. regex) Bandwidth scheduler IP Filtering (eMule and PeerGuardian compatible) IPv6 compliant Available on most platforms: Linux, Mac OS X, Windows, OS/2, FreeBSD qBittorrent 5.1.1 changelog: BUGFIX: Don't interpret wildcard pattern as filepath globbing (glassez) BUGFIX: Fix appearance of search history length spinbox (glassez) BUGFIX: Remove dubious seeding time max value (glassez) BUGFIX: Fix ratio handling (glassez) BUGFIX: Fix compilation with Qt 6.6.0 (glassez) WEBUI: Make General tab text selectable by default (dezza) WEBUI: Add versioning to local preferences (Chocobo1) WEBUI: Make multi-rename search & replace fields use a monospace font (Atk) WEBUI: Fix wrong replacement sequence in IPv6 string (Chocobo1) WEBUI: Fix memory leak (bolshoytoster) WEBUI: Fix path autofill in set location and new category (tehcneko) RSS: Mark matched article as "read" if it refers to a duplicate torrent (glassez) WINDOWS: Update command line help message (KanishkaHalder1771) WINDOWS: NSIS: Don't require agreement on the license page (Chocobo1) LINUX: Fix preview not opening on Wayland (Isak05) LINUX: Add fallback for random number generator (Chocobo1) Download: qBittorrent 5.1.1 | Portable | ~40.0 MB (Open Source) Download: qBittorrent 64-bit installer (qt6) | 41.7 MB Links: qBittorrent Home page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Linus Torvalds releases a pretty ordinary Linux 6.16-rc3 by Paul Hill Linus Torvalds, the head and founder of the Linux kernel, has announced the release of Linux 6.16-rc3. This release comes with fixes for new features that were introduced during the merge window several weeks ago, and for old features where issues have been detected or improvements need to be made. If you remember last week, Torvalds said that rc2 seemed smaller than usual, putting it down to people going on vacation. He said this week’s rc3 seems to be in the usual ballpark for this time of the cycle, so everything looks “entirely normal.” In terms of changes, this release is “dominated” by wireless networking and GPU driver updates, however, Torvalds doesn’t think that anything really huge stands out this time. While nothing stands out Torvalds urged people to carry on testing and submitting patches. This update saw improvements to the core system and architecture. There have been improvements to ARM64 KVM that improve stability and correctness of virtualizations on ARM64. There are also improvements to RISC-V KVM and Trust Domain Extensions (TDX) for Intel which expand and secure virtualization capabilities on those architectures. On the graphics front, there are fixes for the amdgpu and amdkfd drivers that fix job handling, engine resets, display corruption, and power management features. The driver used for Qualcomm’s Adreno GPUs has been updated to improve fault handling, display timing, and driver binding. The open-source Nouveau (Nvidia) driver has been updated with fixes for GSP message queue references, potential integer overflows, buffer size adjustments, and a use-after-free bug. Finally, the Intel i915 driver has been updated to address early wedge issues, memory initializations, and build errors. There are also improvements to Wi-Fi devices (ath12k and iwlwifi), sound (ALSA), power management on AMD, and file system improvements (OverlayFS, EROFS, XFS, NFS, SunRPC). Linux 6.16 is due for release at the end of July and will then be picked up by Linux distributions, which will be the first interaction most end users have with the new features in this update. The main benefit of a newer kernel is that Linux will work on newer hardware, so if you’ve had issues with Linux, be sure to try it periodically in case your hardware is now supported.
    • Technically, it should be account-bound after activating it
  • Recent Achievements

    • Week One Done
      urbanmopdubai1 earned a badge
      Week One Done
    • One Month Later
      Jim Dugan earned a badge
      One Month Later
    • First Post
      Johnny Mrkvička earned a badge
      First Post
    • Week One Done
      viraltui earned a badge
      Week One Done
    • One Month Later
      serfegyed earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      649
    2. 2
      Michael Scrip
      226
    3. 3
      ATLien_0
      218
    4. 4
      Steven P.
      150
    5. 5
      Xenon
      145
  • Tell a friend

    Love Neowin? Tell a friend!