With the following asm code i try to pass a string to a loaded C++ dll file:
My C++ dll function looks like this:
But it doesn't work... When i print "blabla" i can see that only the 3 first charchters are correct - the rest of the string is "corrupt" :| Any help? :/
push DWORD PTR
call
My C++ dll function looks like this:
void TheFunction(char TheString)
{
.....
char *blabla;
blabla=&TheString;
.....
}
But it doesn't work... When i print "blabla" i can see that only the 3 first charchters are correct - the rest of the string is "corrupt" :| Any help? :/
You should pass the address of the string
and use
void TheFunction(char *TheString)
{
.....
.....
}
and use
void TheFunction(char *TheString)
{
.....
.....
}
You mean like this?
Then the application crashes:(
I'm sorry but i'm a bit noobish to pointers? :|
Edit:
And when i try to push the offset of the string, my application still crashes :/?
void TheFunction(char *TheString)
{
.....
char blabla;
blabla=*TheString;
.....
}
Then the application crashes:(
I'm sorry but i'm a bit noobish to pointers? :|
Edit:
And when i try to push the offset of the string, my application still crashes :/?
push offset thestring
call
It should be
If I am not wrong.
void TheFunction(char *TheString)
{
.....
char blabla;
blabla=TheString[0]; // getting the first character in the string
.....
}
If I am not wrong.
Still no success:( No matter what i do, either the application crash or i only see 1-3 of the first charchters:/
Should i use "DWORD PTR" or "OFFSET"? And why:S?
And who is sure what i have to write in my C++ function in order to get this to work? Someone must know for sure:o))
Should i use "DWORD PTR" or "OFFSET"? And why:S?
And who is sure what i have to write in my C++ function in order to get this to work? Someone must know for sure:o))
What do you mean by " i only see 1-3 of the first charchters"
Please give more codes to illustrate.
Please give more codes to illustrate.
Well i check the content of the variable by making a messagebox showing the variable.
is my string is "BlaBla" then i only get "B" in some cases, and "Bla" in other cases... I have no clue whats worng:(
is my string is "BlaBla" then i only get "B" in some cases, and "Bla" in other cases... I have no clue whats worng:(
It should be
Is that what you coded?
push offset stringarray
call yourfunction
int yourfunction(char *string){
MessageBox(0,string,string,0);
return 0;
}
Is that what you coded?
Ahhh finally it worked - thank you very much:o))
So simple code, and i didn't even try that in my 100 different tries:S :D
So simple code, and i didn't even try that in my 100 different tries:S :D