Best approach to use a DLL

Windows specific questions.
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Best approach to use a DLL

Post by UEZ »

Here what I did to use an external DLL.

uFMOD.bi (code too long): http://pasted.co/67c01807

Example:

Code: Select all

#include "uFMOD.bi"

'Generated by *FB File2Bas Code Generator v0.50 build 2017-03-15 beta*

Dim Shared As UByte __1999xm(0 To ...) = _
	{&h45, &h78, &h74, &h65, &h6E, &h64, &h65, &h64, &h20, &h4D, &h6F, &h64, &h75, &h6C, &h65, &h3A, &h20, &h31, &h39, &h39, &h39, &h20, &h62, &h79, &h20, &h57, &h41, &h56, &h45, &h20, &h2F, &h20, &h4D, &h2E, &h6F, &h2E, &h4E, &h1A, &h46, &h61, &h73, &h74, &h54, &h72, &h61, &h63, &h6B, &h65, &h72, &h20, &h76, &h32, &h2E, &h30, &h30, &h20, &h20, &h20, &h04, &h01, &h14, &h01, &h00, &h00, &h01, &h00, &h00, &h00, &h0A, &h00, &h01, &h00, &h01, &h00, &h01, &h00, &h18, &h00, &h85, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h09, &h00, &h00, &h00, &h00, &h40, &h00, &hE3, &h04, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h83, &h25, &h01, &h8D, &h61, &h10, &h0C, &h83, &h50, &h01, &h85, &h61, &h10, &h83, &h19, &h01, &h85, &h61, &h10, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h4C, &h01, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h28, &h01, &h83, &h4B, &h01, &h80, &h80, &h83, &h1C, &h01, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h83, &h44, &h01, &h80, &h80, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h2D, &h01, &h9B, _
	 &h33, &h01, &h0E, &hDC, &h80, &h80, &h83, &h27, &h01, &h80, &h83, &h47, &h01, &h80, &h83, &h1B, &h01, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h9B, &h45, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h44, &h01, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h2C, &h01, &h80, &h80, &h80, &h83, &h20, &h01, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h20, &h01, &h80, &h80, &h83, &h3F, &h01, &h83, &h14, &h01, &h80, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h83, &h40, &h01, &h9B, &h42, &h01, &h0E, &hDC, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h25, &h01, &h83, &h40, &h01, &h80, &h80, &h83, &h19, &h01, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h38, &h01, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h83, &h3D, &h01, &h9B, &h3F, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h83, &h40, &h01, &h9B, &h42, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h83, &h28, &h01, &h80, &h83, &h44, &h01, &h80, &h83, &h1C, &h01, &h80, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h3B, &h01, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h83, &h44, &h01, &h80, &h80, &h80, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h40, &h01, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h27, &h01, &h83, &h47, &h01, &h80, &h80, &h83, &h1B, &h01, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h9B, &h49, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h48, &h01, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2C, &h01, &h80, &h80, &h80, &h83, &h20, &h01, &h80, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h20, &h01, &h80, &h83, &h44, &h01, &h80, &h83, &h14, &h01, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h83, &h49, &h01, &h9B, &h4B, &h01, &h0E, &hDC, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h83, &h25, &h01, &h80, &h83, &h4C, &h01, &h80, &h83, &h19, &h01, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, _
	 &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h9B, &h49, &h01, &h0E, &hDC, &h83, &h4B, &h01, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h28, &h01, &h80, &h83, &h47, &h01, &h80, &h83, &h1C, &h01, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h83, &h40, &h01, &h80, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h9B, &h49, &h01, &h0E, &hDC, &h83, &h47, &h01, &h80, &h80, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h9B, &h4C, &h01, &h0E, &hDC, &h83, &h4B, &h01, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h83, &h27, &h01, &h80, &h80, &h83, &h4E, &h01, &h83, &h1B, &h01, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h50, &h01, &h80, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h83, &h4E, &h01, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h49, &h01, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h2C, &h01, &h80, &h83, &h48, &h01, &h80, &h83, &h20, &h01, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h20, &h01, &h80, &h83, &h50, &h01, &h80, &h83, &h14, &h01, &h80, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h4E, &h01, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h25, &h01, &h83, &h4C, &h01, &h80, &h80, &h83, &h19, &h01, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h4B, &h01, &h80, &h80, &h83, &h31, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h83, &h49, &h01, &h9B, &h4B, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h83, &h4C, &h01, &h9B, &h4E, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h83, &h28, &h01, &h80, &h83, &h50, &h01, &h9B, &h51, &h01, &h0E, &hDC, &h83, &h1C, &h01, &h80, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h83, &h50, &h01, &h9B, &h4C, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2F, &h01, &h9B, &h34, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h83, &h47, &h01, &h80, &h80, &h80, &h80, &h80, &h83, &h36, &h01, &h9B, &h38, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h40, &h01, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, &h80, &h80, &h80, &h83, &h27, &h01, &h83, &h47, &h01, &h80, &h80, &h83, &h1B, &h01, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h9B, &h45, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2D, &h01, &h9B, &h33, &h01, &h0E, &hDC, _
	 &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h34, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h42, &h01, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h83, &h2C, &h01, &h80, &h80, &h83, &h44, &h01, &h83, &h20, &h01, &h80, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h30, &h01, &h9B, &h36, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h80, &h83, &h38, &h01, &h9B, &h39, &h01, &h0E, &hDC, &h80, &h80, &h80, &h80, &h80, &h80, &h07, &h01, &h00, &h00, &h28, &h43, &h29, &h20, &h31, &h39, &h39, &h39, &h20, &h4A, &h65, &h72, &h6F, &h65, &h6E, &h20, &h47, &h2E, &h20, &h54, &h65, &h6C, &h1F, &h01, &h00, &h28, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h30, &h00, &h04, &h00, &h2B, &h00, &h09, &h00, &h1E, &h00, &h0D, &h00, &h18, &h00, &h13, &h00, &h12, &h00, &h1B, &h00, &h0E, &h00, &h25, &h00, &h0A, &h00, &h32, &h00, &h07, &h00, &h40, &h00, &h05, &h00, &h4D, &h00, &h03, &h00, &h8D, &h00, &h00, &h00, &h00, &h00, &h30, &h00, &h00, &h00, &h20, &h00, &h44, &h01, &h20, &h00, &h50, &h00, &h20, &h00, &h50, &h00, &h20, &h00, &h50, &h00, &h20, &h00, &h50, &h00, &h20, &h00, &h50, &h00, &h20, &h00, &h5A, &h00, &h20, &h00, &h64, &h00, &h20, &h00, &h6E, &h00, &h20, &h00, &h78, &h00, &h20, &h00, &h82, &h00, &h20, &h00, &h0B, &h02, &h06, &h01, &h01, &h01, &h01, &h01, &h01, &h00, &h00, &h1A, &h0B, &h15, &h80, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h64, &h00, &h00, &h00, &h00, &h00, &h00, &h00, &h64, &h00, &h00, &h00, &h40, &hDC, &h11, &h80, &h0A, &h0C, &h54, &h72, &h69, &h61, &h6E, &h67, &h6C, &h65, &h2E, &h77, &h61, &h76, &h20, &h20, &h20, &h20, &h20, &h20, &h20, &h20, &h20, &h20, &h01, &hD0, &hB0, &h03, &hAF, &h03, &hB0, &h03, &hB0, &h03, &hAF, &h03, &hB0, &h03, &hAF, &h03, &hB1, &h03, &hAF, &h03, &hB0, &h03, &hAF, &h03, &hB0, &h03, &h9A, &h05, &hB0, &h03, &hAF, &h03, &hB1, &h03, &hAF, &h03, &hB0, &h03, &hAF, &h03, &hB0, &h03, &hB0, &h03, &hAF, &h03, &hB0, &h03, &hB0, &h03, &hC3, &h03, &h51, &hFC, &h50, &hFC, &h50, &hFC, &h50, &hFC, &h51, &hFC, &h50, &hFC, &h50, &hFC, &h51, &hFC, &h50, &hFC, &h51, &hFC, &h4F, &hFC, &h66, &hFA, &h51, &hFC, &h50, &hFC, &h51, &hFC, &h50, &hFC, &h50, &hFC, &h51, &hFC, &h50, &hFC, &h50, &hFC, &h50, &hFC, &h51, &hFC, &h50, &hFC, &h50, &hFC}

Dim as any Ptr hLib = _uFMOD_Startup()
_uFMOD_SetVolume(hLib, 25)

_uFMOD_PlaySongMem(hLib, @__1999xm(0), Ubound(__1999xm) * SizeOf(Ubyte))

Print "Sound playing; waiting for keypress to stop and exit..."
Sleep
_uFMOD_StopSong(hLib)
_uFMOD_Shutdown(hLib)
As I'm new to FB I just wondering what the best approach is to use an external DLL. Is this a good approach? What can be made better?
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

LoadLibraryExA woks with Dylibsymbol also.
You have the third parameter as a tweak for different origins of .dll files. (Visual C for example)
I got hold of file2bas.
Unfortunately Freebasic only does chr(32 times)
So I had to use data.
This is a truncicated .xm file.

Code: Select all



extern "Windows"
declare function LoadLibraryEx alias "LoadLibraryExA"(byval as zstring ptr, byval as any ptr,byval as long) as any ptr
end extern

dim as any ptr L=LoadLibraryex("ufmod.dll",0,0)

print L
if L=0 then print "unable to load dll":sleep:end

