• 0

Help Creating a Patch


Question

Hi! I found some info in this forum about patching a program but not a complete guide.. Lets say i have 1.exe .This exe contains some textboxes.. i want to create a second exe (2.exe) which will be able to patch all or one value of textbox in the 1.exe.

As i said i found in this forum info about creating the 2.exe BUT in an exe which was build with microsoft studio 2010(vb.net or c# etc..) i cannot find strings using w32dasm.. My plan was to open w32dasm and find the address of the string that i want to replace and then patch the address with 2.exe...

So HOW to find the address of a string/textbox.text(value) of an exe?

i can find the strings of an exe which was build by vb6 but not from an exe which was build by vb.net 2010..

Please help me..

Thanks!

Link to comment
https://www.neowin.net/forum/topic/1107347-help-creating-a-patch/
Share on other sites

Recommended Posts

  • 0

I believe what you are referring to is program disassembly, not patching. Generally, a patch is generated using 'diff' and applied using 'patch', a process commonly known as patching. The assumption with patch is usually that you have access to the full source code of the program, which it sounds like you do not. It does not actually help you modify the program in any way.

As for disassembly, it sounds like you don't quite have a firm grasp on the basic concepts yet. I recommend that you read this primer on x86 program disassembly. While it won't specifically answer your question, it should at least give you a better understanding of how programs work and how to find program elements in assembly.

Finally, I believe that your specific problem may have something to do with the utility you are using. While w32dasm has been an excellent win32 disassembler for many years, it is no longer supported (since the last release in 2003) and has a few limitations. The most prominent of which are that it cannot disassemble 64-bit executables and does not work with managed languages, such as .NET and Java. Most likely the reason you can disassemble VB6 executables but not VB.NET 2010 is because after Visual Basic 6, Microsoft transitioned it to use the .NET Framework, hence the name.

  • 0

Why not just recompile the application with the changes you want?

because i want the user to be able to do it.. i make a project for someone.. he wants to "generate" an exe with his own specifications..

so the 1.exe will be the program with NULL values in textboxes.. and the 2.exe will be "patcher"..it will update the textboxe's values of 1.exe.. then he can use the 1.exe with these values.. you understand me? Thanks!

  • 0

Perhaps consider changing the source files rather than the exe?

Generate an exe to read your source files, find the specific classes, open them in a stream reader and replace the text you need changed.

eg: Textbox1.Text = Null; -> Textbox1.Text = "Whatever";

Then the user himself merely has to recompile.

I don't know that what you want done is possible in .net. It might be, but I don't know of a way..

  • 0

because i want the user to be able to do it.. i make a project for someone.. he wants to "generate" an exe with his own specifications..

so the 1.exe will be the program with NULL values in textboxes.. and the 2.exe will be "patcher"..it will update the textboxe's values of 1.exe.. then he can use the 1.exe with these values.. you understand me? Thanks!

Are you telling me that you want your user to learn how to use a disassembler?! I suspect not, but I'm having a little trouble figuring out exactly what you are planning on using the disassembler for now.

If you want the user to be able to generate a customized executable so that it can be distributed with user-defined settings and no external configuration file, you are probably going about it the wrong way. It would probably be easiest to generate a configuration file (such as XML or INI) when the user saves his settings. It would be easiest to have the user simply distribute this file with the executable so his defaults can easily be loaded. If everything must be contained in a single executable, the easiest option is to use an installer, such as NSIS, to package both together and extract them when executed. Another option, which I have looked into but never actually implemented, would be to embed the configuration file into a copy of your executable as a resource, then instruct the program to look for the resource every time it is run.

  • 0

Let me explain you.first of all thanks everyone!!

I work to someone online and make a program for him. He will sell the program to MANY people.. Someone will HAVE to buy 2 programs because the guy im working to, do not want to compile the project all the time and he wants his customers to be able to MAKE THEIR EXE WITH THEIR VALUES :)

so someone will buy these 2 programs.

1.exe is the standard program with NULL VALUES

2.exe is a program which will run and have 3 textboxes. Customer will add in first textfiled his Phone,second textfield his Email and third textfield his address. The he will click CREATE EXE button and the 1.exe will get these values to HIS 3 textfields..now everytime someone openes 1.exe it will contain these values and it will not be null..

:)

  • 0

www.clickteam.com

Use install creator or patch maker, loads of companies use them to make game patches and it does what you're after (differential patching)

That is AWESOME! I have never seen something like that before, but I really like it.

