unix Posted April 23, 2009 Posted April 23, 2009 (edited) Hello,i wanted to ask if someone knows something like a comparison-list of (m)asm and c/ c++ functions. I understand both languages and can write and read it, but a list which compares functions would be nice.What i mean for example:ASMmov eax, value1cmp eax, value2//codemov eax, 5//codemov value3, eaxCif (value1 == value2) { value3 = 5; }Maybe the examples don't match very well but it should be something similar i guess (cant test it right now..).So what i am asking is if there is somewhere a list where i can see how common functions/ instructions look like in asm <-> c?It would be nice to see quickly when i have some asm instructions how the appopriate c function would look like (if-else, loops, strlen, memcpy, ...) Edited April 23, 2009 by unix
metr0 Posted April 23, 2009 Posted April 23, 2009 Hacker Disassembling Uncovered has a section called "Identifying Key Structures of High-Level Languages", you'll find similar information in other publications as well. Or you could do it on your own, code a small C program and analyze the disassembly.
ghandi Posted April 23, 2009 Posted April 23, 2009 (edited) Sometimes it is harder though, if using VC++ because of MS optimization. What you write in your C/C++ code will differ greatly or only a little, depending on your optimization settings.HR,Ghandi Edited April 23, 2009 by ghandi
metr0 Posted April 23, 2009 Posted April 23, 2009 Reminds me of VC++ "optimizing" a "mov dword ptr [00000000], eax" into my code... and no, the C code didn't contain any static zero pointer.
unix Posted April 23, 2009 Author Posted April 23, 2009 Thank you, guess i will look for a copy of Hacker Disassembling Uncovered as i wanted to read it anyway. Thanks Sometimes it is harder though, if using VC++ because of MS optimization. What you write in your C/C++ code will differ greatly or only a little, depending on your optimization settings. I tried that first but got "stuck" because of this.
diablo2oo2 Posted April 23, 2009 Posted April 23, 2009 this discussion is not about masm like the topic says.if i would code that in masm it would look like in c//cif (value1 == value2) { value3 = 5; };---masm---mov eax,value2.if value1 == eax mov value3,5.endif
by:70 Posted April 24, 2009 Posted April 24, 2009 (edited) c:if (value1 == value2){value3 = 5;}Fasm:(http://flatassembler.net/)format PE GUI 4.0entry startvalue1 equ 1value2 equ 1value3 db ?start:mov eax,value1cmp eax,value2jne lablemov eax,5mov byte [value3],allable:; exit Edited April 28, 2009 by by:70
unix Posted April 27, 2009 Author Posted April 27, 2009 (edited) Thanks for your replys. @diablo2oo2: Can you recommend a good book or other resource about "real" masm programming? I tried Art of Assembly Language but it seems to be High Level Assembly.. edit: except iczelions and gobbits from arteam of course. Edited April 27, 2009 by unix
by:70 Posted April 28, 2009 Posted April 28, 2009 (edited) http://www.movsd.com/masm32.rarMicrosoft_Macro_Assembler_Reference.rar Edited April 28, 2009 by by:70
by:70 Posted April 28, 2009 Posted April 28, 2009 (edited) Iczelion's-Tutorial's (recommend) http://tuts4you.com/download.php?view.1200 Edited April 28, 2009 by Teddy Rogers You could just link to the tutorial... :)
unix Posted April 28, 2009 Author Posted April 28, 2009 Thanks by:70, i like the two references Iczelion's-Tutorial's are great too, but i was looking for other ones as i am already working on them
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