Recent Posts

Pages: [1] 2 3 ... 10
1
The Workshop / Re: Progress with GDI+
« Last post by NoCforMe on Today at 02:00:49 PM »
I have edited the values and image to provide meaningful values.
For complex transformations we can combine partial transformations using CombineTransform.
And I am done with this thread.
Well, since your edit to your previous posting was helpful, you're excused.
2
Game Development / Re: Boring console game
« Last post by Alek on Today at 01:48:07 PM »
I don't want to be rude, but it seems like you used a c++ compiler... :idea:

VS 2017 :s

Can you explain a bit on the problem with the entry?
3
Game Development / Re: Boring console game
« Last post by felipe on Today at 12:33:57 PM »
Well, now looking the code you posted above, seems pretty obvious: the entry point for the program is not there and you use c (cdecl) calling convention for that 'procedure'...:shock: Is the game good?  :icon_mrgreen:
4
Game Development / Re: Boring console game
« Last post by felipe on Today at 12:12:30 PM »
I don't want to be rude, but it seems like you used a c++ compiler... :idea:
5
Game Development / Re: Boring console game
« Last post by felipe on Today at 12:07:45 PM »
i will try it. I don't know if defining the stack size is a good idea...:idea:
6
Game Development / Boring console game
« Last post by Alek on Today at 10:08:32 AM »
Attached is a simple and very boring number guessing game. Pretty sure it gets picked up by AV, so if you feel safer the code is posted below. I wrote briefly about my thought process behind it; mainly I write stuff like this to refresh myself and put a bit more thought into research. http://krimsky.net/articles/ibasm.php. Feel free to criticize on any of my MASM articles, I'm only about a week into MASM so go easy ;)

Also big thanks to hutch and vortex.

Code: [Select]
includelib libcmt.lib
includelib libvcruntime.lib
includelib libucrt.lib
includelib legacy_stdio_definitions.lib

.386
.MODEL flat,stdcall
.STACK 4096
STD_INPUT_HANDLE EQU -10 ;https://docs.microsoft.com/en-us/windows/console/getstdhandle
STD_OUTPUT_HANDLE EQU -11
GetStdHandle PROTO nStdHandle:DWORD
WriteConsoleA PROTO hConsoleOutput:DWORD, ;https://docs.microsoft.com/en-us/windows/console/writeconsole
lpBuffer:PTR BYTE,
nNumberOfCharsToWrite:DWORD,
lpNumberOfCharsWritten:PTR DWORD,
lpReserved:DWORD
ReadConsoleA PROTO hConsoleInput:DWORD, ;https://docs.microsoft.com/en-us/windows/console/readconsole
   lpBuffer2:PTR BYTE,
   nNumberOfCharsToRead:DWORD,
   lpNumberOfCharsRead:PTR DWORD,
   pInputControl:PTR BYTE

ExitProcess PROTO dwExitCode:DWORD

extern rand:NEAR
extern time:NEAR
extern srand:NEAR
extern _getch:NEAR

.data
game_randomNumber dd ?
charsWritten dd ?
msg_enternumber db "Guess a number between 0 and 9: ",0;33
msg_win db "Congratulations, your number matches the random!",13,10 ;50
msg_lose db "Sorry, your number doesn't match the random!",13,10 ;46
;lpBufferStorage db BUFFER_SIZE dup(?)
consoleHandleOutput dd ?
consoleHandleInput dd ?

.code
main PROC C
LOCAL buffer[128]:BYTE              

push STD_OUTPUT_HANDLE
call GetStdHandle
mov consoleHandleOutput, eax

push STD_INPUT_HANDLE
call GetStdHandle
mov consoleHandleInput, eax

main_game:
push 0
call time
push eax
call srand                       ;srand(time(NULL))
call rand
xor edx, edx                     ;clear edx
mov ebx, 10
div ebx                          ;remainder is stored in edx, result in eax
mov game_randomNumber, edx       ;rand() % 10

retry_label:
INVOKE WriteConsoleA, consoleHandleOutput, offset msg_enterNumber, 33, offset charsWritten, 0
INVOKE ReadConsoleA, consoleHandleInput, ADDR buffer, 128, offset charsWritten, 0

cmp charsWritten, 3 ;1 character + /r/n
jne retry_label

lea edx, buffer ;load the address of the buffer into edx
xor eax, eax ;clear eax
    mov al, [edx] ;dereference value at edx, move it into the lower 8 bit section of eax
;this ensures we only move over one byte
sub eax, 48
cmp eax, 0
jb retry_label
cmp eax, 9
ja retry_label

cmp eax, game_randomNumber
je win_label

INVOKE WriteConsoleA, consoleHandleOutput, offset msg_lose, 46, offset charsWritten, 0
jmp main_game

win_label:
INVOKE WriteConsoleA, consoleHandleOutput, offset msg_win, 50, offset charsWritten, 0
call _getch
INVOKE ExitProcess, 0

main ENDP
END
7
The Campus / TreeView expand root
« Last post by ragdog on Today at 02:44:02 AM »
Hello @All

I try to expand a root treeview item by a single click, but it works not.
Have any an idea or better solution?

Code: [Select]
.elseif (([edi].NMHDR.code)==NM_CLICK)
PrintText "NM_CLICK"
mov eax,(NM_TREEVIEW ptr[edi]).itemNew.hItem
invoke SendMessage,hWnd,TVM_EXPAND,TVE_EXPAND,eax
PrintDec eax

And is it possible to check with  WM_NOTIFY if a root item expanded or collapsed?

Greets,
8
The Workshop / Re: Progress with GDI+
« Last post by AW on Today at 01:59:43 AM »
I have edited the values and image to provide meaningful values.
For complex transformations we can combine partial transformations using CombineTransform.
And I am done with this thread.
9
The Campus / Re: Which registers are safe, control questions
« Last post by hutch-- on Today at 12:41:41 AM »
They are slightly different animals, the multicat algo will take a number of arguments and for that count it is fast enough but if you are stream appending a very large count to a buffer, the append algo avoids the length scan as it returns the end position of the last write and the next write starts at the end of the last write.
10
The Campus / Re: Which registers are safe, control questions
« Last post by jj2007 on December 09, 2018, 10:04:46 PM »
The "szappend" is a lot more efficient with streamed appends as it uses a current location pointer to update the next write address.

Is it faster than szMultiCat?
Pages: [1] 2 3 ... 10