From 2827e1d59fd62835a60080dd827da11d69f10655 Mon Sep 17 00:00:00 2001 From: Snowiest Date: Sat, 14 Sep 2024 20:17:38 +0800 Subject: [PATCH] Initial commit --- .gitignore | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 27 +++++++++++++++++++++++++++ app.manifest | 10 ++++++++++ argsfet.dll | Bin 0 -> 68608 bytes argsfet.go | 27 +++++++++++++++++++++++++++ go.mod | 3 +++ go.sum | 0 main.go | 20 ++++++++++++++++++++ 8 files changed, 127 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 app.manifest create mode 100644 argsfet.dll create mode 100644 argsfet.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 main.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cf9d2dc --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# .gitignore for Go projects + +# Build artifacts +_dist/ +_build/ +_out/ +bin/ +pkg/ +target/ + +# Go specific build artifacts +.obj/ +.go-work/ +.gopath/ +.gotmp/ +# go mod and go sum files are usually not ignored +# but you might want to if you're not using them +#go.mod +#go.sum + +# IDEs and editors +.idea/ +*.swo +*.swp +*.swx +*.log +*.tmp +*.bak +*.rej +*.orig +*.synctex.gz +*~ # Emacs and others temp files + +# OS generated +.DS_Store +Thumbs.db +desktop.ini + +# Coverage profiles +.coverprofile \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d483add --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# Arguments Fetcher: argsfet + +A simple tool to fetch command line arguments. + +# Build + +```shell +rsrc -manifest app.manifest -o app.syso +go build -ldflags="-w -s" -o argsfet.exe +``` + +# Usage + +Execute + +```shell +argsfet.exe +``` + +then will show the command line arguments and output a file named `command_line_.txt`. +There into `` is the process name which you want to fetch. + +# Reference + +[build - https://github.com/akavel/rsrc](https://github.com/akavel/rsrc) + +[argsfet.dll - https://github.com/Ninohana/argsfet](https://github.com/Ninohana/argsfet) \ No newline at end of file diff --git a/app.manifest b/app.manifest new file mode 100644 index 0000000..e81e3bb --- /dev/null +++ b/app.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/argsfet.dll b/argsfet.dll new file mode 100644 index 0000000000000000000000000000000000000000..b85f783f3bb1db54ea9ca374cef9812ad25507c6 GIT binary patch literal 68608 zcmeHw3w%_?_5W1M-mWi?Wezg zcVXt7IdkUBnKNhR&Ye5=rsDJKMY<5eju4Fsu?>(vw~UV-9Y*%3(;gfp9vJc1xNSDi zW8)UqH?%5&V9WBLuSu!#H8;0}lxn{c3^ywc%}UuN3zVjoTL0wS+-#RA`p~nrKYn0q z_CKsJ^3jp+Z$WzGqt5qllW^4gzmRam`&$8{PmFy3e!vH|j{L_PfK87$CB5m9?Du~r z({KI5fLSsVuj4Ipc+CfKt4%%#wON*d(-J@!b_qzO`O3FIb;(vPbI

gWvIHfRfxFCgIPBSv0w5bqo)fI zZ9*HF?FA-(iV#(kgSEbpPl$ErgR}vBRQ3j$9gEy>ugM0R*ftX6{otcP_rzEv;ufNN za=>7$9}g02BIr2#WOgiaQ(l9?_r@rY(PnAfLopVKNWP}lYih1)s`)BJi6Zdfzic~! z`E#@0qN19*8yW*}NizFTq;efc;{*tpUaGHMz6DuJ;Xl4XdR;! zEYZk}=h+oklJ*By`Mcu~-NWRknfq-<)5)^vL_{uTjAgWk9dHSAU!q0T$l{Am{=dW|d#DQY^q;%6-THfi4^_AI;m*0T^@LY64?> z`c6Z%jv22qBTYf{=T9M8N>Rtt#0AWlR*dLrV%Jf>?`9$DV$ypyqSJ^iW*wJO@mpB- z+fxutA#)RR$1wWC7)1B6leaVD_hf#D87ItZ4Y8XnrFITE7~}z5N?P=%hx$W0Ap?{G_aBQGHkEn@D#2g0XO}dmXXb3vMP$ zxA&#V5(-6WH?3!;RPU!5HqqJbT+>ZToV^W6RKV7Q-7QP8HET@vuOr{Nwex!9!$^=V z)OTKoAq!x&Z8E7vh^z0stoHUq@l&1d9#!kp?|uh(S7#P8H3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yB(82iZ zzLn)~zNR7A(%giO#rIT`IPlH;l?|cF5I_De#LvDB-~|85d$WuFlC57xeopYpa)wFzT!J;qMK|p1pvhZI0o#@G6X1ye23%V5G_~ zdoA||z5FUSn*LS$d|yK=zPB6u=<#TK1^zfd!|YWYnoAmL{rF&gP+X8=!k!XlRB`uQ?Vq z8-ukrrUSej27!ef3;dxYW=~0Iqc!#Hb}Y0kX_3SxwAxIx1m|MLfv#5T19thzVXr?Z z|L8??4O)TE%cJt*q0(W(>~z?5!7BJd6F;e5+R6b*OnfbUp7rr+{{sGb5EVujuTu&> zh>a!(_=h!?h{kke1mq{oML^)41EN?0mHws6}U7_d_B2PDm9D+W?rK>o?xKv3q0R#{P|mH;Oy5?pS(f)t!BJ?!QyNbM2<} zn{M8;Vbi8fq8rb*Q8sI1!AAAYrFZh9a7+ho-EeFFt$DW#cbfcL3t~gw24zFh2KR=l R4aiRYQWi*A;1jmM{{#B&6Sx2X literal 0 HcmV?d00001 diff --git a/argsfet.go b/argsfet.go new file mode 100644 index 0000000..5301a09 --- /dev/null +++ b/argsfet.go @@ -0,0 +1,27 @@ +package main + +import ( + "syscall" + "unsafe" +) + +func ObtainProcessCommandArgs(processName string) string { + // 将进程名转换为UTF-16指针 + processNameUTF16, _ := syscall.UTF16PtrFromString(processName) + + // 加载DLL以及函数 + dll := syscall.MustLoadDLL("argsfet.dll") + GetProcessIdByName := dll.MustFindProc("GetProcessIdByName") + GetCommandLineByProcessId := dll.MustFindProc("GetCommandLineByProcessId") + + // 获取PID + ret, _, _ := GetProcessIdByName.Call(uintptr(unsafe.Pointer(processNameUTF16))) + + // 获取命令行参数 + ret, _, _ = GetCommandLineByProcessId.Call(ret) + commandLine := syscall.UTF16ToString((*[1 << 16]uint16)(unsafe.Pointer(ret))[:]) + + // 释放DLL + _ = dll.Release() + return commandLine +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bcf9837 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module argsfet + +go 1.23.1 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e69de29 diff --git a/main.go b/main.go new file mode 100644 index 0000000..376b70d --- /dev/null +++ b/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "bufio" + "fmt" + "os" +) + +func main() { + if len(os.Args) > 1 { + processName := os.Args[1] + commandLine := ObtainProcessCommandArgs(processName) + fmt.Print(commandLine) + file, _ := os.Create(fmt.Sprintf("command_line_%s.txt", processName)) + defer file.Close() + writer := bufio.NewWriter(file) + writer.WriteString(commandLine) + writer.Flush() + } +}