I found a formula to reverse an XOR
Code: Select all
screen 19
for a as longint = 0 to 255
print a , a xor 2 , 0 eqv ((a xor 2) eqv 2)
if a mod 16 = 0 then sleep
next
sleep
end
Code: Select all
screen 19
for a as longint = 0 to 255
print a , a xor 2 , 0 eqv ((a xor 2) eqv 2)
if a mod 16 = 0 then sleep
next
sleep
end
Code: Select all
print a , a xor 2 , (a xor 2) xor 2
Impossible, information is lost with the OR operation.albert wrote: If you can find a formula to reverse an OR
Code: Select all
screen 19
dim as single v1 , v2 , v3 , v4
for a as longint = 0 to 255
v1 = a or 2
'don't know what a = for (a or 1)
v2 = (a or 1) - ((a or 2) or -2)
if v2 mod 2 = 0 then v2-=1 else v2-=3
print "a = " ; a , "a or 2 = " ; v1 ,, "undo = " ; v2
if a mod 16 = 0 then sleep
next
sleep
end
@Albert. Please don't include or associate me with your data compression ideas. I would really like to maintain some distance between myself and the liability. I am sorry but you are so dazzled by the dream of dollars that you cannot hear or understand the voices of reason to see the fundamental impossibility of your beliefs.Albert wrote:Richard has been a downer on the compression idea , but I've used so much of his code in my programs, i thought I'd include him anyways.
Code: Select all
Function tally (somestring As String,partstring As String,arr() As Integer) As Integer
Dim As Integer i,j,ln,lnp,count,num
Dim As boolean filler=false
ln=Len(somestring)
lnp=Len(partstring)
start:
count=0
i=-1
Do
i+=1
If somestring[i] <> partstring[0] Then Goto skip
If somestring[i] = partstring[0] Then
For j=0 To lnp-1
If somestring[j+i]<>partstring[j] Then Goto skip
Next j
End If
count+=1
If filler = true Then arr(count)=i+1
i=i+lnp-1
skip:
Loop Until i>=ln-1
If filler = false Then Redim arr(count) 'size is now known, repeat the operation to fill arr()
arr(0)=count ' save tally in (0)
num=count
If filler=true Then Goto _return
filler=true
Goto start
_return:
Return num
End Function
#Include "file.bi"
Function loadfile(file as string) as String
If FileExists(file)=0 Then Print file;" not found":Sleep:end
var f=freefile
Open file For Binary Access Read As #f
Dim As String text
If Lof(f) > 0 Then
text = String(Lof(f), 0)
Get #f, , text
End If
Close #f
return text
end Function
Sub savefile(filename As String,p As String)
Dim As Integer n
n=Freefile
If Open (filename For Binary Access Write As #n)=0 Then
Put #n,,p
Close
Else
Print "Unable to save " + filename
End If
End Sub
Sub replace(s As String,position As Integer,chars As String)
var L=len(chars)
mid(s,position,L)=chars
End Sub
redim as integer s()
var L=loadfile("C:\Users\User\Desktop\shell64.exe") '<----------- your file in here
dim as string find="GCC: (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project)"
print "File length ";len(L)
print "Repititions ";tally(L,find,s());" of:"
print find
dim as string g=string(len(find),"Z")
print
print "position to insert this:"
print g;" = ";s(1)
replace(L,s(1),g)
savefile("_shell64.exe",L)
print "done"
sleep