• 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
  On 22/09/2012 at 20:06, articuno1au said:

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
  On 22/09/2012 at 20:09, nouser said:

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
  On 22/09/2012 at 20:13, n_K said:

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
  On 22/09/2012 at 20:27, nouser said:

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
  On 22/09/2012 at 20:40, n_K said:

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
  On 22/09/2012 at 20:55, articuno1au said:


<?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
  On 22/09/2012 at 21:06, nouser said:

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
  On 22/09/2012 at 21:30, articuno1au said:

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

    • KDE brings Wayland PiP to Plasma 6.5, adds finishing touches to 6.4 as release nears by David Uzondu The KDE team has released its This Week in Plasma update, showing the final polish being applied to Plasma 6.4 ahead of its June 17 release. Last week, the KDE team brought performance upgrades, and this week the team is continuing that with improvements like faster loading for System Monitor components in Plasma 6.4. Future work for Plasma 6.5 is already underway, and it includes a feature that many have probably been waiting for: proper Picture-in-Picture support on Wayland. This uses an experimental version of the Wayland PiP protocol, which means applications like Firefox that also implement it can finally display PiP windows correctly. It is a long-overdue addition that moves the Wayland session closer to feature parity with X11. The devs also merged KWin's Background Contrast effect into the Blur effect. Virtual desktops can now be re-ordered from the Pager widget, a feature previously missing. Invert and Zoom settings have been moved into the Accessibility page, which is a more sensible place for them than the Desktop Effects page was. The team also brought consistency to the Breeze application style, with animated effects for checkboxes and radio buttons now working in QtQuick-based apps. Other small cleanups include standardizing the section headers in the Disks & Devices, Networks, and Bluetooth widgets. For those who do a lot of screen recording, Spectacle now makes it much clearer how to stop a recording, both in its notifications and shortcut names. As for the immediate future, Plasma 6.4 and its first point release are getting accessibility and user interface tweaks. The team improved text contrast for labels used in secondary roles throughout Plasma, making things like brightness indicators much easier to read. The Kicker Application Menu in 6.4 can now scroll horizontally when a search returns a ton of results, so you can actually see all of them. The team also delivered some stability improvements in Plasma 6.4.0, most notably fixing a long-standing issue where adding widgets to oversized panels could freeze the entire shell. Discover also got a much-needed fix for a crash that occurred when suggesting replacements for unsupported Flatpak apps. On the usability side, dragging files into a Folder View widget no longer causes glitchy visuals, and Open and Save dialogs from Flatpak-based browsers now properly allow the preview pane to open. Printing from Flatpak GTK apps now respects correct sizing, and installing or removing apps no longer wipes out your search input in Kicker or Kickoff while you're using it. Other notable fixes include: Selection rectangles on the desktop now render properly when using custom fonts or sizes (Plasma 6.3.6) A crash in System Monitor charts used by apps and Plasma components has been resolved (Frameworks 6.15) Switching process views in System Monitor no longer causes crashes (Frameworks 6.16) Open and Save dialogs no longer close when hovering over specific files (Frameworks 6.16) A thumbnailer crash on X11 caused by certain widget styles has been fixed (KDE Gear 25.04.3) Frameworks 6.15 also speeds up System Monitor by delaying tree view arrow loading There are still 3 high-priority Plasma bugs holding out, and the list of quick-win "15-minute bugs" has grown to 23.
    • Hasleo Backup Suite Free 5.4.2.0 by Razvan Serea Hasleo Backup Suite Free is a free Windows backup and restore software, which embeds backup, restore and cloning features, it is designed for Windows operating system users and can be used on both Windows PCs and Servers. The backup and restore feature of Hasleo Backup Suite can help you back up and restore the Windows operating systems, disks, partitions and files (folders) to protect the security of your Windows operating system and personal data. The cloning feature of Hasleo Backup Suite can help you migrate Windows to another disk, or easily upgrade a disk to an SSD or a larger capacity disk. System Backup & Restore / Disk/Partition Backup & Restore Backup Windows operating system and boot-related partitions, including user settings, drivers and applications installed in these partitions, which ensures that you can quickly restore your Windows operating system once it crashes. Viruses, power failure, or other unknown reasons may cause data loss, so it is a good habit to regularly back up the drive that stores important files, you can at least recover lost files from the backup image files in the event of a disaster. System Clone / Disk Clone / Partition Clone Migrate the Windows operating system from one disk to another SSD or larger disk without reinstalling Windows, applications and drivers. Clone entire disk to another disk and ensure that the contents of the source disk and the destination disk are exactly the same. Clone a partition completely to the specified location on the current disk or another disk and ensure that the data will not be changed. File Backup & Restore Back up specified files(folders) instead of the entire drive to another location to protect your data, so you can quickly restore files(folders) from the backup image files when needed. Incremental/Differential/Full Backup Different backup modes are supported, you can flexibly choose data protection schemes, which can improve backup performance and save storage space while ensuring data security. Delta Restore Delta restore uses advanced delta detection technology to check the changed blocks on the destination drive and restore only the changed blocks, so it has a faster restore speed than the traditional full restore. Universal Restore This feature can help us restore the Windows operating system to computers with different hardware and ensure that Windows can work normally without any hardware compatibility issues. Hasleo Backup Suite 5.4.2.0 changelog: Added backup image delete feature Added storage path management feature Improved file backup feature Show application notifications in Windows Notification Center Various other bug fixes and feature improvements Download: Hasleo Backup Suite 5.4.2.0 | 34.4 MB (Freeware) Links: Hasleo Backup Suite Website | Hasleo Backup Suite Guide | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Fresh leak suggests OnePlus Pad Lite in the works, key specs revealed by Sagar Naresh Bhavsar OnePlus recently unveiled the mid-range OnePlus 13s and the OnePlus Pad 3 Android tablet in India (the tablet is also coming to the U.S.). Now, it appears that the company is working on another tablet, this time, a budget model called the OnePlus Pad Lite. Supposedly, it will be the successor to the OnePlus Pad Go, which launched in the U.K., India, and European countries. According to the leaked images, OnePlus Pad Lite follows the same design elements as earlier OnePlus tablets. The tablet is shown to have a circular camera at the center of the rear panel, with the logo sitting in the middle. The USB-C port and speaker grills are located on the right side frame of the tablet. The alleged OnePlus Pad Lite measures 254.9 x 166.5 x 7.4mm and weighs 539 grams, which is slightly taller, wider, and thinner, but weighs less compared to the OnePlus Pad Go. The tablet, courtesy of 91Mobiles and OnLeaks, is displayed in blue, which could be the only color option. One image shows the tablet with a cover that doubles as a kickstand, but may be sold separately. Gallery: OnePlus Pad Lite Based on the leaked specs, the OnePlus Pad Lite could feature an 11-inch LCD 1920x1080 resolution 90Hz display. It could be powered by the MediaTek Helio G100 processor and paired with the Mali G57 GPU. The tablet may come with 6GB of RAM and 128GB of onboard storage, with more storage and RAM options available at launch. Reportedly, the OnePlus Pad Lite could feature a 5MP primary camera and a 5MP selfie camera. Under the hood, it could be juiced by a 9,340 mAh battery. On the software side, OnePlus Pad Lite may come with OxygenOS 15.0.1 based on Android 15 out of the box. There is no clarity on which market OnePlus plans to launch the OnePlus Pad Lite in. However, the report suggests that it could be priced under ₹20,000 (roughly $231). Images by 91mobiles x OnLeaks
    • Zen Browser 1.13b by Razvan Serea Zen Browser is a privacy-focused, open-source web browser built on Mozilla Firefox, offering users a secure and customizable browsing experience. It emphasizes privacy by blocking trackers, ads, and ensuring your data isn't collected. With Zen Mods, users can enhance their browser experience with various customization options, including features like split views and vertical tabs. The browser is designed for efficiency, providing fast browsing speeds and a lightweight interface. Zen Browser prioritizes user control over the browsing experience, offering a minimal yet powerful alternative to traditional web browsers while keeping your online activity private. Zen Browser’s DRM limitation Zen Browser currently lacks support for DRM-protected content, meaning streaming services like Netflix and HBO Max are inaccessible. This is due to the absence of a Widevine license, which requires significant costs and is financially unfeasible for the developer. Additionally, applying for this license would require Zen to be part of a larger company, similar to Mozilla or Brave. Therefore, DRM-protected media won't be supported in Zen Browser for the foreseeable future. Zen Browser offers features that improve user experience, privacy, and customization: Privacy-Focused: Blocks trackers and minimizes data collection. Automatic Updates: Keeps the browser updated with security patches. Zen Mods: Customizable themes and layouts. Workspaces: Organize tabs into different workspaces. Compact Mode: Maximizes screen space by minimizing UI elements. Zen Glance: Quick website previews. Split Views: View multiple tabs in the same window. Sidebar: Access bookmarks and tools quickly. Vertical Tabs: Manage tabs vertically. Container Tabs: Separate browsing sessions. Fast Profile Switcher: Switch between profiles easily. Tab Folders: Organize tabs into folders. Customizable UI: Personalize browser interface. Security Features: Inherits Firefox’s robust security. Fast Performance: Lightweight and optimized for speed. Zen Mods Customization: Deep customization with mods. Quick Access: Easy access to favorite websites. Open Source: Built on Mozilla Firefox with community collaboration. Community-Driven: Active development and feedback from users. GitHub Repository: Contribute and review the source code. Zen Browser 1.13b changes: New Features There's a new way to manage spaces, which brings a more intuitive and user-friendly experience Updated to firefox 139.0.4 Added support for Google safebrowsing for better security Collapsed toolbarr gets a slight UI redesign Fixes Fixed issues related to glance and split view Fixed performance issues and high GPU usage for some users Other small fixes and improvements Breaking Changes Customizable UI buttons at the bottom has been reset to a new default state Download: Zen Browser | 73.6 MB (Open Source) Download: Zen Browser ARM64 | Other Operating Systems View: Zen Browser Home Page | Screenshots 1 | 2 | Reddit Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      5i3zi1 earned a badge
      One Month Later
    • Week One Done
      5i3zi1 earned a badge
      Week One Done
    • Week One Done
      julien02 earned a badge
      Week One Done
    • One Year In
      Drewidian1 earned a badge
      One Year In
    • Explorer
      Case_f went up a rank
      Explorer
  • Popular Contributors

    1. 1
      +primortal
      544
    2. 2
      ATLien_0
      227
    3. 3
      +FloatingFatMan
      160
    4. 4
      Michael Scrip
      113
    5. 5
      +Edouard
      102
  • Tell a friend

    Love Neowin? Tell a friend!