Flo
Flo
Using Google Test for C-Code and mocking C-Modules
I currently face a situation where I have to use Google Test for C-Code. So I am not really able to use gmock to mock C-modules. What I want to do instead is use the CMake build system to choose mocked modules when needed. I want to accomplish that if possible by telling the build system to first search for includes/header files in lets say "path/to/mock/include" and if the regarding header file cant be found there I want it to choose the header file from the "normal" production code path like "path/to/production/include". That I want to do for every target I define. A target will be the test suite for a specific C-module. Normally that should be possible like this: Why do I want to mock? Some of the modules my module under test includes are hardware dependent.
target_include_directories(TARGET "path/to/mock/include")
target_include_directories(TARGET "path/to/production/include")
target_include_directories(TARGET "path/to/mock/include")
target_include_directories(TARGET "path/to/production/include")
You first show cmake the path to the header files of the mocked modules and then to production includes. And that order should also be the order in which the header files are searched for. But somehow I cant get this to work. It seems like the build system ignores the mocked modules and only wants to use the "real" ones. Do you all have some hints about what could be going wrong? Am I missing something? Is there an other/better way to achieve this? Thank you all in advance! Flo
15 replies
STM32 firmware extraction for read out protected devices
Found an interesting article while searching for methods for STM32 firmware extraction. I think its worth to glance through it! https://www.aisec.fraunhofer.de/en/FirmwareProtection.html
4 replies
Just for fun [Help welcome] : Install Linux on an old Prestigio PMP5197DULTRA (Allwinner A-10)
Greetings fellow earthlings, in my free time I like to take apart electronic devices and see how they are built and how I can re purpose them. Also I think its a bit like digital archaeology. Its fun. I tried to extract all the information and important things through Android Debug Bridge like: - NANDA dump (/boot): including a .fex file. Sadly Allwinner did not use device tree files (back then). - Kernel module (.ko) files for the peripherals. OEM Firmware: - U-Boot 2011.09-rc1-00013-g3aa33b0-dirty - Android 4.0.3
root@android:/ # getprop
[ro.board.platform]: [exDroid]
[ro.build.description]: [PMP5197DULTRA-eng 4.0.3 IML74K 20120819 test-keys]
[ro.build.fingerprint]: [yftech/mw07/mw07:4.0.3/IML74K/20120819:eng/test-keys]
[ro.build.product]: [mw07]
[ro.hardware]: [sun4i]
[ro.product.board]: [crane]
[ro.product.brand]: [yftech]
[ro.product.cpu.abi]: [armeabi-v7a]
root@android:/ # getprop
[ro.board.platform]: [exDroid]
[ro.build.description]: [PMP5197DULTRA-eng 4.0.3 IML74K 20120819 test-keys]
[ro.build.fingerprint]: [yftech/mw07/mw07:4.0.3/IML74K/20120819:eng/test-keys]
[ro.build.product]: [mw07]
[ro.hardware]: [sun4i]
[ro.product.board]: [crane]
[ro.product.brand]: [yftech]
[ro.product.cpu.abi]: [armeabi-v7a]
sudo sunxi-fel version
AWUSBFEX soc=00001623(A10) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000
sudo sunxi-fel version
AWUSBFEX soc=00001623(A10) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000
OEM firmware U-Boot output (excerpt): See messages down below. Discord only allows 2000 chars per post. Also I found the debug UART and im able to see U-Boot output and Android startup. GCC Linaro 4.9.4 toolchain installed to compile the Allwinner sun4i kernel. Thats how far I have come. Its the first time working so closely with the kernel and compiling it. How would you tackle this project? What are the big things to watch out for? What are my next steps? What am I unaware of? If you need more detail, logs, pictures just tell me and I will provide it if possible. Thank you! :) PS: My goal is to get Linux running on this tablet with as many functioning peripherals as possible. When done I want to do my first write up of all time and post it on the internet, so that I can give something back to our community. Also I want to support some kind of open source project in the future, as open source is our air and water. I think we were nothing without open source.
13 replies