dim puFMOD_PlaySong as Function _
      ( _
         byval as any Ptr, _
         byval as uinteger, _
         byval as Uinteger _
      ) as Integer
      
   dim puFMOD_StopSong as Function _
      ( _
         byval as any ptr, _
         byval as Integer, _
         byval as Integer _
      ) as Integer
      
   dim as ubyte Array(0 to 11934)
   dim as long ctr
   do
       dim as long tmp
       
       read tmp
     ' 
        if tmp>400 then print "All read @ ";ctr;" elements":exit do
       
         Array(ctr)=cubyte(tmp)
        ctr+=1
        loop
       
    puFMOD_PlaySong=  Dylibsymbol(L, "uFMOD_PlaySong")
    puFMOD_StopSong = Dylibsymbol(L, "uFMOD_PlaySong") 'The same ??
     
    print puFMOD_PlaySong
    print puFMOD_StopSong
    
puFMOD_PlaySong( @array(0), Ubound(array) * SizeOf(ubyte),1)

Print "Sound playing; waiting for keypress to stop and exit..."
Sleep
puFMOD_StopSong(0, 0, 0)
Dylibfree(L)


data 69,120,116,101,110,100,101,100,32,77,111,100,117,108,101,58,32,105,102,32,67,114,121,115,116,97,108,115,46,46,46,32,32,32,32,32,32,26,70 
data 97,115,116,84,114,97,99,107,101,114,32,118,50,46,48,48,32,32,32,4,1,20,1,0,0,11,0,0,0,8,0,11,0,2,0,0,0,5,0 
data 80,0,0,1,2,3,4,5,6,9,7,8,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,64,0,194,2,46,1,64,15,5,128 
data 128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,135,53,1,64,128,128,128,128,128,128,128 
data 128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,54,1,64,128 
data 128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128 
data 128,135,53,1,64,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128 
data 128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,48 
data 1,64,128,128,128,128,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,135,46,1,64,128,128,128,128 
data 128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,53,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46 
data 1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128 
data 128,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,42 
data 1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128 
data 128,135,42,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,51,1,64,128 
data 128,128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128 
data 128,135,49,1,64,128,128,128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128 
data 128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,128,128,128,128,128,128,135,43,1,64,128,128,128,128,128,128,128 
data 128,135,44,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,128,128,128,128,128,128,135,43,1,64,128 
data 128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,128,128,128,135,43 
data 1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,128,128 
data 128,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,46,1,64,13,0,128,128,128,128,128,128,128,9,0 
data 0,0,0,64,0,34,3,46,1,64,15,5,128,128,135,53,1,76,135,53,1,76,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135 
data 49,1,64,135,51,1,76,135,51,1,76,128,128,128,135,53,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,135,53,1,76,135,53,1,76 
data 128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,54,1,64,128,128,128,128,128,128,128,128,135 
data 46,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,53,1,64,128,128,128 
data 128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,135,53,1,76,135,53,1,76,128 
data 128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,135,54,1,76,135,54,1,76,128,128,128,128,128,135,46,1,64,128,128,128 
data 128,128,135,48,1,64,128,128,135,53,1,76,135,53,1,76,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,135,51,1 
data 76,135,51,1,76,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,53,1,64,128,128,128 
data 128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,51,1,64 
data 128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128,135,51,1,76 
data 135,51,1,76,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,42,1,64,135,49,1,76,135,49,1,76,128,128,128,135,44,1,64 
data 128,128,128,128,128,128,128,128,135,46,1,64,128,135,51,1,76,135,51,1,76,128,128,128,128,128,135,49,1,64,128,128,128,128,128,135,42,1,64 
data 128,128,135,49,1,76,135,49,1,76,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,51,1,64 
data 128,128,128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128 
data 128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64 
data 128,135,49,1,76,135,49,1,76,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,135,51,1,76,135,51,1,76,128,128 
data 128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,135,49,1,76,135,49,1,76,128,128,128,135,48,1,64,128,128,128,128,128,128 
data 128,128,135,41,1,64,128,135,48,1,76,135,48,1,76,128,128,128,128,128,135,43,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128 
data 128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64 
data 128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,128,128,128,128,128,128,135,43,1,64,128,128,128,128,128,128 
data 128,128,135,44,1,64,135,48,1,76,135,48,1,76,128,128,128,46,1,64,13,0,128,128,128,128,128,128,128,9,0,0,0,0,64,0,34,3,46 
data 1,64,15,5,128,128,135,46,1,76,135,46,1,76,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,135,48,1,76,135 
data 48,1,76,128,128,128,135,53,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,135,53,1,76,135,53,1,76,128,128,128,128,128,135,48,1 
data 64,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,54,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128 
data 135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,53,1,64,128,128,128,128,128,135,46,1,64,128,128 
data 128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,135,53,1,76,135,53,1,76,128,128,128,135,51,1,64,128,128 
data 128,128,128,128,128,128,135,44,1,64,128,135,54,1,76,135,54,1,76,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128 
data 135,53,1,76,135,53,1,76,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,135,51,1,76,135,51,1,76,128,128,128 
data 135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,53,1,64,128,128,128,128,128,135,44,1,64,128,128 
data 128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128 
data 135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128,135,51,1,76,135,51,1,76,128,128,128,128 
data 135,49,1,64,128,128,128,128,128,128,128,128,135,42,1,64,135,49,1,76,135,49,1,76,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128 
data 135,46,1,64,128,135,51,1,76,135,51,1,76,128,128,128,128,128,135,49,1,64,128,128,128,128,128,135,42,1,64,128,128,135,49,1,76,135,49 
data 1,76,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128 
data 135,42,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128 
data 128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,135,49,1,76,135,49,1 
data 76,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,135,51,1,76,135,51,1,76,128,128,128,128,135,43,1,64,128,128 
data 128,128,128,128,128,128,135,44,1,64,135,49,1,76,135,49,1,76,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,135 
data 48,1,76,135,48,1,76,128,128,128,128,128,135,43,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128 
data 128,128,128,128,128,128,135,41,1,64,128,128,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128 
data 135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,128,128,128,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,135,48 
data 1,76,135,48,1,76,128,128,128,46,1,64,13,0,128,128,128,128,128,128,128,9,0,0,0,0,64,0,129,2,152,15,5,128,135,42,1,64,135 
data 48,1,76,135,48,1,76,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,135,46,1,76,135,46,1,76,128,128,128,128 
data 128,135,49,1,64,128,128,128,128,128,135,42,1,64,128,128,135,44,1,76,135,44,1,76,128,128,128,128,135,44,1,64,128,128,128,128,128,128,128 
data 128,135,46,1,64,128,128,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128 
data 128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,42,1,64,128,128,128,128,128,135,44 
data 1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,135,41 
data 1,76,135,41,1,76,128,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128 
data 128,128,128,128,135,41,1,64,128,135,46,1,76,135,46,1,76,128,128,128,128,128,135,43,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128 
data 128,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44 
data 1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,128,128,128,128,128,128,135,43,1,64,128,128,128,128 
data 128,128,128,128,135,44,1,64,128,128,128,128,128,46,1,64,13,0,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,9,0,0,0,0,64,0,250,3,46,1,64,15,5,128,128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128 
data 135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,135,53,1,68,128,128,135,53,1,64,128,128,128,128,128,128,128,128,135,46,1 
data 64,128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128,128,135,48,1,64,128,128,128,128,128,135,49,1,64,128,128,135,53,1,76,135,53 
data 1,76,135,53,1,68,128,128,128,135,54,1,64,128,135,54,1,76,135,54,1,76,128,128,128,128,128,135,46,1,64,135,53,1,76,135,53,1,76 
data 135,53,1,68,128,128,135,48,1,64,128,128,135,54,1,76,135,54,1,76,128,128,128,128,135,49,1,64,128,135,53,1,76,135,53,1,76,135,53 
data 1,68,128,128,128,128,135,53,1,64,135,54,1,76,135,54,1,76,128,128,128,135,46,1,64,128,128,135,53,1,76,135,53,1,76,135,53,1,68 
data 128,128,128,135,48,1,64,128,135,51,1,76,135,51,1,76,128,128,128,128,128,135,49,1,64,135,49,1,76,135,49,1,76,135,53,1,68,128,128 
data 135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,135,51,1,76,135,51,1,76,135,51,1,68,128,128,128,128,135,46,1,64,128,128 
data 128,128,128,135,48,1,64,128,128,128,128,135,51,1,68,128,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,135,51,1,76,135 
data 51,1,76,135,51,1,68,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,135,51,1,76,135,51,1,76,135,51,1,68,128 
data 128,128,128,135,53,1,64,135,53,1,76,135,53,1,76,128,128,128,135,44,1,64,128,128,135,51,1,76,135,51,1,76,135,51,1,68,128,128,128 
data 135,46,1,64,128,135,53,1,76,135,53,1,76,128,128,128,128,128,135,48,1,64,135,51,1,76,135,51,1,76,135,51,1,68,128,128,135,51,1 
data 64,128,128,135,53,1,76,135,53,1,76,128,128,128,128,135,44,1,64,128,135,51,1,76,135,51,1,76,135,51,1,68,128,128,128,128,135,46,1 
data 64,135,49,1,76,135,49,1,76,128,128,128,135,48,1,64,128,128,135,48,1,76,135,48,1,76,135,51,1,68,128,128,128,135,49,1,64,128,128 
data 128,128,128,128,128,128,135,42,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1 
data 64,128,128,128,135,49,1,68,128,128,128,128,135,49,1,64,128,128,128,128,128,135,42,1,64,128,128,135,49,1,76,135,49,1,76,135,49,1,68 
data 128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128,128,135,51,1,64,128,128 
data 135,51,1,76,135,51,1,76,128,128,128,128,135,42,1,64,128,135,49,1,76,135,49,1,76,135,49,1,68,128,128,128,128,135,44,1,64,135,51 
data 1,76,135,51,1,76,128,128,128,135,46,1,64,128,128,135,49,1,76,135,49,1,76,135,49,1,68,128,128,128,135,49,1,64,128,135,51,1,76 
data 135,51,1,76,128,128,128,128,128,135,42,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128,128,135,44,1,64,128,128,135,48,1,76,135,48 
data 1,76,128,128,128,128,135,46,1,64,128,135,46,1,76,135,46,1,76,135,49,1,68,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1 
data 64,128,128,135,48,1,76,135,48,1,76,135,48,1,68,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,135,48,1 
data 68,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,128,135,48,1,68,128,128,128,128,135,43,1,64,128,128,128,128,128 
data 135,44,1,64,128,128,128,128,135,48,1,68,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,135,48,1,68,128,128 
data 135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,135,48,1,68,128,128,128,128,135,48,1,64,128,128,128,128,128,135,41,1 
data 64,128,128,135,46,1,76,135,46,1,76,135,48,1,68,128,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,135,49,1,76,135 
data 49,1,76,135,48,1,68,128,128,46,1,64,13,0,128,128,128,128,128,128,128,9,0,0,0,0,64,0,250,3,46,1,64,15,5,128,128,135,53 
data 1,76,135,53,1,76,135,53,1,68,128,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,135,53,1,68,128,128,135,53 
data 1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128,128,135,48,1,64,128,128,128,128 
data 128,135,49,1,64,128,128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128,135,54,1,64,128,135,54,1,76,135,54,1,76,128,128,128,128 
data 128,135,46,1,64,135,53,1,76,135,53,1,76,135,53,1,68,128,128,135,48,1,64,128,128,135,54,1,76,135,54,1,76,128,128,128,128,135,49 
data 1,64,128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128,128,135,53,1,64,135,54,1,76,135,54,1,76,128,128,128,135,46,1,64,128 
data 128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128,135,48,1,64,128,135,51,1,76,135,51,1,76,128,128,128,128,128,135,49,1,64,135 
data 49,1,76,135,49,1,76,135,53,1,68,128,128,135,51,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,135,51,1,76,135,51,1,76,135 
data 51,1,68,128,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128,135,51,1,68,128,128,128,135,51,1,64,128,128,128,128 
data 128,128,128,128,135,44,1,64,135,51,1,76,135,51,1,76,135,51,1,68,128,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128 
data 135,51,1,76,135,51,1,76,135,51,1,68,128,128,128,128,135,53,1,64,135,53,1,76,135,53,1,76,128,128,128,135,44,1,64,128,128,135,51 
data 1,76,135,51,1,76,135,51,1,68,128,128,128,135,46,1,64,128,135,53,1,76,135,53,1,76,128,128,128,128,128,135,48,1,64,135,51,1,76 
data 135,51,1,76,135,51,1,68,128,128,135,51,1,64,128,128,135,53,1,76,135,53,1,76,128,128,128,128,135,44,1,64,128,135,51,1,76,135,51 
data 1,76,135,51,1,68,128,128,128,128,135,46,1,64,135,49,1,76,135,49,1,76,128,128,128,135,48,1,64,128,128,135,48,1,76,135,48,1,76 
data 135,51,1,68,128,128,128,135,49,1,64,128,128,128,128,128,128,128,128,135,42,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128,128,135,44 
data 1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,135,49,1,68,128,128,128,128,135,49,1,64,128,128,128,128,128,135,42,1,64,128 
data 128,135,49,1,76,135,49,1,76,135,49,1,68,128,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,135,49,1,76,135,49,1 
data 76,135,49,1,68,128,128,135,51,1,64,128,128,135,51,1,76,135,51,1,76,128,128,128,128,135,42,1,64,128,135,49,1,76,135,49,1,76,135 
data 49,1,68,128,128,128,128,135,44,1,64,135,51,1,76,135,51,1,76,128,128,128,135,46,1,64,128,128,135,49,1,76,135,49,1,76,135,49,1 
data 68,128,128,128,135,49,1,64,128,135,51,1,76,135,51,1,76,128,128,128,128,128,135,42,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128 
data 128,135,44,1,64,128,128,135,48,1,76,135,48,1,76,128,128,128,128,135,46,1,64,128,135,46,1,76,135,46,1,76,135,49,1,68,128,128,128 
data 128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,135,48,1,76,135,48,1,76,135,48,1,68,128,128,128,135,43,1,64,128,128,128,128 
data 128,128,128,128,135,44,1,64,128,128,135,48,1,68,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,41,1,64,128,128,128,135,48,1,68 
data 128,128,128,128,135,43,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,135,48,1,68,128,128,128,135,49,1,64,128,128,128,128,128,128,128 
data 128,135,41,1,64,128,128,135,48,1,68,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,135,48,1,68,128,128,128 
data 128,135,48,1,64,128,128,128,128,128,135,41,1,64,128,128,135,46,1,76,135,46,1,76,135,48,1,68,128,128,128,135,43,1,64,128,128,128,128 
data 128,128,128,128,135,44,1,64,135,44,1,76,135,44,1,76,135,48,1,68,128,128,46,1,64,13,0,128,128,128,128,128,128,128,9,0,0,0,0 
data 64,0,184,3,46,1,64,15,5,128,128,135,46,1,76,135,46,1,76,135,53,1,68,135,53,1,76,128,128,135,48,1,64,128,128,128,128,128,128 
data 128,128,135,49,1,64,128,128,135,53,1,68,135,53,1,76,128,135,53,1,64,128,128,128,128,128,135,53,1,76,128,128,135,46,1,64,128,128,128 
data 135,53,1,68,135,53,1,76,128,128,128,135,48,1,64,128,128,128,128,128,135,49,1,64,128,128,128,128,135,53,1,68,135,53,1,76,128,128,135 
data 54,1,64,128,128,128,128,135,54,1,76,128,128,128,135,46,1,64,128,128,135,53,1,68,135,53,1,76,128,135,48,1,64,128,128,128,128,128,128 
data 128,128,135,49,1,64,128,128,128,135,53,1,68,135,53,1,76,128,128,128,135,53,1,64,128,128,128,135,53,1,76,128,135,46,1,64,128,128,128 
data 128,135,53,1,68,135,53,1,76,128,128,135,48,1,64,128,128,128,128,128,128,128,128,135,49,1,64,128,128,135,53,1,68,135,53,1,76,128,135 
data 51,1,64,128,128,128,128,128,135,51,1,76,128,128,135,44,1,64,128,128,128,135,51,1,68,135,51,1,76,128,128,128,135,46,1,64,128,128,128 
data 128,128,135,48,1,64,128,128,128,128,135,51,1,68,135,51,1,76,128,128,135,51,1,64,128,128,128,128,135,51,1,76,128,128,128,135,44,1,64 
data 128,128,135,51,1,68,135,51,1,76,128,135,46,1,64,128,128,128,128,128,128,128,128,135,48,1,64,128,128,128,135,51,1,68,135,51,1,76,128 
data 128,128,135,53,1,64,128,128,128,135,53,1,76,128,135,44,1,64,128,128,128,128,135,51,1,68,135,51,1,76,128,128,135,46,1,64,128,128,128 
data 128,128,128,128,128,135,48,1,64,128,128,135,51,1,68,135,51,1,76,128,135,51,1,64,128,128,128,128,128,135,51,1,76,128,128,135,44,1,64 
data 128,128,128,135,51,1,68,135,51,1,76,128,128,128,135,46,1,64,128,128,128,128,128,135,48,1,64,128,128,128,128,135,51,1,68,135,51,1,76 
data 128,128,135,49,1,64,128,128,128,128,135,49,1,76,128,128,128,135,42,1,64,128,128,135,49,1,68,135,49,1,76,128,135,44,1,64,128,128,128 
data 128,128,128,128,128,135,46,1,64,128,128,128,135,49,1,68,135,49,1,76,128,128,128,135,49,1,64,128,128,128,135,49,1,76,128,135,42,1,64 
data 128,128,128,128,135,49,1,68,135,49,1,76,128,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,135,49,1,68,135,49,1 
data 76,128,135,51,1,64,128,128,128,128,128,135,51,1,76,128,128,135,42,1,64,128,128,128,135,49,1,68,135,49,1,76,128,128,128,135,44,1,64 
data 128,128,128,128,128,135,46,1,64,128,128,128,128,135,49,1,68,135,49,1,76,128,128,135,49,1,64,128,128,128,128,135,49,1,76,128,128,128,135 
data 42,1,64,128,128,135,49,1,68,135,49,1,76,128,135,44,1,64,128,128,128,128,128,128,128,128,135,46,1,64,128,128,128,135,49,1,68,135,49 
data 1,76,128,128,128,135,48,1,64,128,128,128,135,48,1,76,128,135,41,1,64,128,128,128,128,135,48,1,68,135,48,1,76,128,128,135,43,1,64 
data 128,128,128,128,128,128,128,128,135,44,1,64,128,128,135,48,1,68,135,48,1,76,128,135,48,1,64,128,128,128,128,128,135,48,1,76,128,128,135 
data 41,1,64,128,128,128,135,48,1,68,135,48,1,76,128,128,128,135,43,1,64,128,128,128,128,128,135,44,1,64,128,128,128,128,135,48,1,68,135 
data 48,1,76,128,128,135,49,1,64,128,128,128,128,135,49,1,76,128,128,128,135,41,1,64,128,128,135,48,1,68,135,48,1,76,128,135,43,1,64 
data 128,128,128,128,128,128,128,128,135,44,1,64,128,128,128,135,48,1,68,135,48,1,76,128,128,128,135,48,1,64,128,128,128,135,48,1,76,128,135 
data 41,1,64,128,128,128,128,135,48,1,68,135,48,1,76,128,128,135,43,1,64,128,128,128,128,128,128,128,128,135,44,1,64,128,128,135,48,1,68 
data 135,48,1,76,128,46,1,64,13,0,128,128,128,128,128,135,46,1,76,128,9,0,0,0,0,64,0,114,4,46,1,64,15,5,128,128,135,53,1 
data 76,135,53,1,76,135,53,1,68,128,135,53,1,68,128,135,48,1,64,128,128,128,128,135,53,1,68,128,128,128,135,49,1,64,128,128,135,53,1 
data 68,128,135,53,1,68,135,53,1,64,128,128,128,128,128,135,53,1,68,135,53,1,68,128,135,46,1,64,128,135,53,1,76,135,53,1,76,135,53 
data 1,68,128,135,53,1,68,128,128,135,48,1,64,128,128,128,135,53,1,68,128,135,49,1,64,128,128,128,128,135,53,1,68,128,135,53,1,68,128 
data 135,54,1,64,128,128,128,128,135,53,1,68,135,54,1,68,128,128,135,46,1,64,135,53,1,76,135,53,1,76,135,53,1,68,128,135,53,1,68 
data 135,48,1,64,128,128,128,128,128,135,53,1,68,128,128,135,49,1,64,128,128,128,135,53,1,68,128,135,53,1,68,128,128,135,53,1,64,128,128 
data 128,135,53,1,68,135,53,1,68,135,46,1,64,128,128,135,53,1,76,135,53,1,76,135,53,1,68,128,135,53,1,68,128,135,48,1,64,128,128 
data 128,128,135,53,1,68,128,128,128,135,49,1,64,128,128,135,53,1,68,128,135,53,1,68,135,51,1,64,128,128,128,128,128,135,53,1,68,135,51 
data 1,68,128,135,44,1,64,128,135,51,1,76,135,51,1,76,135,51,1,68,128,135,51,1,68,128,128,135,46,1,64,128,128,128,135,51,1,68,128 
data 135,48,1,64,128,128,128,128,135,51,1,68,128,135,51,1,68,128,135,51,1,64,128,128,128,128,135,51,1,68,135,51,1,68,128,128,135,44,1 
data 64,135,51,1,76,135,51,1,76,135,51,1,68,128,135,51,1,68,135,46,1,64,128,128,128,128,128,135,51,1,68,128,128,135,48,1,64,128,128 
data 128,135,51,1,68,128,135,51,1,68,128,128,135,53,1,64,128,128,128,135,51,1,68,135,53,1,68,135,44,1,64,128,128,135,51,1,76,135,51 
data 1,76,135,51,1,68,128,135,51,1,68,128,135,46,1,64,128,128,128,128,135,51,1,68,128,128,128,135,48,1,64,128,128,135,51,1,68,128,135 
data 51,1,68,135,51,1,64,128,128,128,128,128,135,51,1,68,135,51,1,68,128,135,44,1,64,128,135,51,1,76,135,51,1,76,135,51,1,68,128 
data 135,51,1,68,128,128,135,46,1,64,128,128,128,135,51,1,68,128,135,48,1,64,128,128,128,128,135,51,1,68,128,135,51,1,68,128,135,49,1 
data 64,128,128,128,128,135,51,1,68,135,49,1,68,128,128,135,42,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128,135,49,1,68,135,44,1 
data 64,128,128,128,128,128,135,49,1,68,128,128,135,46,1,64,128,128,128,135,49,1,68,128,135,49,1,68,128,128,135,49,1,64,128,128,128,135,49 
data 1,68,135,49,1,68,135,42,1,64,128,128,135,49,1,76,135,49,1,76,135,49,1,68,128,135,49,1,68,128,135,44,1,64,128,128,128,128,135 
data 49,1,68,128,128,128,135,46,1,64,128,128,135,49,1,68,128,135,49,1,68,135,51,1,64,128,128,128,128,128,135,49,1,68,135,51,1,68,128 
data 135,42,1,64,128,135,49,1,76,135,49,1,76,135,49,1,68,128,135,49,1,68,128,128,135,44,1,64,128,128,128,135,49,1,68,128,135,46,1 
data 64,128,128,128,128,135,49,1,68,128,135,49,1,68,128,135,49,1,64,128,128,128,128,135,49,1,68,135,49,1,68,128,128,135,42,1,64,135,49 
data 1,76,135,49,1,76,135,49,1,68,128,135,49,1,68,135,44,1,64,128,128,128,128,128,135,49,1,68,128,128,135,46,1,64,128,128,128,135,49 
data 1,68,128,135,49,1,68,128,128,135,48,1,64,128,128,128,135,49,1,68,135,48,1,68,135,41,1,64,128,128,135,48,1,76,135,48,1,76,135 
data 48,1,68,128,135,48,1,68,128,135,43,1,64,128,128,128,128,135,48,1,68,128,128,128,135,44,1,64,128,128,135,48,1,68,128,135,48,1,68 
data 135,48,1,64,128,128,128,128,128,135,48,1,68,135,48,1,68,128,135,41,1,64,128,135,48,1,76,135,48,1,76,135,48,1,68,128,135,48,1 
data 68,128,128,135,43,1,64,128,128,128,135,48,1,68,128,135,44,1,64,128,128,128,128,135,48,1,68,128,135,48,1,68,128,135,49,1,64,128,128 
data 128,128,135,48,1,68,135,49,1,68,128,128,135,41,1,64,135,48,1,76,135,48,1,76,135,48,1,68,128,135,48,1,68,135,43,1,64,128,128 
data 128,128,128,135,48,1,68,128,128,135,44,1,64,128,128,128,135,48,1,68,128,135,48,1,68,128,128,135,48,1,64,128,128,128,135,48,1,68,135 
data 48,1,68,135,41,1,64,128,128,135,48,1,76,135,48,1,76,135,48,1,68,128,135,48,1,68,128,135,43,1,64,128,128,128,128,135,48,1,68 
data 128,128,128,135,44,1,64,128,128,135,48,1,68,128,135,48,1,68,46,1,64,13,0,128,128,128,128,128,135,48,1,68,135,46,1,68,9,0,0 
data 0,0,64,0,210,4,46,1,64,15,5,128,128,135,53,1,76,128,135,53,1,68,128,135,53,1,68,128,135,48,1,64,128,128,135,53,1,76,128 
data 135,53,1,68,128,128,128,135,49,1,64,135,51,1,76,128,135,53,1,68,128,135,53,1,68,135,53,1,64,128,128,128,135,51,1,76,128,135,53 
data 1,68,135,53,1,68,128,135,46,1,64,128,135,53,1,76,128,135,53,1,68,128,135,53,1,68,128,128,135,48,1,64,128,135,53,1,76,128,135 
data 53,1,68,128,135,49,1,64,128,128,135,51,1,76,128,135,53,1,68,128,135,53,1,68,128,135,54,1,64,128,128,135,51,1,76,128,135,53,1 
data 68,135,54,1,68,128,128,135,46,1,64,135,53,1,76,128,135,53,1,68,128,135,53,1,68,135,48,1,64,128,128,128,135,53,1,76,128,135,53 
data 1,68,128,128,135,49,1,64,128,135,51,1,76,128,135,53,1,68,128,135,53,1,68,128,128,135,53,1,64,128,135,51,1,76,128,135,53,1,68 
data 135,53,1,68,135,46,1,64,128,128,135,53,1,76,128,135,53,1,68,128,135,53,1,68,128,135,48,1,64,128,128,135,53,1,76,128,135,53,1 
data 68,128,128,128,135,49,1,64,135,51,1,76,128,135,53,1,68,128,135,53,1,68,135,51,1,64,128,128,128,135,51,1,76,128,135,53,1,68,135 
data 51,1,68,128,135,44,1,64,128,135,54,1,76,128,135,51,1,68,128,135,51,1,68,128,128,135,46,1,64,128,135,54,1,76,128,135,51,1,68 
data 128,135,48,1,64,128,128,135,53,1,76,128,135,51,1,68,128,135,51,1,68,128,135,51,1,64,128,128,135,53,1,76,128,135,51,1,68,135,51 
data 1,68,128,128,135,44,1,64,135,54,1,76,128,135,51,1,68,128,135,51,1,68,135,46,1,64,128,128,128,135,54,1,76,128,135,51,1,68,128 
data 128,135,48,1,64,128,135,53,1,76,128,135,51,1,68,128,135,51,1,68,128,128,135,53,1,64,128,135,53,1,76,128,135,51,1,68,135,53,1 
data 68,135,44,1,64,128,128,135,54,1,76,128,135,51,1,68,128,135,51,1,68,128,135,46,1,64,128,128,135,54,1,76,128,135,51,1,68,128,128 
data 128,135,48,1,64,135,53,1,76,128,135,51,1,68,128,135,51,1,68,135,51,1,64,128,128,128,135,53,1,76,128,135,51,1,68,135,51,1,68 
data 128,135,44,1,64,128,135,54,1,76,128,135,51,1,68,128,135,51,1,68,128,128,135,46,1,64,128,135,54,1,76,128,135,51,1,68,128,135,48 
data 1,64,128,128,135,53,1,76,128,135,51,1,68,128,135,51,1,68,128,135,49,1,64,128,128,135,53,1,76,128,135,51,1,68,135,49,1,68,128 
data 128,135,42,1,64,135,51,1,76,128,135,49,1,68,128,135,49,1,68,135,44,1,64,128,128,128,135,51,1,76,128,135,49,1,68,128,128,135,46 
data 1,64,128,135,49,1,76,128,135,49,1,68,128,135,49,1,68,128,128,135,49,1,64,128,135,49,1,76,128,135,49,1,68,135,49,1,68,135,42 
data 1,64,128,128,135,51,1,76,128,135,49,1,68,128,135,49,1,68,128,135,44,1,64,128,128,135,51,1,76,128,135,49,1,68,128,128,128,135,46 
data 1,64,135,49,1,76,128,135,49,1,68,128,135,49,1,68,135,51,1,64,128,128,128,135,49,1,76,128,135,49,1,68,135,51,1,68,128,135,42 
data 1,64,128,135,51,1,76,128,135,49,1,68,128,135,49,1,68,128,128,135,44,1,64,128,135,51,1,76,128,135,49,1,68,128,135,46,1,64,128 
data 128,135,49,1,76,128,135,49,1,68,128,135,49,1,68,128,135,49,1,64,128,128,135,49,1,76,128,135,49,1,68,135,49,1,68,128,128,135,42 
data 1,64,135,51,1,76,128,135,49,1,68,128,135,49,1,68,135,44,1,64,128,128,128,135,51,1,76,128,135,49,1,68,128,128,135,46,1,64,128 
data 135,49,1,76,128,135,49,1,68,128,135,49,1,68,128,128,135,48,1,64,128,135,49,1,76,128,135,49,1,68,135,48,1,68,135,41,1,64,128 
data 128,135,53,1,76,128,135,48,1,68,128,135,48,1,68,128,135,43,1,64,128,128,135,53,1,76,128,135,48,1,68,128,128,128,135,44,1,64,135 
data 51,1,76,128,135,48,1,68,128,135,48,1,68,135,48,1,64,128,128,128,135,51,1,76,128,135,48,1,68,135,48,1,68,128,135,41,1,64,128 
data 135,53,1,76,128,135,48,1,68,128,135,48,1,68,128,128,135,43,1,64,128,135,53,1,76,128,135,48,1,68,128,135,44,1,64,128,128,135,51 
data 1,76,128,135,48,1,68,128,135,48,1,68,128,135,49,1,64,128,128,135,51,1,76,128,135,48,1,68,135,49,1,68,128,128,135,41,1,64,135 
data 53,1,76,128,135,48,1,68,128,135,48,1,68,135,43,1,64,128,128,128,135,53,1,76,128,135,48,1,68,128,128,135,44,1,64,128,135,51,1 
data 76,128,135,48,1,68,128,135,48,1,68,128,128,135,48,1,64,128,135,51,1,76,128,135,48,1,68,135,48,1,68,135,41,1,64,128,128,135,51 
data 1,76,128,135,48,1,68,128,135,48,1,68,128,135,43,1,64,128,128,135,51,1,76,128,135,48,1,68,128,128,128,135,44,1,64,135,49,1,76 
data 128,135,48,1,68,128,135,48,1,68,46,1,64,13,0,128,128,128,135,49,1,76,128,135,48,1,68,135,46,1,68,9,0,0,0,0,64,0,238 
data 3,46,1,64,15,5,128,128,135,53,1,76,135,53,1,76,135,53,1,68,128,128,128,135,48,1,64,128,128,128,128,135,53,1,68,128,128,128,135 
data 49,1,64,135,54,1,76,135,54,1,76,135,53,1,68,128,128,135,53,1,64,128,128,128,128,128,135,53,1,68,128,128,135,46,1,64,128,135,56 
data 1,76,135,56,1,76,135,53,1,68,128,128,128,128,135,48,1,64,128,128,128,135,53,1,68,128,135,49,1,64,128,128,128,128,135,53,1,68,128 
data 128,128,135,54,1,64,128,128,128,128,135,53,1,68,128,128,128,135,46,1,64,128,128,135,53,1,68,128,128,135,48,1,64,128,128,128,128,128,135 
data 53,1,68,128,128,135,49,1,64,128,128,128,135,53,1,68,128,128,128,128,135,53,1,64,128,128,128,135,53,1,68,128,135,46,1,64,128,128,135 
data 54,1,76,135,54,1,76,135,53,1,68,128,128,128,135,48,1,64,128,135,56,1,76,135,56,1,76,128,135,53,1,68,128,128,128,135,49,1,64 
data 135,54,1,76,135,54,1,76,135,53,1,68,128,128,135,51,1,64,128,128,128,128,128,135,53,1,68,128,128,135,44,1,64,128,135,51,1,76,135 
data 51,1,76,135,51,1,68,128,128,128,128,135,46,1,64,128,128,128,135,51,1,68,128,135,48,1,64,128,128,135,53,1,76,135,53,1,76,135,51 
data 1,68,128,128,128,135,51,1,64,128,128,128,128,135,51,1,68,128,128,128,135,44,1,64,135,54,1,76,135,54,1,76,135,51,1,68,128,128,135 
data 46,1,64,128,128,128,128,128,135,51,1,68,128,128,135,48,1,64,128,128,128,135,51,1,68,128,128,128,128,135,53,1,64,128,128,128,135,51,1 
data 68,128,135,44,1,64,128,128,128,128,135,51,1,68,128,128,128,135,46,1,64,128,128,128,128,135,51,1,68,128,128,128,135,48,1,64,128,128,135 
data 51,1,68,128,128,135,51,1,64,128,128,128,128,128,135,51,1,68,128,128,135,44,1,64,128,128,128,135,51,1,68,128,128,128,128,135,46,1,64 
data 128,128,128,135,51,1,68,128,135,48,1,64,128,128,128,128,135,51,1,68,128,128,128,135,49,1,64,128,128,128,128,135,51,1,68,128,128,128,135 
data 42,1,64,135,49,1,76,135,49,1,76,135,49,1,68,128,128,135,44,1,64,128,128,128,128,128,135,49,1,68,128,128,135,46,1,64,128,135,51 
data 1,76,135,51,1,76,135,49,1,68,128,128,128,128,135,49,1,64,128,128,128,135,49,1,68,128,135,42,1,64,128,128,135,53,1,76,135,53,1 
data 76,135,49,1,68,128,128,128,135,44,1,64,128,128,128,128,135,49,1,68,128,128,128,135,46,1,64,128,128,135,49,1,68,128,128,135,51,1,64 
data 128,128,128,128,128,135,49,1,68,128,128,135,42,1,64,128,128,128,135,49,1,68,128,128,128,128,135,44,1,64,128,128,128,135,49,1,68,128,135 
data 46,1,64,128,128,128,128,135,49,1,68,128,128,128,135,49,1,64,128,128,128,128,135,49,1,68,128,128,128,135,42,1,64,135,51,1,76,135,51 
data 1,76,135,49,1,68,128,128,135,44,1,64,128,128,135,53,1,76,135,53,1,76,128,135,49,1,68,128,128,135,46,1,64,128,135,51,1,76,135 
data 51,1,76,135,49,1,68,128,128,128,128,135,48,1,64,128,128,128,135,49,1,68,128,135,41,1,64,128,128,135,49,1,76,135,49,1,76,135,48 
data 1,68,128,128,128,135,43,1,64,128,128,128,128,135,48,1,68,128,128,128,135,44,1,64,135,51,1,76,135,51,1,76,135,48,1,68,128,128,135 
data 48,1,64,128,128,128,128,128,135,48,1,68,128,128,135,41,1,64,128,135,48,1,76,135,48,1,76,135,48,1,68,128,128,128,128,135,43,1,64 
data 128,128,128,135,48,1,68,128,135,44,1,64,128,128,128,128,135,48,1,68,128,128,128,135,49,1,64,128,128,128,128,135,48,1,68,128,128,128,135 
data 41,1,64,128,128,135,48,1,68,128,128,135,43,1,64,128,128,128,128,128,135,48,1,68,128,128,135,44,1,64,128,128,128,135,48,1,68,128,128 
data 128,128,135,48,1,64,128,128,128,135,48,1,68,128,135,41,1,64,128,128,128,128,135,48,1,68,128,128,128,135,43,1,64,128,128,128,128,135,48 
data 1,68,128,128,128,135,44,1,64,128,128,135,48,1,68,128,128,46,1,64,13,0,128,128,128,128,128,135,48,1,68,128,9,0,0,0,0,64,0 
data 26,2,41,1,76,15,8,128,128,128,128,135,41,1,76,128,128,128,135,44,1,76,128,128,135,44,1,76,128,128,128,128,128,135,48,1,76,128,128 
data 128,128,135,48,1,76,128,128,128,135,53,1,76,128,128,135,53,1,76,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 
data 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,136,13,128,128,128,128,128,128,128,7,1,0,0,68,114 
data 101,97,109,98,101,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,122,1,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,55,0,4,0,63,0,9,0,41,0,16,0,12,0,21,0,19,0,30,0,9,0,86,0,3,0,0,0,0,0,0 
data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,11,0,42,0,26,0,47,0,43,0,42,0,66,0,19,0,82,0,15,0 
data 98,0,19,0,111,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,2,3,6,1,0,7,2,4,0,0,0,0,255 
data 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,242,35,0,0,0,0,0,0,0,0,0,0,64,0,0,128 
data 0,8,68,114,101,97,109,98,101,108,32,32,32,32,32,32,32,32,32,32,32,32,32,32,12,29,25,11,2,243,227,219,228,227,234,246,5,20,26 
data 33,28,32,20,7,254,240,224,219,228,232,234,251,7,22,25,31,27,30,20,5,252,235,225,220,232,229,239,253,9,22,26,31,25,26,19,3,250,235 
data 222,222,232,232,241,1,10,21,25,30,27,25,14,2,249,231,224,224,234,233,243,3,12,19,28,27,26,23,13,0,248,230,223,229,232,233,246,7,12 
data 22,28,26,24,19,13,254,245,229,224,229,233,237,248,8,14,22,26,28,22,17,10,254,243,230,224,229,235,237,252,11,14,20,26,27,19,17,8,252 
data 241,230,224,233,235,239,254,13,13,21,28,22,20,14,6,251,241,227,229,231,236,242,0,14,14,22,24,23,17,14,5,249,240,228,229,232,239,243,2 
data 14,15,22,23,22,17,12,3,247,241,227,229,235,238,247,4,13,16,22,23,20,15,11,1,247,239,230,228,235,241,249,4,15,16,21,22,18,15,10 
data 0,246,238,229,231,237,241,250,6,15,17,20,23,15,13,9,255,245,239,229,230,240,242,252,7,16,15,22,20,15,12,7,254,244,238,230,231,242,244 
data 253,10,14,16,21,18,14,12,6,252,245,236,231,234,241,246,255,11,14,15,21,18,12,10,6,251,244,236,233,233,242,248,1,10,14,17,19,18,10 
data 9,5,250,242,238,232,236,242,249,2,12,14,16,20,16,9,8,4,250,242,236,235,234,245,250,3,12,14,16,21,15,7,8,3,248,242,238,232,236 
data 246,252,4,13,15,16,19,14,7,7,2,246,243,237,232,238,247,253,5,14,13,18,16,14,7,7,0,245,243,236,235,238,248,255,5,13,15,19,15 
data 12,6,6,255,244,243,239,233,237,251,0,5,14,16,16,16,10,6,6,254,243,243,239,233,240,252,0,6,15,14,18,14,10,5,5,253,244,243,238 
data 234,241,253,1,6,16,15,16,14,9,5,3,252,243,245,236,235,243,254,2,7,16,13,17,12,8,5,3,250,244,245,237,235,245,255,2,7,15,14 
data 16,12,7,5,2,250,243,244,237,237,246,0,2,7,17,13,16,11,6,3,2,250,243,244,238,236,248,0,3,9,16,14,13,11,6,3,0,251,243 
data 243,239,237,249,0,4,9,16,14,12,12,4,2,0,250,244,244,236,239,251,1,3,11,15,13,12,11,4,1,255,250,245,242,236,242,252,1,3,12 
data 15,12,11,10,4,0,255,249,246,241,238,243,253,1,3,12,16,11,11,9,4,0,254,249,246,242,238,243,254,0,4,14,15,10,10,10,2,0,253 
data 251,245,240,240,244,255,1,5,12,15,9,11,9,2,254,254,250,245,242,239,247,254,1,5,13,15,8,10,9,1,254,254,250,246,240,240,248,254,1 
data 6,14,13,8,9,9,0,254,254,251,245,240,242,248,255,1,7,13,13,8,10,7,0,253,255,250,245,240,244,248,255,1,8,14,10,9,9,7,255 
data 254,254,251,244,240,244,249,0,1,8,12,11,8,11,5,254,255,255,249,245,242,244,249,255,3,7,13,9,8,10,6,253,255,0,248,244,242,246,250 
data 255,2,8,12,9,9,10,4,253,255,0,248,243,244,246,250,255,3,9,12,7,9,10,4,252,0,0,248,244,243,247,249,255,4,10,10,8,9,10 
data 3,253,255,0,248,244,243,247,249,0,4,9,11,7,9,9,2,254,0,0,246,244,245,247,249,0,4,9,10,8,9,8,2,254,1,254,247,245,245 
data 246,249,1,5,9,10,8,9,8,1,255,1,254,245,245,246,246,250,1,5,8,10,7,10,7,1,0,1,253,245,247,246,245,249,2,6,8,8,9 
data 10,6,1,0,2,252,245,247,246,245,249,3,6,7,9,9,9,6,1,1,1,251,245,247,246,244,251,2,7,6,10,8,10,6,0,2,1,250,245 
data 248,245,245,251,4,4,8,8,10,9,5,2,2,0,250,245,248,245,244,252,4,5,6,11,9,9,5,1,3,0,248,246,249,243,245,251,5,5,7 
data 9,10,9,5,2,2,255,249,246,248,243,245,253,4,6,6,9,11,8,6,2,2,254,249,246,247,244,245,253,4,4,8,10,9,9,6,2,2,253 
data 249,246,247,242,245,0,3,5,9,9,11,9,5,3,1,253,248,248,245,243,246,255,3,5,8,11,9,7,7,2,1,253,249,247,246,242,248,255,3 
data 4,9,10,8,7,6,3,1,253,249,248,245,244,247,0,2,5,8,9,8,6,7,3,0,254,250,249,245,243,249,255,2,5,8,8,7,7,7,3 
data 0,254,250,249,245,244,248,0,2,4,8,8,7,7,7,3,255,254,252,247,246,244,249,255,2,4,9,7,6,8,7,2,0,254,251,249,244,244,251 
data 255,1,5,8,7,6,7,7,3,0,254,250,249,244,246,249,255,2,5,8,6,7,8,6,3,255,255,250,248,246,245,249,255,3,4,8,7,6,8 
data 6,2,1,254,250,248,244,247,249,255,3,6,7,6,8,8,5,2,0,254,250,247,245,246,250,255,3,6,7,6,7,9,5,1,1,254,249,247,245 
data 247,250,0,3,6,7,5,8,9,4,2,0,254,249,246,245,248,250,0,3,6,6,6,9,8,4,2,0,254,248,246,245,246,252,0,4,6,7,6 
data 10,8,3,1,1,252,248,247,245,246,252,0,5,7,6,6,10,7,4,1,0,251,248,246,246,247,251,1,5,7,6,7,10,7,2,2,0,250,248 
data 246,246,247,251,2,6,6,7,7,9,7,2,2,255,251,246,246,246,247,253,2,6,7,7,7,10,6,2,2,254,250,246,247,245,248,253,3,6,7 
data 7,8,9,6,2,1,254,248,247,247,244,248,254,5,6,7,7,9,8,5,3,1,252,248,247,246,246,248,255,4,7,7,8,9,8,4,2,0,252 
data 247,246,248,245,248,0,5,7,8,8,8,8,4,2,0,251,246,247,247,246,249,0,5,8,8,8,9,7,4,1,0,249,248,246,247,246,249,2,5 
data 9,7,9,8,7,4,1,254,249,247,247,246,246,251,2,7,7,9,9,7,6,4,0,254,249,246,248,246,245,252,4,7,8,8,9,7,6,3,1,500 

