EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


Simple ASM RS232 Transmitter Code

By: mamb0  -  Date Submitted: 2009-04-02 22:27:12

  1. Assembler RS232 Data Transmitter*/
  2.  
  3.  
  4. #include <stdio.h>
  5. #include <conio.h>
  6. #define CNTRLZ 0x1A
  7.  
  8. int main(void) {
  9.  
  10. char readmode[] = "r";
  11. char writemode[] = "w";
  12. char datafile[] = "H:\\text.txt" ;
  13. char filefailed[] = "This file has failed to load\n";
  14. char comport[] = "COM1";
  15. char comfail[] = "Failed to open COM\n";
  16. char startmsg[] = "CSA File Transfer Program\n";
  17. int char_send;
  18.  
  19. FILE * dp;
  20. FILE * fp;
  21.  
  22. __asm {
  23.  
  24. lea eax, startmsg //load start message 'Message'
  25. push eax //
  26. call dword ptr [printf] //display start message
  27. add esp, 4 //clear stack
  28.  
  29. //*if ((fp = fopen("H:\\text.txt", "r")) == NULL)*//
  30. lea eax, readmode //
  31. push eax //
  32. lea eax, datafile //load H:\\text.txt
  33. push eax //
  34. call dword ptr [fopen] //read datafile H:\\txt.txt
  35. add esp,8 //
  36. mov dword ptr [fp], eax //
  37. cmp dword ptr [fp], 0 //compare file point with zero
  38. jnz comport_open //Open COM1 for file transfer if file point is 0
  39.  
  40. //*printf(""This file has failed to load/n"); return 1;*//
  41.  
  42. lea eax, filefailed //
  43. push eax //
  44. call dword ptr [printf] //display 'This file has failed to load' if there is no H:\\.txt.txt
  45. add esp, 4 //
  46. jmp end_of_asm_program //Jump to the end of the program
  47.  
  48. comport_open:
  49.  
  50.  
  51. //*if ((dp = fopen("COM1", "w")) == NULL) {*//
  52. //*printf("fail to open COM port\n"); return 1;*//
  53.  
  54. lea eax, writemode //
  55. push eax //
  56. lea eax, comport //
  57. push eax //
  58. call dword ptr [fopen] //Open COM port 1 for file transfer
  59. add esp, 8 //
  60. mov dword ptr [dp], eax //
  61. cmp dword ptr [dp], 0 //compare destination point to 0
  62. jnz notEOF //if destination point is 0 jump to file sending sub routine
  63. lea eax, comfail //
  64. push eax //
  65. call dword ptr [printf] //Display 'Failed to open COM' if teh COM port cannot be opened
  66. add esp, 4 //
  67. jmp end_of_asm_program //
  68.  
  69.  
  70.  
  71.  
  72.  
  73. //*while ((c = fgetc(fp )) != EOF) {*//
  74. //*fputc( c, dp);*//
  75.  
  76. notEOF:
  77. mov eax, dword ptr [fp] //
  78. push eax //
  79. call dword ptr [fgetc] //send encrypted character
  80. add esp, 4 //
  81. mov char_send, eax //
  82. cmp char_send, 0FFFFFFFFh //compare current character with the end of the file
  83. Je close_file //
  84.  
  85. mov eax, dp //
  86. push eax //
  87. mov eax, char_send //
  88. xor eax, 0e4h //encrypt character by hex value '228'
  89. push eax //
  90. call dword ptr [fputc] //transfer the file to the destination
  91. add esp,8 //
  92. Jmp notEOF //
  93.  
  94. close_file: //close both the file and its transfer parameters
  95.  
  96. mov eax, dp //
  97. push eax //
  98. mov eax, 3fh //
  99. push eax //
  100. call dword ptr [fputc] //
  101. add esp, 8 //
  102.  
  103. mov eax, fp //
  104. push eax //
  105. call dword ptr [fclose] //
  106. add esp, 4 //
  107.  
  108. mov eax, dp //
  109. push eax //
  110. call dword ptr [fclose] //
  111. add esp, 4 //
  112.  
  113. end_of_asm_program:
  114. }
  115.  
  116. return 0;
  117.  
  118. }
Return to asm category list

Who Visited EnigmaGroup Today?

1556 Guests, 262 Users (178 Spiders)
aurena, 3ntr0py, m0rt, rospark, whisperer, Blavatsky, lotato, nmobin27, learning, suetekh, Hessesian, Rex_Mundi, st3alth, Partisan, hackaday, K0gller, fitz, DrOptix, Jayjay, JohnMalkovitzch, psychomarine, whoami, Vspectrum, San Marino, TinCardinal, brunoriversyhn, TheHarrisonW, code-g, yshiau, BillTuer, Psiber_Syn, Klosse, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, GothicLogic, strudels, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, trueorfalse, Sir D. Naut, zach, batsbargy, Rik, Macabre, ellisp, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, limited, Nikhil, evjfvir967nj, blackknight911, Distorted, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, riesenjoe, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, valy1177, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, CloverCipher, m4f10, Vengeance987, avacraft, Bumpadjuppy, becool, thecoder, ddxc, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, RomeoG, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, IvanDimitriev, advilapyday, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, lonely.connection, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz, MSI52, twink gay cam dUi8D, temoJessy
 
Enigma Group