dr6673999 2018-09-01 09:41
浏览 68
已采纳

为什么用vim打开go build的二进制文件,我可以看到一些源代码库信息?

In windows, new go file: test.go

package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello World!")
}

Then run go build test.go and then vim test.exe.

Search test.go, I can see many dir infos.

Why it happens and how to hide the info?

  • 写回答

1条回答 默认 最新

  • douying4909 2018-09-01 10:47
    关注

    Why it happens ?

    The golang is a compiled language - that's mean it uses compiler (translators that generate machine code from source code). The test.exe file is a source code compiled into machine code.

    How to hide the info?

    The binary file (compiled program) contains all data(the source code, the .data section, strings and so on), you can't hide that info from binary, there is no way to do that, all that you can do is obfuscate somehow your source code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line