Hello World
Ici on trouve de l'actu, des essais sur les technos de l'information, de l'étrange et pas mal de bazard...
Ce blog véhicule des images, quelques videos, des sons, du code et des outils.
Bon surf.
Ici on trouve de l'actu, des essais sur les technos de l'information, de l'étrange et pas mal de bazard...
Ce blog véhicule des images, quelques videos, des sons, du code et des outils.
Bon surf.
Histoire de continuer les bricolages avec l'interpréteur Phantom (http://phantomtest.com ), deux petits scripts de rien du tout:
Pilotage de WebReaper (http://www.webreaper.net ):
use "WebReaper.dec"
string url1="<NOM DU SITE>";
Sleep(15);
WebReaper.AfxControlBar701.ToolbarWindow321.ComboBox1.Edit1.SetText(url1);
WebReaper.AfxControlBar701.ToolbarWindow321.MouseClick(0,313,13,3);
Puis de MiniBrowser (http://www.geocities.com/minibrws/ ):
use "MiniBrowser.dec"
#
# On demarre Mini-Browser
System("minibrowser.exe");
Sleep(5);
# Site destination
string BaseURL="http://www.google.com";
# On envoi au site un UserAgent type Internet Explorer 5.
# Mini_Browser.TPanel1.TPageControl1.Settings.TPanel1.User.IE.Click();
# Le referrer: la page précédente.
Mini_Browser.TPanel2.TComboBox1.SetText("http://fbalmer2k.over-blog.com");
# Donnees pour requete POST: Rien pour cette fois.
Mini_Browser.TPanel2.TComboBox2.SetText("");
# URL destination.
Mini_Browser.TPanel2.TComboBox3.SetText(BaseURL);
#Passage en mode BROWSE (LOG par defaut)
Mini_Browser.TPanel1.TPageControl1.MouseClick(0,78,10,0);
#Lancement de la requete
Mini_Browser.TPanel2.Get.MouseClick(0,25,11,0);
Tripatouillage de fichier .wav 8 bits/Mono.
Certaines modifications des samples étant franchement infames.
Ou comment ajouter des parasites à un son bien propre...
;Wav Cracker
;17-18 fevrier 2007
;Franck Balmer
;Charge un fichier .wav
;Uniquement 8bits/Mono
AppTitle "Wave Cracker [Proto]"
Type WavHeader
Field RiffMark$
Field SampleSize1% ;32b
Field TypeMark$
Field FormatMark$
Field Unkn1% ;32b
Field Channels# ;16b+16b
Field Freq#
Field BlockAlign1#
Field BlockAlign2# ;16b+16b
Field DataMark$
Field SampleSize2# ;32b
End Type
Global FileHeader.WavHeader= New WavHeader
ScrambleTyp=1
WavFileName$=Input$("Fichier Wave: ")
Print "[De]Scrambling: "
Print "[SHL] -> 1"
Print "[SHR] -> 2"
Print "[SAR] -> 3"
Print "[XOR] -> 4"
Print "[ADD] -> 5"
Print "[SUB] -> 6"
Print "[AND] -> 7"
Print "[OR ] -> 8"
Print "[COS ] -> 10"
Print "[ACS ] -> 11"
ScrambleTyp=Input("Choix: ")
If (ScrambleTyp<10) Then
MinScrambleValue=Input ("Valeur Min: ")
MaxScrambleValue=Input ("Valeur Max: ")
If (MinScrambleValue>MaxScrambleValue) Then
TempoScrambleValue=MaxScrambleValue
MaxScrambleValue=MinScrambleValue
MinScrambleValue=TempoScrambleValue
End If
If (ScrambleTyp<4) Then
If (MaxScrambleValue>8) Then
MaxScrambleValue=8
End If
End If
Else
MinScrambleValue=1
MaxScrambleValue=1
End If
;For ScrambleTyp=1 To 4
For ScrambleValue=MinScrambleValue To MaxScrambleValue
;Ouverture du fichier d'entree
InFileHandle = ReadFile(WavFileName$)
WavFileSize=FileSize(WavFileName$)
Print
Print "OK. File Size: "+WavFileSize
Print
;Ouverture du fichier de sortie
OutFileHandle = WriteFile("Out.wav")
;Parcours et recopie du header
FileHeaderRiffMark$=""
For k=1 To 4 ;RiffMark
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
FileHeaderRiffMark$=FileHeaderRiffMark$+Chr$(Tempo)
Next
For k=1 To 4 ;SampleSize1
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
FileHeaderTypeMark$=""
For k=1 To 4 ; TypeMark
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
FileHeaderTypeMark$=FileHeaderTypeMark$+Chr$(Tempo)
Next
FileHeaderFormatMark$=""
For k=1 To 4 ;FormatMark
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
FileHeaderFormatMark$=FileHeaderFormatMark$+Chr$(Tempo)
Next
For k=1 To 4 ;Unkn1
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
For k=1 To 4 ;Channels
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
For k=1 To 4 ;Freq
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
For k=1 To 4 ;BlockAlign1
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
For k=1 To 4 ;BlockAlign2
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
FileHeaderDataMark$=""
For k=1 To 4 ;DataMark
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
FileHeaderDataMark$=FileHeaderDataMark$+Chr$(Tempo)
Next
For k=1 To 4 ;SampleSize2
Tempo=ReadByte(InFileHandle)
WriteByte(OutFileHandle,Tempo)
;
Next
;Print FileHeaderRiffMark$
;Print FileHeaderTypeMark$
;Print FileHeaderFormatMark$
;Print FileHeaderDataMark$
Select ScrambleTyp
Case 1
Print "SHL "+ScrambleValue
Case 2
Print "SHR "+ScrambleValue
Case 3
Print "SAR "+ScrambleValue
Case 4
Print "XOR "+ScrambleValue
Case 5
Print "ADD "+ScrambleValue
Case 6
Print "SUB "+ScrambleValue
Case 7
Print "AND "+ScrambleValue
Case 8
Print "OR "+ScrambleValue
Case 10
Print "COS "
Case 11
Print "ACOS "
Default
Print "XOR "+ScrambleValue
End Select
For k=1 To WavFileSize-44
SampleValue=ReadByte(InFileHandle)
;Ecriture dans fichier de sortie
;En fontion de ScrambleTyp
Select ScrambleTyp
Case 1
WriteByte(OutFileHandle,SampleValue Shl ScrambleValue)
Case 2
WriteByte(OutFileHandle,SampleValue Shr ScrambleValue)
Case 3
WriteByte(OutFileHandle,SampleValue Sar ScrambleValue)
Case 4
WriteByte(OutFileHandle,SampleValue Xor ScrambleValue)
Case 5
WriteByte(OutFileHandle,SampleValue + ScrambleValue)
Case 6
WriteByte(OutFileHandle,SampleValue - ScrambleValue)
Case 7
WriteByte(OutFileHandle,SampleValue And ScrambleValue)
Case 8
WriteByte(OutFileHandle,SampleValue Or ScrambleValue)
Case 10
WriteByte(OutFileHandle,Int (128+127*Cos(SampleValue)))
Case 11
WriteByte(OutFileHandle,Int (ACos((SampleValue-128)/127)))
Default
WriteByte(OutFileHandle,SampleValue Xor ScrambleValue)
End Select
;Fin du parcourd du fichier source
Next
CloseFile (InFileHandle)
CloseFile (OutFileHandle)
;Lecture du fichier resultat:
sndout=LoadSound("out.wav")
outchannel=PlaySound (sndout)
Print "Playing [De]Scrambled "+WavFileName$+"..."
Delay 5000
StopChannel outchannel
FreeSound sndout
Print "--------"
Next ;ScrambleValue
End
Entre un jeu sur Saturn et un Duel Yugi, du code Turbo Basic de gestion "raz des pistes" de disquettes:
rem Librairie de fonctions Bios Floppy
rem Lecture/Ecriture de Secteurs
rem Gestion de la Disk Parameter Table
rem Franck Balmer - Fevrier 2007
DEFINT A-Z
rem Definition des constantes 1
%DataBufferSize=9216
rem Definition des Globales
dim DataBuffer%(%DataBufferSize)
rem Definition des Constantes 2
%MaxSectorsPerTrack=18
%MaxTrackNumber=79
rem 0=128,1=256,2=512,3=1024
%MaxSectorSize=3
rem Registres 8086
%AX=1:%BX=2:%CX=3:%DX=4
%SI=5:%DI=6
%BP=7
%DS=8:%ES=9
rem Fonctions BIOS
Def FnGetInterruptSeg%(InterruptNumber%)
def seg=&H0
FnGetInterruptSeg%=peek(4*InterruptNumber%+2)+256*peek(4*InterruptNumber%+3)
def seg
end def
Def FnGetInterruptOff%(InterruptNumber%)
def seg=&H0
FnGetInterruptOff%=peek(4*InterruptNumber%)+256*peek(4*InterruptNumber%+1)
def seg
end def
sub SetDPTSectorSize (SectorSize%)
def seg=FnGetInterruptSeg%(&H1E)
poke FnGetInterruptOff%(&H1E)+&H03,SectorSize%
def seg
end sub
Def FnGetLastDiskError%
REG %AX,&H0100
call interrupt &H13
FnGetLastDiskError%=int(REG(%AX)/256)
end def
sub ReadSectors(Drive%,Track%,Head%,Sector%,NbrSect%)
shared DataBuffer%()
REG %ES,VARSEG(DataBuffer%(0))
REG %BX,VARPTR(DataBuffer%(0))
REG %CX,256*Track%+Sector%
REG %DX,256*Head%+Drive%
REG %AX,2*256+NbrSect%
call interrupt &H13
end sub
sub WriteSectors(Drive%,Track%,Head%,Sector%,NbrSect%)
shared DataBuffer%()
REG %ES,VARSEG(DataBuffer%(0))
REG %BX,VARPTR(DataBuffer%(0))
REG %CX,256*Track%+Sector%
REG %DX,256*Head%+Drive%
REG %AX,2*256+NbrSect%
call interrupt &H13
end sub
sub ResetDrive (Drive%)
REG %AX,&H0000
REG %DX,Drive%
call interrupt &H13
end sub
sub DiagLastDiskError
color 4
if (FnGetLastDiskError%=&h01) then
print "Mauvaise Commande (inconnue)"
end if
if (FnGetLastDiskError%=&h02) then
print "Erreur dans le marqueur d'adresse"
end if
if (FnGetLastDiskError%=&h04) then
print "Secteur non trouv‚"
end if
if (FnGetLastDiskError%=&h10) then
print "Erreur CRC"
end if
if (FnGetLastDiskError%=&h40) then
print "Mauvais positionnement, piste non trouv‚e"
end if
if (FnGetLastDiskError%=&h80) then
print "Time out"
end if
end sub
Un code TB bien gras, bien lourd.
A nouveau création de formats spéciaux.
rem Illegal Format Acte II
rem Formatage/Protek
rem Franck Balmer - Fevrier/Mars 2007
rem My Master is a Monster
rem DEFINT A-Z
rem Definition des constantes 1
%FormatTableSize=72
rem Definition des Globales
dim FormatTable%(%FormatTableSize)
rem On claque en dur la table de formattage
rem Barbare mais efficace
rem Ici 4 secteurs definis en C/H/R/N
NbrSect%=4
SegFormatTable%=VARSEG(FormatTable%(0))
DEF SEG=SegFormatTable%
OffFormatTable%=VARPTR(FormatTable%(0))
poke OffFormatTable%+0,4
poke OffFormatTable%+1,0
poke OffFormatTable%+2,1
poke OffFormatTable%+3,1
poke OffFormatTable%+4,4
poke OffFormatTable%+5,0
poke OffFormatTable%+6,3
poke OffFormatTable%+7,1
poke OffFormatTable%+8,4
poke OffFormatTable%+9,0
poke OffFormatTable%+10,4
poke OffFormatTable%+11,2
poke OffFormatTable%+12,4
poke OffFormatTable%+13,0
poke OffFormatTable%+14,5
poke OffFormatTable%+15,3
DEF SEG
rem Definition des Constantes 2
%MaxSectorsPerTrack=18
%MaxTrackNumber=79
rem 0=128,1=256,2=512,3=1024
%MaxSectorSize=3
rem Interface Registres 8086
%AX=1:%BX=2:%CX=3:%DX=4
%SI=5:%DI=6
%BP=7
%DS=8:%ES=9
rem Programme principal
SegFormatTable%=VARSEG(FormatTable%(0))
DEF SEG=SegFormatTable%
OffFormatTable%=VARPTR(FormatTable%(0))
DEF SEG
Drive%=0
Head%=0:Track%=4:NbrSect%=4
REG %ES,SegFormatTable%
REG %BX,OffFormatTable%
REG %CX,256*Track%+0
REG %DX,256*Head%+Drive%
REG %AX,5*256+NbrSect%
call Interrupt &H13
rem Allez, un Zopi et on va se coucher...
end
| Novembre 2009 | ||||||||||
| L | M | M | J | V | S | D | ||||
| 1 | ||||||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||||
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | ||||
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | ||||
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | ||||
| 30 | ||||||||||
|
||||||||||
Commentaires