home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / Code Inside / Tut16.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  24.8 KB  |  588 lines

  1. **************************************************************************************************************
  2.                    Crudd's Forward Me
  3. **************************************************************************************************************
  4.  
  5. Author:        Crudd
  6. Protection:    Reconstruct the Sections and make a valid PE file
  7. URL:        http://www.immortaldescendants.org/users/santmat/reversemes/forwardme.zip
  8. Tools:        W32Dasm
  9.         Hex-Editor
  10.         Tutorial about PE header from "LUEVELSMEYER" (to explain it better ;)
  11.  
  12.  
  13. --->    Intro...
  14.  
  15. Welcome to my next Tutorial !!!
  16. This time a ReverseMe from Crudd.
  17. We need to make a valid PE file out of several Sections :)
  18.  
  19.  
  20. --->    Let's Begin...
  21.  
  22. Open the zip file and you'll see some files including the "ForwardMe.txt" :)
  23. Unzip everything to somewhere on your computer (i prefer desktop), you can leave the .txt file
  24. but make sure you read it ;)
  25.  
  26. 1.
  27. Ok first things first we're going to examine the other files so open up your Hex-Editor, and
  28. open the first file called "1_Here.hex".
  29. Hmmm... some weird shit here, dunno yet let's rename the file to "Unknown.hex".
  30.  
  31. 2.
  32. Let's open the second file which is called "2_Are.hex".
  33. Aahh now that's some good stuff you'll immediately notice that this is the import table because
  34. of the API's you see below.
  35. So let's rename this file to "Import.hex".
  36.  
  37. 3.
  38. Let's open the third file called "3_The.hex".
  39. We'll see some strings in here and especially the "Congrats, everything seems to be working fine." string.
  40. So this is probably some Text Section let's rename it to "Text.hex"
  41.  
  42. 4.
  43. Let's open the fourth file, it's called "4_Five.hex".
  44. Hmm... some Unicode strings like "Cancel" , "Name" , "Serial" <--- Probably the Resource Section ;)
  45. So let's call this file "Rsrc.hex".
  46.  
  47. 5.
  48. Let's now open the last file called "5_Sections.hex".
  49. Ah Opcodes ;) this must be the Code Section.
  50. So let's rename it to "Code.hex".
  51.  
  52. Now we know what kind of Sections these files contain (except for the unknown), but we need
  53. to figure out where to put it all in one file ?
  54. Hold pen and paper ready to write down some info ;)
  55.  
  56. 1.
  57. Ok open the first file which is now called "Unknown.hex".
  58. Ok look for some kind of offset thingy...
  59. Damn, i still can't get the feeling of this Section :(
  60. Let's leave it as it is...
  61.  
  62. 2.
  63. Open the second file which is now called "Import.hex".
  64. Ah this is better :)
  65. see the first 4 bytes "000040A4" and then check out some other bytes near it.
  66. they all contain that "00004000" (ok some 41 and 42 :)
  67. But we can say that this must probably be 00004000, write it down.
  68.  
  69. 3.
  70. Open the third "Text.hex".
  71. Hmmm... i can see 00402000 :)
  72. So this is probably 00002000 write it down.
  73.  
  74. 4.
  75. Ok, open the fourth file called "Rsrc.hex".
  76. This one is a little tougher because you need to know the resource Structure :)
  77. well in the beginning there are just some numbers and stuff till we reach "Crudd's Forward Me" (in Unicode).
  78. Just above that string we see one line with all zero's *the only line there is ;)
  79. So we can say that the string is somesort of Main Window based thing...
  80. And you can notice (if you look closely) that it starts at 00000060 ...
  81. Hmm.. let's search for something with 60 .......... Ah check it at 00000072 "00005060" :)
  82. So this section is probably 00005000 write it down.
  83.  
  84. 5.
  85. Now the final file called "Code.hex".
  86. It'll probably be 00001000 but let us just take a look if it is :)
  87. So we see all those numbers and letters and then... check at offset 00000042.
  88. it says 6800104000 <--- 00401000 :) so this should probably be 00001000 write it down.
  89.  
  90. Now let me give some info we got so far:
  91.  
  92. Original Name    New Name    Offset (virtual)
  93. --------------------------------------------------------------------------------------------------------------
  94. 1_Here.hex    Unknown.hex    ?
  95. 2_Are.hex    Import.hex    00004000
  96. 3_The.hex    Text.hex    00002000
  97. 4_Five.hex    Rsrc.hex    00005000
  98. 5_Sections.hex    Code.hex    00001000
  99.  
  100. As you can see we got, 1000, 2000, 4000, 5000 so Unknown.hex must be 3000 :)
  101. Ok, you can check the files now for the size let me give you a more better organized table now ;)
  102.  
  103. Original Name    New Name    Raw Size    Virtual Offset    Virtual Size    Raw Offset
  104. --------------------------------------------------------------------------------------------------------------
  105. 5_Sections.hex    Code.hex    00000560    00001000    00001000    ?
  106. 3_The.hex    Text.hex    000000A4    00002000    00001000    ?
  107. 1_Here.hex    Unknown.hex    00000058    00003000    00001000    ?
  108. 2_Are.hex    Import.hex    00000304    00004000    00001000    ?
  109. 4_Five.hex    Rsrc.hex    00000228    00005000    00001000    ?
  110.  
  111. We don't know the raw offsets yet because we need to make the PE now :)
  112. So let's make a New File in your Hex-Editor, size about ... 10 kb (just in case ;)
  113. It's very hard to tell it detailed but i'll do my best ;)
  114. First we need to create the DOS stub and let Window$ recognize the file as a valid .exe :)
  115. I'm not going to tell this very detailed because it sucks big ass (DOS) ;)
  116. Well first of all it must contain "MZ" at the first 2 bytes, so the system knows it's an
  117. executable.
  118. I suggest to fill this in the first 64 bytes:
  119.  
  120. --------------------------------------------------------------------------------------------------------------
  121.  
  122. 4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00        MZÉ           
  123. B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00        ╕       @       
  124. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                        
  125. 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00                    Ç   
  126.  
  127. --------------------------------------------------------------------------------------------------------------
  128.  
  129. The "80 00 00 00" at offset 0000003C tells the system where the PE header should start.
  130. Now we get some other DOS shit at offset 00000040 fill in something like this (the text can be changed :)
  131.  
  132. --------------------------------------------------------------------------------------------------------------
  133.  
  134. 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 52 75        ║ ┤═!╕L═!Ru
  135. 6E 20 74 68 69 73 20 64 61 6D 6E 20 70 72 6F 67        n this damn prog
  136. 72 61 6D 20 69 6E 20 57 69 6E 64 6F 77 24 20 70        ram in Window$ p
  137. 6C 65 61 73 65 2E 2E 2E 20 3B 29 0D 0D 0A 24 00        lease... ;)$ 
  138.  
  139. --------------------------------------------------------------------------------------------------------------
  140.  
  141. I don't know exactly what the numbers are at the beginning of this, but the text will be displayed when you
  142. try to run this program in DOS.
  143. Now on to the PE header at offset 00000080.
  144.  
  145. First of all the "Signature Bytes" (PE) at the beginning of the PE header, so the system knows it's an
  146. Portable Executable :)
  147. But don't forget it's a dword so enter this at the beginning of the PE header:
  148.  
  149. --------------------------------------------------------------------------------------------------------------
  150.  
  151. offset 00000080:    50 45 00 00        (PE  )
  152.  
  153. --------------------------------------------------------------------------------------------------------------
  154.  
  155. Then we get the "Machine Code" at offset 00000084, it's a word.
  156. Let me show you some info of the Tutorial from "LUEVELSMEYER" (Organized):
  157.  
  158. --------------------------------------------------------------------------------------------------------------
  159.  
  160. for Intel 80386 processor or better        0x014C
  161. for Intel 80486 processor or better        0x014D
  162. for Intel Pentium processor or better        0x014E
  163. for R3000 (MIPS) processor, big endian        0x0160
  164. for R3000 (MIPS) processor, little endian    0x0162
  165. for R4000 (MIPS) processor, little endian    0x0166
  166. for R10000 (MIPS) processor, little endian    0x0168
  167. for DEC Alpha AXP processor            0x0184
  168. for IBM Power PC, little endian            0x01F0
  169.  
  170. --------------------------------------------------------------------------------------------------------------
  171.  
  172. Most standard computers use 0x014C so we're going to enter that at offset 00000084 :)
  173. Let me show you (word):
  174.  
  175. --------------------------------------------------------------------------------------------------------------
  176.  
  177. offset 00000084:    4C 01            (L)
  178.  
  179. --------------------------------------------------------------------------------------------------------------
  180.  
  181. Then the next "word" are the number of Sections we have, that's easy because we have:
  182.  
  183. Code.hex
  184. Text.hex
  185. Unknown.hex
  186. Import.hex
  187. Rsrc.hex
  188.  
  189. 5 Sections, so enter this (word):
  190.  
  191. --------------------------------------------------------------------------------------------------------------
  192.  
  193. offset 00000086:    05 00            ( )
  194.  
  195. --------------------------------------------------------------------------------------------------------------
  196.  
  197. Next we get the Time Stamp, we don't have to worry about this now, we can leave it blank :)
  198. So enter this (dword):
  199.  
  200. --------------------------------------------------------------------------------------------------------------
  201.  
  202. offset 00000088:    00 00 00 00        (    )
  203.  
  204. --------------------------------------------------------------------------------------------------------------
  205.  
  206. Then we get something that i don't know what it is and it's always blank (AFAIK).
  207. So enter this (dword):
  208.  
  209. --------------------------------------------------------------------------------------------------------------
  210.  
  211. offset 0000008C:    00 00 00 00        (    )
  212.  
  213. --------------------------------------------------------------------------------------------------------------
  214.  
  215. Then we get another something that i don't know what it is and it's also always blank (AFAIK).
  216. So enter this (dword):
  217.  
  218. --------------------------------------------------------------------------------------------------------------
  219.  
  220. offset 00000090:    00 00 00 00        (    )
  221.  
  222. --------------------------------------------------------------------------------------------------------------
  223.  
  224. Now we get the "SizeOfOptionalHeader" it's almost always E000.
  225. Enter this (word):
  226.  
  227. --------------------------------------------------------------------------------------------------------------
  228.  
  229. offset 00000094:    E0 00            (α )
  230.  
  231. --------------------------------------------------------------------------------------------------------------
  232.  
  233. The next "word" contains the "Characteristics" of the file containing some flags.
  234. Let me show you some info from "LUEVELSMEYER" (Organized):
  235.  
  236. --------------------------------------------------------------------------------------------------------------
  237.  
  238. Bit 0     (IMAGE_FILE_RELOCS_STRIPPED)
  239. Bit 1     (IMAGE_FILE_EXECUTABLE_IMAGE)
  240. Bit 2     (IMAGE_FILE_LINE_NUMS_STRIPPED)
  241. Bit 3     (IMAGE_FILE_LOCAL_SYMS_STRIPPED)
  242. Bit 4     (IMAGE_FILE_AGGRESIVE_WS_TRIM)
  243. Bit 7     (IMAGE_FILE_BYTES_REVERSED_LO)
  244. Bit 8     (IMAGE_FILE_32BIT_MACHINE)
  245. Bit 9     (IMAGE_FILE_DEBUG_STRIPPED)
  246. Bit 10    (IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP)
  247. Bit 11    (IMAGE_FILE_NET_RUN_FROM_SWAP)
  248. Bit 12    (IMAGE_FILE_SYSTEM)
  249. Bit 13    (IMAGE_FILE_DLL)
  250. Bit 14    (IMAGE_FILE_UP_SYSTEM_ONLY)
  251.  
  252. --------------------------------------------------------------------------------------------------------------
  253.  
  254. Now you probably think "Ah, this makes a lot of sense" NOT !!! ;)
  255. Honestly i have no idea what he's talking about exactly, so i checked some PE files and found out that
  256. the value is most of the time "0F01".
  257. So enter this (word):
  258.  
  259. --------------------------------------------------------------------------------------------------------------
  260.  
  261. offset 00000096:    0F 01            ()
  262.  
  263. --------------------------------------------------------------------------------------------------------------
  264.  
  265. Now we get something i also don't know what it is, so just leave it blank :)
  266. Enter this (dword , dword , dword , dword):
  267.  
  268. --------------------------------------------------------------------------------------------------------------
  269.  
  270. offset 00000098:    00 00 00 00        (    )
  271. offset 0000009C:    00 00 00 00        (    )
  272. offset 000000A0:    00 00 00 00        (    )
  273. offset 000000A4:    00 00 00 00        (    )
  274.  
  275. --------------------------------------------------------------------------------------------------------------
  276.  
  277. Now we get to the "OEP" (Original Entry Point) we don't know this yet so leave it blank (dword):
  278.  
  279. --------------------------------------------------------------------------------------------------------------
  280.  
  281. offset 000000A8:    00 00 00 00        (    )
  282.  
  283. --------------------------------------------------------------------------------------------------------------
  284.  
  285. Now again we get to some stuff i have no idea about so let's leave it blank (dword , dword):
  286.  
  287. --------------------------------------------------------------------------------------------------------------
  288.  
  289. offset 000000AC:    00 00 00 00        (    )
  290. offset 000000B0:    00 00 00 00        (    )
  291.  
  292. --------------------------------------------------------------------------------------------------------------
  293.  
  294. Now we get to the "Image Base", i've showed in the file "Code.hex" ---> 00401000 (remember ;)
  295. so the Image Base must be 00400000
  296. Enter this (dword):
  297.  
  298. --------------------------------------------------------------------------------------------------------------
  299.  
  300. offset 000000B4:    00 00 40 00        (  @ )
  301.  
  302. --------------------------------------------------------------------------------------------------------------
  303.  
  304. Then we get to some linker that must always be 00001000 or more.
  305. So enter this (dword):
  306.  
  307. --------------------------------------------------------------------------------------------------------------
  308.  
  309. offset 000000B8:    00 10 00 00        (   )
  310.  
  311. --------------------------------------------------------------------------------------------------------------
  312.  
  313. Then again some stuff i don't know so leave it blank.
  314. Enter this (dword):
  315.  
  316. --------------------------------------------------------------------------------------------------------------
  317.  
  318. offset 000000BC:    00 00 00 00        (    )
  319.  
  320. --------------------------------------------------------------------------------------------------------------
  321.  
  322. Now we get some kind of version info, i don't know exactly what it is.
  323. But enter this (dword , dword , dword , dword):
  324.  
  325. --------------------------------------------------------------------------------------------------------------
  326.  
  327. offset 000000C0:    04 00 00 00        (   )
  328. offset 000000C4:    00 00 00 00        (    )
  329. offset 000000C8:    04 00 00 00        (   )
  330. offset 000000CC:    00 00 00 00        (    )
  331.  
  332. --------------------------------------------------------------------------------------------------------------
  333.  
  334. Now the next 8 bytes are "The end of the file (dword) and it's length (dword)"
  335. We know that the last Section (Rsrc.hex) has the "Virtual Address" 00005000 and the "Virtual Size"
  336. is 00001000 (well we made that, to look nice ;)
  337. So enter this (dword , dword):
  338.  
  339. --------------------------------------------------------------------------------------------------------------
  340.  
  341. offset 000000D0:    00 60 00 00        ( `  )
  342. offset 000000D4:    00 10 00 00        (   )
  343.  
  344. --------------------------------------------------------------------------------------------------------------
  345.  
  346. Now again some stuff i don't know, and we can leave it blank.
  347. Enter this (dword , dword):
  348.  
  349. --------------------------------------------------------------------------------------------------------------
  350.  
  351. offset 000000D8:    00 00 00 00        (    )
  352. offset 000000DC:    00 00 00 00        (    )
  353.  
  354. --------------------------------------------------------------------------------------------------------------
  355.  
  356. The next 6 dword's have something to do with Kernel32, i don't know exactly what it stands for :(
  357. But just enter this as in most PE files (dword , dword , dword , dword , dword , dword):
  358.  
  359. --------------------------------------------------------------------------------------------------------------
  360.  
  361. offset 000000E0:    00 00 10 00        (   )
  362. offset 000000E4:    00 10 00 00        (   )
  363. offset 000000E8:    00 00 10 00        (   )
  364. offset 000000EC:    00 10 00 00        (   )
  365. offset 000000F0:    00 00 00 00        (    )
  366. offset 000000F4:    10 00 00 00        (   )
  367.  
  368. --------------------------------------------------------------------------------------------------------------
  369.  
  370. Now we get the Table of some import's and stuff about the Sections,
  371. (like Import Table and the Resource Section).
  372. Let me show you some info from "LUEVELSMEYER" (Organized):
  373.  
  374. --------------------------------------------------------------------------------------------------------------
  375.  
  376. IMAGE_DIRECTORY_ENTRY_EXPORT        (0)
  377. IMAGE_DIRECTORY_ENTRY_IMPORT        (1)
  378. IMAGE_DIRECTORY_ENTRY_RESOURCE        (2)
  379. IMAGE_DIRECTORY_ENTRY_EXCEPTION        (3)
  380. IMAGE_DIRECTORY_ENTRY_SECURITY        (4)
  381. IMAGE_DIRECTORY_ENTRY_BASERELOC        (5)
  382. IMAGE_DIRECTORY_ENTRY_DEBUG        (6)
  383. IMAGE_DIRECTORY_ENTRY_COPYRIGHT        (7)
  384. IMAGE_DIRECTORY_ENTRY_GLOBALPTR        (8)
  385. IMAGE_DIRECTORY_ENTRY_TLS        (9)
  386. IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG    (10)
  387. IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT    (11)
  388. IMAGE_DIRECTORY_ENTRY_IAT        (12)
  389.  
  390. --------------------------------------------------------------------------------------------------------------
  391.  
  392. We don't have to deal with this yet because we can't be sure of the offset and length's :)
  393. Let's continue with building the Sections at offset 00000178.
  394. The first Sections is the file "Code.hex".
  395. The structure of the Sections looks like this:
  396.  
  397. --------------------------------------------------------------------------------------------------------------
  398.  
  399. 00 00 00 00 00 00 00 00        The Name of the Section    (2 dword's)
  400. 00 00 00 00            Raw Size        (dword)
  401. 00 00 00 00            Virtual Offset        (dword)
  402. 00 00 00 00            Virtual Size        (dword)
  403. 00 00 00 00            Raw Offset        (dword)
  404. 00 00 00 00            ?            (dword)
  405. 00 00 00 00            ?            (dword)
  406. 00 00 00 00            ?            (dword)
  407. 00 00 00 00            flags            (dword)
  408.  
  409. --------------------------------------------------------------------------------------------------------------
  410.  
  411. So for the first Section (Code.hex) it would be the following:
  412.  
  413. --------------------------------------------------------------------------------------------------------------
  414.  
  415. offset 00000178:    43 6F 64 65 00 00 00 00        The Name of the Section    (Code    )
  416. offset 00000180:    60 05 00 00            Raw Size        (00000560)
  417. offset 00000184:    00 10 00 00            Virtual Offset        (00001000)
  418. offset 00000188:    00 10 00 00            Virtual Size        (00001000)
  419. offset 0000018C:    00 00 00 00            Raw Offset        (?)
  420. offset 00000190:    00 00 00 00            ?            (00000000)
  421. offset 00000194:    00 00 00 00            ?            (00000000)
  422. offset 00000198:    00 00 00 00            ?            (00000000)
  423. offset 0000019C:    FF FF FF FF            flags            (FFFFFFFF)
  424.  
  425. --------------------------------------------------------------------------------------------------------------
  426.  
  427. Notice the "flags" ;)
  428. i saw that you can change it to FFFFFFFF and everything will be fine :)
  429. We don't know the "Raw Offset" yet, so we just continue with the other Sections:
  430.  
  431. --------------------------------------------------------------------------------------------------------------
  432.  
  433. The Section (Text.hex):
  434.  
  435. offset 000001A0:    54 65 78 74 00 00 00 00        The Name of the Section    (Text    )
  436. offset 000001A8:    58 00 00 00            Raw Size        (00000058)
  437. offset 000001AC:    00 20 00 00            Virtual Offset        (00002000)
  438. offset 000001B0:    00 10 00 00            Virtual Size        (00001000)
  439. offset 000001B4:    00 00 00 00            Raw Offset        (?)
  440. offset 000001B8:    00 00 00 00            ?            (00000000)
  441. offset 000001BC:    00 00 00 00            ?            (00000000)
  442. offset 000001C0:    00 00 00 00            ?            (00000000)
  443. offset 000001C4:    FF FF FF FF            flags            (FFFFFFFF)
  444.  
  445. The Section (Unknown.hex):
  446.  
  447. offset 000001C8:    55 6E 6B 6E 6F 77 6E 00        The Name of the Section    (Unknown )
  448. offset 000001D0:    A4 00 00 00            Raw Size        (000000A4)
  449. offset 000001D4:    00 30 00 00            Virtual Offset        (00003000)
  450. offset 000001D8:    00 10 00 00            Virtual Size        (00001000)
  451. offset 000001DC:    00 00 00 00            Raw Offset        (?)
  452. offset 000001E0:    00 00 00 00            ?            (00000000)
  453. offset 000001E4:    00 00 00 00            ?            (00000000)
  454. offset 000001E8:    00 00 00 00            ?            (00000000)
  455. offset 000001EC:    FF FF FF FF            flags            (FFFFFFFF)
  456.  
  457. The Section (Import.hex):
  458.  
  459. offset 000001F0:    49 6D 70 6F 72 74 00 00        The Name of the Section    (Import  )
  460. offset 000001F8:    04 03 00 00            Raw Size        (00000304)
  461. offset 000001FC:    00 40 00 00            Virtual Offset        (00004000)
  462. offset 00000200:    00 10 00 00            Virtual Size        (00001000)
  463. offset 00000204:    00 00 00 00            Raw Offset        (?)
  464. offset 00000208:    00 00 00 00            ?            (00000000)
  465. offset 0000020C:    00 00 00 00            ?            (00000000)
  466. offset 00000210:    00 00 00 00            ?            (00000000)
  467. offset 00000214:    FF FF FF FF            flags            (FFFFFFFF)
  468.  
  469. The Section (Rsrc.hex):
  470.  
  471. offset 00000218:    52 73 72 63 00 00 00 00        The Name of the Section    (Rsrc    )
  472. offset 00000220:    28 02 00 00            Raw Size        (00000228)
  473. offset 00000224:    00 50 00 00            Virtual Offset        (00005000)
  474. offset 00000228:    00 10 00 00            Virtual Size        (00001000)
  475. offset 0000022C:    00 00 00 00            Raw Offset        (?)
  476. offset 00000230:    00 00 00 00            ?            (00000000)
  477. offset 00000234:    00 00 00 00            ?            (00000000)
  478. offset 00000238:    00 00 00 00            ?            (00000000)
  479. offset 0000023C:    FF FF FF FF            flags            (FFFFFFFF)
  480.  
  481. --------------------------------------------------------------------------------------------------------------
  482.  
  483. Ok, now we can put the files in this New File :)
  484. But where ???
  485. Let's start with "Code.hex" copy the whole stuff from that file and put it in the New File at offset 00000400
  486. Now you can also change the "Raw Offset" of the Section "Code" to:
  487.  
  488. --------------------------------------------------------------------------------------------------------------
  489.  
  490. offset 0000018C:    00 04 00 00            Raw Offset        (00000400)
  491.  
  492. --------------------------------------------------------------------------------------------------------------
  493.  
  494. Now open the file "Text.hex" and copy the whole stuff to the the New File at offset 00000A00
  495. Now you can also change the "Raw Offset" of the Section "Text" to:
  496.  
  497. --------------------------------------------------------------------------------------------------------------
  498.  
  499. offset 000001B4:    00 0A 00 00            Raw Offset        (00000A00)
  500.  
  501. --------------------------------------------------------------------------------------------------------------
  502.  
  503. Now open the file "Unknown.hex" and copy the whole stuff to the the New File at offset 00000B00
  504. Now you can also change the "Raw Offset" of the Section "Unknown" to:
  505.  
  506. --------------------------------------------------------------------------------------------------------------
  507.  
  508. offset 000001DC:    00 0B 00 00            Raw Offset        (00000B00)
  509.  
  510. --------------------------------------------------------------------------------------------------------------
  511.  
  512. Now open the file "Import.hex" and copy the whole stuff to the the New File at offset 00000C00
  513. Now you can also change the "Raw Offset" of the Section "Import" to:
  514.  
  515. --------------------------------------------------------------------------------------------------------------
  516.  
  517. offset 00000204:    00 0C 00 00            Raw Offset        (00000C00)
  518.  
  519. --------------------------------------------------------------------------------------------------------------
  520.  
  521. Now open the file "Rsrc.hex" and copy the whole stuff to the the New File at offset 00001000
  522. Now you can also change the "Raw Offset" of the Section "Rsrc" to:
  523.  
  524. --------------------------------------------------------------------------------------------------------------
  525.  
  526. offset 0000022C:    00 10 00 00            Raw Offset        (00001000)
  527.  
  528. --------------------------------------------------------------------------------------------------------------
  529.  
  530. Now after the Section "Rsrc" you can remove the rest of the file at offset 00001250 :)
  531. Ok now we made the whole New File but we still need to change some things in the PE header.
  532. I assume you changed all the "Raw Offsets" now so we'll need to change some things in the table in the
  533. Pe header.
  534. Let me show you:
  535.  
  536. --------------------------------------------------------------------------------------------------------------
  537.  
  538. offset 00000100        00 40 00 00    (Import Table)
  539. offset 00000104        40 00 00 00    (And it's length)
  540.  
  541. offset 00000108        00 50 00 00    (Resource)
  542. offset 0000010C        28 02 00 00    (And it's length)
  543.  
  544. --------------------------------------------------------------------------------------------------------------
  545.  
  546. I think that's it now save the New File as "ForwardMe.exe" and run it....!!!! oh no :(
  547. We haven't inserted a OEP (Original Entry Point) ;)
  548. How are we going to find this ???
  549. I suggest to open W32Dasm and open the New File (ForwardMe.exe).
  550. Then click on "Jmp Fn" (Imports) and you'll see a list of API's.
  551. Hmmm... GetCommandLineA, GetModuleHandleA, DialogBoxParamA...
  552. Try GetCommandLineA, and then you'll see just some lines above this:
  553.  
  554. --------------------------------------------------------------------------------------------------------------
  555.  
  556. 55        push ebp
  557. 8B EC        mov ebp, esp
  558.  
  559. --------------------------------------------------------------------------------------------------------------
  560.  
  561. Looks nice ;)
  562. Ok, try to put the offset 00001418 (18 14 00 00) in the New File save it and run it, this time it works :P
  563. We're finished now...!
  564. Job Done !!!
  565.  
  566.  
  567. --->    Outro...
  568.  
  569. Ok, it was f**king hard to explain the PE header, i tried my best and i hope you liked it and learned
  570. something from it :)
  571. This was a good and original idea for a ReMe, nice Crudd ;)
  572.  
  573.  
  574. --->    Greetings...
  575.  
  576. Everybody from TrickSoft        (www.TrickSoft.net)
  577. Everybody from Cracking4Newbies        (www.Cracking4Newbies.com)
  578. Everybody from Keygenning4Newbies    (Keygenning4Newbies.cjb.net)
  579. Everybody from ReverseMes        (ReverseMes.cjb.net)
  580. And Crudd, SantMat and You...
  581.  
  582.             Don't trust the Outside, trust the InSiDe !!!
  583.  
  584.                       Cya...
  585.  
  586.                     CoDe_InSiDe
  587.  
  588. Email:    code.inside@home.nl