how to write string in memory mapped file in VB6 - vb6

I want to store a string in memory mapped file using VB6. I have to read that string in C#. My basic need is to implement IPC. Please help me with this.
Thanks in advance.

Related

How to SHSetLocalizedName with a hard coded string?

I want to localize a shortcut and have come across this API SHSetLocalizedName() which takes a path to an executable and a resource ID. However, I want to use a string instead. It looks like it just writes to desktop.ini:
[LocalizedFileNames]
Test.lnk=#program.exe,-101
I played with it manually and I can just do this:
[LocalizedFileNames]
Test.lnk=Localized Name of Test Shortcut
Does anyone know a programmatic way of doing this? I really don't want to write to desktop.ini myself.
Thanks.
A hard coded string is the opposite of localization!
The point of SHSetLocalizedName is to have various parts of the start menu and some special folders (My documents etc.) display in a language that matches the users current UI language. To do this the string has to be a resource in a PE file so that the magic of multiple versions of a resource in different languages can work.
If you always want a specific name you can just rename the file. If you can't do that (you don't have write access or you are trying to trick the user) then perhaps this is not something you should programmatically be doing?
SHGetSetFolderCustomSettings knows how to change some values in desktop.ini but this string is not one of them. I believe using WritePrivateProfileString is the only solution...

File names in programs: why the need for them?

I'm learning the basics of programming, and am currently going over calling files in pseodocode.
My text explains the process of calling a file to read or write to, but it doesn't explain why we have an internal name to reference a file to which we read or write. When I was reviewing with a friend, we thought perhaps it's because the program itself would need something like a variable to reference the actual file in memory.
Would anyone mind clarifying why we reference existing files in memory with a file name in a program? I would really appreciate the understanding.
Thank you so much for your time!
The reason why we name objects in programs is to separate their semantic meaning from their transient features.
In your case, a program may let the user place a file in a directory, other than the default one. In that case the filename would change accordingly, while the internal name used by the program to refer to the file object would remain.

where is write the CLSID of a directshow filter?

please consider the microsoft "AVI mux" directshow filter, it have CLSID: {E2510970-F137-11CE-8B67-00AA00A3F1A6}
suppose that, just for an experiment, I want to change this code. I opened the file qcap.dll with WinHex qcap.dll but I can not find this string inside it, then I wonder where is written, if it's written in qcap.dll. Thanks
It is there but it is not a string, it is hardcoded as a binary value. Then you are to consider registration of the DLL, which stands alone from file contents. Whatever you are trying to achieve patching a stock DLL, it is wrong and a no-go for a real task. Not to mention that the file is proceted by System Restore and reversing is likely to be an EULA violation.

Assigning my own file path in reverse engineering

I am working on reverse engineering and i wanted to give my own file path without using open dialog box like writing a fixed file path and read a file from that every time the software start.i tried to give the file name in a .data section of the software but it retrieve only the hex number not the string.
Is there any way hooking windows API for file open?or any way to write in memory and to read it every time the software starts?Any advice or direction would be greatly appreciated.
I think that what you may be looking for is "intercepting system call", quick google search came up with this link:
http://jbremer.org/intercepting-system-calls-on-x86_64-windows/ so it should be possible and not too difficult.
Basically if you manage to intercept a call to GetOpenFileName and replace it with custom implementation you should be able to do what you want (that is put hardcoded file path to appropriate buffer in LPOPENFILENAME structure)
As for your attempt to modify compiled code (I assume that what you are referring as reverse engineering is disassembling and modifying binaries) it should be possible to do, but it will require deep knowledge of windows binary architecture and assembly language.

md5/hash on vb6?

I'm making a program that has a login. Is there any way to encrypt the normal password so that it can't be read in the data base? I've done a trick but I'm not content with it. What I did was to get the first, mid, and last char only and convert each char into ascii. Is there a way to convert all the text into ascii or something like md5/hash in php?
I'm really sorry about this thing, I haven't mentioned that my project is a VB6 project.
Don't use MD5 to store hashed passwords! See stuff like http://www.freerainbowtables.com/ for reasons why. MD5 is thoroughly broken... Check what you have available in VB6 (I'm hardly a VB6 guy ;-)) in the realm of cryptography. Something based on (salted) password-based encryption stuff is what you want, Google for "vb6 pbkdf2", I see a lot of hits there :)
I have been using a class by Phil Fresle for generating MD5 signatures for strings. You can copy and paste the source to create the class. To use it in your application I suggest storing the hash rather than the password. The class source code can be found here.

Resources