I'm not sure it solves the problem at hand though. On second thought, maybe it could be used for this purpose, I'm just not sure exactly how yet.

  • 0

Let me explain you.first of all thanks everyone!!

I work to someone online and make a program for him. He will sell the program to MANY people.. Someone will HAVE to buy 2 programs because the guy im working to, do not want to compile the project all the time and he wants his customers to be able to MAKE THEIR EXE WITH THEIR VALUES :)

so someone will buy these 2 programs.

1.exe is the standard program with NULL VALUES

2.exe is a program which will run and have 3 textboxes. Customer will add in first textfiled his Phone,second textfield his Email and third textfield his address. The he will click CREATE EXE button and the 1.exe will get these values to HIS 3 textfields..now everytime someone openes 1.exe it will contain these values and it will not be null..

:)

How are the values saved by 1.exe?

Can you just create an XML config file with your settings in it?

Sorry, this just seems like reinventing the wheel to me >.<

  • 0

Yeah just use XML or INI or SQL or anything like that, you can even embed it into the EXE (if needed) and just extract it when the program runs (have a header like #####SECRETHEADER) to look for and get the data after that.

Exactly what I was going to suggest next. You beat me to it. Needless to say, I agree.

  • 0

You can definitely embed resources into the exe.

The issue is that the guy compiling it would have to create the config file each time he compiled it.

You could even use internal variables and just have the guy edit them in.. Probably easier if you are taking that approach..

  • 0

i need these resources to be editable by the user via an other exe... :/

i have seen what i am asking in trojans in the looong past. user could put his ip/dns and create an exe..i think it was being done with patching.. i was too young..i just remember that..i want something similar..basically i want that thing but not for trojan lol thanks

  • 0


<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Settings>
<ServerPath>C:\Server\whatever.exe</ServerPath>
<PortNumber>8420</PortNumber>
<PortCheck>true</PortCheck>
<AutoStart>true</AutoStart>
</Settings>
</ArrayOfSettings>[/CODE]

That's how I do it. Simply create a structure (or class) containing your settings.

[CODE]
public struct Settings
{
public string ServerPath;
public int PortNumber;
public bool PortCheck;
public bool AutoStart;
}
[/CODE]

Then:

[CODE]
var xmlSerializer = new XmlSerializer(typeof (Settings[]));
var sWriter = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "Settings.xml", false);
xmlSerializer.Serialize(sWriter, settingsArray);
sWriter.Close();
[/CODE]

to write the settings out of the program, or the deserialize method to read the settings into the program.

This way the .exe is distributed all on it's own, but your program can create a settings file to work off of.

If the user needs to make changes, they can simply make a change in the .xml file (or in your application, or in a separate application that only makes the file etc etc etc)

You can embed this file as a resource and read it out of the resource instead of as a filesystem request. Then you just make the executable take the values and save them.. Might defy the point though >.>

EDIT::

I consulted with an expert on the subject, and he said it's possible, but it's a butt load of pain to do. He said that once values are changed in the initial compile, it becomes next to impossible to find in C++, and only marginally better in CLI language.

  • 0


<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Settings>
<ServerPath>C:\Server\whatever.exe</ServerPath>
<PortNumber>8420</PortNumber>
<PortCheck>true</PortCheck>
<AutoStart>true</AutoStart>
</Settings>
</ArrayOfSettings>[/CODE]

That's how I do it. Simply create a structure (or class) containing your settings.

[CODE]
public struct Settings
{
public string ServerPath;
public int PortNumber;
public bool PortCheck;
public bool AutoStart;
}
[/CODE]

Then:

[CODE]
var xmlSerializer = new XmlSerializer(typeof (Settings[]));
var sWriter = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "Settings.xml", false);
xmlSerializer.Serialize(sWriter, settingsArray);
sWriter.Close();
[/CODE]

to write the settings out of the program, or the deserialize method to read the settings into the program.

This way the .exe is distributed all on it's own, but your program can create a settings file to work off of.

If the user needs to make changes, they can simply make a change in the .xml file (or in your application, or in a separate application that only makes the file etc etc etc)

You can embed this file as a resource and read it out of the resource instead of as a filesystem request. Then you just make the executable take the values and save them.. Might defy the point though >.>

EDIT::

I consulted with an expert on the subject, and he said it's possible, but it's a butt load of pain to do. He said that once values are changed in the initial compile, it becomes next to impossible to find in C++, and only marginally better in CLI language.

