Fungus Posted March 24, 2008 Share Posted March 24, 2008 I am wondering how to use wsprintf in asm... when I doinvoke wsprintf,bufOutput,concat,string1,string2masm spits out some weird code...bufOutput is a 400h byte buffer, concat is "%s%s" , and string1 and string2... Link to comment
Loki Posted March 24, 2008 Share Posted March 24, 2008 You need to use addresses. i.e.: invoke wsprintf, addr bufOutput, addr concat, addr string1, addr string2 Or you could use : invoke lstrcat, addr string1, addr string2 invoke lstrcpy, addr bufOutput, addr string 1 Hope that helps mate Link to comment
evlncrn8 Posted March 24, 2008 Share Posted March 24, 2008 also pay attention to the fact that its a c style api, NOT stdcall like 99.9% of the other windows api's, so YOU have to balance the stack after calling it... (add esp, (4* amount_of_parameters_passed)... Link to comment
HVC Posted March 24, 2008 Share Posted March 24, 2008 Actually by using the INVOKE directive, MASM should correctly handle the stack balancing (the wsprintf prototype in MASM32 uses the C calling convention).But if you push the parameters manually and use CALL , then what evlncrn8 said applies. Link to comment
Fungus Posted March 25, 2008 Author Share Posted March 25, 2008 Thanks guys, working nicely Link to comment
Loki Posted March 25, 2008 Share Posted March 25, 2008 After your last few questions I'm intrigued as to what you are coding Link to comment
Fungus Posted March 25, 2008 Author Share Posted March 25, 2008 After your last few questions I'm intrigued as to what you are coding you'll see soon Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now