Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing version info parse #921 #2362

Closed
wants to merge 1 commit into from

Conversation

AntonDevil
Copy link
Contributor

Resource directory and version info structure parse implemented.
Parsing tested. Need to think about storing information and how
to work with UTF-16 (mb storing in sdb in UTF-8?) Assumed that
PE file resource directory 3 levels deep (type group - entries - langs).
proposals and advices are welcome =)

@AntonDevil
Copy link
Contributor Author

btw, parsing resource directory is the first step to many of PE Info #921 parsing

@XVilka
Copy link
Contributor

XVilka commented Apr 12, 2015

You can store UTF-16 as a base64 in sdb.

@radare
Copy link
Collaborator

radare commented Apr 12, 2015

Yep. Use native sdb functions to do that. Anyway you can also convert utf16 to utf8. That will be more readable but you lose the original encoding, not sure if you really need that, but i prefer to work in utf8 all the time.

On 12 Apr 2015, at 10:40, Anton Kochkov [email protected] wrote:

You can store UTF-16 as a base64 in sdb.


Reply to this email directly or view it on GitHub.

@Maijin
Copy link
Contributor

Maijin commented Apr 12, 2015

Being able to retrieve the original content is very resources.
As you know it's quite common to find sub-dll or sub-executable as a Resources in Malware.

@radare
Copy link
Collaborator

radare commented Apr 12, 2015

The original content is inside the file. When you get a string you want it readable and accessible by the user.

On 12 Apr 2015, at 11:01, Maijin [email protected] wrote:

Being able to retrieve the original content is very resources.
As you know it's quite common to find sub-dll or sub-executable as a Resources in Malware.


Reply to this email directly or view it on GitHub.

@Maijin
Copy link
Contributor

Maijin commented Apr 12, 2015

Yes of course if it's only string issue it's ok 👍


static void free_Var(Var *var) {
if (var) {
if (var->szKey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to check if bla is null before calling free (bla) :)

@jvoisin
Copy link
Contributor

jvoisin commented Apr 12, 2015

Except the if (bla != NULL) free (bla); and not checking memory-allocation, the code looks pretty clean to me, that's great :)

@jvoisin
Copy link
Contributor

jvoisin commented Apr 12, 2015

It would be cool to have some tests to avoid regressions btw ;)

@XVilka
Copy link
Contributor

XVilka commented Apr 12, 2015

This one is heavily related #926

@Maijin
Copy link
Contributor

Maijin commented Apr 12, 2015

@jvoisin for the moment it doesn't display anything so, it's quite hard to test. But I suppose this resource parser is launch against all PE files in format.pe tests and passes current tests.

@radare
Copy link
Collaborator

radare commented Apr 12, 2015

if you store that information in sdb, the user can access it using the k command using an sdb query. We can think in a generic way to interact with this information in a generic way to support other file formats later.

@AntonDevil AntonDevil force-pushed the addVersionInfo branch 2 times, most recently from 6de941d to b6cff43 Compare April 14, 2015 01:56
@AntonDevil
Copy link
Contributor Author

Guys, you could check version info parsing. It is in bin/cur/info/vs_version_info directory in sdb. Comments, claims, complaints highly required. Thinking of adding regression test.
Hope i didn't break any tests.

@Maijin
Copy link
Contributor

Maijin commented Apr 14, 2015

@AntonDevil See the green check, means that you didn't break tests ;-)

@radare
Copy link
Collaborator

radare commented Apr 14, 2015

ready to merge?

@AntonDevil
Copy link
Contributor Author

@radare Yes

@radare
Copy link
Collaborator

radare commented Apr 14, 2015

Those changes can't be applied to master. Can you redo the pullreq with a single-squashed commit rebased from the master branch?

thanks

Implementing version info parse
@AntonDevil
Copy link
Contributor Author

@radare done

@radare
Copy link
Collaborator

radare commented Apr 14, 2015

Thanks! merged

@radare radare closed this Apr 14, 2015
@radare
Copy link
Collaborator

radare commented Apr 14, 2015

Well... that broke the windows build because of dupped defines.
see http://ci.rada.re/job/radare2-w32/4108/console

@radare radare reopened this Apr 14, 2015
@radare
Copy link
Collaborator

radare commented Apr 15, 2015

Fixed in 1aac146fdfdc9ff16812f9ba21ea9586f00ef3a6

@radare radare closed this Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants