frranck / asm2c

Tool to convert DOS Assembly code to C code
MIT License
171 stars 27 forks source link

Convert Go/Golang based "Assembly" into C #5

Open atErik opened 4 years ago

atErik commented 4 years ago

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.

xor2003 commented 4 years ago

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

frranck commented 4 years ago

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