' CRYSTALS.XM  (short)   01-30-2018



 
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Best approach to use a DLL

Post by UEZ »

@dodicat: thanks for your example! Good to know the LoadLibraryExA version. "FB File2Bas Code Generator" is written by me with AutoIt. ^^
V0.50 creates an array but this doesn't work for larger files because afaik it will loaded to the stack and this can cause a stack overflow. Why it's loaded to the stack instead of a memory block I don't know. Of course the stack size can be increased on compiling but it is not endless. -=> -t < value > Set stack size in kbytes (default: 1M)

That's the reason for v0.60 which generates the data section with the binary data. Firstly, unfortunately I don't know how to get the size of that data and further it must be loaded although it is already available in the memory after startup. That's the reason why I added the size at the beginning.
Secondly, the size of the exe increase unexpected. For example when I encode a 200kb image file as data the compiled exe will increase approx. the same string size instead of the binary size. Somehow the data section is saved as a string not embedded as binary.

I converted the AutoIt version of ufmod.dll but found the source of it a few minutes ago which consists also a FB example -> https://sourceforge.net/projects/ufmod/
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

I got file2bas here:
http://www.gammaphase.altervista.org/core.htm
It produces a powerbasic function (pbmain).
But the information is easily extracted for freebasic.
I missed your own fb version, or are they related?


