modem.py

A place to submit all custom code, scripts, and programs.
Forum rules
Do NOT post malicious code or programs. Please review all code posted in this forum before downloading or running any of the code or programs here.

modem.py

Post by pretentious on Fri Dec 25, 2015 6:46 am
([msg=91043]see modem.py[/msg])

So dial up modems were a bit before my time but from what I understand, the weird scratchy tone that they have become famous for was literally digital data being transmitted through the speaker.
This code will open any file and write the binary data to a wav file so you can hear it.
Code: Select all
import wave
import array
import sys
f = open(sys.argv[1], "rb")
print sys.argv[1]
obj = wave.open(sys.argv[1]+ ".wav",'w')
obj.setnchannels(1)
obj.setsampwidth(2)
obj.setframerate(3500)
data = array.array('h')
try:
    byte = f.read(1)
    while byte != "":
      try:      
         data.append(struct.unpack('>h', f.read(2))[0])
      except:
         break
finally:
   f.close()
   obj.writeframes(data)
   obj.close()
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.

IF you feel like exchanging ASCII arrays, let me know ;)
Can you say brainwashing It's a non stop disco
User avatar
pretentious
Addict
Addict
 
Posts: 1203
Joined: Wed Mar 03, 2010 12:48 am
Blog: View Blog (0)


Re: modem.py

Post by -Ninjex- on Fri Dec 25, 2015 11:55 am
([msg=91044]see Re: modem.py[/msg])

This is actually kinda cool. Thanks for sharing (:
image
For those that know
K: 0x2CD8D4F9
User avatar
-Ninjex-
Moderator
Moderator
 
Posts: 1691
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)


Re: modem.py

Post by libroot on Sat Dec 26, 2015 1:57 pm
([msg=91048]see Re: modem.py[/msg])

Ah. The good ol dial up days. That is pretty neat actually.
libroot - Another section of the interweb
User avatar
libroot
New User
New User
 
Posts: 4
Joined: Sun Nov 29, 2015 9:28 pm
Blog: View Blog (0)



Return to Custom Code

Who is online

Users browsing this forum: No registered users and 0 guests