home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / +HCU / 121-130.TXT < prev    next >
Encoding:
Text File  |  2000-05-25  |  41.5 KB  |  1,069 lines

  1. ========================================================
  2. +HCU Maillist          Issue: 121             01/20/1998 
  3. --------------------------------------------------------
  4. Send Articles To:......................... *************
  5. Info, Help, Unsubscription, etc:....... ****************
  6. Web Repository.........................hcuml.home.ml.org
  7. ========================================================
  8.  
  9. CONTENTS:
  10.  
  11. #1  Subject: Assembly
  12.  
  13. #2  Subject: finding program entry points
  14.  
  15. ARTICLES:
  16.  
  17. -----#1-------------------------------------------------
  18. Subject: Assembly
  19.  
  20. > -----#2-------------------------------------------------
  21. > Subject: Assembly
  22. > I'm still learning assembly and there is something that I'm not
  23. > sure of. The TEST command. It compares two things bit by
  24. > bit and sets Z to 1 if it's the same right? I see this line in programs
  25. > all the time,
  26. > TEST    AL, AL
  27. > and sometimes Z = 1 and sometimes not. Can someone explain this
  28. > to me?
  29. >     Joe Dark
  30. The test instruction performs a logical AND, and set the flags
  31. accordingly. E.g. test al,al or test ebx,ebx will set the Z flag if and
  32. only if ebx/al = 0 - more generally the Z flag will be set only if the
  33. operands share no common bits.
  34. I suppose this is why this instruction is often used by highlevel
  35. languages to test for error when exiting a call. Then you can let
  36. EAX/AL/whatever carry an error code and be 0 if no error occured.
  37.  
  38. On a totally different note - there was a discussion a while back on
  39. wrapping on the PE-executable. To those of you who don't keep up with the
  40. "warez scene" my PE-encrypter was released in sourcecode back in decemeber
  41. and it can still be found on my webnote along with an example of how you
  42. can patch packaged PE-files without having to go thru the agony of
  43. unpacking them. While this isn't a direct answer of how you can remove
  44. such a wrapper it does contain atleast half the answer.
  45.  
  46. On  a totally different note - can anyone think of a reason why
  47. ExitProcess sometimes chrashes if the Direction flag has been changed
  48. during a program on windows NT 4.0 workstation and not on a windows 95?
  49. Can a stack imbalance be the reason for the chrash and the STD flag change
  50. the offsettting factor?
  51.  
  52. Stone - United Cracking Force
  53. ************************
  54.  
  55.  
  56. -----#2-------------------------------------------------
  57. Subject: finding program entry points
  58.  
  59. [repost: first message got mangled]
  60.  
  61. You can get the entry point info from the EXE / PE header. Though, if you
  62. are lazy (like me) you can use HIEW (my favourite cracking tool).
  63.  
  64. Load the file into Hiew and then switch to code mode. Then press F8.
  65.  
  66. i.e. press F4, F3, F8.
  67.  
  68. Pressing F5 after F8 will jump to the code position.
  69.  
  70. Using IDA Pro 3.7 may also help as it can usually find entry points whereas
  71. Wdasm is quite poor. Also, I find ver. 8.9 very buggy and personally use 8.5.
  72.  
  73. ~~
  74. Ghiribizzo
  75.  
  76.  
  77. =====End of Issue 121===================================
  78.  
  79.  
  80.  
  81.  
  82. ========================================================
  83. +HCU Maillist          Issue: 122             01/21/1998 
  84. --------------------------------------------------------
  85. Send Articles To:......................... *************
  86. Info, Help, Unsubscription, etc:....... ****************
  87. Web Repository.........................hcuml.home.ml.org
  88. ========================================================
  89.  
  90. CONTENTS:
  91.  
  92. #1  Subject: Assembly
  93.  
  94. #2  Subject: Re: finding program entry points
  95.  
  96. ARTICLES:
  97.  
  98. -----#1-------------------------------------------------
  99. Subject: Assembly
  100.  
  101. The TEST command is identical to the AND command except that the result is
  102. NOT stored. The flags are however changed as if an AND command were used.
  103. Summary of flags changed (taken from Art of Assembly):
  104.  
  105.     It clears the carry flag. 
  106.     It clears the overflow flag. 
  107.     It sets the zero flag if the result is zero, they clear it otherwise. 
  108.     It copies the H.O. bit of the result into the sign flag. 
  109.     It sets the parity flag according to the parity (number of one bits) in
  110. the     L.O. byte of the result. 
  111.     It scrambles the auxiliary carry flag. 
  112.  
  113. For crackers the TEST command is useful because it is often used as the
  114. compare part of a compare/jump if good type of checking. In Win32 this
  115. usually manifests itself as a TEST EAX,EAX. This means the zero flag will
  116. be set IF AND ONLY IF EAX contains a non-zero BIT.
  117.  
  118. Note: TEST is to AND as CMP is to SUB.
  119.  
  120. I recommend you buy yourself a book on 80486 programming which will have
  121. useful references to all the opcodes and other useful info. If you're short
  122. of cash, there are useful free internet alternatives such as the Art of
  123. Assembly I quoted from above.
  124.  
  125. ~~
  126. Ghiribizzo
  127.  
  128. -----#2-------------------------------------------------
  129. Subject: Re: finding program entry points
  130.  
  131. [repost2: 2nd message did not make it]
  132. [repost: first message got mangled]
  133.  
  134. You can get the entry point info from the EXE / PE header. Though, if you
  135. are lazy (like me) you can use HIEW (my favourite cracking tool).
  136.  
  137. Load the file into Hiew and then switch to code mode. Then press F8.
  138.  
  139. i.e. press F4, F3, F8.
  140.  
  141. Pressing F5 after F8 will jump to the code position.
  142.  
  143. Using IDA Pro 3.7 may also help as it can usually find entry points whereas
  144. Wdasm is quite poor. Also, I find ver. 8.9 very buggy and personally use 8.5.
  145.  
  146. ~~
  147. Ghiribizzo
  148.  
  149.  
  150. =====End of Issue 122===================================
  151.  
  152.  
  153.  
  154.  
  155. ========================================================
  156. +HCU Maillist          Issue: 123             01/23/1998 
  157. --------------------------------------------------------
  158. Send Articles To:......................... *************
  159. Info, Help, Unsubscription, etc:....... ****************
  160. Web Repository.........................hcuml.home.ml.org
  161. ========================================================
  162.  
  163. CONTENTS:
  164.  
  165. #1  Subject: Sorry
  166.  
  167. #2  Subject: re:hacker trouble and outlook excrement
  168.  
  169. #3  Subject: Netscape Source Code !
  170.  
  171. ARTICLES:
  172.  
  173. -----#1-------------------------------------------------
  174. Subject: Sorry
  175.  
  176. Sorry about the repost and the late reply to the question about TEST. It
  177. seems that the digest script does it's thing sometime around midnight GMT
  178. (+/- 2 hours) rather than just before the current issue is sent. The result
  179. being that items posted after the digest but before the sending of the
  180. issue are stuck in a sort of limbo and will arrive a day late.
  181.  
  182. I've discovered also that some of my postings are being bounced back by the
  183. remailer (probably due to the anti-replay-attack mechanism employed), I
  184. think I've got it solved now.
  185.  
  186. ~~
  187. Ghiribizzo
  188.  
  189. -----#2-------------------------------------------------
  190. Subject: re:hacker trouble and outlook excrement
  191.  
  192. FORWARDED by fravia+
  193.  
  194. fravia+
  195. send a message on each of the mailing lists referring to this matter and
  196. that my email should go to ******************* (the site i mentioned in a
  197. newsletter so noone gets really confused)
  198.  
  199. i think that people would be suspicious of anyone claiming to be me on the
  200. lists unless the email came from the right place (ie tallahassee) but if
  201. you send a letter confirming the new email it will be accepted properly
  202. since you know me
  203.  
  204. ....i am a little worried about the fbi poking around reading people's
  205. email as well, so i am not sure i should use it again unless encrypted
  206. with pgp...
  207.  
  208. (i am really getting tired of servers going down due to irresponsible
  209. hackers)
  210.  
  211. this really sucks.
  212.  
  213. +gthorne
  214. -----------
  215. END FORWARDED BY FRAVIA
  216.  
  217.  
  218.  
  219. -----#3-------------------------------------------------
  220. Subject: Netscape Source Code !
  221.  
  222.  
  223. O.K., 
  224. from Netscapes Homepage: 
  225. Netscape plans to make Netscape Communicator 5.0 source code available 
  226. for modification and redistribution beginning later this quarter with 
  227. the first developer
  228. release of the product. The company will handle free source distribution 
  229. with a license which allows source code modification and redistribution 
  230. and provides
  231. for free availability of source code versions, building on the heritage 
  232. of the GNU Public License (GPL), familiar to developers on the Net. 
  233. Netscape intends to
  234. create a special Web site service where all interested parties can 
  235. download the source code, post their enhancements, take part in 
  236. newsgroup discussions, and
  237. obtain and share Communicator-related information with others in the 
  238. Internet community. Netscape will also continue to develop new 
  239. technologies and offer
  240. periodic certified, high-quality, supported releases of its Netscape 
  241. Communicator and Navigator products, incorporating some of the best 
  242. features created by this
  243. dynamic community. 
  244.  
  245.  
  246. ______________________________________________________
  247. Get Your Private, Free Email at **********************
  248.  
  249. =====End of Issue 123===================================
  250.  
  251.  
  252.  
  253.  
  254. ========================================================
  255. +HCU Maillist          Issue: 124             01/24/1998 
  256. --------------------------------------------------------
  257. Send Articles To:......................... *************
  258. Info, Help, Unsubscription, etc:....... ****************
  259. Web Repository.........................hcuml.home.ml.org
  260. ========================================================
  261.  
  262. CONTENTS:
  263.  
  264. #1  Subject: repository
  265.  
  266. #2  Subject: hackers and hassles
  267.  
  268. #3  Subject: PGP
  269.  
  270. ARTICLES:
  271.  
  272. -----#1-------------------------------------------------
  273. Subject: repository
  274.  
  275. Hi +Alt-f4! :)
  276.  
  277. > If someone had told me sooner, I could have made the fix in a few
  278. > seconds.(Only needed to change a couple of lines)
  279.  
  280. My fault. Sorry. I gave a look at it immediately after you sent your previous 
  281. message, but I didn't answer... O:-)
  282.  
  283. > I can only assume
  284. > 1) No-one cares
  285. > 2) No one checked the page
  286. > 3) Every one assumes I am a terrible programmer :(
  287.  
  288. 4) I thought it was MY fault, so I was waiting someone other's response... 
  289. But I assure you I care, I checked the page and I think you're a good 
  290. programmer... especially after my last visit to the page: it really works fine 
  291. and it seems to be really faster than the old applet I use... 
  292.  
  293. > Please send comments, EVEN IF IT DOESN'T WORK!
  294.  
  295. It works :) To be honest, I didn't try to make it crash, I just made some 
  296. simple searches, but it seems to work fine and fast... now some questions:
  297.  
  298. Does it need all those single issues? Is it possible for me to continue using 
  299. groups of 10 issues together? It's a lot easier to maintain... as you can see 
  300. from my page, I sometimes forget to put online the 10-packs, think about all 
  301. those single issues!
  302.  
  303. Can I put it on my page? O:-))
  304.  
  305.  
  306. byez,
  307.  
  308.     .+MaLaTTiA.
  309.  
  310. -----#2-------------------------------------------------
  311. Subject: hackers and hassles
  312.  
  313.  
  314. Thank God (or Sharp...) for cracking.net and alternate emails
  315.  
  316. i wanted to say hello to you all since this last week has meant my emails
  317. have been beouncing from my old email address at freenet.fsu.edu - if you
  318. emailed me, and i did not respond, that is what happened
  319.  
  320. (hoping no-one sent any nice juicy electronic mailings directly to the fbi
  321. via that address..)
  322.  
  323. maybe we should start using pgp a little more frequently?
  324.  
  325. i noticed that fravia forwarded my message properly to the list - so i
  326. wont bore you with restating myself
  327.  
  328. i have however made the articles available if you would like to read the
  329. newsfeed about it - just for interest's sake anyway
  330.  
  331. ****************************************
  332.  
  333. as you can see i have had to streamline my sig a little this week...
  334.  
  335. +gthorne
  336.  
  337. /**************************************************\
  338.  
  339.            Greythorne The Technomancer
  340.  
  341.  WebSite: *********************
  342.  OrcPaks: ******************************************
  343.  
  344. \**************************************************/
  345.  
  346.  
  347.  
  348. -----#3-------------------------------------------------
  349. Subject: PGP
  350.  
  351. Greetings All,
  352. With all the e-mail privacy discussions going about I decided to
  353. get PGP(bout time huh?)Anyway,my question is that there is a new
  354. version of PGP and it uses the DSS/Diffie-Hellman encryption instead
  355. of RSA..Was just wondering what type the majority in here use and if
  356. one was more secure than the other?Newer versions don't necessarily
  357. mean better do they :-).Oh an thanks for the healthy dose of
  358. paranoia,lol
  359. Warlord
  360.  
  361.  
  362. =====End of Issue 124===================================
  363.  
  364.  
  365.  
  366.  
  367. ========================================================
  368. +HCU Maillist          Issue: 125             01/25/1998 
  369. --------------------------------------------------------
  370. Send Articles To:......................... *************
  371. Info, Help, Unsubscription, etc:....... ****************
  372. Web Repository.........................hcuml.home.ml.org
  373. ========================================================
  374.  
  375. CONTENTS:
  376.  
  377. #1  Subject: Re:Repository
  378.  
  379. #2  Subject: pgp
  380.  
  381. ARTICLES:
  382.  
  383. -----#1-------------------------------------------------
  384. Subject: Re:Repository
  385.  
  386. Hi     .+MaLaTTiA.
  387.  
  388. >Does it need all those single issues? Is it possible for me to continue
  389. using 
  390. >groups of 10 issues together? It's a lot easier to maintain... as you can
  391. see 
  392. >from my page, I sometimes forget to put online the 10-packs, think about all 
  393. >those single issues!
  394.  
  395. Any size groups you want! :)
  396. All you have to do, is put the individual files you want in the zip, and
  397. also on the server. When searching it uses the zip, and for displaying it
  398. uses the server(I did this because browsers can't directly read from a
  399. zip), but I can search in a zip much quicker...
  400.  
  401. I am working on another version that doesn't need files on the server. With
  402. a combination of javascript and frames, I could make it so the Java can
  403. update the display straight from the zip.
  404. This means you could keep the individual issues, and only have to upload
  405. the new zip...
  406. If this works, I could then add html tags to the page, so that it
  407. automatically goes to the line with the word you were searching for. The
  408. possibilities are endless...
  409. Of course. all this is only worthwhile if other people want it. So far, it
  410. seems only you and I are intersted .+MaLaTTiA. !
  411.  
  412. >Can I put it on my page? O:-))
  413.  
  414. Yeah, of course!
  415. I'll document the way it is used, so they you can add it easily...
  416.  
  417. +Alt-F4
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424. -----#2-------------------------------------------------
  425. Subject: pgp
  426.  
  427. I like to stick with PGP 2.62g, the one with the "bug fix" that enables 
  428. it up to 1024-bit keys. I've heard than newer versions such as 5.0 have 
  429. this feature now, but with the NSA and all I really only trust the 
  430. cypherphunk's "g" version.
  431.  
  432. mammon_
  433.  
  434. ______________________________________________________
  435. Get Your Private, Free Email at **********************
  436.  
  437. =====End of Issue 125===================================
  438.  
  439.  
  440.  
  441.  
  442. ========================================================
  443. +HCU Maillist          Issue: 126             01/27/1998 
  444. --------------------------------------------------------
  445. Send Articles To:......................... *************
  446. Info, Help, Unsubscription, etc:....... ****************
  447. Web Repository.........................hcuml.home.ml.org
  448. ========================================================
  449.  
  450. CONTENTS:
  451.  
  452. #1  Subject: Advanced Javascript page...
  453.  
  454. #2  Subject: re:  Repository
  455.  
  456. #3  Subject: DSS/Diffie-Hellman vs. RSA
  457.  
  458. ARTICLES:
  459.  
  460. -----#1-------------------------------------------------
  461. Subject: Advanced Javascript page...
  462.  
  463. Hi +all..
  464.  
  465. Has anyone managed to get through to the Advanced javascript page?
  466.  
  467. I managed to get a valid password(Through brute force), but the program
  468. doesn't seem to use the first letter..
  469. I tried all letters and numbers as the first character, with no luck.....
  470. So has anyone got through?
  471. +Alt-F4
  472.  
  473. -----#2-------------------------------------------------
  474. Subject: re:  Repository
  475.  
  476. >Of course. all this is only worthwhile if other people want it. So far, it 
  477. >seems only you and I are intersted .+MaLaTTiA. !
  478.  
  479. +Alt-F4, I am interested in your repository idea.  I think that it will
  480. have wide-ranging application, once people really grasp what it can  do.
  481. Likely there is commercial value there for you.
  482.  
  483. I would be most interested in using it on my page.
  484.  
  485. A question to all:  I am relatively "unanointed" regarding +HCU.  Is there
  486. a certain requirement for using the "+" before ones name?
  487.  
  488. zinger
  489.  
  490. -----#3-------------------------------------------------
  491. Subject: DSS/Diffie-Hellman vs. RSA
  492.  
  493. [repost: mix up]
  494.  
  495. Personally, I have both types of keys. I try to use D-H as much as I can,
  496. but often use RSA to maintain backwards compatibility with 3.x users. I
  497. think that PGP offer a 'free' personal version of PGP5 which means that
  498. anyone with windows 95 will be able to use the newer keys. However, I'm not
  499. sure if the newer versions have been ported to other platforms.
  500.  
  501. As to the pros and cons of the algorithms:
  502.  
  503. 1. D-H is much faster at encryption/decryption than RSA
  504. 2. The discrete logarithm (D-H) is thought to be a more difficult problem
  505. to       solve than factoring (RSA).
  506. 3. RSA has some 'quirks' which may compromise security if the user is not
  507. aware    of them.
  508. 4. PGP uses MD5 to hash for RSA whereas it uses SHA for D-H. MD5 was broken
  509. (partially) in 1996 - I haven't kept up with the area and it may well have
  510. been completely broken by now. If you intend to use PGP for signing, you
  511. should go for D-H.
  512. 5. While writing this, I decided to take a look at the PGP manual and found
  513. that it had new symmetric algorithms. Previous versions used only IDEA, but
  514. now PGP offers CAST (default on D-H keys), IDEA (only option for RSA keys)
  515. and Triple-DES. I haven't heard of CAST before but the manual says it's
  516. new. I'm surprised that it was chosen in favour of IDEA (well, maybe not -
  517. the patent holders of IDEA want royalties [at least on commmercial
  518. versions]). I'll take a look into CAST.
  519.  
  520.  
  521. There's information in the user manual and also there's a wealth of
  522. information on the web.
  523.  
  524. ~~
  525. Ghiribizzo
  526.  
  527.  
  528. =====End of Issue 126===================================
  529.  
  530.  
  531.  
  532.  
  533. ========================================================
  534. +HCU Maillist          Issue: 127             01/28/1998 
  535. --------------------------------------------------------
  536. Send Articles To:......................... *************
  537. Info, Help, Unsubscription, etc:....... ****************
  538. Web Repository.........................hcuml.home.ml.org
  539. ========================================================
  540.  
  541. CONTENTS:
  542.  
  543. #1  Subject: advanced javascript
  544.  
  545. #2  Subject: erratums & appendix
  546.  
  547. ARTICLES:
  548.  
  549. -----#1-------------------------------------------------
  550. Subject: advanced javascript
  551.  
  552. +Alt-F4,
  553.  
  554. I've managed to get through on the fravia.org site. Are you sure you've got
  555. the correct password?
  556.  
  557. ~~
  558. Ghiribizzo
  559.  
  560.  
  561. -----#2-------------------------------------------------
  562. Subject: erratums & appendix
  563.  
  564. ---------------
  565. Erratum and appendix for:
  566. Encoded selfmodifying targets the Power Desk suite from Mijenix an essay
  567. by Uncle Van
  568.     
  569. ------ QUOTE
  570. As we can see it has 572A bytes initialized data (data we should NOT
  571. touch!) and is at offset 6A8000 in the file. With our piece of code the
  572. size increases to: 
  573.  
  574.         572A+0E8A=65B4h
  575.  
  576.  
  577. what we round up to 6600h (must be so for systems reason) for both
  578. virtual and raw size. The offset in the EXE where we should place our
  579. code is calculated so: 
  580.  
  581.         6A800+572A=6FF2Ah
  582. ---- Unquote
  583. The reason behind rounding up these values - is a concept Microsoft
  584. introduced because of among other things - speed of loading. Rounding up
  585. the ObjectSize(part in a PE-file is called an Object - not a segment -
  586. segment is a term used in realmode memory management :) ) should be done
  587. in accordance to the File Alignment which can be found in the PE-Header.
  588. This would normally be 200h - but it need not be. (Quine is bailed out
  589. by this fact in his great essay on HASP) When rounding up it should be
  590. done so that the Physical Size (Microsoft denotation for Rawdata size)
  591. is a multiple of this - any excess should be zeropadded (according to MS
  592. documentation on PE files - however this is a place where MS's loaders
  593. are not too uptight ;) ). Normally the Object's VirtualSize should be
  594. aligned in accordance with the ObjectAlignment (which also can be found
  595. in the PE-header) however for the last object it's not a problem.
  596. Further - we can touch the data in the reloctions. They are not used
  597. unless the program should be relocated for some reason. It does however
  598. involve a problem a general compatability - because should it be
  599. relocated it would chrash had we touched the relocs. However it's worth
  600. noting that that you patch-in the memory address to the read function in
  601. Hardcode without adding this address to the relocation table - thus if
  602. the program are relocated you chrash anyways. The program isn't
  603. relocated normally because it has an ImageBase of 400000h which is the
  604. default for WinNT 3.50+ and 95. Another problem with your patching is
  605. the ImageSize field in the PE-Header. You do not update it as you add to
  606. the virtual size of the .reloc object. I don't know if you tested your
  607. crack on a windows NT - because it it's much more rigorous in it's
  608. incosistency checks than windows95. Without having actually tried it -
  609. it is my best guess that you'll get an AccessDenied notice if you try.
  610. If you are curious how to append code/or data to PE-files I suggest you
  611. take a look at my PE-crypter at ********************************
  612. IMHO the crack would've been more elegant if you had taken out the
  613. write-memory and the checking the original zero's and had just patched
  614. in the right bytes at the right address straight away. But ofcause you
  615. wouldn't have to venture into the fashinating field of appending stuff
  616. ;)
  617.  
  618. ------ Quote
  619. But as you walk to the higher ring number more and more restrictions
  620. appears: several opcodes get disabled, you are not allowed to acces
  621. memory regions you not own, IN and OUT instructions are getting
  622. "controlled", and at least, you can't even write to your own code
  623. segments because it is write protected too. (Here I'm not so sure!) 
  624. You can "jump" from a ring with higher privilege to code in rings with
  625. lower privilege, but not vice versa. 
  626. In the windo$e world applications run of course in the ring 3 mode ;-(,
  627. while the main part of the OS itself AND the drivers (Vxd!) operate at
  628. ring 0. And as we already know from Fravias page, overwriting the own
  629. code is essential for a good protection. The most cool protections BTW
  630. were made in DOS real-mode times, some of them are not cracked yet! 
  631. ----- Unquote
  632. It is true that your own code can be write protected. However this is
  633. something that you choose (or most likely your linker) at compile time.
  634. In the part of the PE-header refered to as the object table - each
  635. object is assigned flags - these flags determine among other things
  636. weather a GPF should be produced by writting in the memory space
  637. occupied (defined in the object table entry too) by the object.
  638. Overridding this protection microsoft supplied some API functions -
  639. which we in this essay rampage amongst. It is true you cannot directly
  640. jump from a lower ring to a higher  But there is ways. Pietrek noted
  641. that you could setup your own call gates and obtain ring 0 that way.
  642. Others noted that MS left a undocumented VXD function in one of their
  643. VxD's for ring switching. Further it's not entirely true that the major
  644. part of the OS operates at ring 0. Infact MS went thru great lengths to
  645. ensure this wasn't the case. Memory management, IO management and such
  646. ofcause requires ring 0, naturally - so this is kept in ring 0. But most
  647. in terms of lines of code is actually ring 3 based.
  648. ---------
  649. Erratum for:
  650. Pushing the Envelope with HASP - by Quine
  651.  
  652. As Fravia notes - this is an excellent essay. That it has an error of
  653. beauty does not change this fact. Quine is a master cracker and this
  654. essay is unusually insightful and well written. heheh. enough ass
  655. kissing.. :)
  656.  
  657. ------Quote
  658. A regular breakpoint won't fire because they've re-routed the interrupt.
  659.  No problem.  This has always seemed more of a minor nuisance than
  660. anything else because all you have to do is set a debug register
  661. breakpoint.  So, 'bpmb CallHasp x' does the trick.  The x indicates that
  662. it will break if the execution reaches that address.  In other words,
  663. it's functionally equivalent to a regular bpx, but invisible to any
  664. anti-SoftICE tricks.  
  665. Of course, you only get four debug register bps at a time, but I've
  666. always found that to be plenty.
  667. ------ UnQuote
  668. These statements are well - not entirely correct. A regular breakpoint
  669. won't fire - more than once. This is because the way a regular
  670. breakpoint works is by inserting an interupt 3 - (elsewhere on fravia's
  671. somebody uses the opcode cd 03 - to get a int 3 - this is soooo clumbsy
  672. - the real opcode is one byte (0cch)) Anyways - this int 3 is
  673. overwritten as by Hasp as it overwrites this section in the memory - as
  674. Quine notes later. Rerouting interupts requires ring 0 - which HASP
  675. doesn't have and doesn't take. Had it had ring 0 - I'm quite certain
  676. that along with int 3 it would've rerouted int 1 (debug exception) which
  677. is the handler of the BPM's making Quine's approach useless (even
  678. tracing would be gone then because tracing utillizes this exception
  679. too). This however isn't the case. 
  680. The invisibillity is only an approximative truth. As no opcode is
  681. inserted into the program obviously you can't look for changes or
  682. anything to that effect. Also you cannot access the breakpoint registers
  683. from ring 3. Thus bpmb on execution is undetectable from ring 3. Not
  684. from ring 0 though. It should be noted that while the breakpoint isn't
  685. detecable from ring 3 - winice is - on my homepage you can find multiple
  686. techniques - some exploiding holes in windows - some more wellbehaved -
  687. but common to them all is they run from ring 3.
  688. One should also note that this hole thing with Int 3 isn't a specific
  689. anti-softice technique - it's a general counter meassure to any debugger
  690. - in particular application level debuggers which does not have the int
  691. 1 possiblities avaible because of their ring 3 status.
  692. The technique that Quine applies is a very efficient technique - that
  693. you should all learn and enjoy - it is truely powerful.
  694. ---------
  695. Appendix for:
  696. Quine's quick crack for Heavy Protection - by Quine ofcause :)
  697.  
  698. ---- Quote
  699. P.S.  A further consequence of +RCG's neglect of relocations is that
  700. the program will crash if it is ever relocated by the operating
  701. system.  This is not bound to happen to an exe, but it is extremely
  702. likely with a dll, in which case the operating system will start
  703. adding values to bytes within the encrypted code and that will lead to
  704. an inevitable crash.
  705. ----- Unquote
  706.  
  707. Quine has an excellent point. That I'd like to take the opportunity to
  708. elaborate on. EXE-files are not relocated by windows if they can be
  709. loaded by the desired ImageBase which is put in the PE-header by the
  710. linker. Modern linkers has obviously chosen a Desired ImageBase that is
  711. always possible in win 95/nt and thus relocations is not a problem and
  712. will not be used. However Windows NT 3.12 does exists and new operating
  713. systems might have a different way of assigning memory so that the
  714. default imagebase of today might not be that of tomorrow forcing
  715. relocation to all files made now. DLL's are more vounerable to
  716. Relocations than EXE's. However not much - but encrypting them blindly
  717. is definately not a good idea. The real issue here is that relocations
  718. MIGHT take place and blindly encrypting forgetting about relocations is
  719. the sure way to incompatbillity which ofcause is not a desireable
  720. quality. However there is a way to encrypt without suffering the
  721. penalties of having to explicitly dealing with relocations. If you
  722. encrypt additively the encryption/decryption scheme is invariant to
  723. relocations. E.g. Add 4 to every byte in the image for encryption and
  724. sub them for decryption will not be effected by relocations because
  725. relocations in themselves are additive of nature. At first glance such a
  726. scheme seems a week encryption - however it can be shown that every
  727. byte-2-byte schemes such as XOR,ROL/ROR encryptions can be considered
  728. special cases of a sufficiently advanced additive scheme.
  729. Also I'd like to speak a word of warning about using Ring 0 code to
  730. defend against debuggers. The stability offered by NT hinges (an
  731. actually what little stability offered by win95 too) on a seperation
  732. between the application level and the system level. (ring 3/ring 0) -
  733. gaining ring 0 and using it in a protection system is a violation of the
  734. sound principle of having this seperation - and indeed if you are just a
  735. wee bit intelligent - not required for a good protection either. They
  736. key word is here - stay out of ring 0 unless you have most excellent
  737. reasons to be there. Think of it this way: Microsoft wanted to keep the
  738. GFX driver out of ring 0. When you think of how much hardware related a
  739. GFX driver and thus the incentive to program it in ring 0 is - the
  740. ring-seperation issue is in it's right light. Do not write ring 0 code
  741. unless there is no other way of doing what you want. 
  742.  
  743.  
  744. ----------
  745. Stone / United Cracking Force '98
  746. ************************
  747. email: ************
  748.  
  749. =====End of Issue 127===================================
  750.  
  751.  
  752.  
  753.  
  754. ========================================================
  755. +HCU Maillist          Issue: 128             01/29/1998 
  756. --------------------------------------------------------
  757. Send Articles To:......................... *************
  758. Info, Help, Unsubscription, etc:....... ****************
  759. Web Repository.........................hcuml.home.ml.org
  760. ========================================================
  761.  
  762. CONTENTS:
  763.  
  764. #1  Subject: Re: errata & etc.
  765.  
  766. ARTICLES:
  767.  
  768. -----#1-------------------------------------------------
  769. Subject: Re: errata & etc.
  770.  
  771. Stone,
  772.  
  773. >>>>
  774. It is true that your own code can be write protected. However this is
  775. something that you choose (or most likely your linker) at compile time.
  776. <<<<
  777.  
  778. From what I remember this is just needs a READWRITE flag set in the source
  779. code. But I can't remember where I read this.
  780.  
  781. >>>>
  782. This is because the way a regular breakpoint works is by inserting an
  783. interupt 3 - (elsewhere on fravia's somebody uses the opcode cd 03 - to get
  784. a int 3 - this is soooo clumbsy - the real opcode is one byte (0cch))
  785. <<<<
  786.  
  787. I assumed that softice used hardware breakpoints when they were available
  788. for bpxing - I didn't think that you had to do it by hand. Oh well, back to
  789. fkey/macro definitions...
  790. As for CCh - I just wish some asm programmers used CD03 when they whacked
  791. INT 21h onto 3 :) Was CD03 used deliberately to 'nop out' unwanted code? It
  792. seems very unnatural to type CD03 rather than CC.
  793.  
  794. >>>>
  795. winice is - on my homepage you can find multiple
  796. techniques - some exploiding holes in windows - some more wellbehaved -
  797. but common to them all is they run from ring 3.
  798. <<<<
  799.  
  800. I've always thought it strange that protectionists never tried to search
  801. for softice given how easy it can be done and how difficult (if not
  802. impossible) it would be to hide from a determined programmer.
  803. I wrote to Quine about this not long ago as he pre-empted one of my
  804. 'concept' protection schemes: basically heavy softice detection with PE
  805. wrapping. I thought that since most crackers have little experience in
  806. unpacking PE packed files it would be quite safe also tools were limited at
  807. the time, but with Quine's SoftDump...
  808.  
  809. >>>>
  810. key word is here - stay out of ring 0 unless you have most excellent
  811. reasons to be there. Think of it this way: Microsoft wanted to keep the
  812. GFX driver out of ring 0. When you think of how much hardware related a
  813. GFX driver and thus the incentive to program it in ring 0 is - the
  814. ring-seperation issue is in it's right light. Do not write ring 0 code
  815. unless there is no other way of doing what you want. 
  816. <<<<
  817.  
  818. I agree that going to ring 0 is hardly ever necessary. But I remember
  819. reading the above paragraph somewhere recently. Was it something you wrote?
  820. Do you know where it is from?
  821.  
  822. >>>>
  823. P.S.  A further consequence of +RCG's neglect of relocations is that
  824. the program will crash if it is ever relocated by the operating
  825. system.  This is not bound to happen to an exe, but it is extremely
  826. likely with a dll, in which case the operating system will start
  827. adding values to bytes within the encrypted code and that will lead to
  828. an inevitable crash.
  829. <<<<
  830.  
  831. In defence of RCG. I think he was presenting a protection CONCEPT rather
  832. than a finished protection itself - it has done it's job of presenting
  833. ideas and has generated discussion. 
  834.  
  835. ~~
  836. Ghiribizzo
  837.  
  838. =====End of Issue 128===================================
  839.  
  840.  
  841.  
  842.  
  843. ========================================================
  844. +HCU Maillist          Issue: 129             01/30/1998 
  845. --------------------------------------------------------
  846. Send Articles To:......................... *************
  847. Info, Help, Unsubscription, etc:....... ****************
  848. Web Repository.........................hcuml.home.ml.org
  849. ========================================================
  850.  
  851. CONTENTS:
  852.  
  853. #1  Subject: Re: erratums & appendix
  854.  
  855. ARTICLES:
  856.  
  857. -----#1-------------------------------------------------
  858. Subject: Re: erratums & appendix
  859.  
  860. Well, it's always nice have a message from Stone who is a true scholar of=
  861.  the PE
  862. format, an excellent exe-packer, and all around good cracker.  As it =
  863. turns out, from
  864. our correspondence, we agree on many points.  I'd just like to take a =
  865. little time to
  866. comment on his comments and may be expand on a point or two.
  867.  
  868. Stone >>>>>>>>>>>>>>
  869. It is true that your own code can be write protected. However this is
  870. something that you choose (or most likely your linker) at compile time.
  871. In the part of the PE-header refered to as the object table - each
  872. object is assigned flags - these flags determine among other things
  873. weather a GPF should be produced by writting in the memory space
  874. occupied (defined in the object table entry too) by the object.
  875. Overridding this protection microsoft supplied some API functions -
  876. which we in this essay rampage amongst. It is true you cannot directly
  877. jump from a lower ring to a higher  But there is ways. Pietrek noted
  878. that you could setup your own call gates and obtain ring 0 that way.
  879. Others noted that MS left a undocumented VXD function in one of their
  880. VxD's for ring switching. Further it's not entirely true that the major
  881. part of the OS operates at ring 0. Infact MS went thru great lengths to
  882. ensure this wasn't the case. Memory management, IO management and such
  883. ofcause requires ring 0, naturally - so this is kept in ring 0. But most
  884. in terms of lines of code is actually ring 3 based.
  885. <<<<<<<<<<<<<<<<<<<
  886.  
  887. All of this quite correct and to add something, as Stone knows, =
  888. VirtualProtect is my
  889. preferred method of writing to the code section at runtime.  It allows =
  890. you to set a
  891. read only page to read/write (with some restrictions obviously) and then =
  892. set it back
  893. once you're done.
  894.  
  895. Stone >>>>>>>>>>>>>>>>>>>>>
  896. ---------
  897. Erratum for:
  898. Pushing the Envelope with HASP - by Quine
  899.  
  900. As Fravia notes - this is an excellent essay. That it has an error of
  901. beauty does not change this fact. Quine is a master cracker and this
  902. essay is unusually insightful and well written. heheh. enough ass
  903. kissing.. :)
  904. <<<<<<<<<<<<<<<<<<<<<
  905. Oh, come on, it's never enough ;)
  906. >>>>>>>>>>>>>>>>>>>>>>>
  907. ------Quote
  908. A regular breakpoint won't fire because they've re-routed the interrupt.
  909.  No problem.  This has always seemed more of a minor nuisance than
  910. anything else because all you have to do is set a debug register
  911. breakpoint.  So, 'bpmb CallHasp x' does the trick.  The x indicates that
  912. it will break if the execution reaches that address.  In other words,
  913. it's functionally equivalent to a regular bpx, but invisible to any
  914. anti-SoftICE tricks. =20
  915. Of course, you only get four debug register bps at a time, but I've
  916. always found that to be plenty.
  917. ------ UnQuote
  918. These statements are well - not entirely correct. A regular breakpoint
  919. won't fire - more than once. This is because the way a regular
  920. breakpoint works is by inserting an interupt 3 - (elsewhere on fravia's
  921. somebody uses the opcode cd 03 - to get a int 3 - this is soooo clumbsy
  922. - the real opcode is one byte (0cch)) Anyways - this int 3 is
  923. overwritten as by Hasp as it overwrites this section in the memory - as
  924. Quine notes later. Rerouting interupts requires ring 0 - which HASP
  925. doesn't have and doesn't take. Had it had ring 0 - I'm quite certain
  926. that along with int 3 it would've rerouted int 1 (debug exception) which
  927. is the handler of the BPM's making Quine's approach useless (even
  928. tracing would be gone then because tracing utillizes this exception
  929. too). This however isn't the case.=20
  930. The invisibillity is only an approximative truth. As no opcode is
  931. inserted into the program obviously you can't look for changes or
  932. anything to that effect. Also you cannot access the breakpoint registers
  933. from ring 3. Thus bpmb on execution is undetectable from ring 3. Not
  934. from ring 0 though. It should be noted that while the breakpoint isn't
  935. detecable from ring 3 - winice is - on my homepage you can find multiple
  936. techniques - some exploiding holes in windows - some more wellbehaved -
  937. but common to them all is they run from ring 3.
  938. One should also note that this hole thing with Int 3 isn't a specific
  939. anti-softice technique - it's a general counter meassure to any debugger
  940. - in particular application level debuggers which does not have the int
  941. 1 possiblities avaible because of their ring 3 status.
  942. The technique that Quine applies is a very efficient technique - that
  943. you should all learn and enjoy - it is truely powerful.
  944. ---------
  945. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  946. I have to admit that Stone is absolutely on point here.  I was a little =
  947. sloppy here
  948. and didn't do enough research into anti-SI/anti-debugging techniques, but=
  949.  rather just
  950. made an assumption.  I have since taken a look at the anti-debugging info=
  951.  on Stone's
  952. site and learned what to look for next time and how it works.  I suggest =
  953. every one
  954. take a peel there.
  955. Stone >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  956. Also I'd like to speak a word of warning about using Ring 0 code to
  957. defend against debuggers. The stability offered by NT hinges (an
  958. actually what little stability offered by win95 too) on a seperation
  959. between the application level and the system level. (ring 3/ring 0) -
  960. gaining ring 0 and using it in a protection system is a violation of the
  961. sound principle of having this seperation - and indeed if you are just a
  962. wee bit intelligent - not required for a good protection either. They
  963. key word is here - stay out of ring 0 unless you have most excellent
  964. reasons to be there. Think of it this way: Microsoft wanted to keep the
  965. GFX driver out of ring 0. When you think of how much hardware related a
  966. GFX driver and thus the incentive to program it in ring 0 is - the
  967. ring-seperation issue is in it's right light. Do not write ring 0 code
  968. unless there is no other way of doing what you want.=20
  969. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  970. Ok, this is a big deal, people.  The only problem with what Stone wrote =
  971. here is that
  972. he didn't write it in all capitals with a lot of exclamation points :).  =
  973. STAY OUT OF
  974. RING ZERO!  What this really means is stay out of ring zero unless you =
  975. are writing a
  976. debugging tool of some sort that requires it.  Do not ever use ring zero =
  977. in a
  978. protection scheme!!!  This is tantamount to spreading a virus (or a =
  979. trojan horse,
  980. whatever).  Foisting ring zero code on unsuspecting and unknowing users =
  981. is highly
  982. irresponsible.  You're going to crash the computer at one point or =
  983. another and that
  984. really sucks.  Especially if you get some crazy idea to use ring zero =
  985. code on an NT
  986. system (provided you have some means of even getting it there).  NT =
  987. machines don't
  988. crash.  If you manage to crash one, you've done a very bad thing that =
  989. people will
  990. hate you for.  One of the two times in 9 months my NT system has crashed =
  991. (this is not
  992. a typo) was because of a bad driver and I was ready to kill the driver =
  993. programmers.
  994. The other time was because I did something stupid in SoftICE.  A crashed =
  995. NT machine
  996. is a sad, pathetic site that is the fault of bad and irresponsible =
  997. programming by, I
  998. have to say, someone other than Micro$oft.
  999.  
  1000. I've spouted off long enough.  Thanks, Stone, for your comments.
  1001.  
  1002. Quine
  1003.  
  1004.  
  1005. =====End of Issue 129===================================
  1006.  
  1007.  
  1008.  
  1009.  
  1010. ========================================================
  1011. +HCU Maillist          Issue: 130             01/31/1998 
  1012. --------------------------------------------------------
  1013. Send Articles To:......................... *************
  1014. Info, Help, Unsubscription, etc:....... ****************
  1015. Web Repository.........................hcuml.home.ml.org
  1016. ========================================================
  1017.  
  1018. CONTENTS:
  1019.  
  1020. #1  Subject: A question about SoftICE
  1021.  
  1022. #2  Subject: W32Dasm
  1023.  
  1024. #3  Subject: Re: W32Dasm
  1025.  
  1026. ARTICLES:
  1027.  
  1028. -----#1-------------------------------------------------
  1029. Subject: A question about SoftICE
  1030.  
  1031. Hi,
  1032.   A question about SoftIce:
  1033.   How could I set a breakpoint to a function which name start with a ? mark
  1034. ( ex.   *********************************************  <-- comes from
  1035. timelock 3.0) ?
  1036.  
  1037. BlueMan
  1038.  
  1039. -----#2-------------------------------------------------
  1040. Subject: W32Dasm
  1041.  
  1042. Has anyone else ever gotten a GDI failure while dissassembling
  1043. things using this program?
  1044.  
  1045.     Joe Dark
  1046.  
  1047.  
  1048. -----#3-------------------------------------------------
  1049. Subject: Re: W32Dasm
  1050.  
  1051. Joe Dark wrote:
  1052. >Has anyone else ever gotten a GDI failure while dissassembling
  1053. >things using this program?
  1054.  
  1055. Yes, i always got that message with one of the cracked early versions,
  1056. when it finnished the disassembling and wanted to present the result,
  1057. (may be something wrong with fonts), but it never really was a problem.
  1058. I just hit ok and everything worked fine. Now i have reged 8.9 (fished
  1059. from net) and it does not produce the GDI message.
  1060.  
  1061. bye Zer0+
  1062.  
  1063.  
  1064. =====End of Issue 130===================================
  1065.