thanks for your reply,that way is not standalone..the xml file HAS to be in the same folder with the exe..right? correct me if im wrong

  • 0

thanks for your reply,that way is not standalone..the xml file HAS to be in the same folder with the exe..right? correct me if im wrong

Yep.

Once you embed a resource, you can't access it easily as a user.

Hell, you can't access it easily outside of the application even if you wrote the application.

There really isn't a good way to do this :\

Best bet sounds like settings the values pre compile and just using constants >.>

  • 0

check here: https://www.neowin.net/forum/topic/1021544-help-me-making-a-patch-vbnet/

this guy asks how to patch an exe.. so this is enough heplfull..also someone else there posted a project about patching an other exe.. BUT in my exe i cannot find what is the offset address that need to be patched.. a vb6 exe shows the strings in w32dams.. vb.net exe file wont show the strings in w32dasm so i cannot get the address.. i tried other than w32dasm(as you mentioned w32dasm is old..) but still i cannot see the strings in order to get their address and change them...

  • 0

Compile with null values.

Compile a new exe with a different value.

Compare the two exes in binary (Google it), that should identify where the variables are stored in CLI.

Write a binary editor to insert the values.

Waste 5+ hours perfecting the above >.>

  • 0

Compile with null values.

Compile a new exe with a different value.

Compare the two exes in binary (Google it), that should identify where the variables are stored in CLI.

Write a binary editor to insert the values.

Waste 5+ hours perfecting the above >.>

