How to open executable binary without running it in ollydbg? - portable-executable

When I try to open a PE executable , it's automatically run.
How can I just open it statically without running it? I just want to see the binary file in hex format.

If you really want see it in "hex format" - just use any of hex viewer or hex editor. There are lots of them, including plugins for file managers (FAR, Total Commander) or hex editors like WinHex.
If you want to see it disassembled - use disassembler. IDA, hiew, etc.
Or, start OllyDbg, than in menu select View -> File .
Also, there is PE file header view mode (right mouse button (RMB) -> Special -> PE header). You can edit (RMB -> Binary -> Edit) and save file (RMB -> save) too.
You can read this in OllyDbg help, "Tips and tricks", 1st line.

for viewing your code in hex mode do this:
view > file
or
view > Executable modules > select module > right click > View executable file
your second question in comment : there's a "Keep Size" option which is checked by default,what does that mean?
keep size is not important. edit binary let you to change bytes. if you tick keep size it let you only change bytes you selected. if you don't tick you can change all bytes start from you select.

Related

Matlab script not displaying images (imshow)

As the title says, I have looked over my code and I don't see a reason that my script is not printing out the images. In particular, I have solution code that does print out the images and I don't see any differences in the code so I'm at a bit of a loss. The code does throw errors at unfinished lines, however there should still be printed images in the first few sections, the errors shouldn't interfere with that so I still don't know why they don't print out. My code is as follows:
EDIT: Some of my classmates have the same error, I suspect it might be a path issue but I'm not sure how to address that.
EDIT2: I've reformatted the post to be clearer, sorry for including extraneous parts of this code. The document is a .mlx file, hence where there is code and text interspersed. The code did not run when I used the "Run section" button, however if I copied and pasted the coded into the Command Window it would run without issue.
P = phantom('Modified Shepp-Logan',300);
figure
imshow(P);
imwrite(P, 'raw1.tif');
This section of the code seems to be working as expected when I tested it on MATLAB R2019b.
P = phantom('Modified Shepp-Logan',300);
figure
imshow(P);
imwrite(P, 'raw1.tif');
As an aside, all files will be saved to the current working directory unless otherwise specified.
Steps Taken:
To Run Script
Home Tab → New Script → Paste Script → Editor Tab → Run
and Give Script Save Name
To Easily Open Exported/Saved File:
Current Folder Side Panel → Right Click On File → Open Outside MATLAB
Results
Extension: Other Cool Tricks (to avoid running unfinished lines)
Using %% can be used to separate the script into sections. Each section can be run using the Run Section Button in the EDITOR tab or can be run using the command:
Windows: Ctrl + r
MacOS: ⌘ + r
Section 1 Code
%%
Section 2 Code
%%
Section 3 Code
Using MATLAB version: R2019b

Shortcut to jump to a chunk in R Markdown?

