|
Is the SampleSub() function in a DLL?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hello. Thanks for the answer. No, the SampleSub() function is inside a VB6 program, an executable. Then I build a C DLL with the code above and inject it on the VB6 process. Sorry if I don't explain that very well.
Thanks again.
|
|
|
|
|
How are you determining the address of the VB6 function?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi, thanks for your answer. I'm using:
AddressOf SampleSub
Also OllyDbg gives me that address.
|
|
|
|
|
I would experiment with calling other VB6 functions to see if they give the same result. Especially try calling a function that takes no parameters to see if the problem might be the parameter passing.
Have you ever had success calling a VB6 function from C?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
I'm afraid I don't know what it could be. However, I had always believed that it was not possible to arbitrarily call into a VB6 executable.
I was under the impression that the old VB worked on a, sort of, virtual execution scheme, and the VB program was under the control of a supervisor thread.
I wish I could be more helpful!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Ok thank you very much, I'll keep trying and tell you if I could make the trick. If anybody have any idea please tell me!!
Thanks again!
|
|
|
|
|
|
Hi Randor, thank you very much for your reply. I'm actually just using a VB6 "function" with no return value and that takes no parameters. This one:
Public Sub SampleSub()
MsgBox "Hello world!"
End Sub
With the typedef void (__stdcall *SampleSubPtr)(void); prototype. What should I use instead of void ? I think it will be better to start calling a simple function with no parameters, that's why I delete the old function that returns a VB boolean and takes two Integers as it params. I checked out the link your provided but that's for a Variant type in VB6, do you mean I should use VARIANT in C++ for any VB6 type?
I was thinking... I always get the Access violation when reading... error, do you think that a type incompatibility can cause this?
What would you do in my place? This problem is driving me crazy!
Thanks again!
|
|
|
|
|
hi all,
please guide me and provide me a right direction.
currently I m using office automation and random password generation for this but is to time taking and slow process.
please help me to start for ms office file password recovery type application?
thanks in advance.
|
|
|
|
|
Le@rner wrote: please guide me and provide me a right direction. Learn how to do basic research[^].
Veni, vidi, abiit domum
|
|
|
|
|
I already do this this search list all recovery application.
not about the how to implement of code for this..
|
|
|
|
|
Then I guess you need to try contacting one of the authors of those packages.
Veni, vidi, abiit domum
|
|
|
|
|
really why those authors disclose their logics..
it means codeproject not help me for this...
|
|
|
|
|
Le@rner wrote: it means codeproject not help me for this... No, it means we don't have the answer.
Veni, vidi, abiit domum
|
|
|
|
|
can u please suggest me any other option or way to move on.
|
|
|
|
|
The only thing I can suggest is more Googling, and maybe some initiative. You also need to consider why passwords exist; if it was easy to crack them then there would be no reason to use them in the first place.
Veni, vidi, abiit domum
|
|
|
|
|
hi all,
is there any option to know the office file is password protected or not?
thanks in advance.
|
|
|
|
|
Try opening it?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I m using excel and word automation to open files is there any other method to chk file without opening the file is password protected or not.
coz other than excel and word files I m not able to open using automation....
and also if the file open function is inside the loop of random password generator and try with every new password to open the file the program becomes slower.
please help me,
|
|
|
|
|
Le@rner wrote: if the file open function is inside the loop of random password generator and try with every new password to open the file the program becomes slower. If you do not know the password then maybe you are not supposed to be opening the file.
Veni, vidi, abiit domum
|
|
|
|
|
yes file is not open and return exception of wrong password until the correct password is generated.
that's y I m taking help for another approach..
|
|
|
|
|
Le@rner wrote: ...return exception of wrong password until the correct password is generated. That seems to be the answer to your "is there any option to know the office file is password protected or not" question.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
not I m trying to open the file with different password if password is correct its open otherwise its generate the exception...
in my question "to identify the file is password protected or not" I m want to chk just before open the document.
|
|
|
|