August 26, 2025Aug 26 31 minutes ago, Stuttered said:The code is getting increasing complex...just imagine for a sec how complex is Human DNA! ! !new bug report -
August 26, 2025Aug 26 Hi,Added some lazy codesFixed some bugs (and added new ones 😅) . ShowFileSize__4.rar
August 26, 2025Aug 26 2 hours ago, jackyjask said:just imagine for a sec how complex is Human DNA! ! !new bug report -Should be fixed. Added the auto-type-calc option for LCF-AT requested. Calc button has been removed. Once I'm done or get exhausted from this, I'll add the SRC. ;) FileSizeCALC_v0.0.5.rar
August 26, 2025Aug 26 4 minutes ago, jackyjask said:thanksbut :)Update: Found why it's crashing. Again, same issue. I would somehow need to mix between using Decimal and BigInteger to make the input value longer, which I'm not sure I can do at this point. Appreciate the testing feedback... Edited August 27, 2025Aug 27 by Stuttered
August 27, 2025Aug 27 Author OK thanks for new versions guy's. @Stuttered, looks good that you removed the calc button and to calc the results on fly but its not working if I change the format 1000 / 1024. That's bad. Maybe you can fix that too.I have another request / question about 1000 decimal and 1024 binary. Is there a quick way to get results to see of values I enter of 1000 dec & 1024 binary?Example: I enter 1 GB / 1024 and I get this...File Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,589,934,592 1 Bit = 1/8 Byte Bytes 1,073,741,824 1 Byte = 8 Bits Kilobytes 1,048,576 1 KB = 1024 Bytes Megabytes 1,024 1 MB = 1024 KB Gigabytes 1 1 GB = 1024 MB Terabytes 9.766e-4 1 TB = 1024 GB Petabytes 9.537e-7 1 PB = 1024 TB ...its showing all results of 1024 what sizes they have. If I change now the format to 1000 decimal I get this...File Size Breakdown (Decimal (1000-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 Byte Bytes 1,000,000,000 1 Byte = 8 Bits Kilobytes 1,000,000 1 KB = 1000 Bytes Megabytes 1,000 1 MB = 1000 MB Gigabytes 1 1 GB = 1000 MB Terabytes 1.000e-3 1 TB = 1000 GB Petabytes 1.000e-6 1 PB = 1000 PB ...what shows me same in decimal. But now I want to know how large is 1 GB / 1000 decimal in 1024 binary is but I don't get to see the results of it and I need to do this manually.1,000,000,000 Byte of decimal results / copyPaste value into edit controlChange format to 1024Change unit to Bytes and I get this results outFile Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 Byte Bytes 1,000,000,000 1 Byte = 8 Bits Kilobytes 976,562.5 1 KB = 1024 Bytes Megabytes 953.674316 1 MB = 1024 KB Gigabytes ---> 0.93132257 1 GB = 1024 MB <--- Terabytes 9.095e-4 1 TB = 1024 GB Petabytes 8.882e-7 1 PB = 1024 TB ...and now I know the results I want to know. 1 GB / 1000 decimal = 0.93132257 GB / 1024. You know what I mean? I want to get those results too without doing that manually copy / past etc steps. Maybe you guy's could add something for this too to get the results right away. Or you show all results at once. One more time about the DOT & Comma thing. You see the results of 0.93132257 GB but the DOT is a problem. If I enter this value via copy / paste into a calculator its showing "93.132.257" instead what means the calculator did not handle the DOT as Comma. Maybe you can correct that too anyhow to set the Comma where it belongs too. So I hope my requests are not too demanding. 🙂 Thanks.greetz
August 27, 2025Aug 27 2 hours ago, LCF-AT said:OK thanks for new versions guy's. @Stuttered, looks good that you removed the calc button and to calc the results on fly but its not working if I change the format 1000 / 1024. That's bad. Maybe you can fix that too.I have another request / question about 1000 decimal and 1024 binary. Is there a quick way to get results to see of values I enter of 1000 dec & 1024 binary?Example: I enter 1 GB / 1024 and I get this...File Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,589,934,592 1 Bit = 1/8 ByteBytes 1,073,741,824 1 Byte = 8 BitsKilobytes 1,048,576 1 KB = 1024 BytesMegabytes 1,024 1 MB = 1024 KBGigabytes 1 1 GB = 1024 MBTerabytes 9.766e-4 1 TB = 1024 GBPetabytes 9.537e-7 1 PB = 1024 TB...its showing all results of 1024 what sizes they have. If I change now the format to 1000 decimal I get this...File Size Breakdown (Decimal (1000-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 ByteBytes 1,000,000,000 1 Byte = 8 BitsKilobytes 1,000,000 1 KB = 1000 BytesMegabytes 1,000 1 MB = 1000 MBGigabytes 1 1 GB = 1000 MBTerabytes 1.000e-3 1 TB = 1000 GBPetabytes 1.000e-6 1 PB = 1000 PB...what shows me same in decimal. But now I want to know how large is 1 GB / 1000 decimal in 1024 binary is but I don't get to see the results of it and I need to do this manually.1,000,000,000 Byte of decimal results / copyPaste value into edit controlChange format to 1024Change unit to Bytes and I get this results outFile Size Breakdown (Binary (1024-based)):Unit Size Description------------ ------------------------ --------------------------------Bits 8,000,000,000 1 Bit = 1/8 ByteBytes 1,000,000,000 1 Byte = 8 BitsKilobytes 976,562.5 1 KB = 1024 BytesMegabytes 953.674316 1 MB = 1024 KBGigabytes ---> 0.93132257 1 GB = 1024 MB <---Terabytes 9.095e-4 1 TB = 1024 GBPetabytes 8.882e-7 1 PB = 1024 TB...and now I know the results I want to know. 1 GB / 1000 decimal = 0.93132257 GB / 1024. You know what I mean? I want to get those results too without doing that manually copy / past etc steps. Maybe you guy's could add something for this too to get the results right away. Or you show all results at once. One more time about the DOT & Comma thing. You see the results of 0.93132257 GB but the DOT is a problem. If I enter this value via copy / paste into a calculator its showing "93.132.257" instead what means the calculator did not handle the DOT as Comma. Maybe you can correct that too anyhow to set the Comma where it belongs too. So I hope my requests are not too demanding. 🙂 Thanks.greetzHmmm... Not sure I can do that, but I'll take a look. Here is v0.0.7. FileSizeCALC_x86_v0.0.7.rar
August 27, 2025Aug 27 not a bug just curiuos - why TB, PB lines are always showing e+-xxx scientific format? also would be nice to allow resizing the window as for big values one need to use scroller.....wow!why is that? :)nice to have - actual build -
August 28, 2025Aug 28 16 hours ago, jackyjask said:not a bug just curiuos -why TB, PB lines are always showing e+-xxx scientific format?also would be nice to allow resizing the window as for big values one need to use scroller.....wow!why is that? :)nice to have - actual build -Only because this is how the online app does it, I guess?this — PostimagesApp still needs some clean up, and the stretchable is fine. The internal VER I don't care about atm.3 hours ago, jackyjask said:mitigated big numbers/overflowsFileSizeCALC-0.0.8custom.zipNice! I'll take a look at the changes. Edited August 28, 2025Aug 28 by Stuttered
August 28, 2025Aug 28 @jackyjask , Can you increase the MaxLength to like 35 and see if you run into issues?
August 28, 2025Aug 28 I've seen you are trying to load icon from the file on disk, but the icon is already embedded into the exe itself.... lets solve this micro puzzle:how to reuse existing embedded icon (as native PE resorce) and assign it into the Form icon property?I triedd this but for some reason I hit 0 (null?) response [DllImport("user32.dll", SetLastError = true)] static extern IntPtr LoadImage(IntPtr hInstance, IntPtr lpName, uint uType, int cxDesired, int cyDesired, uint fuLoad); [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("kernel32.dll")] static extern uint GetLastError(); public Form1(string filePath = null) { const uint IMAGE_ICON = 1; const uint LR_DEFAULTSIZE = 0x0040; const uint LR_SHARED = 0x8000; IntPtr hm = GetModuleHandle(null); IntPtr hIcon = LoadImage(hm, (IntPtr)3, IMAGE_ICON, 32, 32, LR_DEFAULTSIZE | LR_SHARED); // 0 ... why? uint why = GetLastError(); // 0 here - means no issue?? WTF?!
August 28, 2025Aug 28 2 minutes ago, jackyjask said:I've seen you are trying to load icon from the file on disk, but the icon is already embedded into the exe itself.... lets solve this micro puzzle:how to reuse existing embedded icon (as native PE resorce) and assign it into the Form icon property?I triedd this but for some reason I hit 0 (null?) response [DllImport("user32.dll", SetLastError = true)] static extern IntPtr LoadImage(IntPtr hInstance, IntPtr lpName, uint uType, int cxDesired, int cyDesired, uint fuLoad); [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr GetModuleHandle(string lpModuleName); [DllImport("kernel32.dll")] static extern uint GetLastError(); public Form1(string filePath = null) { const uint IMAGE_ICON = 1; const uint LR_DEFAULTSIZE = 0x0040; const uint LR_SHARED = 0x8000; IntPtr hm = GetModuleHandle(null); IntPtr hIcon = LoadImage(hm, (IntPtr)3, IMAGE_ICON, 32, 32, LR_DEFAULTSIZE | LR_SHARED); // 0 ... why? uint why = GetLastError(); // 0 here - means no issue?? WTF?!Yeah, I saw that. There is a way to do it, but I need to go back and look at an older code project to remember how...
August 28, 2025Aug 28 oooooooooopsC# .net BigInter type DOES NOT support numbers with decimal points......... what a pity!so seems we do not have in-built .net type for very big numbers together with decimal points...decided to use this public/free lib:GitHubGitHub - peteroupc/Numbers: A C# implementation of arbitr...A C# implementation of arbitrary-precision numbers and arithmetic - peteroupc/Numbersusing it seems all is looking nice! eg:Uploading Attachment...
August 28, 2025Aug 28 21 minutes ago, jackyjask said:oooooooooopsC# .net BigInter type DOES NOT support numbers with decimal points......... what a pity!so seems we do not have in-built .net type for very big numbers together with decimal points...decided to use this public/free lib:GitHubGitHub - peteroupc/Numbers: A C# implementation of arbitr...A C# implementation of arbitrary-precision numbers and arithmetic - peteroupc/Numbersusing it seems all is looking nice!eg:Uploading Attachment...Well, I guess that's why it would not work. The icon issue is fixed, You have to add the .ico as a resource and then add code.Right-click on project->properties. Add icon (icon and manifest).Add .ico to .resx file (double-click and then add)Add code below:Code:// Explicitly set the form's icon from the executabletry{this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);}catch (Exception ex){MessageBox.Show($"Error loading icon: {ex.Message}", "Icon Load Error");}Update:I have incorporated the library, and may have this working... app update in a bit...FileSizeCalc.ico Edited August 28, 2025Aug 28 by Stuttered
August 28, 2025Aug 28 2 hours ago, jackyjask said:oooooooooopsC# .net BigInter type DOES NOT support numbers with decimal points......... what a pity!so seems we do not have in-built .net type for very big numbers together with decimal points...decided to use this public/free lib:GitHubGitHub - peteroupc/Numbers: A C# implementation of arbitr...A C# implementation of arbitrary-precision numbers and arithmetic - peteroupc/Numbersusing it seems all is looking nice!eg:Uploading Attachment...Bro, what is this & how touse this in c#... Edited August 28, 2025Aug 28 by .hloire
August 28, 2025Aug 28 2 hours ago, Stuttered said:Well, I guess that's why it would not work. The icon issue is fixed, You have to add the .ico as a resource and then add code.Right-click on project->properties. Add icon (icon and manifest).Add .ico to .resx file (double-click and then add)Add code below:Code:// Explicitly set the form's icon from the executabletry{this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);}catch (Exception ex){MessageBox.Show($"Error loading icon: {ex.Message}", "Icon Load Error");}Update:I have incorporated the library, and may have this working... app update in a bit...FileSizeCalc.icoUpdate v0.0.10. Thx @jackyjask for pointing to the BigNumber library and assist. See attached. FileSizeCALC_v0.0.10.rar
August 28, 2025Aug 28 3 hours ago, Stuttered said:this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);damn it! this is GENIOUS! (instead of WinAPI old dirty crap!!!)1 hour ago, .hloire said:Bro, what is this & how touse this in c#...easy! just read the docs :)built a binary using that multi-precision lib: (left vs last build fom @Stuttered ) FileSizeCALC_0.0.11.zip
August 28, 2025Aug 28 41 minutes ago, jackyjask said:damn it! this is GENIOUS! (instead of WinAPI old dirty crap!!!)easy! just read the docs :)built a binary using that multi-precision lib: (left vs last build fom @Stuttered )FileSizeCALC_0.0.11.zipSeems like we have a winner! 👍
Thursday at 01:11 AM2 days Author Hey guys,do you know how to manage & calculate this manually via code (M)ASM? Do you have some tiny example and could test (don't debug the tools now)? So I have size as ASCII string like 64.2 MB. Are there some quick handy functions to use stings like that with? I just did remember crt_strtol & crt_atoi but they don't work with comma or dot signs etc. Example: SizeText, What-In MB, What-Out MB, format to calc withinvoke function_A, chr$("64.2"), MB, MB, 1024 == 61.2 MB Sting output invoke function_A, chr$("64.2"), MB, MB, 1000 == 67.3 MB String output or invoke function_A, chr$("64.2"), MB, GB, 1024 == 0.059 GB String outputI don't remember whether there is already some function or not so do you know?greetz
Thursday at 11:32 AM1 day I would suggest the FPU Library from Raymond: https://masm32.com/masmcode/rayfil/fpu.htmlThe FpuAtoFL function is probably what you want to convert the ascii string to a REAL4LOCAL rSize:REAL4 Invoke FpuAtoFL, Addr szFloatString, Addr rSize, DEST_MEM4 ; rSize now contains the float such as 64.2you can then load this into the fpu (or keep it on fpu stack with DEST_FPU flag), load some conversion value into the FPU to multiply by and do the multiplication, then convert the result back to ascii with the FpuFLtoA function Edited Thursday at 11:32 AM1 day by fearless
Thursday at 08:08 PM1 day Author Hello @fearless,thanks for the info but I need some ready example code even for the part after I got that float value etc. String to value then calc to MB or GB or etc to string. I also don't remember those float calculation stuff and div & mul operations. Just wanna do pretty same as the conversion tool can do by using a size string and getting result as string back I want as in examples before. Some size calculation lib would be nice. .data? rSize REAL4 ? lea edi, rSize invoke FpuAtoFL, chr$("64.2"), edi, DEST_MEM4 rSize 004AFADC 409CCCCD <-- and then? 004AFAE0 00000000greetz
Thursday at 11:53 PM1 day Author I got something like this...invoke FpuAtoFL, chr$("64.2"), NULL, DEST_FPU invoke FpuAtoFL, chr$("1000"), NULL, DEST_FPU fmul...just to put 2 value strings into FPU register doing some multiplication and having the result in st0. The question now is how to get the value in st0 to string. As I said, I just forgot all those stuff pretty much but must be very simple somehow. I tried this other function FpuFLtoA but always get ERROR back. Seems I'm using this wrong.Basic Questions:ASCII string to Float register / copyFloat register X to ASCII string bufferIs there a way to limit the value with X values after comma like 64.2 or 64.23 or 64.234 + doing some round up?greetz
Yesterday at 02:48 AM1 day Here's a complete command-line program using fasm (exe attached).format PE console entry start include 'win32wx.inc' .code ; Enter with EAX pointing to the suffix (first two wide characters). ; If the suffix is found its value is put on the FPU stack and carry is cleared, ; otherwise 1 is put and carry is set. get_unit: mov esi, units mov eax, [eax] .repeat .if dword[esi] = eax fld qword[esi+4] clc ret .endif add esi, 12 .until esi = units_end fld1 stc ret start: invoke CommandLineToArgvW, invoke GetCommandLine, args .if [args] <> 4 cinvoke printf, help invoke ExitProcess, 1 .endif lea ebx, [eax+4] cinvoke _wtof, dword[ebx] mov eax, [ebx+4] call get_unit fmulp mov eax, [ebx+8] call get_unit fdivp fld qword[one_thou-8] fcomip st, st1 mov eax, fmtf mov ecx, fmtg cmovae eax, ecx sub esp, 8 fstp qword[esp] cinvoke printf, eax invoke ExitProcess, 0 help db "fsize SIZE IN-UNIT OUT-UNIT", 10 db 10 db "Units are B, KB, Ki, MB, Mi, GB, Gi, TB or Ti.",10 db 0 fmtg db "%.3g", 10, 0 fmtf db "%.0f", 10, 0 struct UNITS suffix du 2 dup (?) value dq ? ends align 4 units UNITS "B", 1.0 UNITS "KB", 1000.0 one_thou: UNITS "Ki", 1024.0 UNITS "MB", 1000000.0 UNITS "Mi", 1048576.0 UNITS "GB", 1000000000.0 UNITS "Gi", 1073741824.0 UNITS "TB", 1000000000000.0 UNITS "Ti", 1099511627776.0 units_end: section '.bss' readable writeable args dd ? section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ msvcrt,'MSVCRT.DLL',\ shell32,'SHELL32.DLL' include 'api\kernel32.inc' import shell32,\ CommandLineToArgvW,'CommandLineToArgvW' import msvcrt,\ printf,'printf',\ _wtof,'_wtof' I've chosen to go with decimal and binary units, rather than an additional number. E.g. "64.2 MB Mi" converts decimal to binary and "64.2 Mi MB" converts binary to decimal. If the unit isn't recognised it will be ignored (it's detected, though, so just add your own test). The output is three significant digits for numbers under 1000, no decimals otherwise. fsize.exe
Create an account or sign in to comment