flat assembler
Message board for the users of flat assembler.
Index
> Windows > [WIP] BitBox |
Author |
|
bitshifter 17 Jun 2010, 13:23
I am making a tool to fondle bits in various ways.
Check it out, leave a reply, share some ideas... Note: You must be logged in for attatchment to be visible.
_________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. Last edited by bitshifter on 04 Nov 2010, 18:40; edited 7 times in total |
|||||||||||
17 Jun 2010, 13:23 |
|
Teehee 17 Jun 2010, 16:14
Cool. Put a button to select/deselect all bits. A option to choose among byte, word and dword would be useful too.
|
|||
17 Jun 2010, 16:14 |
|
edemko 17 Jun 2010, 16:49
more readability needed as your program must be useful in computer basic numerology: ignore " " or "'" or anything else in string flow: it provides readability for the end user
|
|||
17 Jun 2010, 16:49 |
|
edemko 18 Jun 2010, 00:19
Small example, best viewed in fasmw(ouadji), toggle bits with the mouse:
Code: format pe gui 4.0 include 'win32wx.inc' rw equ readable writable section '' code rw executable items dd ? brushes dd ?,? buf24bytes db 24 dup ? fmt du '%d',0 entry $ mov ecx,32 mov ebx,10 .init_bits: xor edx,edx push edx lea eax,[ecx-1] div ebx shl edx,16 lea eax,[eax+edx+$0030'0030] push eax push $0020'0030 loop .init_bits mov [items],esp xor eax,eax invoke DialogBoxParamW,eax,eax,eax,WindowProc,eax add esp,6*2*64 ret proc WindowProc wnd:dword, msg:dword, wParam:dword, lParam:dword mov eax,[msg] .if eax=WM_CLOSE invoke EndDialog,[wnd],'cool' .elseif eax=WM_INITDIALOG mov ecx,32 .load_bits: push ecx invoke SendDlgItemMessageW,[wnd],IDC_LSTBITS,LB_ADDSTRING,0,0 pop ecx loop .load_bits invoke CreateSolidBrush,$00e0e0e0 mov [brushes],eax invoke CreateSolidBrush,$00f0f0f0 mov [brushes+4],eax .elseif eax=WM_MEASUREITEM mov eax,[wParam] .if eax=IDC_LSTBITS mov eax,[lParam] mov dword[eax+16],12 .endif .elseif eax=WM_DRAWITEM mov eax,[wParam] .if eax=IDC_LSTBITS mov ebx,[lParam] test byte[ebx+8],1 mov eax,[brushes] mov ecx,[brushes+4] cmovnz eax,ecx push eax lea eax,[ebx+28] invoke FillRect,dword[ebx+24],eax invoke SetBkMode,dword[ebx+24],TRANSPARENT push /*DT_EXPANDTABS+*/DT_EXTERNALLEADING+DT_LEFT+DT_NOCLIP+DT_NOPREFIX+DT_SINGLELINE+DT_VCENTER lea eax,[ebx+28] push eax push 4 mov eax,[ebx+8] lea eax,[eax*2+eax] shl eax,2 add eax,[items] push eax invoke DrawTextW,dword[ebx+24] .endif .elseif eax=WM_COMMAND mov eax,[wParam] .if ax=IDC_LSTBITS shr eax,16 .if eax=LBN_SELCHANGE invoke SendDlgItemMessageW,[wnd],IDC_LSTBITS,LB_GETCURSEL,0,0 mov ebx,[items] push 0 push eax lea eax,[eax*2+eax] lea eax,[ebx+eax*4] xor byte[eax],$01 invoke SendDlgItemMessageW,[wnd],IDC_LSTBITS,LB_SETCURSEL xor eax,eax mov ecx,32 .gether_bits: bt dword[ebx],0 rcr eax,1 add ebx,12 loop .gether_bits invoke wsprintf,buf24bytes,fmt,eax add esp,4 invoke SendMessageW,[wnd],WM_SETTEXT,0,buf24bytes .endif .endif .endif .ret0: xor eax,eax ret endp section '' import rw library gdi32, 'gdi32.dll',\ kernel32, 'kernel32.dll',\ user32, 'user32.dll' include 'api\gdi32.inc' include 'api\kernel32.inc' include 'api\user32.inc' section '' resource rw IDD_MAIN = 0 IDC_LSTBITS = 1 directory RT_DIALOG,dialogs resource dialogs,\ IDD_MAIN,0,idd_main dialog idd_main,'main',0,0,200,230,/*WS_VISIBLE+*/WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+DS_CENTER,,,'Courier New',8 dialogitem 'listbox','',IDC_LSTBITS,3,3,20,220,WS_VISIBLE+WS_CHILD+WS_TABSTOP+LBS_NOINTEGRALHEIGHT+LBS_OWNERDRAWFIXED+LBS_NOTIFY enddialog |
|||
18 Jun 2010, 00:19 |
|
bitshifter 21 Jun 2010, 03:26
A little more progress...
New application icon and file version information. Since we are a tool window the icon is only used for file build. I hacked into the system menu so we now have a 'Sticky' and 'About' options. The 'About' option displays a simple message box with version info and such. The 'Sticky' option toggles the topmost window style (topmost by default) Also i have subclassed the edit controls and started to verify valid user input in realtime. Still much work to do, but this is enough for an alpha version _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. Last edited by bitshifter on 28 Jun 2010, 13:36; edited 1 time in total |
|||
21 Jun 2010, 03:26 |
|
bitshifter 22 Jun 2010, 04:55
And some more small progress...
Added code to make sure common controls are registered. Added 3 new operation control buttons [and] [or] [xor] Subclassed rvalue control to start monitoring input. Changed application icon color from green to light grey. Minor size optimizations and naming changes. Added missing version info (now is complete) Added manifest resource to enable XP themes. Its been a while since i played with tool tips so i am on a refresher... Soon we will have them on all the operational control buttons. I think this will become a very popular and useful tool _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
22 Jun 2010, 04:55 |
|
Teehee 22 Jun 2010, 16:13
_________________ Sorry if bad english. |
||||||||||
22 Jun 2010, 16:13 |
|
bitshifter 28 Jun 2010, 09:51
New version
New look and feel, including many changes inside and out. Now validates all user input with more robust conversion routines. I still have more things to add but this is the next release anyway. Try it out, leave a reply, share an idea... _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
28 Jun 2010, 09:51 |
|
sinsi 28 Jun 2010, 10:09
How about a sar button?
|
|||
28 Jun 2010, 10:09 |
|
edemko 28 Jun 2010, 10:48
how about "number1 sar number2"
that's difficult a bit |
|||
28 Jun 2010, 10:48 |
|
bitshifter 28 Jun 2010, 13:31
Because of the design, it is very easy to add new operations...
For example, to perform the requested operation only needs very little code... Code: mov ecx,[_rvalue] ... cmp eax,ID_BUTTON_SAR jne .not_sar_clicked sar [_lvalue],cl jmp .refresh_lvalue .not_sar_clicked: ... Originally i was just going to include the standard C bit operations. But i guess asm users want the complete set of operations. Maybe i could do a string box where you type in the instruction name. Otherwise the box will start to become full of buttons and confusing. Alternately i could script the buttons so user can choose what they are... Thanks for the reply's, i will consider any ideas to make this a better tool. _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
28 Jun 2010, 13:31 |
|
edemko 30 Jun 2010, 13:48
download an archive: http://board.flatassembler.net/topic.php?t=7434&start=41
|
|||
30 Jun 2010, 13:48 |
|
KingDemon 28 Oct 2010, 18:49
I like the idea, but wouldn't it be more useful to have two rows of checkboxes - one for source and one for destination instead of just edit box for destination?
Also, you could make it run in the Systray and pop-up/pop-down on a global hotkey. Or, more complex it could be made into a Desk Band for the taskbar (with SetFocus on global hotkey). |
|||
28 Oct 2010, 18:49 |
|
baldr 28 Oct 2010, 23:14
KingDemon,
Don't sit and wait, you might be first to implement it in such ways! |
|||
28 Oct 2010, 23:14 |
|
bitshifter 29 Oct 2010, 07:59
I think this will be solved with the inclusion of xchg instruction.
Then the box will not have to be cluttered with two bit fields... As for using the system tray, its something i have thought about. I have version 0.0.0.4 almost ready, just a few more finishing touches and some test runs... |
|||
29 Oct 2010, 07:59 |
|
KingDemon 29 Oct 2010, 17:08
Well, I started adding the relevant parts from the SysTray example to BitBox, thinking I could do it in less than 10 minutes , but when I realized that I had to go around replacing "DestroyWindow" with "EndDialog"; ".finished" and ".unhandled" with ".processed" and God know what else, I just gave up. I'm simply that lazy. I sure wish I could give these little things more than 10 minutes, but after you've done them a couple of times, it gets boring. And who know, if you try, maybe you'll enjoy it more than I did.
|
|||
29 Oct 2010, 17:08 |
|
bitshifter 30 Oct 2010, 09:25
Ok, version 0.0.0.4 snapshot is ready for testing...
It is a bit smaller than v3 to take up less room on the screen. Also a few more operations have been added. And more value range checking is being performed. Still much to do, but so little time... Edit: Ok, so i had some time play... I added a simple taskbar icon which is used to activate window. Also the window is no longer "sticky" by default. I guess this bumps it to version 0.0.0.5 Edit: Version 0.0.0.6 1) Edit controls share same single subclass now with new filtering system. 2) Traded conditional moves for branch statements for increased portability. 3) Enabled edit context menu, cut/copy/paste etc... Note: Pasted value must not contain any base identifier crap (0x,b,etc) No known bugs, feel free to find and report one Thanks for trying it, and thanks for comments/criticism... |
|||
30 Oct 2010, 09:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.