How can I create a patch to insert a menu into an executable file which does not have a menu? - reverse-engineering

I am just trying to write a patch that inserts a menu into an application which does not. When I an executable file in a resource editor, I found the menu and I saved the file again and it doesn't show up. I then used OllyDbg to disassemble the executable and wrote the code, saved it. When I clicked the application, it still does not show up. And I do not know how to write a proper patch for this. What else should I do if none of the options work?
I used HxD for hex editing for making the menu appear (I was hoping to see the manu) by adding the commands
CreateMenu
LoadMenu
AppendMenu
InsertMenuItem...
but nothing worked. Can anyone help me?
Thanks!!!
CodexSeraphinus123

Related

nothing happens when I click configure build task in VSCODE saying no build task found

When I Ctrl+shift+B I get this. I click it and it goes no-where. I wait thinking my computer is thinking but nothing. Tried to create a folder .vscode and place a tasks.json in it. VScode acts like it doesn't even see it. I expect VScode to bring the menus up that I see in all the other posts when they click it. Mine just is not going anywhere when I click it. Thanks
since i am not allowed to answer for some picky reason. we shall see if this survives. To help the poor guy that spent too long looking. I created a new folder and put scripts in with no .vscode. then ctrl+shift+p searched for tasks.auto clicked on whatever auto it came up with. It built a new settings.json. I copied the tasks.json from the other folder over and was able to build. finally. found this work around here https://techoverflow.net/2020/01/24/how-to-fix-platform-io-no-tasks-to-run-found-configure-tasks/
configureBuildTask
Follow this tutorial:
https://code.visualstudio.com/docs/cpp/config-linux
I had the same issue, then followed the tutorial. Afterwards the issue was gone.

How can I get Octave GUI to load/read .m files correctly in editor and console?

I am taking a class on using Octave for machine learning algorithms, and as part of the assignments, they provide a series of .m files to build upon with our own code as well as to run for submission credit through the auto-grader. My problem is that the .m files load perfectly fine in a regular text editor program like Atom or Notepad, but in Octave, the files are best described as nonsense, and thus will not run in the console. If I open the files in a regular editor and copy/paste over the crazy into Octave, it seems to save it and reopen fine. But, I have close to 20 files for the first project alone, and this solution is untenable in the long run. I have a screenshot of how it's loading. Is there some setting I need to change? Uninstall/reinstall Octave? I'm new to Octave and the Octave GUI, and I'm striking out with Google for a solution. I am using version 6.2.0. Thank you for any help/advice!
screenshot of how octave is loading my .m files
Update: I responded to this in a comment below, but I tried loading it another way into Octave GUI and received the following error: ">> error: load: unable to determine file format of 'C:/Users/sophi/documents/octave/assignment_1/computeCost.m" This tracks for me because it makes sense why it would open the files in such a weird way. It's simply not sure what they are. However, I created my own simple functions from scratch to test, saved them as .m files, and was able to run them perfectly fine. I'm including one of the files below. Maybe there's a key in the formatting of the files offered by the class which is impacting Octave's ability to process it correctly?
function plotData(x, y)
%PLOTDATA Plots the data points x and y into a new figure
% PLOTDATA(x,y) plots the data points and gives the figure axes labels of
% population and profit.
figure; % open a new figure window
% ====================== YOUR CODE HERE ======================
% Instructions: .... goes on about assignment
% ============================================================
end
MOST RECENT UPDATE: The plot thickens. Yesterday, I was able to open the files I created and run them in the Octave environment, and I (wrongly) assumed they would still work today. They are doing the same stupid thing as the files included by the course. I checked inside preferences for the editor, and it says it is loading and saving them as IBM273 if that helps. Thank you for everyone has pitched in ideas. I really appreciate it!
It was 100% the encoding. I thought it was strange it was saving/loading in IBM273, so I switched it to UTF-8. Almost all the files are working now. The only ones that aren't are the ones I was trying to copy/paste yesterday to see what was going on with the load problems and the basic new problems I wrote. So I deleted everything, redownloaded, and set the default UTF-8 going forward and voila! Solved! Thanks again!
If you want to open a .m file in octave, Try this solution
It is necessary to declare a current directory before saving a file, loading a file, or running an M-file. By default, unless you edit the Octave shortcut, the current directory will be .../Octave/work. After you start Octave, change the current directory by either using the toolbar at the left-hand side of the screen, or entering the path in the bar at the top.
To open an .m file, you can use file -> open, or type
open filename

How to change Active configuration in monodevelop?