Freebasic shared arrays are not on the stack.
Or
redim as long a(20000) (dynamic array)
is not on the stack.

or
dim as long ptr z=new long[20000]
is not on the stack.
delete[] z
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Best approach to use a DLL

Post by UEZ »

As mentioned above I wrote it using AutoIt.

Latest version: FB File2Bas Code Generator v0.80 build 2019-01-05 beta incl. source code.

Just drag'n'drop a file to the FB icon. Rmb to have some options.
Last edited by UEZ on Jan 07, 2019 9:58, edited 2 times in total.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

Thanks UEZ.
I'll try it out.
Try this maybe
use notepad to save:
image2.txt

Code: Select all

35|90|ufmod.zip|({M(xoE6y'xq*[]X@Nx#'*v=BRLbq*SW6fzchI^YIA[kAa9,VpblJqgl_a.=_#$&0K23pK9nFAkE?6t6,[ZEoH#4%GeR|nZiUI{jX_cIT41:N(,4lBiI]1B8=Esi(#$/@oORp:x2'z$PA;A9RbM@Fs@KTp8Pq^:H(0QY3MqN[2\Jz+yypaUYMa.6R?SW>0N5|yn8m)OgvlZFy1Dp>JmvmOcn5]>a1T<p-w{q2USV,6JMaEm\BkRR/%9??drW3o;N7%{>4B7tRrWwG4|gs`sARs7>W]Hic//Cp]]WK'*GBFT,=,mtims0m%B0UQQ<w_4:Kp3>6`{[XKf1_.[dJf|4yRO0_z/dcb+zF;zR+mMkBPAh'GdF=E31%7N,J?gy)JFE5us?uR<%RBXxI`CZ:^6<NtkH'r@zLab8w6)<6CAN?50QAEYirZ2fmYwZ<o#k[_-pRiG;ZzNv@,#hQN|B,<\QwW2SH=N;`ixVU_KZjvDbU_7p7qKSg;bLd24Bvi|P2V;x<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9b9PG-JFROtb)Z>ap#E\=U[L9_7#sonA32bgVM2ggH|9xcw5MX*Bpl0yXf@IH'(iA*H[X:\?3ajUC:i%YDBjW0Q=)lAMI7t3r0l9%h5^DUuV+7Y2Jd1[IxOF(h7Vs$&%/\#g(Rs`<VH+k_.Hxxs&.vqNKFRnOfpIGTB-WeKWp<fQL{;O9cgN1Go2$l551y$=&pB,6|/3Zny7F0>9'zpL?{IVtu^,%ZEOpOYCC?ov)G>sfV'A&)gvgp$BzLir:tiBi(Rc<p:URDK;yZCQ+8I8ZO)9-_ARzl83AIT:o#ohFG7w]/l2o'2o;AvMBXQE%a6?G#.LUg=[KfS-TGu2Ge+x@,jW^$d/x15#]s<SgyQ'ox5k|2t;5(+3SlhxR#h[;?tri0ROU'*+ofa7Z>?VR^+c{ 
and the decompressor

Code: Select all

'look ups
Dim Shared As Ubyte ADDQmod(0 To 19),ADDbool(0 To 19) 
Dim  Shared As Ubyte Subqmod(0 To 19),Subbool(0 To 19)

For z As Integer=0 To 19
    ADDQmod(z)=(z Mod 10+48)
    ADDbool(z)=(-(10<=z))
    Subqmod(z)=(z Mod 10+48)
    Subbool(z)=(-(10>z))
Next z 

Dim Shared As Ubyte Q(0 To 99,1 To 9)
            For n As Long=0 To 99
                For m As Long=1 To 9
                    Q(n,m)=(n Mod m)*10
                Next
            Next
Dim Shared As Integer _Mod(0 To 99),_Div(0 To 99)
For z As Integer=0 To 99:_Mod(z)=(z Mod 10+48):_Div(z)=z\10:Next
    '==============
    Function Qmult(a As String,b As String) As String
        Var flag=0,la = Len(a),lb = Len(b)
        If Len(b)>Len(a) Then flag=1:Swap a,b:Swap la,lb
        Dim As Ubyte n,carry,ai
        Var c =String(la+lb,"0")
        For i As Integer =la-1 To 0 Step -1
            carry=0:ai=a[i]-48
            For j As Integer =lb-1 To 0 Step -1
                n = ai * (b[j]-48) + (c[i+j+1]-48) + carry
                carry =_Div(n):c[i+j+1]=_Mod(n)
            Next j
            c[i]+=carry
        Next i
        If flag Then Swap a,b
        Return Ltrim(c,"0")
    End Function
    
    Function plus(_num1 As String,_num2 As String) As String
        Var _flag=0,n_=0
        Dim As Ubyte addup=Any,addcarry=Any
        #macro finish()
        answer=Ltrim(answer,"0")
        If _flag=1 Then Swap _num2,_num1
        Return answer
        #endmacro
        If Len(_num2)>Len(_num1) Then 
            Swap _num2,_num1
            _flag=1
            Endif
            Var diff=Len(_num1)-Len(_num2)
            Var answer="0"+_num1
            addcarry=0
            For n_=Len(_num1)-1 To diff Step -1 
                addup=_num2[n_-diff]+_num1[n_]-96
                answer[n_+1]=ADDQmod(addup+addcarry)
                addcarry=ADDbool(addup+addcarry)
            Next n_ 
            If addcarry=0 Then 
                finish()
            End If
            If n_=-1 Then 
                answer[0]=addcarry+48
                finish()
                End if
                For n_=n_ To 0 Step -1 
                    addup=_num1[n_]-48
                    answer[n_+1]=ADDQmod(addup+addcarry)
                    addcarry=ADDbool(addup+addcarry)
                    If addcarry=0 Then Exit For
                Next n_
                answer[0]=addcarry+48
                finish()
            End Function
            
            
            Function minus(num1 As String,num2 As String) As String
                Dim As Integer bigger,swapflag           
                Dim sign As String * 1
                Var lenf=Len(NUM1)
                Var lens=Len(NUM2)
                #macro finishup()
                answer=Ltrim(answer,"0")
                If answer="" Then Return "0"
                If swapflag=1 Then Swap NUM1,NUM2
                Return sign+answer
                #endmacro
                #macro compare()
                If Lens>lenf Then bigger= -1:Goto fin
                If Lens<lenf Then bigger =0:Goto fin
                If NUM2>NUM1 Then 
                    bigger=-1
                Else
                    bigger= 0
                End If
                fin:
                #endmacro
                
                compare()
                If bigger Then 
                    sign="-"
                    Swap NUM2,NUM1
                    Swap lens,lenf
                    swapflag=1
                End If
                Var diff=lenf-lens
                Dim As String answer=NUM1
                Dim As Integer n
                Dim As Ubyte takeaway,subtractcarry
                subtractcarry=0
                For n=lenf-1 To diff Step -1 
                    takeaway= num1[n]-num2[n-diff]+10-subtractcarry
                    answer[n]=Subqmod(takeaway)
                    subtractcarry=Subbool(takeaway)
                Next n 
                
                If subtractcarry=0 Then:finishup():End If
                If n=-1 Then:finishup():End If
                For n=n To 0 Step -1 
                    takeaway= num1[n]-38-subtractcarry 
                    answer[n]=Subqmod(takeaway)
                    subtractcarry=Subbool(takeaway)
                    If subtractcarry=0 Then Exit For
                Next n
                finishup()
            End Function 
            
            #include "file.bi"
            Function loadfile(file As String) As String
                Var  f=Freefile
                If  Fileexists(file)=0 Then Print file;"  not found,press a key":Sleep:End
                Open file For Binary Access Read As #f
                Dim As String text
                If Lof(1) > 0 Then
                    text = String(Lof(f), 0)
                    Get #f, , text
                End If
                Close #f
                Return text
            End Function
            
            Sub savefile(filename As String,p As String)
                Dim As Integer n
                n=Freefile
                If Open (filename For Binary Access Write As #n)=0 Then
                    Put #n,,p
                    Close
                Else
                    Print "Unable to load " + filename
                End If
            End Sub
            
            Function StringSplit(s_in As String,chars As String,result() As String) As Long
                Dim As Long ctr,ctr2,k,n,LC=Len(chars)
                Dim As boolean tally(Len(s_in))
                #macro check_instring()
                n=0
                While n<Lc
                    If chars[n]=s_in[k] Then 
                        tally(k)=true
                        If (ctr2-1) Then ctr+=1
                        ctr2=0
                        Exit While
                    End If
                    n+=1
                Wend
                #endmacro
                
                #macro split()
                If tally(k) Then
                    If (ctr2-1) Then ctr+=1:result(ctr)=Mid(s_in,k+2-ctr2,ctr2-1)
                    ctr2=0
                End If
                #endmacro
                '==================  LOOP TWICE =======================
                For k  =0 To Len(s_in)-1
                    ctr2+=1:check_instring()
                Next k
                If ctr Then Redim result(1 To ctr): ctr=0:ctr2=0 Else  Return 0
                For k  =0 To Len(s_in)-1
                    ctr2+=1:split()
                Next k
                '===================== Last one ========================
                If ctr2>0 Then
                    Redim Preserve result(1 To ctr+1)
                    result(ctr+1)=Mid(s_in,k+1-ctr2,ctr2)
                End If
                Return Ubound(result)
            End Function
            
            
            Function shortdiv(Byval s As String,s2 As String) As  String
                Dim As Ubyte main,carry,d=s2[0]-48,temp
                Dim As String ans=s
                For z As Integer=0 To Len(s)-1
                    temp=(s[z]-48+carry)
                    main=temp\d
                    carry=Q(temp,d)
                    ans[z]=main+48
                Next z
                ans=Ltrim(ans,"0")
                Return ans
            End Function
            
            Function div90(s As String) As String
                Var n1=shortdiv(s,"2")
                Var n2=shortdiv(n1,"5")
                Var n3=shortdiv(n2,"9")
                ' if n3="" then n3="0"
                Return n3
            End Function
            
            Function mod90(s As String) As String
                Var n1=shortdiv(s,"2")
                Var n2=shortdiv(n1,"5")
                Dim As String n3=shortdiv(n2,"9")
                Return minus(s,qmult(n3,"90"))
            End Function
            
            Function div256(s As String) As String
                Var n1=shortdiv(s,"4")
                Var n2=shortdiv(n1,"8")
                Var n3=shortdiv(n2,"8")
                ' if n3="" then n3="0"
                Return n3
            End Function
            
            Function mod256(s As String) As String
                Var n1=shortdiv(s,"4")
                Var n2=shortdiv(n1,"8")
                Dim As String n3=shortdiv(n2,"8")
                Return minus(s,qmult(n3,"256"))
            End Function
            
            Function converttobase90(Byval i As String,b As String="90",begin As Long=35) As String
                Dim As String d,m,g
                Do
                    d=div90(i)
                    m=mod90(i)
                    g=Chr(Vallng(m)+begin)+g
                    i=d
                Loop Until i=""
                Return g
            End Function
            
            Function converttobase256(Byval i As String,b As String="90",begin As Long=35) As String
                Dim As String d,m,g
                Do
                    d=div256(i)
                    m=mod256(i)
                    g=Chr(Vallng(m)+begin)+g
                    i=d
                Loop Until i="" 
                Return g
            End Function
            
            
            
            ' ============== base 256 TO DECIMAL =================================     
            Function convertbaseto10(Byval Number As String,b As String="256",begin As Long=35) As String
                Dim As String sum
                sum=Str(Asc(Left(Number,1))-begin)
                For n As Integer=2 To Len(Number)
                    Var z=Number[n-1]
                    sum=plus(Qmult(sum,b),Str((z-begin)) ) 
                Next n
                Return sum
            End Function
            
            Function compress(f As String,basenum As String="128",begin As Long=35) As String Export
                Var b=convertbaseto10(f,"256",0)
                Print "Phase 1 compress, please wait ..."
                Return converttobase90(b,basenum,begin)
            End Function
            
            Function uncompress(f As String,basenum As String="128",begin As Long=35) As String Export 
                Var g2=convertbaseto10(f,basenum,begin)
                Print "phase 1 uncompress, please wait ..."
                Return converttobase256(g2,basenum,0)
            End Function
            
            print "please wait ..."
            
            #macro compressor
            Dim As String file="ufmod.zip"
            Dim As String basenum="90"
            Dim As Long startnum=35
            
            Var ss=loadfile(file)
            Var cc=compress(ss,basenum,startnum)
            
            cc=Str(startnum)+"|" + basenum +"|" + file +"|"+cc
            savefile("image2.txt",cc)
            #endmacro
            'compressor
        'start here
            Var s=loadfile("image2.txt")
            s=trim(s)
            Redim As String a()
            stringsplit(s,"|",a())
            print a(1)+"|"+a(2)+"|"+a(3)+"|"
            s=Ltrim(s,a(1)+"|"+a(2)+"|"+a(3)+"|")
            
            Print "text file length = "; Len(s)
            Var g=uncompress(s,(a(2)),Val(a(1)))
            Print "OK, length= ",Len(g)
            Print "file is ";"NEWfile"+a(3)
            
            savefile("NEWfile"+a(3),g)
            Sleep
        
            
             
 
to get the dll file.
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Best approach to use a DLL

Post by UEZ »

As you might recognized in the AutoIt code I embedded the FB image as Base64 encoded string. The idea is to develope also FB File2Bas Code Generator to compress the file if it makes sense and encode it afterwards e.g. to base 64.
What I used in 'File to Base64 String Code Generator' for AutoIt is the windows built-in compression function RtlGetCompressionWorkSpaceSize / RtlCompressBuffer or the external LZMAT compression. If you want to have a look please visit https://www.autoitscript.com/forum/topi ... es-easily/.
The next steps for FB File2Bas Code Generator are to add also compression and basexx encoding.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

Autoit looks powerful.
I think it handles long strings better than freebasic.


Anyway, I made up trial base64 functions calling the crypt32 dll.

Code: Select all




Declare Function CryptBinaryToString Lib "Crypt32"Alias "CryptBinaryToStringA"(As zstring Ptr,As Long,As Long,As zstring Ptr,As Long Ptr) As Long

Declare Function CryptStringToBinary Lib "Crypt32"Alias "CryptStringToBinaryA"(As zstring Ptr,As Long,As Long,As Byte Ptr,As Long Ptr,As Long,As Long Ptr) As Long


Function Base64Decode(s As String ) As String 
    Dim As Long  Length = Len(s)
    Dim As Byte Ptr b=Callocate(length,1)
    CryptStringToBinary( Strptr(s), Length,1, b, @Length, 0, 0)
    Function= *Cast(zstring Ptr,b)
    Deallocate  b
End Function   

Function Base64Encode(p As String ) As String 
    Dim As Long L=Len(p)*2
    Dim As zstring Ptr s=Callocate(L,1)
    CryptBinaryToString(Strptr(p),Len(p),1,s,@L)
    Function=*Cast(zstring Ptr,s)
    Deallocate s
End Function


dim as string g="0123456789abcdefghijklmnopqrstuvwxyz"
g+=g
g+=g
g+=g
g+=g


var e= Base64Encode(g)
print e
var f= Base64Decode(e)
print f
print
print iif (f=g,"LOOKS OK","ERROR")
sleep

 
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Best approach to use a DLL

Post by UEZ »

dodicat wrote:Autoit looks powerful.
I think it handles long strings better than freebasic.
AutoIt is a scripting language with powerful abilities to create scripts and apps but for graphical stuff too slow.

Yes, with FB you cannot create long strings. ;-(

Your CryptBinaryToString implementation works properly and is very short.

What I'm trying since some hours fails although I used CryptStringToBinaryA function same as what I did in AutoIt to decode the base64 string which doesn't work properly with my version!

Can you see the error?

Code: Select all

#include "windows.bi"
'#include "win/wincrypt.bi"


#Define CRYPT_STRING_NOCRLF &h40000000

/'

declare function CryptStringToBinary Lib "Crypt32.dll" alias "CryptStringToBinaryA"_
   (byval pszString as LPCTSTR, _
    byval pcchString as DWORD, _
    byval dwFlags as DWORD, _
    byval pbBinary as any Ptr, _
    byval pcbBinary as any Ptr, _
    byval pdwSkip as DWORD, _
    byval pdwFlag as DWORD) As WINBOOL


Function _WinAPI_DecodeBase64(sBase64 as String) as ULong
   Dim as ULong iSize
   CryptStringToBinary(StrPtr(sBase64), _
                       0, _
                       CRYPT_STRING_BASE64 or CRYPT_STRING_NOCRLF, _
                       0, _
                       VarPtr(iSize), _
                       0, _
                       0)
   Return iSize
End Function
'/

'https://msdn.microsoft.com/en-us/library/windows/desktop/aa380285(v=vs.85).aspx
Function _WinAPI_Base64Decode(sBase64 as String) as UByte Ptr
   #Define CRYPT_STRING_BASE64 1
   Dim as any Ptr hLib = Dylibload("Crypt32.dll")
   dim pCryptStringToBinary as Function _
      (byval pszString as LPCSTR, _
       byval pcchString as DWORD, _
       byval dwFlags as DWORD, _
       byval pbBinary as UBYTE Ptr, _
       byval pcbBinary as DWORD Ptr, _
       byval pdwSkip as DWORD Ptr, _
       byval pdwFlag as DWORD Ptr) As WINBOOL
   pCryptStringToBinary = Dylibsymbol(hLib, "CryptStringToBinaryA")
   Dim as DWORD iSize
   var result = pCryptStringToBinary( StrPtr(sBase64), _
                                      0, _
                                      CRYPT_STRING_BASE64, _
                                      0, _
                                      @iSize, _
                                      0, _
                                      0)
   If result = 0 then
      Dylibfree(hLib)
      Return 0
   End If

   Dim as UByte aDecode(0 to iSize)
   
   result = pCryptStringToBinary(  StrPtr(sBase64), _
                                   0, _
                                   CRYPT_STRING_BASE64, _
                                   @aDecode(0), _
                                   @iSize, _
                                   0, _
                                   0)
   Dylibfree(hLib)
   If result = 0 then Return 0
      
   Return @aDecode(0)
End Function


Dim as Ubyte Ptr aB64Decoded = _WinAPI_Base64Decode("SWYgeW91IGNhbiByZWFkIHRoaXMgdGhlbiBkZWNvZGluZyB3b3JrZWQgcHJvcGVybHkuIDotKQ==")

For i as ULong = 0 to 54
   ? Chr(aB64Decoded[i]);
Next
?

Sleep
It seems that the first 8 bytes get corrupted.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

Looks like you should use
Dim as Byte ptr aDecode=callocate(isize,1)
Seems to reproduce the whole sentence.
(remember to deallocate afterwards)

I am on XP just now, my win 10 is updating, it'll take a while (so it says)
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Best approach to use a DLL

Post by UEZ »

I assume it has something to do with the return pointer:

Code: Select all

'https://msdn.microsoft.com/en-us/library/windows/desktop/aa380285(v=vs.85).aspx
Function _WinAPI_Base64Decode(sBase64 as String) as UByte Ptr
   #Define CRYPT_STRING_BASE64 1
   Dim as any Ptr hLib = Dylibload("Crypt32.dll")
   dim pCryptStringToBinary as Function _
      (byval pszString as zstring Ptr, _
       byval pcchString as Long, _
       byval dwFlags as Long, _
       byval pbBinary as UBYTE Ptr, _
       byval pcbBinary as Long Ptr, _
       byval pdwSkip as Long Ptr, _
       byval pdwFlag as Long Ptr) As Boolean
   pCryptStringToBinary = Dylibsymbol(hLib, "CryptStringToBinaryA")
   Dim as Long iSize = Len(sBase64)
   Dim as UByte aDecode(0 to iSize)
   Var result = pCryptStringToBinary( StrPtr(sBase64), _
                                      0, _
                                      1, _
                                      @aDecode(0), _
                                      @iSize, _
                                      0, _
                                      0)
   Dylibfree(hLib)
   If result = 0 then Return 0
   ?  Cast(zstring Ptr, @aDecode(0))[0]   'this returns the proper text
   ? @aDecode(0)
   Return @aDecode(0)
End Function


Dim as Byte Ptr aB64Decoded = _WinAPI_Base64Decode("SWYgeW91IGNhbiByZWFkIHRoaXMgdGhlbiBkZWNvZGluZyB3b3JrZWQgcHJvcGVybHkuIDotKQ==")
? aB64Decoded

? Cast(zstring Ptr, aB64Decoded)[0] 'but not here


Sleep
Within the function it prints the proper string but not outside. Beside that I need it outside because it can also be binary data and not always a string.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

You can make
static as UByte aDecode(0 to iSize)
in the function.
or

make aDecode a ubyte ptr=callocate(isize,1)
and alter the pCryptStringToBinary parameter and return aDecode
UEZ
Posts: 988
Joined: May 05, 2017 19:59
Location: Germany

Re: Best approach to use a DLL

Post by UEZ »

Thx dodicat, with static it works properly.

Is this a bug? For my understanding it makes no sense.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Best approach to use a DLL

Post by dodicat »

Buggy, then IMHO yes.
Riddled.
Try this with -gen gas, -gen gcc and 64 bit fb
then without the comments (" from function" , " from outside" , " independent" )

Code: Select all


function dothis() as ubyte ptr
    dim as ubyte a(0 to 4)
    a(0)=72
    a(1)=101
    a(2)=108
    a(3)=108
    a(4)=111
    print *cast(zstring ptr,@a(0))," from function"
    return @a(0)
end function

dim as ubyte ptr z=dothis()

print *cast(zstring ptr,z)," from outside"

'=========
    dim as ubyte a(0 to 4)
    a(0)=72
    a(1)=101
    a(2)=108
    a(3)=108
    a(4)=111
    print *cast(zstring ptr,@a(0)), "independent"
    sleep



     
A different result each time.
Using static is the best common option.
But I would tweak

static as ubyte adecode()
redim aDecode(0 to iSize)

just to be sure the array is clean at each call.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Best approach to use a DLL

Post by srvaldez »

dodicat, you realize that the function dothis is returning a pointer to a local array which is no longer valid after function call?
now it may work with a static array because it's preserved between function calls, though I would not recommend it.
Post Reply