Skip to content

Commit

Permalink
fixed x compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed Aug 10, 2014
1 parent 271f28c commit a701498
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Binary file modified tools/fuckGFW-32.exe
Binary file not shown.
Binary file modified tools/fuckGFW-64.exe
Binary file not shown.
14 changes: 8 additions & 6 deletions tools/fuckGFW.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (

func Exit(message string){
fmt.Println(message)
time.Sleep(5 * time.Second)
time.Sleep(3 * time.Second)
os.Exit(0)
}

Expand Down Expand Up @@ -60,21 +60,23 @@ func main(){
if err != nil {
Exit(err.Error())
}
err = os.Rename(HOSTS_PATH, HOSTS_PATH+".BAK")
if err != nil {
Exit(err.Error())
}
_ = os.Remove(HOSTS_PATH+".BAK")
_ = os.Rename(HOSTS_PATH, HOSTS_PATH+".BAK")
}
yours += SEARCH_STRING + BR

f, err = os.OpenFile(HOSTS_PATH, os.O_WRONLY|os.O_CREATE, 0644)
f, err = os.OpenFile(HOSTS_PATH, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
if err != nil {
Exit(err.Error())
}
_, err = f.WriteString(yours + hosts)
if err != nil {
Exit(err.Error())
}
err = f.Close()
if err != nil {
Exit(err.Error())
}

Exit("Success!")
}

0 comments on commit a701498

Please sign in to comment.