I'm following these steps to build sdrsharp on stable Debian. So fr, everything went without a hitch, but I can't figure out this step:
cd into the new sdrsharp directory and then load monodevelop and open the sdrsharp.sln project. If the .sln doesn't open use a text editor to open the .sln file and at the end of the first line change the 12.00 to 11.00. Older versions of monodevelop don't understand the VS2012 header.
Set the Active Configuration from Debug|x86 to Release|x86.
The first one is just given for context, monodevelop has no problem opening the file. But how do I change the Actove Configuration?
Monodevelops internal help is broken, I have no experience with monodevelop or similiar tools as I'm no coder, hence asking here.
Edit to add
The same question was asked and answered here, there should be an option under the "project" tab. But in my case, working from the downloaded .sln, all options under project are grayed out. What to do?
Fixed! The Version had to be changed back to 11 (first bullet point above, relevant to my special case), then reopen file, then it's opened as a project, not as a text file and all the options work.
Take home lessen: That a progeam opens a file without complaining does noit mean there's no error.

view.run_command("example") not working

I created first plugin for sublime text 3 with name relative:
import sublime, sublime_plugin
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
Then save it to path
/pathToSublime3/Packages/relative/relative.py
Then try to test it in command window (cntrl + `):
view.run_command('example')
I expected to see Hello, World! in the beginning of current opened file, but fail. What I do wrong?
If your experience was like mine, you may have copied several super basic plugins to try to find one that worked. I think the failure of the others was affecting the Hello World one. For what it's worth, here are the things I did that seem to have worked.
I'm using ST3 on Win7, so maybe there are differences in plugin development between that and ST2.
Note that as I tried many different permutations of these, I don't exactly know which ones are the real fix. But if these get you working, then maybe you can start making incremental changes and see when it breaks.
Moved all *.py files that were my plugins into "Packages" folder. (I read many posts that said that plugin files in the "Packages\User" or "Packages\NameOfPlugin" folder should be read, but I haven't tried them yet. I put it in "Packages" to make sure that finding the files wasn't a problem.)
Restart Sublime after every change. (The docs say you don't have to, but if you have errors in your plugins, it seems that the auto-reload feature doesn't work. Which kinda makes sense. Once I got the errors out of all my plugins, the auto-reload feature started working correctly.)
A few of the simple/tutorial plugins I copied off the web (even some from sublimetext.com!) referenced/imported "sublimePlugin" which errorred on my ST3 Win7 instance. Apparently the correct library to import is "sublime_plugin". The two places this is used, in basic plugins, are 1) at the very top in the import section, as well as 2) in the class line, which I'll illustrate below...
# didn't work for me...
class ExampleCommand(sublimePlugin.TextCommand):
# DID work for me...
class ExampleCommand(sublime_plugin.TextCommand):
'Ctrl+N' create a new file, then try it again. Don't run it in the old file.
All I need is close sublime text 3 and open it again. Now Hello World works fine
The console doesn't open with Ctrl + ` For Sublime Text 2, but this example is written in the v2 documentation.
Using that command opens up a popup starting with # which is to open another file.
The console opens by doing Ctrl + F1. After that, you can write that code in there, and the text will be added into your current view (in any view, in fact).
Be sure to read the "Where to Store Plugins", I made the mistake of creating a folder (package) when the hello_world.py is simply a plugin. Also keep in mind from the documentation window commands and text commands, cause in this case since it is a text command you must execute it in the "view" that you want it to place the text (which can't be the plugin definition file that you created.
Hope that helps anyone in the future as that was a few things I came across

After moving my Windows Store App project I can't compile it because .resw not found

I have a Problem with a Windows Store App.
I moved the folder and now I cant compile it, I get the error:
Fehler 2 File C:\[old path]\Strings\en-US\Resources.resw not found. C:\[new path]\MakePRI
I dont know how to fix it because the app is in the same relative path in the project as before.
any hints for a solution?
This item was probably added to the project with absolute path. You can fix that in one of two ways:
In SolutionExplorer remove Resources.resw from the project. Then click on Show All Files icon to make the file appear in its folder although it's not included in the project (I understand you did copy it over when moving the project). Now right click on the file and select Include In Project. After that you can again turn off Show All Files.
In Solution Explorer right click on the project and select Unload Project. Now right click on the project again and select Edit ProjectName.csproj. In the file find Resources.resw and replace the existing tag (and any subtags) with <PRIResource Include="Strings\en-US\Resources.resw" />. Save the changes and close the file. Right click on the project again and select Reload Project.
I got into this problem and I found an easy solution. Open the project and it will show the error. Now right click on the App name in Solution Explorer (on the right hand side) and select Build.This will set the path again and the project can be run now.