flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
a115433 13 Mar 2010, 13:47
using global varialbes = lame
there is no pe64. or at least i dont know about it. only pe32 and pe32+. you dont check for errors. invoke CloseHandle no argument? you imports have wrong name, look into manual for correct ones. use heap functions instead of Local/Global. |
|||
![]() |
|
semiono 13 Mar 2010, 17:07
a115433 wrote: using global varialbes = lame ![]() Quote: invoke CloseHandle Ok, sorry!.. _________________ Windows 9, FL Studio 19 |
|||
![]() |
|
semiono 13 Mar 2010, 21:48
PE > PE64
win32a.inc > win64a.inc dword > qword dd > dq eax > rax etc... align 4 > align 8 retn 4 > retn 8 Compiled with no bugs! ![]() Not work! ![]() |
|||
![]() |
|
a115433 13 Mar 2010, 22:08
format pe64
section '' readable executable jmp $ does it work? |
|||
![]() |
|
LocoDelAssembly 13 Mar 2010, 22:40
If this is a question of whether "format pe64" works or not in Windows 64-bit, all examples in the package work and use "format PE64 GUI 5.0" except for WIN64\PE64DEMO
|
|||
![]() |
|
semiono 13 Mar 2010, 22:48
Not work it (kill not work)
# pkill.exe calc.exe Compilation not say a reports of bug Code: format PE64 include '%fasm%\win64ax.inc' entry start section '.rsrc' resource data executable readable writeable ; ... start: invoke GetCommandLine invoke CommandLineToArgv,rax,argsNum cmp qword[argsNum],1 push rax jbe @F ; jump_if_below_or_equal push qword[rax+4] call AdjustMyToken stdcall findProcessID test rax,rax jz @F invoke OpenProcess,PROCESS_TERMINATE,FALSE,rax push rax invoke TerminateProcess,rax,1 invoke CloseHandle,[hToken] jmp start @@: invoke ExitProcess,0 argsNum dq ? section '.idata' import data executable readable writeable library advapi32,'ADVAPI32.dll',kernel32,'KERNEL32.DLL',shell32,'SHELL32.DLL' include '%fasm%\api\advapi32.inc' import kernel32,OpenProcess,'OpenProcess',\ TerminateProcess,'TerminateProcess',\ CloseHandle,'CloseHandle',\ lstrcmpi,'lstrcmpiW',\ CreateToolhelp32Snapshot,'CreateToolhelp32Snapshot',\ Process32First,'Process32FirstW',\ Process32Next,'Process32NextW',\ GetCommandLine,'GetCommandLineW',\ LocalFree,'LocalFree',ExitProcess,'ExitProcess' import shell32,CommandLineToArgv,'CommandLineToArgvW' TOKEN_ADJUST_PRIVILEGES equ 20h TOKEN_QUERY equ 8h SE_PRIVILEGE_ENABLED equ 2h AdjustMyToken: invoke LookupPrivilegeValue,emptyStr,privName,tokenPriv.LUID1 mov qword[tokenPriv.PrivilegeCount],1h mov qword[tokenPriv.Attributes],SE_PRIVILEGE_ENABLED invoke OpenProcessToken,-1,TOKEN_ADJUST_PRIVILEGES OR TOKEN_QUERY,hToken invoke AdjustTokenPrivileges,[hToken],FALSE,tokenPriv,0,0,0 invoke CloseHandle,[hToken] ret emptyStr db '',0 privName db 'SeDebugPrivilege',0 struct TOKEN_PRIVILEGES PrivilegeCount dq ? LUID1 dq ? LUID2 dq ? Attributes dq ? ends hToken dq ? TH32CS_SNAPPROCESS equ 2 findProcessID: ; takes one parameter through stack: pointer to the process name push rbp invoke CreateToolhelp32Snapshot,TH32CS_SNAPPROCESS,0 mov rbp,rax mov qword[procEntry.dwSize],sizeof.PROCESSENTRY32W invoke Process32First,rax,procEntry @@: invoke Process32Next,ebp,procEntry test rax,rax jz @F invoke lstrcmpi,procEntry.szExeFile,qword[rsp+16] test rax,rax jnz @B mov rax,qword[procEntry.th32ProcessID] @@: pop rbp retn 8 struct PROCESSENTRY32W dwSize dq ? cntUsage dq ? th32ProcessID dq ? th32DefaultHeapID dq ? th32ModuleID dq ? cntThreads dq ? th32ParentProcessID dq ? pcPriClassBase dq ? dwFlags dq ? szExeFile dd MAX_PATH dup (?) ends tokenPriv TOKEN_PRIVILEGES <> procEntry PROCESSENTRY32W <> align 8 Code: push qword[rax+8] not result the same ![]() |
|||
![]() |
|
a115433 13 Mar 2010, 23:03
push qword[rax+8]
you dont have to write operand size. push is always 64bit in ia32e. test rax,rax jnz @B also, i suggest using cmovcc's. jnz are dead in ia32e. |
|||
![]() |
|
LocoDelAssembly 13 Mar 2010, 23:05
So, "push [rax+8]" compiles for you? Can you share the "patch"?
|
|||
![]() |
|
a115433 13 Mar 2010, 23:17
hmm, it doesnt.
my mistake, sorry. but ive read that it can be only 64bit address size, why fasm doesnt compile with qword word? its only possibility, and this is not present in some other instructions. |
|||
![]() |
|
LocoDelAssembly 13 Mar 2010, 23:28
fasm supports "push word [rax+8]". I though for a moment it was a mistake (I was expecting dword allowed), but it is actually supported:
Intel's PUSH documentation wrote: IF StackAddrSize = 64 |
|||
![]() |
|
semiono 14 Mar 2010, 00:18
Code: Can you share the "patch"? ![]() _________________ Windows 9, FL Studio 19 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.