touchall script

the touch command under is useful, but not found under windows system. So just write one by hand:

The critical API is SetFileTime.

SetFileTime(h, file_time, file_time, file_time);

This touchall script find all dirs and files under specify path recursively. and change all file-time (ctime/mtime/atime) to now.

Sources …..

Continue reading
Posted in Others | Tagged , , | Comments Off on touchall script

an inconceivable bug of STM32CubeMX….

The default value of Heap and Stack in STM32CubeMX is 0x200 bytes Heap and 0x400 bytes Stack.

Which is work fine in most situation.

BUT the middleware of USBStack use malloc! for TX and RX buffer!!!
That will make the USB enumerate process fail (some yellow exclamation point).
At that time, system still recognize that device, so I can’t get the point, waste much time to debug and tracing.

It is better to increase this automatically when user enable USB stack?

After change heap to 0x800, everything fine.

Posted in Memo | Tagged , , , , | Comments Off on an inconceivable bug of STM32CubeMX….

Disable Chrome PDF plugin

For the old chrome version, goto chrome://plugin and disable it. But when I upgrade to 62, missing this.

And I found chrome://settings/content/pdfDocuments
Or find by click

I found https://superuser.com/questions/30850/stop-pdfs-from-displaying-inside-google-chrome finally:)

Posted in Memo | Tagged , , , | Comments Off on Disable Chrome PDF plugin

STM32F103 marking summary

This is collection I got.

and compare with PCN-8363-2014.03.31.pdf PCN-8390-2014.05.07.pdf PCN-9484-2015.12.17.pdf PCN-9511-2016.04.22.pdf PCN-9685-2016.04.19.pdf

Assembly Plant

Country of Origin

Manufactured date

The problem is, howto identify 2003 or 2013?

Interconnect

Chip revision

Posted in Memo | Tagged , , , , | Comments Off on STM32F103 marking summary

Bug in Python3.6 standard library when compile using MinGW

Python36 is compiled by Visual Studio 2015 or MSBuild tools 2015, which included Compiler v19.00 (MSC_VER 1600). But “C:\Python36\Lib\distutils\cygwinccompiler.py” can’t handle it…

I modify it simply like this:

Posted in Memo | Tagged , , , , , , , | Comments Off on Bug in Python3.6 standard library when compile using MinGW

USB3.0 Hub

I bought some USB3.0 hub, and look inside:)

Unitek Y-3043CBK, RTS5411, transfer stable and look pretty. This chip have EFuse ROM, so external SPI Flash is useless.

Continue reading

Posted in Memo | Tagged , , , , , | Comments Off on USB3.0 Hub

Xilinx update Spartan3AN device!

I found the release date of some XC3S50AN is 2014 or 2016! and Impact can’t download to In-System Flash, show me “SPI not found”…
But the older 2010’s IC is OK. After some searching…

Xilinx manufacturing Spartan3AN devices, not discontinued! And the flash density is changed.

https://www.xilinx.com/support/answers/59572.html

http://www.xilinx.com/support/documentation/customer_notices/xcn14003.pdf

Posted in Memo | Tagged , , | Comments Off on Xilinx update Spartan3AN device!

Dump PE file

I am using some tool to check a PE file (dll or exe) depends, most free tool support 32bits file.
So I decided to write an tool support 32bits and 64bits PE file.

The PE struct is defined in MinGW’s headers. So What I need to do is write a parser and make some test.

the PE file is like this

An example PE header is

Both EXE and DLL file, the first 128 bytes is the same. This a DOS program, which print that message above. The MAGIC is “MZ”

Then is `e_lfanew`, which is `80 00 00 00`, point to new NT header.

the NT header is:

The Opt Header is difference between 32bits and 64bits!
The first WORD of Opt header is magic, for 32bits is 0x010B, 64bits is 0x020B.

So we can write a script to show PE type

which will output like `file` command:

For more details, see the source code

https://github.com/buaabyl/pedump

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

Posted in Writing | Tagged , , , , | Comments Off on Dump PE file

Remove unnecessary php file please

When I analysis web server log file, I found this

That means someone checking my files, and want to get the MySQL password?

It is better to prevent this location in web server!

Posted in Memo | Tagged , , , , | Comments Off on Remove unnecessary php file please

the format of openssh public key

The openssh public key is like this :

using openssl to decode it:

And I write a python script to decode it, and found the format like this:

The sample python code:

Posted in Writing | Tagged , , , , | Comments Off on the format of openssh public key