Search found 582 matches

by UEZ
Aug 04, 2020 20:01
Forum: Windows
Topic: Opcode call from memory issue
Replies: 3
Views: 86

Re: Opcode call from memory issue

Thank you both!

It never came to my mind to check the endian stuff when writing bytes to the memory.

Then I think I found the reason why viewtopic.php?f=6&t=28722#p274422 doesn't work. I need to convert the bytes to the other endian mode.
by UEZ
Aug 04, 2020 17:51
Forum: Windows
Topic: Opcode call from memory issue
Replies: 3
Views: 86

Opcode call from memory issue

I have this code which works: Dim As Ubyte iLen, iLines Restore __OpCode: Read iLen Read iLines Dim As Any Ptr OpCodeMem = Allocate(iLen) Dim AverageMemCall As Function(a As Integer, b As Integer) As Integer = OpCodeMem Dim As Integer Ptr FunctionMem = Cast(Integer Ptr, AverageMemCall) For i As Ubyt...
by UEZ
Aug 04, 2020 12:40
Forum: Projects
Topic: COMWrapperBuilder tool
Replies: 11
Views: 413

Re: COMWrapperBuilder tool

I found my mistake. I only opened files in UTF8, so I didn't open ANSI files. Now I've fixed it, I'm trying to open it in several formats. I updated: https://github.com/XusinboyBekchanov/VisualFBEditor/commit/a454dde3c926dcfada8b4bdf60e5900ca80dfc69 ANSI is still not working, getting the same error...
by UEZ
Aug 03, 2020 20:17
Forum: Projects
Topic: COMWrapperBuilder tool
Replies: 11
Views: 413

Re: COMWrapperBuilder tool

I'm still getting error with latest SimpleVariantPlusTemplate.bi FreeBASIC Compiler - Version 1.08.0 (2020-05-12), built for win32 (32bit) Copyright (C) 2004-2019 The FreeBASIC development team. standalone target: win32, 486, 32bit backend: gas compiling: C:\...\Excel Example.bas -o C:\...\Excel Exa...
by UEZ
Aug 03, 2020 17:17
Forum: Projects
Topic: COMWrapperBuilder tool
Replies: 11
Views: 413

Re: COMWrapperBuilder tool

COMWrapperBuilder.exe doesn't work properly. I get a message "Not find #include "SimpleVariantPlus.bi" in modules!" although the line exists at the top of the code (the Word example). Why is Notepad.exe starting when I press the open button? After the last update also the Excel e...
by UEZ
Aug 03, 2020 10:42
Forum: Projects
Topic: COMWrapperBuilder tool
Replies: 11
Views: 413

Re: COMWrapperBuilder tool

Thanks Xusinboy Bekchanov for sharing this useful code example to control Excel via COM interface. But I don't understand what COMWrapperBuilder tool is doing. Can you please explain it again? With Autoit I'm working since years with this COM interface to control Excel, Word, PP, ActiveDirectory, etc.
by UEZ
Aug 02, 2020 13:06
Forum: General
Topic: A PRNG for graphics programs?
Replies: 67
Views: 1212

Re: A PRNG for graphics programs?

deltarho[1859] wrote:Agreed, but I don't understand your point.

That was only a brain fart... ^^

deltarho[1859] wrote:Modern compilers will replace 2^32 with 4294967296

I didn't disassemble the code to see if the FB compiler is smart to replace such expression.
by UEZ
Aug 02, 2020 11:48
Forum: General
Topic: A PRNG for graphics programs?
Replies: 67
Views: 1212

Re: A PRNG for graphics programs?

Btw, you use a constant 2^32, shouldn't it be 2^32-1? Where in particular? In functions: Private Function NR32.RandD As Double ' Rnd replacement Engine Return this.state/2^32 End Function Private Function NR32.Range Overload ( Byval One As Double, Byval Two As Double ) As Double Engine Return this....
by UEZ
Aug 02, 2020 10:49
Forum: General
Topic: A PRNG for graphics programs?
Replies: 67
Views: 1212

Re: A PRNG for graphics programs?

I may as well continue. http://deltarho.org.uk/Downloads/smile.png UEZ uses Function RandomRange(fStart As Single, fEnd As Single) As Single Return Rnd() * (fEnd - fStart) + fStart End Function In keeping with Microsoft's appending with Ex for their 'posh' versions of APIs my normal distribution ve...
by UEZ
Jul 31, 2020 8:41
Forum: General
Topic: A PRNG for graphics programs?
Replies: 67
Views: 1212

Re: A PRNG for graphics programs?

Thanks deltarho[1859]. Imho, the total randomness is for gfx programs not that important, rather perlin noise function to get a controlled randomness. Let this run for a while and maybe you can see Mona Lisa or even your self for a fraction of a second... ;-) #include "fbgfx.bi" Using FB #...
by UEZ
Jul 25, 2020 14:15
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 371

Re: Issue with VirtualProtect

Thanks @jj2007. Let's say my opcode is in memory using Allocate which gives me the address and one function within the opcode is memory opcode + &h00A1. There is the entry point for a function with 3 parameters. How can I call it? Any idea on this? Is this a valid approach? (code extract from ab...
by UEZ
Jul 24, 2020 20:01
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 371

Re: Issue with VirtualProtect

Thanks all for your replies. The odd thing is that VirtualProtect returns 1 which means is successful but on the other hand the error flag was set. When I use following code #Include Once "windows.bi" SetLastError(0) ? GetLastError() Dim As Ubyte Ptr BinData Dim As SIZE_T iLen = 1000 Dim A...
by UEZ
Jul 24, 2020 14:38
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 371

Re: Issue with VirtualProtect

Not everybody around here is familiar, with Auto-It. More information on: VirtualProtect's 'workings', is therefore needed ... Currently there is no need for Autoit code, just the issue why VirtualProtect produces an error code 126. With Autoit the return value of VirtualProtect is 1, same with FB,...
by UEZ
Jul 24, 2020 9:19
Forum: Windows
Topic: Issue with VirtualProtect
Replies: 10
Views: 371

Issue with VirtualProtect

I want to port an Autoit script to Freebasic but I've problems with VirtualProtect. #Include Once "windows.bi" Sub __MemoryDllCore() Static As Ubyte Ptr BinData Dim As Ushort iLen, iLines, p = 0 Dim As String aBinary(1) Restore __OpCode: Read iLen iLen \= 2 Read iLines BinData = Allocate(i...
by UEZ
Jul 23, 2020 15:58
Forum: Projects
Topic: Gas64 (no more use of gcc, only gas) WDS / LNX
Replies: 336
Views: 36040

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

@UEZ Thanks again for your report in the BasicCoder2's thread. The error was due to 'dx' used as variable name generating an error when assembling. It's allowed in the current version but I did a mistake when compiling or copying files. The right version (For now only Exes for WDS) http://users.fre...

Go to advanced search