Is there a shortcut to jump to a chunk in a R Markdown (on a Mac)? I'm looking for a way to quickly go between one chunk to another.
I'm not completely sure this is possible on Mac, but in RStudio for Windows you can select to show the «document outline» in the IDE. Not really a shortcut perhaps, but it can easily be used to jump to different named chunks in the R Markdown document by clicking it.
By default, I believe the outline is set to only show «Sections» (i.e. ## Header here), so to enable it to show named chunks, go to Tools -> Global options -> R Markdown -> Show in document outline. Then set it to «Sections and Named Chunks»
fn + Command + Up/Down works on the latest RStudio. It also jumps to heading sections.
This preference option exists on the Mac desktop RStudio as well.

using LoadSTL() function

I what to convert .STL file to .mat to simulate object in m file in matlab. I am call the function like this way
LoadSTL('F:\D Backup\najib\FYP\Dr istaz\matlab_sim_02\matlab_sim\quadfullprt.STL')
but I get this error:
**File format in an unexpected type.
Check the file specified is an STL format file with ASCII formatting.
(Error - number of vertices not a multiple of 3)
Attempt to reference field of non-structure array.
Error in LoadSTL (line 58)
disp(numel(points.x))
Error in mainCoverter (line 3)
LoadSTL('F:\D Backup\najib\FYP\Dr istaz\matlab_sim_02\matlab_sim\quadfullprt.STL')**
how can I resolve this? thanks in advance
Try opening the STL file in a viewing program like MeshLab (it's free and will open STL files), then save it as a new STL file but being sure to check ASCII format instead of binary. This might be a checkbox or it may be a separate file-type in the pull-down menu. For example, in MeshLab, after selecting STL and clicking "save", a new menu will pop up with extra options where you can de-select "Binary encoding".

Adding new filetypes to Windows 7's New context menu

I'm trying to add CSS, PHP, JS and HTML file types to the "New" right click menu in Windows 7. I know how to add the file types to the menu with ShellNew entries in the registry. But Windows doesn't give you any control over the display names of the new items - according to this the name's always taken from whatever application you've assigned to open the doc. I've set Notepad++ to open all of these file types, so I'm going to end up with several identical "Notepad++ document" entries in the menu, like this:
Does anybody know if there's a way out of this stupid situation without installing any tweak utilities?
Thanks all!
Fred
To rename a context menu > new's item (in Windows 7, at least):
Open regedit.
Go to HKEY_CLASSES_ROOT\.%ext% and note the (Default) value. This is the file extension's ProdID.
Go to HKEY_CLASSES_ROOT\%ProdID% (usually %ext%file) using the value obtained from step two. Set the (Default) value to whatever you would like the context menu new item to display as.
Under HKEY_CLASSES_ROOT\%ProdID%, if there is a FriendlyTypeName value, rename it to FriendlyTypeName.old, as the (Default) value "is deprecated by the FriendlyTypeName entry"
I don't believe there is even a need to log out / restart, but if the changes don't take effect, log out and/or restart.
You could change the file type description for each file class manually.
Look up the prog id under HKEY_CLASSES_ROOT\.%ext% (The default value)
Under HKEY_CLASSES_ROOT\%progid%, set the default value and/or the "FriendlyTypeName" string to the string you want.
You might have to log off for it to take effect.
You should probably stay away from the Chrome and Notepad++ file type/association dialogs so they don't overwrite your strings.
Both Chrome and Notepad++ are open source, you can create a patch for them that use better names for the file types. (What is a "Chrome HTML Document" anyway, HTML5 + extra chrome juice? =) )
I was able to derive a solution from the answers above.
I replicated the particular application (JetBrains PHPStorm in my case) registry entry.
PHPStorm2019.1 -> PHPStorm2019.1.scss, PHPStorm2019.1.js.
Now I changed the Default REG_SZ of PHPStorm2019.1.scss to SCSS File and PHPStorm2019.1.js to JavaScript file.
Mapped .scss and .js to PHPStorm2019.1.scss and PHPStorm2019.1.js respectively.

Xcode Mark similar to emacs

Is it possible to bookmark a line in Xcode similar to the "mark" functionality in emacs? Also is there a shortcut used I can use to jump to a line number? My source code is becoming long and hard to navigate.
Yes; if you place the text caret on the line that you want to bookmark and select Edit > Add to Bookmarks (or ⌘D) you can add that line to the bookmarks in your project. You can then access these bookmarks from the Bookmarks item in the Groups & Files pane.
To go to a certain line, choose Edit > Go to Line... from the menu (or ⌘L), and type in the line number you want to navigate to.
I would also recommend that you use the #pragma mark directive to help you navigate around in source files. It takes the format:
#pragma mark <Label>
And will show up in the functions popup menu at the top of your source file; it makes it much easier to navigate around your code by grouping together common functions, improving the overall structure and readability of your code.
You can also use the "mark" key sequence, control-# or control-space, then you can use Delete to Mark (control-W), Select to Mark (control-X control-M), and Swap With Mark (control-X control-X). These emacs-like key bindings are supported in all Cocoa text views in Mac OS X, and you can customize the keybindings for Xcode in Xcode > Preferences > Key Bindings > Text Key Bindings.
You can bookmark an individual line in a file:
in your .emacs file
(global-set-key "\C-cb" 'bookmark-map)
sets it up, so:
control-c b m sets a bookmark (you can name it whatever you want.)
control-c b j jumps to a bookmark (it asks which bookmark you want)
Also:
(global-set-key [f1] 'goto-line)
sets F1 to ask for a line number and jump to that file

Resources