Questions tagged [getmodulefilename]
25 questions
0
votes
1 answer
Is there an equivalent of GetModuleFileName() for Linux and how would I use it?
I have a function on Windows to get the address of the module in buf:
GetModuleFileName(0, buf, buf_size);
I want to do the same on Linux (which I do not know much about). I found the function dladdr(X, &dlInfo) which seems to do the right thing.…

user3443063
- 1,455
- 4
- 23
- 37
0
votes
1 answer
Get current file name after creating executable
I can get the current directory and the name of the current .go file but if i build a .exe from the file with go build then i still get the .go name.
.../Project/Test/testfile.go
After building testfile.go with go build i have these:
1)…

0_o
- 570
- 6
- 18
0
votes
1 answer
GetModuleFileName Antivirus False Detection ??? Get current process PATH
Hellow I am trying to retrive path off current process...
here is my first code:
#include
#include
using namespace std;
int CALLBACK WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int…

Davit Tvildiani
- 1,915
- 3
- 19
- 29
0
votes
1 answer
Trying to find exec file using GetModuleFileName but returns numbers
Here is my code. I have a buffer to save the output but it returns numbers. could someone explain this and how would I be able to get my exe file?
wchar_t buffer[MAX_PATH];
GetModuleFileName(NULL,buffer,sizeof(buffer));
cout << buffer << "\n";

Nakruf
- 17
- 1
- 5
0
votes
1 answer
Unclear edge-case of GetModuleFileName
MSDN docs state:
lpFilename [out]
A pointer to a buffer that receives the fully qualified path of the module. If the length of the path is less than the size that the nSize parameter specifies, the function succeeds and the path is returned as a…
user2201041
0
votes
2 answers
WinAPI: find directory of own executeable when location is changed
I'd like to create a C++ program that constantly checks the executables location and moves
it to a defined location if it is not there.
This works for a one time run.
However my issue is that, when I run the executable and place the…

NULL
- 31
- 1
- 1
- 6
0
votes
0 answers
GetModuleFileNameExA of 32bit app from 64bit app behaves differently on Win7 vs Win Server 2012?
Kind of a complicated question that I can't properly summarize in the title.
I have a 64 bit process (Foo64) that creates a 32 bit child process (Bar32), then tries to get the full path of Bar32's version of kernel32.dll. Obviously I expect Bar32 to…

David
- 7,011
- 1
- 42
- 38
-1
votes
1 answer
Copy current executable to another path C++ (Windows only)
I forgot how to program in C++, I want my exutable to copy itself to another path. I found a code that do what I want to do but there are conversion error that I don't know how to resolve :
void Victim::replicate()
{
char filename[ MAX_PATH ];
…

Sad1que
- 37
- 6
-1
votes
1 answer
Does Clojure have an equivalent to Python's if __name__=="__main__"?
Possible Duplicate:
What is the clojure equivalent of the Python idiom “if name == 'main'”?
I would use -main, but it only runs in compiled mode, not interpreted mode.
I would use (if (.isAbsolute (java.io.File. *file*)) (main…

mcandre
- 22,868
- 20
- 88
- 147
-1
votes
1 answer
Not able to get executable path for process id 4 (ntoskrnl.exe)
I have been trying to obtain the executable path by enumerating all processes. I used both GetModuleFileNameExA and QueryFullProcessImageNameA to obtain the path of the executables.
It works for almost everything except few like ntoskrnl.exe…

Keshav
- 47
- 1
- 7