in the past i used to patch some exe's from other people to change the program title(window title) just for fun.. the thing is that from old exes you could be able to read the string's offset address using w32dasm..but with new exes i cannot do that.. thats what im looking for..a program that will give me the address of the strings!

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

    • No registered users viewing this page.
  • Posts

    • So how did you solve the problem? Disabling Secure Boot isn’t a solution.
    • Another devilish issue surrounding these certificates is what can happen with old, unsuspecting PCs that nevertheless have Secure Boot enabled. In my case, it was a Dell with a 3rd-gen Core chip (so about 13 years old). As of the last few weeks, it was suddenly BSOD'g within about 5 minutes of booting. Turns out it was because of MS's "Secure-Boot-Update" scheduled task, which is scheduled to run 5 minutes after login. It's explained in gory detail here (this is not my post, but it was where I found the answer), but the short version is that this legacy system would need fairly elaborate, manual certificate intervention since MS's automatic cert update method cannot work. How to do that is linked late in the thread. https://www.bleepingcomputer.c...od-caused-by-scheduled-task Secure Boot wasn't at all important for this particular PC, so I disabled it to be done with the problem.
    • Winhance 26.06.12 by Razvan Serea Winhance is an open-source Windows enhancement utility designed to help users debloat, optimize, and customize Windows 10 and 11. It provides a user-friendly interface for removing unwanted apps, legacy components, and optional features safely, giving you more control over your system. With Winhance, you can improve performance, reduce clutter, and enhance privacy without the need for a clean install. Beyond basic debloating, Winhance offers extensive optimization tools. Users can tweak power plans, adjust gaming and performance settings, control notifications, and manage Windows Update behavior. Privacy-focused settings allow you to limit telemetry and data collection, while system customization options let you personalize the taskbar, Start menu, Explorer, and Windows themes. Winhance also supports installing or removing software efficiently, including external apps via WinGet integration, streamlining both new setups and daily maintenance. New AI privacy groups have been added for Windows AI, Microsoft Edge AI, and Microsoft Office AI, giving users clearer control over AI-related telemetry and feature usage. In addition, new settings in Gaming & Performance introduce AI taskbar pin toggles, options to remove AI apps, and controls for AI services and scheduled tasks, allowing users to better manage how AI components run in the background and appear in the system. For advanced users and IT professionals, Winhance integrates WIMUtil, a tool for creating custom Windows installation ISOs with automated configuration. You can generate autounattend.xml files, inject drivers, and apply your chosen Winhance settings automatically during installation. Most changes are non-destructive and reversible, with clear explanations in the GUI. Whether you’re optimizing a single PC or managing multiple systems, Winhance delivers a faster, cleaner, and highly personalized Windows experience. The Winhance.Installer.exe includes both Installable and Portable versions during setup. Winhance supports both Windows 10 and Windows 11 64-bit versions. It's regularly updated to ensure compatibility with the latest Windows updates and features. Winhance key features: Debloat Windows – Safely remove unwanted apps, features, and legacy components. Optimize Performance – Tune system settings for speed, responsiveness, and gaming. Privacy Enhancements – Control telemetry, data collection, and notifications. Power Management – Configure power plans and advanced energy settings. Windows Update Control – Adjust update behavior for stability and convenience. Theme Customization – Switch between light/dark mode and adjust system colors. Taskbar & Start Menu Tweaks – Modify layout, icons, and behavior. Explorer Customization – Adjust file explorer appearance and functionality. Software Management – Install/remove Windows apps and optional features. External Apps Installation – Deploy essential apps via WinGet integration. Configuration Management – Save, export, and import Winhance settings easily. Automation with WIMUtil – Create custom Windows ISOs with integrated settings. Autounattend.xml Generator – Automate Windows installations with preconfigured options. Driver Integration – Include current system drivers in custom ISOs. Non-Destructive Changes – Reversible settings with clear explanations in the GUI. Winhance 26.06.12 changelog: Features Builder Mode — build a Winhance config file or autounattend.xml without changing anything on the PC you're sitting at. Flip the new mode switcher to Builder, set everything the way you want it, and save the result as a Winhance config or an autounattend file ready for deployment on other machines. Sponsors & Supporters page — the exit donation dialog is gone. In its place, an in-app page (heart icon or the More menu) recognizes the businesses and individual supporters who keep Winhance free. It works offline and is fully localized. Change History — Winhance now keeps a receipt of everything it does. ChangeHistory.txt records every setting change (before and after values) and every app install or removal, with clear headers for config imports and bulk actions. Open it from the More menu. Hebrew language support — Winhance is now available in 29 languages. New Explorer customizations: desktop icon visibility toggles, This PC folder visibility, an icon cache size setting, and automatic thumbnail cache cleanup. New "All apps view" setting for the redesigned Windows 11 Start menu, and the Windows 11 system tray icons setting is now a dropdown with more control. App-local UI zoom — press Ctrl +/-/0 or use Ctrl+MouseWheel to scale the whole app, just like a browser. New External Apps: EA app, Ubisoft Connect, Battle.net, Rockstar Games Launcher, PowerShell, and Helium Browser. Bug Fixes Layouts no longer clip when the Windows text size slider is set above 100%. Accessibility: Narrator now announces setting names on toggles and dropdowns, previously unlabeled buttons are labeled, and progress updates are announced. Silent updates now respect your custom install location instead of reverting to the default. Cancel in Review Mode no longer clears your app selections. OneNote is now detected correctly for Win32 Click-to-Run installs. Clean Start Menu applies more reliably by also writing the group policy path. WinGet errors are no longer silent — error details now show in the terminal output. Fixed a startup crash on older Windows builds caused by a .NET runtime regression. Config import now converts power setting values correctly and no longer re-applies an already-active power plan. Improvements App icons load noticeably faster and cover almost everything now, including legacy capabilities and optional features — they come from a dedicated, checksum-validated icon repository and are fetched in parallel. Software & Apps polish: per-icon tooltips, extra table columns, an app sort dropdown, relocated search, and a cleaner compact view. A warning now appears when the Connected Devices Platform Service is set to Manual or Disabled, since some Windows features depend on it. Download: Winhance 26.06.12 | 61.5 MB (Open Source) Links: Winhance Website | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Microsoft Windows 11 Pro and Office Home & Business 2024 is still 69% off by Steven Parker Today's highlighted deal comes via our Apps + Software section of the Neowin Deals store, where you can save 69% on Windows 11 Pro + Microsoft Office Home & Business 2024. Upgrade your computing experience with Windows 11 Pro. This cutting-edge operating system boasts a sleek new design and advanced tools to help you work faster and smarter. From creative projects to gaming and beyond, Windows 11 delivers the power and flexibility you need to achieve your goals. With a focus on productivity, the new features are easy to learn and use, enhancing your workflow and efficiency. Whether you're a student, professional, gamer, or creative, Windows 11 Home has everything you need to take your productivity to the next level. New interface. easier on the eyes & easier to use Biometrics login*.Encrypted authentication & advanced antivirus defenses DirectX 12 Ultimate. Play the latest games with graphics that rival reality. DirectX 12 Ultimate comes ready to maximize your hardware* Screen space. Snap layouts, desktops & seamless redocking Widgets. Stay up-to-date with the content you love & the new you care about Microsoft Teams. Stay in touch with friends and family with Microsoft Teams, which can be seamlessly integrated into your taskbar** Wake & lock. Automatically wake up when you approach and lock when you leave Smart App Control. Provides a layer of security by only permitting apps with good reputations to be installed Windows Studio Effects. Designed with Background Blur, Eye Contact, Voice Focus, & Automatic Framing Touchscreen. For a true mouse-less or keyboard-less experience TPM 2.0. Helps prevent unwanted tampering Windows 11 Pro also includes a number of productivity-focused features, such as the ability to snap multiple windows together and create custom layouts, improved voice typing, and a new, more powerful search experience. Personal and professional users will enjoy a modern and secure computing experience, with improved performance and productivity features to help users get more done. Only on Windows 11 Pro If you require enterprise-oriented features for your daily professional tasks, then Windows 11 Pro is a better option. Set up with a local account (only when set up for work or school) Join Active Directory/Azure AD Hyper-V Windows Sandbox Microsoft Remote Desktop BitLocker device encryption Windows Information Protection Mobile device management (MDM) Group Policy Enterprise State Roaming with Azure Assigned Access Dynamic Provisioning Windows Update for Business Kiosk mode Maximum RAM: 2TB Maximum no. of CPUs: 2 Maximum no. of CPU cores: 128 Good to know: Length of access: lifetime Redemption deadline: redeem your code within 30 days of purchase Access options: desktop Max number of device(s): 1 Version: Windows 11 Pro Updates included Click here to verify Microsoft partnership Created with ChatGPT The essentials to get it all done. Microsoft Office 2024 Home is the latest version of Microsoft’s renowned productivity suite, which includes essential applications like Word, Excel, PowerPoint, and OneNote. This version is specifically designed for individuals and families seeking reliable tools for various home tasks, including document creation, spreadsheet management, presentation design, and note-taking. Office Home 2024 is for students and families who want classic Office apps on their Mac or PC. A one-time purchase installed on 1 PC or Mac for use at home or school. Lifetime license for MS Word, Excel, PowerPoint, & OneNote One-time purchase installed on 1 Windows PC for use at home or work Instant Delivery & Download – access your software license keys and download links instantly Free customer service – only the best support! Microsoft Office 2024 Home or Business for PC or Mac includes: Microsoft Office Word Microsoft Office Excel Microsoft Office PowerPoint Microsoft Office OneNote Is it legit? Click here to verify Microsoft partnership Good to Know ONE-TIME PURCHASE INSTALLED ON 1 DEVICE This licensing type will be connected with your Microsoft Account, NOT your actual device. This is a one-use code. The product you are purchasing is NOT MICROSOFT 365. Please read the product details. Redemption deadline: redeem your code within 30 days of purchase Access options: desktop Full versions No subscriptions – no monthly/annual fees Version: 2024 Updates included Here's the deal: This Microsoft Office Pro 2024 + Windows 11 Pro bundle normally costs $448.99, but this deal can be yours from just $134.97, that's a saving of $314. For full terms, specifications, and license info please click the link below. Microsoft Office Pro 2024 + Windows 11 Pro for just $134.97 (was $448.99) Although priced in U.S. dollars, this deal is available for digital purchase worldwide. Support queries If you have queries or need support for any of the Neowin Deals, please use the contact form here. Neowin Deals are managed and sold by StackCommerce who represent Neowin on an affiliate basis. Why we post these deals We post these because we earn commission on each sale so as not to rely solely on advertising, which many of our readers block. It all helps toward paying staff reporters, servers and hosting costs. So for those that keep moaning and complaining, be thankful we're still online for you to even do that. Other ways to support Neowin Whitelist Neowin by not blocking our ads Create a free member account to see fewer ads Make a donation to support our day to day running costs Subscribe to Neowin - for $14 a year, or $28 a year for an ad-free experience Disclosure: Neowin benefits from revenue of each sale made through our branded deals site powered by StackCommerce.
    • Of course the problem was Secure Boot's new certificates. Install media created by the official Media Creation Tool is already signed with a valid certificate from Microsoft, so maybe that certificate isn't "up-to-date" enough for machines with the new ones installed in the UEFI. There's really no other logical explanation.
  • Recent Achievements

    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      agatameier earned a badge
      Week One Done
    • Week One Done
      ssd21345 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      518
    2. 2
      +Edouard
      198
    3. 3
      PsYcHoKiLLa
      147
    4. 4
      ATLien_0
      95
    5. 5
      Steven P.
      77
  • Tell a friend

    Love Neowin? Tell a friend!