Follow us on Twitter!
You cannot teach a man anything; you can only help him find it within himself. - Galileo
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 18
Guests Online: 15
Members Online: 3

Registered Members: 82889
Newest Member: Geriztul
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-12-09 22:08
I can do all the parsing and other related crap, but I was wondering how I would I make it interpret a file(like how a .bat is processed without having to be typed every time). I guess my real question is what does Windows send to a program when a file set to be opened by that program is double clicked. Would the path to the file that was double clicked be in argv?
Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-12-09 22:39
environment variables.

Right-click "my computer", it's somewhere in there.


Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-12-09 22:49
I know what environment variables are, just type "set" into cmd and you see *most* of them. But what would be sent to my program and how would I access the information sent to it? I guess another example that may clarify, is how when you click a .txt, it is automatically opened/displayed by notepad.
Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-12-09 22:51
You provide a path to the binary that handles opening the file, and you associate a file extension with a file.

It's a bit different on non-windows systems, though you can just expect people to put the file-to-be-opened as an argument of the program.


Author

RE: Creating a Simple Scripting Language.

reaper4334
Member



Posts: 315
Location: Uk
Joined: 24.11.06
Rank:
Moderate
Posted on 22-12-09 23:37
Hm, not sure what exactly you're trying to ask.. but I think spy and mosh have pretty much covered it..

Tyler3791 wrote:
Would the path to the file that was double clicked be in argv?

In most cases, yes.



i129.photobucket.com/albums/p210/reaper4334/reaper.png

www.catb.org/hacker-emblem/glider.png
reaper4334@hotmail.co.uk http://reaper4334.freehostia.com
Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 22-12-09 23:51
Compromise wrote:
You provide a path to the binary that handles opening the file, and you associate a file extension with a file.

I'm asking from the point of view of the binary, how does the binary get the path to the file it's supposed to open?
Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 23-12-09 01:41
I(with help) figured it out, thanks. The path to the file is in argv[1].
[edit]I got rid of the insulting "anyway," happy?[/edit]

Edited by on 23-12-09 06:34
Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 23-12-09 03:11
Yep, and all by myself too.Pfft
[edit]In case it wasn't clear, that's sarcasm for thanks for your help.[/edit]

Edited by on 23-12-09 03:12
Author

RE: Creating a Simple Scripting Language.


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 23-12-09 05:42
Thanks anyway.

Anyway...


Aaaanyyyyywaaaayyyyy...

Sheesh.