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

Cross-compiling for Windows using Fedora 36; CONFIGURE_FEDORA36_win64.bash errors out on libre2-dev #464

Open
InfiniteBSOD opened this issue Mar 6, 2024 · 9 comments

Comments

@InfiniteBSOD
Copy link

Host: Win 11 x64 23H2 (22631.3155)
VM software: VMware Player 17
Guest OS: Fedora 36 x86-64
uname -a: Linux fedora 5.17.5-300.fc36.x86_64 #1 SMP PREEMPT Thu Apr 28 15:51:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Hello,

Trying to compile bulk_extractor for windows using these instructions.

However the script ("CONFIGURE_FEDORA36_win64.bash") stops with this error:
checking for RE2... no configure: error: Could not find RE2 library. Please install libre2-dev or equivalent.

OK (I'm not that well versed in Linux):
sudo dnf install libre2-dev
returns:

No match for argument: libre2-dev
Error: Unable to find a match: libre2-dev

I tried installing re2 which worked (to install) but the script seems to depend on libre2-dev.

I am unsure if pulling the repo as the instructions tell me is correct since I read:
Note: Currenlty bulk_extractor 2.1 does not build on windows, but 2.0 does.
when viewing the release for 2.0 it refers to Fedora 18 in bulk_extractor-2.0.0\src_win\README_WINDOWS.md.

I tried to install Fedora 18 but it requires me to modify the URLs for yum since the URLs are outdated (updates are now located in "archive" and http instead of https) so I gave up on that route.

Appreciate the application though, would love to try a 2.x-version on Windows.

Best Regards

@InfiniteBSOD InfiniteBSOD changed the title Cross-compiling for Windows using Fedora 36; CONFIGURE_FEDORA36_win64.bash errors out on RE2 Cross-compiling for Windows using Fedora 36; CONFIGURE_FEDORA36_win64.bash errors out on libre2-dev Mar 6, 2024
@simsong
Copy link
Owner

simsong commented Mar 6, 2024

Thank you for the email. You are correct — there is no support for re2 under MinGW.
I've been working on this very problem lately. The problem is that one of our users entered a regular expression [a-z]*@company.com and that expression basically causes the regular expression engine in both pcre and in std::regex to hang. Which means that if you don't have RE2 installed, and you use that regular expression, you will have a bad outcome.

How do you think this should be handled? Do you want to have bulk_extractor without scan_find - the ability to search for arbitrary regular expressions? or would you rather have it hang if you specify a bad regular expression?

or, would you like to port libre2 to MinGW?

@simsong
Copy link
Owner

simsong commented Mar 6, 2024

Tagging @jonstewart

@InfiniteBSOD
Copy link
Author

Thank you for the email. You are correct — there is no support for re2 under MinGW. I've been working on this very problem lately. The problem is that one of our users entered a regular expression [a-z]*@company.com and that expression basically causes the regular expression engine in both pcre and in std::regex to hang. Which means that if you don't have RE2 installed, and you use that regular expression, you will have a bad outcome.

How do you think this should be handled? Do you want to have bulk_extractor without scan_find - the ability to search for arbitrary regular expressions? or would you rather have it hang if you specify a bad regular expression?

or, would you like to port libre2 to MinGW?

Thank you so much for your quick reply.

I am thinking aloud here and I am not that well-versed in bulk_extractor so I might assume that something works a certain way that it doesn't:

Ok so one use-case I thought of with regex is to specify a regex that looks for strings that can be "seeds" for BTC.
That doesn't seem to be covered in any available "scanner" although BTC-addresses are identified using the "accts"-scanner if I remember correctly.

I'm not a C/C++ programmer so developing a scanner or plugin to bulk_extractor is beyond my technical knowledge however to be able to specify custom regex to find things that the scanners don't or that is highly specific to a certain DFIR-investigation would be extremely helpful.

So without having any knowledge of how big a job it would be my 5 cents are to port libre2 to MinGW so that custom regex would work.

Thanks again for answering (and very promptly).

Appreciate your work and the software immensely.

@simsong
Copy link
Owner

simsong commented Mar 7, 2024

libre2 depends on https://abseil.io
Both need to be running under MinGW.

@InfiniteBSOD
Copy link
Author

libre2 depends on https://abseil.io Both need to be running under MinGW.

Ah gotcha.

Saw this on their GitHub if it might be any help, the linked fix should solve this issue which was "Building Abseil 20230802.0 with MinGW-w64 fails".

Perhaps they (Abseil) fixed so it now compiles under MinGW :) ?

@simsong
Copy link
Owner

simsong commented Mar 8, 2024

I've actually added support for pcre and re-added support for std::regex to be20_api, so we should have support back for Windows soon. It will just be really, really slow with bad regular expressions.

@kieranjol
Copy link

I misread the windows build warning and still tried to compile in Fedora 36 and 40. Glad to hear that a fix is in the works as i was running into crashing issues with the latest version on Windows and I figured there was no point in raising the issue as it was so far behind 2.1.

@simsong
Copy link
Owner

simsong commented May 30, 2024 via email

@kieranjol
Copy link

kieranjol commented May 30, 2024 via email

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

No branches or pull requests

3 participants