How does a Dependency Walker work? [closed] - dependency-walker

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I would like to be able to write my own version of a dependency walker tool (I think this is a good way to learn things).
However, I don't have the necessery knowledge to be able to know, given a PE file (dll/exe) - what are it's depenencies.
I would appreciate a reference to a place that can supply me this knowledge (tutorial / article / literature / etc..).
Thanks!

It's straight forward in principle (pseudo-code off the top of my head):
Create empty dependency list (list 1)
Create empty list of references yet to be looked at (list 2)
Add main module to list 2
repeat
Select first module in list 2
Open the PE file
Parse header to find import section
Enumerate import modules
for each module imported
if not already in list 1, Add it
if not already in list 2, Add it
Remove from list 2
until list 2 is empty.
Result in list 1.
To figure out how to actually parse the relevant parts of a PE, you can get the Portable Executable specification off of msdn.microsoft.com.

Related

How can we check if a domain is valid or not in go? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
How can we check if a domain is valid or not in go? Is there some function in go to validate it?
Some of the conditions are
1.) The domain length should be between 4 and 48
2.) Domain should use only letters, numbers, hyphens, and periods.
Example
something.in -> valid
some-stuff.in -> valid
some!thing.com -> invalid
Have you looked at the net package? : https://golang.org/pkg/net/?m=all#isDomainName and maybe also combining it with checking the length with len() ?

sub-subclass concept in OWL [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am posting this on stackoverflow since I am quite confused with OWL right now.
So in OWL file, can I represent a sub-subclass concept?
For example, entities belong to a class called Wine and it inside this class, we have a sub-class called WineType and then Within the WineType, we have sub-subclass called enzyme_avability. Would this be possible in OWL as a nested class concept? (e.g. )
Please help me with this
Yes it is possible. I think what you are looking for is here
http://www.w3.org/TR/owl2-syntax/#Object_Property_Restrictions
So in sort you are representing a hierarchy structure which is completely supported by OWL.
You can write axioms like:
A subClassOf B
B subClassOf C
and so on, without limits on the number of levels you want to define. A reasoner will be able to answer queries like: is A subclass of C? by following the hierarchy.
Of course, more complex ways to arrange the hierarchy exist, e.g., the object property restrictions mentioned by Jinal.

Auto-Completion [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How does Google or amazon implement the auto-suggestion at their search box. I am looking for the algorithm with technology stack.
PS: I have searched over the net and found this and this and many many more. But I am more interested in not what they do but how they do it. NoSQL database to store the phases? or is it sorted or hashed according to keyword's? So to rephrase the question: Given the list of different searches ignoring personalization, geographic-location etc, How do they store, manage and suggest it so well.
This comes under the domain of stastical language processing problems. Take a look at spelling suggestion article by Norvig. Auto - completion will use a similar mechanism.
The idea is that from past searches, you know the probability of phrases (or better called bigram, trigram, ngram). For each such phrase, the auto complete selects the one having max value of
P(phrase|word_typed) = P(word_typed|phrase) P(phrase) / P(word_typed)
P(phrase|word_typed) = Probability that phrase is right phrase if word typed
so far is word_typed
Norvig's article is a very accessible and great explanation of this concept.
Google takes your input and gives TOP4 RESULTS ACCORDING TO THE RANK IDs [if results are less it returns parameters as empty strings] given to different keywords which differ dynamically by the hit and miss count.
Then, they make a search query and returns 4 fields with url, title, and 2 more fields in Json, omnibox then populates the data using prepopulate functions in Chrome trunk.

What is best file naming style for protobuf? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
There is a Style Guide for Protocol Buffers. But it does not clearly say how a .proto file should be named.
MyProtos.proto, my_protos.proto or my-protos.proto, which is the better name?
I don't believe there's an appropriate answer to how any file "should be named" other than aim for consistency and clarity.
Consistency would mean following the file-naming conventions your project already has for sources and headers. If your sources are named using camel-case, do the same for the proto files. The most common choice seems to me to be the my_protos.proto version.
Clarity to me means that the file name should give some clue as to the contents. I generally favour naming files after the class which they implement, and usually have a separate file (pair) per class. I would recommend the same for the proto files. I prefer several small proto files each defining a single Message or very closely related Messages over a single huge proto file defining all your Messages in the one place.
Since the question is almost 8 year old, for those who people looking at this in 2020 s, now there is a style guide published by google.
Excerpt for file naming
Files should be named lower_snake_case.proto
https://developers.google.com/protocol-buffers/docs/style

How can I index my source code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Are there any tools out there that will index source code, client side, and provide blazing fast search results?
How can I index our internal source code? is related but covers server side tools.
Everything and Locate32 are nice indexing-tools on the windows platform. Just one problem, they only index the file-names.
DocFetcher is another solution, it tries to index the content of the files, but have big memory issues as it cannot index the content of bigger files, and just skips them
I'm also on the search for something to index my data, and i want some tool like locate32 wich is supernice to integrate with the windows shell, but it would be nice to get it to index the content of files also, only brute word indexing, no magic to be done to the data, but let me do plain wildcard searches, like words starting with, ending with, and containing.
But the search is still on.. (for an app, that is..)
Install ctags.
Then ctags -R in the root of your source tree. Many editors, including Vim, can use the resulting tags file to give near-instant search results.
I know this is an old question, but maybe this will help someone else.
Take a look at CodeIDX: http://sourceforge.net/projects/codeidx/.
Using CodeIDX you can index multiple directories using filetype filters and search the created index.
You can open multiple searches at the same time and the results can be viewed in a preview.
Using GNU Global you can get browsable, searchable source code. You can run this locally too or use all the tools that go with it (like less to go straight to a function definition).
See http://www.tamacom.com/tour/kernel/linux/ for an example of the Linux Kernel.

Resources