asm2c icon indicating copy to clipboard operation
asm2c copied to clipboard

Convert Go/Golang based "Assembly" into C

Open atErik opened this issue 3 years ago • 2 comments

Hi,
( i have Starred this project).
as far as i understand this tool can handle upto 32bit x86 code ?
can/does it also support AMD64 based Assembly into ANSI C ?

i need to convert "Go" into "C" , or "Go" into "C++" , i have posted some solutions here (in SO) & mentioned this project there too , & also here . Please upvote my Q+A both in SO (or vote "Converting/transpiling..." topic here to Undelete), if you want to . ( Google Crimes1, 2, 3, 4, 5, 6. Problems in "Go"1, 2, 3, 4, 5, 6, 7. )

Output of below commands are in "Main.s" file , which has Golang/Google based"Assembly" , not general/standard or GNU/GAS-Assembly, not NASM-Assembly.
cmd: go tool compile -S Main.go
 or
cmd: go build -gcflags -S Main.go

can this "asm2c" tool produce ANSI C output from Go-Assembly ?
if not, would you please add such option/feature ?
or, what would you suggest i should use ?

EDIT : added a sentence on upvoting in SO.
EDIT : added links for 'Go'-problems.
EDIT : added a link to new Transpiler-List project site, etc.

atErik avatar Oct 21 '20 11:10 atErik

You may also try ida/hex-rays (which I think is better but expensive) or https://github.com/xor2003/masm2c (which have instructions tested, but not fully compatible to 64bit) or facebook transcoder

xor2003 avatar Oct 21 '20 12:10 xor2003

hi @atErik, it's a small subset of instructions, see https://github.com/frranck/asm2c/blob/master/BUGS.md

frranck avatar Nov 09 '20 06:11 frranck