I've heard that learning assembly language is a good way to become a better computer programmer. Is this true? Is it worth the effort? Does anybody have any suggestions on this subject?
Name:
Anonymous2005-04-21 14:59
It will at the very least help you understand what computers really do. It will make an already good programmer ever so slightly better. If you use compiled languages then knowledge of assembly will also help you debug and examine the output of your compiler.
Name:
Anonymous2005-04-21 16:04
Further to what 2 said, any decent computer science degree will teach you some assembly language. So yes, understanding at least some basic assembly language can only add to your overall knowledge particularly memory handling and such. I have to say though, in my experience its not fun and its not pretty but it is certainly worth delving into.
Name:
Anonymous2005-04-21 17:22
depending on what you want to do, learning assembly could either be pretty worthless or a complete utter waste of time that damages your brain forever.
there's a reason it's called machine code (which is what asm maps more or less directly to), and that's because it's only meant to be used by machines.
Name:
Anonymous2005-04-21 18:52
i think it's fun to control the machine without anything between you and the MACHINE. teh sex
Name:
Christy McJesus!DcbLlAZi7U2005-04-21 20:16
Technically yes, it would make you a slightly better programmer. In reality the payoff compared to the effort involved is too small to make it worth your time; you'd reap far greater rewards from learning a wide range of high level languages.
Name:
Anonymous2005-04-23 0:18
While I'm somewhat inclined to agree with >>6, I must point out that in order to be any sort of programmer worth anything, you'll need to know at least one assembly language.
You'll probably rarely use it, and compilers continue to do increasingly good jobs (on increasingly complex hardware), but not having some familiarity with the machine itself is plain stupid.
Name:
Anonymous2005-04-24 23:28
It's both incredibly helpful and incredibly worthless. The best you can get out of it is an appreciation for what's actually going on in the computer. I never understood pointers until I picked up a teensy bit of assembly. As far as my intended reason for learning it, being able to debug without symbols, it's much easier to get the friggin' symbols than it is to sit there and try to figure out the bug means.
Name:
Anonymous2005-04-28 12:11
ok thanks, everyone.
Name:
Anonymous2005-04-28 14:12
additionally i'd like to add ..assembly isn't a hard language to learn.
Name:
Anonymous2005-04-29 1:16
And as well, can't you include little bits of assembly inside of code you write in certain other languages just to stop people debugging your code in their tracks, in order to make any company you happen to work for <i>suffer</i> if you're fired?
Name:
Anonymous2005-04-29 7:06
Actually that sounds like a good way to get fired in the first place. And it's assuming that the code is for a single architecture/OS anyway, inline assembly has no place in platform-independent code.
Name:
Anonymous2005-04-29 8:36
Any programmer worth the name would be able to quickly comprehend what an inline asm block is doing. Gone are the days where we could pull bizarre self-modifying code trickery, kill debuggers, rewrite interrupt vectors, etc.
So that's an utterly stupid idea.
Name:
Anonymous2005-04-29 10:21
>>12
You can too use inline assembly in platform independant code. Just use macros.
Name:
Anonymous2005-04-29 12:14
13>> Oh BTW, it's good because it's fast.
Name:
Anonymous2005-04-29 12:14
s/13>>/14>>/
Name:
Anonymous2005-04-29 23:18
>>10
Is right. The syntax and major operations of assembly are not hard. Just like how the kana in Japanese are not hard. But if you've skimmed a page on assembly online and think "1 4m 4 1337 h4x0r," you're just as deluded as a wapanese who thinks he is a Japanese expert because he can read katakana.
Name:
Anonymous2005-04-30 6:56
Summary: no.
Name:
Anonymous2005-04-30 8:45
>>1
Yes, assembly if worth learning (and not that hard to learn) IF (A VERY BIG IF) you already know the C language VERY WELL (I insist on it). I'm a student and learned C before assembly: when I switched to assembly, I understood that C is just a high-level assembly language and the only confusing difference was the "C calling conventions" (like sub %esp... to create local variables for example) and the use of registers instead of variable names. Of course assembly is more "limited" because you have to use jumps instead of for/while loops but you can write basic stuff with it in a short amount of time.
>>15
Beware the "assembly is faster" because GCC can generate very fast assembly code from C code. All the basic stuff I did in assembly was not that faster than GCC and I had to hack a lot of things to be really faster (twice faster for example). You'll have to know a bit of algorithm too if you want to really optimize an application (FFT for example).
I learned asm while i learned how to crack apps and reverse stuff, also learned c while i was it by examining/reversing c programs(in some cases fully retrieved the source code). As a result of some 3-4 years of reversing i can comprehend a good majority of programs and see behind all of the code, answer questions about what an obscure library is doing or why, or find spyware, stolen code in commercial applications. Of course my main reason was to crack, but in the process i have learned so much more.
From the coding standpoint, i know quite a few situations where inline as in almost unavoidable(or you can alloc some buffer and execute it, but its still machine code..).
>>13
You obsviously don't know modern protections... they may not be as varied as DOS protections, but there are a lot of things you can still do if you have a solid knowledge of win internals.Oh, and there are 2 protections that hook interrupts nowadays(usinga driver), i can't particuallry call them professional though since they make the system unstable, however they are still regarded as one of the strongest in the market. That said, i can crack most of them in 5min->8hr by hand, except 3 of them which take 1-2 months of reasearch and arent accessible to the general public(*phew*) except for very large sums of money.
Name:
Anonymous2007-04-14 10:18 ID:JCs+BXRA
except 3 of them which take 1-2 months of reasearch and arent accessible to the general public(*phew*) except for very large sums of money.
I am interested in further information. Elaborate please?
>>22
ok, if you insist, i will only give the name of 2 of them:
starforce - can be easy or hard, depending on implemntation, usually used by games, but not always, it can also cause a lot of lag and problems with the user's pc. from a crackers standpoint, it is quite strong if used correctly, it has been cracked many times, but it generally takes a lot more time to crack it.
securom - crackable semi-automatically if tools are created, can take a few months
note that these are game protections. The third one costs about 300$ , and is easily obtainable, but still makes your app lag like hell(20-30x slowdown if wrong routines are protected with it) and causes random bsod's, i'm not mentioning its name since i want to see less of that slow faggotry on the market( can crack it in about 2 days, so you're not really missing out on much ).
>>22
oh ya, i'll give you one tip though, i've seen simple protections like Armadillo be very strong at times, the trick was to implement custom triggers and collaborate with the company so they would provide you with certain custom tricks to verify if the app is unwrapped, then cause some subtle data corruption that shows itself later and makes the app unusable. It seems that you have cracked it, but you really haven't. That's the strongest protection casual software developers get with least effort. Other solutions are implementing custom protections yourself, those willstop novices and some average crackers, but not professionals of course.
To examplify, that armadillo took me one day to crack, instead of the usual 30min. Again, anything can be cracked if enough time is given, but you can make the job harder.
Name:
Anonymous2007-04-14 13:02 ID:JCs+BXRA
Have you seen the protections on some of the Windows executables - e.g. WINLOGON.EXE - to avoid modification that may allow users to use the OS past its licensed limits? For example, enabling multiple terminal server sessions on XP. I've tried to crack those but it was too difficult for me.
"Microsoft protects its software from abuse by writing into the basic code protection mechanisms that, while the program is running, continually verify that it has not been tampered with. The program may call for the tamper protection mechanism every 40 clicks of the mouse, or every time a file is opened, and if the right response is not forthcoming, the program shuts down. The call is usually encrypted so that it cannot be detected or intercepted."
Name:
Anonymous2007-04-14 13:51 ID:A7AOF5DU
All though you'll rarely find a reason to code in assembly, as it's been said it could only add on to your skills.
However if you want to become a better programmer I believe your time will be better spent studying O-notation and algorithm efficiency as well as data structures (or more generally, linked lists).
>>25
nah, didn't try it that,
but chances are it's just some integrity checks, and as i remember MS tends to put those all in one place(usually a dll), patching the dll and you're clear.
As for silent triggers that you mentioned, they are indeed annoying,but one should know that what they mean by 'encrypted call' is more likely to be more conspicious than they think.
For example people would use exceptions to get to OEP of asprotected programs making the job easier, while the authors thought that exceptions made the job harder..
As for vista's code integrity checking and patchguard, they've been basically cracked as well: http://www.symantec.com/avcenter/reference/Windows_Vista_Kernel_Mode_Security.pdf - integrity checking part http://uninformed.org/index.cgi?v=6&a=1 - defeating patchguard
I think anyone with a little bit of skill can aply the info symantec provided to defeat the integrity checks easily(in vista).
Again, i'm not sure about about modifying winlogon.exe, as i used a pre-cracked version for my xp, and as much as i remember the validation checks were in WgaTray.exe.
Also
'The program may call for the tamper protection mechanism every 40 clicks of the mouse, or every time a file is opened, and if the right response is not forthcoming, the program shuts down.'
<-- MS likes to keep its protection modules in one place, thus its possible to locate them even if you dont know who calls them(for example, set a bp in the code integrity dll's EP and you'll break when an app is LoadLibraryA/W'ing it.. Only problem with that is that services and r0 apps are a pain to debug and you need to use a r0 debugger(think SoftICE and the family), for the rest OllyDBG will suffice
>>25
oh ya i forgot something essential there,
to catch 99% of the integrity checks you just need to set a membp on read( or hwbp on access) on a bunch of code that will be checked, regardless what they do you'll find that code that accesses it(since to checksum/hash IT HAS TO READ THE DATA).. if that doesnt work you go about bp'ing VirtualProtect/Ex(as thats what you can use for removing breakpoints), then they can go even further by calling the kernel directly, but that can be cought as well..and the game continues :D
Logical approach always wins, no matter how hard they try :)
Holy fuck, like 99% of people in here are fucking retarded.
ASM is NOT hard. It IS worth learning. If you think it's hard, you're stupid. Case closed. If you have half a brain you can easily do anything in ASM that you can do in any HLL.
Another point: learning more than one HLL is stupid. C and C++ are really as far as you can go. Java is immensely fucking stupid, and everything else is not really even worth mentioning. Not to mention most all HLLs are so similar syntax-wise anyway they're practicly the same to code in anyway. Also, people who like languages because they're different, or have virtualization or what the fuck ever, are stupid. It's like, way to go, make your programs pointlessly slower. Fail.
Name:
Anonymous2007-04-15 3:51 ID:/DBPOJ0n
I don't want to hear anyone complain about having to learn Assembly to get their BS in CS. Our school was too cheap to buy the licenses for a conventional Assembly package. We got stuck with MIPS. Oh God I hated MIPS.
The instructions that you write in assembler map exactly to the machine code that is executed by the processor. So you will be programming using the CPU's main features, i.e. registers, the stack and jumps (equivalent of GOTO) rather than higher level concepts that would in other languages compile down to these.