View Full Version : Belajar Assembly
thread ini untuk berbagi pengetahuan mengenai bahasa rakitan alias assembly. di sini tidak ada batasan, mau x86, x64, windows assembly, linux assembly, intel syntax, AT&T syntax, dsb, pokoknya bebas :)
btw, nanti contoh aplikasinya menyusul ya :)
widnyana putra
03-26-2010, 01:30 PM
Pertamax
brb ambil tiker mau gelar lesehan dulu sambil nunggu mentornya dateng. :D
Download MASM32
h**p://www.masm32.com/masmdl.htmWin32 assembly tutorials, PE tutorials with associated source code
including some MASM articles from Ates. This is a very nice package
compiled into an offline document of Iczelion wonderful tutorials by
TheXROOster. "I did this for my own personal reference and thought
other people might need this so here it is, included are all 20 of his
tutorials on MASM32."
It is a .chm document and is very simple and straight forward technique to making these a better offline source then htm files.
h**p://www.tuts4you.com/download.php?view.1200
h**p://win32assembly.online.fr/Diatas itu Tutorial MASM favorit saia :D
dikarenakan kita tidak bisa meng-GPL-kan source code kita yg menggunakan MASM atau ingin "selingkuh" dari MASM, maka coba gunakan JWasm
JWasm is a free MASM-compatible assembler with these features:
native support for output formats Intel OMF, MS Coff (32- and 64-bit), Elf (32-and 64-bit), Bin and DOS MZ.
precompiled JWasm binaries are available for DOS, Windows and Linux. For OS/2 and FreeBSD, makefiles are supplied.
Instructions up to SSE4.2 are supported.
JWasm is written in C. The source is portable and has successfully been tested with Open Watcom, MS VC, GCC and more.
As far as programming for Windows is concerned, JWasm can be used with both Win32Inc (http://www.japheth.de/Win32Inc.html) and Masm32 (http://www.japheth.de/Masm32.html). Since v2.01, it will also work with Sven B. Schreiber's ancient WALK32 (http://www.google.com/search?q=WALK32).
C header files can be converted to include files for JWasm with h2incX (http://www.japheth.de/h2incX.html).
JWasm's source code is released under the Sybase Open Watcom Public License (http://www.japheth.de/JWasm/License.html), which allows free commercial and non-commercial use.
h**p://www.japheth.de/JWasm.html
This reference should be precise instruction set reference (including
x86-64). Its principal aim is exact definition of instruction
parameters and attributes.
In contrast to other references, primary source of this reference is a
XML document, which guaratees clear and structured information base and
therefore ability to extract many various informations such as a list
of instructions from requested groups, etc.
The reference is primarily based on Intel manuals as Intel is the
originator of x86 architecture. Additionally, it describes undocumented
instructions as well. On appropriate places, it gives a notice if an
opcode act differently on AMD architecture. Support for Cyrix, NexGen
etc. specific instructions is not sheduled at all. As for
Itanium-specific instructions, they are added just for the sake of
interest - they give a notice that the appropriate opcodes are already
used.
x86-32:
h**p://ref.x86asm.net/geek32.html
x86-64:
h**p://ref.x86asm.net/geek64.html
Homepage:
h**p://ref.x86asm.net/index.htmlOldschool
h**p://www.xs4all.nl/~smit/asm01001.htm#index1
h**p://kipirvine.com/asm/4th/sampleChapters/index.htm
Interrupt Jump Table
h**p://www.ctyme.com/intr/int.htmAssembly IDE
-RadASM
h**p://www.oby.ro/rad_asm/
h**p://members.a1.net/ranmasaotome/main.html
-Easycode
h**p://www.easycode.cat/English/index.htm
-WinASM
h**p://www.winasm.net/
-AsmEdit V5.0
h**p://asmedit.massmind.org/
-Chrome IDE
h**p://pagesperso-orange.fr/franck.charlet/index.htm
-AsmEditor
h**p://astase.com/produits/asmeditor/
Courtesy of Tuts4You
Regards,
M2R (Assembly Enthusiast)
Baru tw klo SSE 4.2 punya instruksi CRC32
Bisa dimanfaatin antivirus nie :cool:
CRC32 Accumulate CRC32 value using the polynomial 0x11EDC6F41 (or, without the high order bit, 0x1EDC6F41)
http://en.wikipedia.org/wiki/SSE4
Sayangnya baru ada di processor Intel i7 :(
Baru tw klo SSE 4.2 punya instruksi CRC32
Bisa dimanfaatin antivirus nie :cool:
http://en.wikipedia.org/wiki/SSE4
Sayangnya baru ada di processor Intel i7 :(
mungkin bisa dengan cara mendeteksi processornya bro, jadi kalau i7 terdeteksi, maka bisa pakai fungsi itu (CMIIW). kalau tidak salah, ansav yang lama punya fungsi seperti itu ya?
kalo ubtuk assembly yang pake objek iru pake yang RADasm yach
apa ansav juga dibuat dengan RadAsm ? soale kalo tampilanny6a DOS itu mbosenin
kalo objek tinggal tempatkan dan tempatkan , :D
mungkin bisa dengan cara mendeteksi processornya bro, jadi kalau i7 terdeteksi, maka bisa pakai fungsi itu (CMIIW). kalau tidak salah, ansav yang lama punya fungsi seperti itu ya?
iya bwt ngedeteksi fitur MMX n SSE :cool:
kalo ubtuk assembly yang pake objek iru pake yang RADasm yach
apa ansav juga dibuat dengan RadAsm ? soale kalo tampilanny6a DOS itu mbosenin
kalo objek tinggal tempatkan dan tempatkan , :D
RadASM itu IDEnya aja :-"
lynxluna
03-29-2010, 10:16 PM
kalo ubtuk assembly yang pake objek iru pake yang RADasm yach
apa ansav juga dibuat dengan RadAsm ? soale kalo tampilanny6a DOS itu mbosenin
kalo objek tinggal tempatkan dan tempatkan , :D
Object? Widget kaleee.. salah kaprah neh.
@lynxluna
klo ngomongin object, jd inget artikel ttg OOP di web mas yg dulu. haha =))
bingung mulai belajarnya darimana, ada project sederhana g :(
@atas
yg saia posting itu kan tutorial bwt newbie yg baru bljr assembly :D
bingung mulai belajarnya darimana, ada project sederhana g :(
coba diikuti petunjuk dari bro M2R ;) :top:
btw, kalau udah ga tahan, ini saya kasih PR, coba buat aplikasi pakai assembly yg cari informasi CPU dengan menggunakan instruksi CPUID, trus ditampilkan menggunakan messagebox :)
dewaphobia
03-31-2010, 12:38 PM
ikut belajar :blink:. mohon bantuannya yaa. :)
bingung mulai belajarnya darimana, ada project sederhana g :(
btw, ini contoh listing assembly untuk mencari tahu string processor yg digunakan. kode ini saya buat menggunakan Fasm dengan aseembly 32 bit non unicode. tidak ada error handler
format PE GUI 4.0
include 'win32a.inc'
; code
xor eax,eax
cpuid
lea edi,[szmsg]
mov [edi],ebx
mov [edi+4],edx
mov [edi+8],ecx
invoke MessageBox,0,szmsg,szcap,MB_OK + MB_ICONINFORMATION
invoke ExitProcess,0
; data
szmsg db "xxxxxxxxxxxx",0
szcap db "cpuinfo",0
; imports
data import
library kernel32,'kernel32.dll',user32,'user32.dll'
import kernel32,ExitProcess,'ExitProcess'
import user32,MessageBox,'MessageBoxA'
end data
hasilnya seperti ini
http://i39.tinypic.com/24lolmw.png
ikut belajar :blink:. mohon bantuannya yaa. :)
sama2 belajar bro :) btw, gmn kalau di thread ini kita bikin projekt tools sederhana untuk menganalisa malware atw tools lainnya?
baru aja dasar udah masuk dunia malware ass, tp gak papa juga ya ? :)
btw, kalau udah ga tahan, ini saya kasih PR, coba buat aplikasi pakai assembly yg cari informasi CPU dengan menggunakan instruksi CPUID, trus ditampilkan menggunakan messagebox :)tega bener nie mas void :D
nampilin messagebox aja msh g tw :wacko:
eh ini malah pke nampilin CPUID
lea edi,[szmsg]di fasm bisa pke addr g sie? klo bs kn enak :D
sama2 belajar bro :) btw, gmn kalau di thread ini kita bikin projekt tools sederhana untuk menganalisa malware atw tools lainnya? wah ini ide saia dr dulu, bru mw saia ksh tw klo gathering, mw bikin antidot (cleaner untuk 1 virus tertentu) :D kan smw member bisa ikutan
tp masa lgsg mw maen pke assembly? ya gpp sie, asalkan jgn bikin tampilannya dr assembly, mending pke VB :p klo bikin assembly, tw sendiri gmn, mesti nangkep windows message lewat loop yang tak terhingga
lea edi,[szmsg]
mov [edi],ebx
mov [edi+4],edx
mov [edi+8],ecxitu EDI nya gpp g direstore? :-?
; лллллллллллллллллллллллллллллллллллллллллллллллллл ллллллллллллллллллллллл
.586 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
; include files
; ~~~~~~~~~~~~~
include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\Comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\shell32.inc
include \masm32\include\oleaut32.inc
include \masm32\include\dialogs.inc
include \masm32\macros\macros.asm ; the macro file
; libraries
; ~~~~~~~~~
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\Comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\oleaut32.lib
; ----------------------------------------
; prototypes for local procedures go here
; ----------------------------------------
.data?
hInstance dd ?
.code
; лллллллллллллллллллллллллллллллллллллллллллллллллл ллллллллллллллллллл
LibMain proc instance:DWORD,reason:DWORD,unused:DWORD
.if reason == DLL_PROCESS_ATTACH
push instance
pop hInstance
mov eax, TRUE
.elseif reason == DLL_PROCESS_DETACH
.elseif reason == DLL_THREAD_ATTACH
.elseif reason == DLL_THREAD_DETACH
.endif
ret
LibMain endp
; лллллллллллллллллллллллллллллллллллллллллллллллллл ллллллллллллллллллллллл
comment -----------------------------------------------------
You should add the procedures your DLL requires AFTER
the LibMain procedure. For each procedure that you
wish to EXPORT you must place its name in the "CPUID.def"
file so that the linker will know which procedures to
put in the EXPORT table in the DLL. Use the following
syntax AFTER the LIBRARY name on the 1st line.
LIBRARY CPUID
EXPORTS YourProcName
EXPORTS AnotherProcName
-------------------------------------------------------
; лллллллллллллллллллллллллллллллллллллллллллллллллл ллллллллллллллллллллллл
GetCPUID proc addrCPUID:DWORD
mov esi, addrCPUID
mov eax,1
cpuid
mov dword ptr [esi],eax
mov eax,3
cpuid
mov dword ptr [esi+4],ecx
mov dword ptr [esi+8],edx
ret
GetCPUID endp
end LibMain
LIBRARY CPUID
EXPORTS GetCPUID
Attribute VB_Name = "modCPUID"
Type CPUID
CPUID(0 To 2) As Long
End Type
VERSION 5.00
Begin VB.Form frmCPUID
Caption = "GetCPUID"
ClientHeight = 1260
ClientLeft = 60
ClientTop = 375
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 1260
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "CPUID"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 1695
TabIndex = 1
Top = 240
Width = 1305
End
Begin VB.Label lblCPUID
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Caption = "lblCPUID"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 480
TabIndex = 0
Top = 600
Width = 3735
End
End
Attribute VB_Name = "frmCPUID"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Sub GetCPUID Lib "CPUID.dll" (ByRef v_CPUID As CPUID)
Private Sub Form_Load()
Dim CPUID As CPUID
GetCPUID CPUID
lblCPUID.Caption = HexVal(CPUID.CPUID(0)) & "-" & HexVal(CPUID.CPUID(1)) & "-" & HexVal(CPUID.CPUID(2))
End Sub
Private Function HexVal(ByVal lngValue As Long) As String
HexVal = Hex(lngValue)
If Len(HexVal) < 8 Then HexVal = String(8 - Len(HexVal), "0") & HexVal
HexVal = Left$(HexVal, 4) & "-" & Right$(HexVal, 4)
End Function
by sibi12
@M2R:
waduh, maaf bro sepertinya kita bergerak terlalu cepat :worship: soalnya saya jg bingung, harus dimulai darimana. untuk rekan2 yg lain, mungkin sebaiknya membaca tutorial yg sudah bro M2R post di halaman #1 dan kalau ada yg kurang dimengerti bisa dibahasa bersama di sini. btw, untuk fasm, kita tidak perlu menuliskan addr bro :) ... untuk antidot, wah sarannya bagus sekali bro. dulu saya pernah bikin pakai assembly sampai ke GUInya, tapi lupa saya simpan dimana. nanti saya cari2 lagi filenya. soal EDI, itu tidak saya restore soalnya EDI tidak digunakan pada instruksi selanjutnya (CMIIW).
format ELF executable
entry main
; code segment
segment readable executable
main:
xor eax,eax ; eax = 0
cpuid ; instruksi cpuid
lea edi,[cpuinfo] ; edi = alamat buffer
mov [edi],ebx ; simpan ke buffer
mov [edi+4],edx ; -----sda-----
mov [edi+8],ecx ; -----sda-----
mov eax,4 ; 4 = sys_write (CMIIW)
mov ebx,1 ; 1 = stdout
mov ecx,cpuinfo ; alamat string
mov edx,13 ; panjang string
int 0x80 ; syscall
mov eax,1 ; 1 = sys_exit
xor ebx,ebx ; 0 = return value
int 0x80 ; syscall
; data segment
segment readable writeable
cpuinfo rb 12
spasi db 0x0A
assemble (build) dan eksekusi executablenya
$ fasm cpuinfo.asm
flat assembler version 1.68 (16384 kilobytes memory)
3 passes, 178 bytes.
$ ./cpuinfo
GenuineIntel
referensi:
http://flatassembler.net/docs.php?article=manual
@M2R:
waduh, maaf bro sepertinya kita bergerak terlalu cepat :worship: soalnya saya jg bingung, harus dimulai darimana. untuk rekan2 yg lain, mungkin sebaiknya membaca tutorial yg sudah bro M2R post di halaman #1 dan kalau ada yg kurang dimengerti bisa dibahasa bersama di sini. btw, untuk fasm, kita tidak perlu menuliskan addr bro :) ... untuk antidot, wah sarannya bagus sekali bro. dulu saya pernah bikin pakai assembly sampai ke GUInya, tapi lupa saya simpan dimana. nanti saya cari2 lagi filenya. soal EDI, itu tidak saya restore soalnya EDI tidak digunakan pada instruksi selanjutnya (CMIIW).
http://flatassembler.net/docs.php?article=manual
sebaiknya mulai aja belajar dr tutor 1 Iczelion :D
atau kita langsung bergerak ke project antidot? :o_o:
mnurut saia, sblm ke project antidot lebih baik diajarin cara pke SVN atau GIT :)
klo yg ttg EDI, berdasarkan
format PE GUI 4.0
include 'win32a.inc'
maka saia berpikiran :
When you program under Win32, you must know some important rules. One such rule is that, Windows uses esi, edi, ebp and ebx internally and it doesn't expect the values in those registers to change. So remember this rule first: if you use any of those four registers in your callback function, don't ever forget to restore them before returning control to Windows.CMIIW
Hmm, kok kynya saia yg salah pengertian ttg penggunaan EDI :p
tp gpp lah, namanya jg belajar :D
sebaiknya mulai aja belajar dr tutor 1 Iczelion :D
atau kita langsung bergerak ke project antidot? :o_o:
keknya kita langsung bergerak ke project antidotnya aja bro, jadi teman2 ansavers bisa sambil belajar, sambil menanyakan juga hal2 yang belum dimengerti. jadi jalannya bisa lebih cepat (IMHO)
mnurut saia, sblm ke project antidot lebih baik diajarin cara pke SVN atau GIT :)
saya juga belum terbiasa pakai git atau svn bro. biasanya pakai ke-2 ini hanya untuk checkout... :worship:
klo yg ttg EDI, berdasarkan
format PE GUI 4.0
include 'win32a.inc'
maka saia berpikiran :
When you program under Win32, you must know some important rules. One such rule is that, Windows uses esi, edi, ebp and ebx internally and it doesn't expect the values in those registers to change. So remember this rule first: if you use any of those four registers in your callback function, don't ever forget to restore them before returning control to Windows.
CMIIW
Hmm, kok kynya saia yg salah pengertian ttg penggunaan EDI :p
tp gpp lah, namanya jg belajar :D
saya bukan programmer yang baik bro :p ...wkwkwkwkw. sebenarnya alasan saya tidak me-restore edi, karena program yg di atas itu sangat sederhana dan tidak menggunakan fungsi callbak (CMIIW) ;)
keknya kita langsung bergerak ke project antidotnya aja bro, jadi teman2 ansavers bisa sambil belajar, sambil menanyakan juga hal2 yang belum dimengerti. jadi jalannya bisa lebih cepat (IMHO)Hehe, sangat setuju saia :cool:
apa mw pke engine ansav aja? yg jadul jg gpp kan, yg penting bisa search n fix
saya juga belum terbiasa pakai git atau svn bro. biasanya pakai ke-2 ini hanya untuk checkout... :worship:lah klo g pke git atau svn, gmn kita mw merge project bersama? :-?
oia, minta tolong ma mas anvie atau mas lynxluna aja :D
terakhir,,,
callback function tuh apa ya? yg kya gmn tuh :shy:
snippet please
anvie
04-05-2010, 03:54 PM
@m2r:
saya harap anda memporting ansav +EA ke Yasm, masm suck soalnya ehehehhe
@mas anvie
nie lg dateng2 dah minta porting aja :P MASM aja msh g ngerti saia :help: baca dr halaman pertama dunk mas n jawab pertanyaan2nya, atau klo ada salah ya bnerin. at least kasih tips :D
lgpl dokumentasi n contoh YASM g sebanyak MASM jd butuh ekstra perhatian bwt belajar :wacko:
klo saia dah ngerti assembly kya mas anvie mah dengan senang hati saia porting (cuman harapan....) :(
anvie
04-06-2010, 03:04 AM
Experimen assembly di MacOS X 10.6.3 (Snow Leopard) menggunakan YASM x86_64 :D
just for share, aku build hello world ada dua macem, yang pertama menggunakan darwin syscall, dan yang satunya menggunakan libc, dan ternyata make syscall lebih mudah dari pada pake libc, nih buktinya:
proses dari pertama kali install yasm sampe berhasil build :pisangdance:
studi kasus (helloworld) full syscall:
anlabmac:~ Robin$ sudo port install yasm
Password:
---> Computing dependencies for yasm
---> Fetching yasm
---> Attempting to fetch yasm-0.8.0.tar.gz from http://distfiles.macports.org/yasm
---> Verifying checksum(s) for yasm
---> Extracting yasm
---> Configuring yasm
---> Building yasm
---> Staging yasm into destroot
---> Installing yasm @0.8.0_0
---> Activating yasm @0.8.0_0
---> Cleaning yasm
anlabmac:~ Robin$
echo "
> SECTION .data
> hello db 'Hello world', 10
> hellolen equ $ - hello
>
> SECTION .text
> global start
>
> start:
> mov rax, 0x2000004
> mov rdi, 1
> mov rsi, qword hello
> mov rdx, hellolen
> syscall
> mov rax, 0x2000001
> xor rdi, rdi
> syscall" > hallo.asm
anlabmac:~ Robin$ yasm -f macho64 hallo.asm
anlabmac:~ Robin$ ld hallo.o
anlabmac:~ Robin$ ./a.out
Hello world
done! :pisangdance:
nah sekarang kalo mau pake libc, satu yang harus diperhatikan, sebelum function call stack harus align 16 byte, padahal juga gak dipake :wacko: (dasar steve jobs).
anlabmac:~ Robin$ echo "
> section .data
> hallo db \"Hello world\",10,0
>
> section .text
>
> extern _printf
>
> global _main
>
> _main:
> push rbp
> mov rbp, rsp
> sub rsp, 16
>
> mov [rbp-4], edi
> mov [rbp-16], rsi
>
> lea rdi, [hallo wrt rip]
> xor eax, eax
> call _printf
> xor eax,eax
>
> leave
> ret" > hallo.asm
anlabmac:~ Robin$ yasm -f macho64 hallo.asm
anlabmac:~ Robin$ ld -arch x86_64 -o hallo -lcrt1.10.6.o hallo.o -lSystem
anlabmac:~ Robin$ ./hallo
Hello world
anlabmac:~ Robin$
entry point kalo pake library luar misal libc gak harus langsung ke kode kita, harus lewat crt1.bla.bla.bla.
done.
happy coding. :cool:
...
nah sekarang kalo mau pake libc, satu yang harus diperhatikan, sebelum function call stack harus align 16 byte, padahal juga gak dipake :wacko: (dasar steve jobs).
...
sama dengan di win64 (tested on Windows 7 x64) ... saya sempat coba, kalau tidak me-reserve 16 byte di stack maka akan error :(
btw, tadi sempat juga test yasm di GNU/Linux x86 :)
$ cat tiest.asm
section .data
cpuinfo db "CPU: ############",0x0a,0
section .text
extern printf
global main
main:
push ebp
mov ebp,esp
xor eax,eax
cpuid
lea edi,[cpuinfo+5]
mov [edi],ebx
mov [edi+4],edx
mov [edi+8],ecx
push cpuinfo
call printf
add esp,4
xor eax,eax
leave
ret
$ yasm -f elf -o tiest.o tiest.asm && gcc -s -o tiest tiest.o
$ file tiest ; size tiest
tiest: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped
text data bss dec hex filename
961 276 4 1241 4d9 tiest
$
$ ./tiest
CPU: GenuineIntel
$
anvie
04-06-2010, 09:12 PM
@void: ternyata bukan salahnya steve jobs wakakakaka
@all:
oia, kalo pake 64 bit, printf gak butuh stack, semua function parameter (kalo gak terlalu panjang/cukup) akan ditaruh di register, seperti dalam contoh:
lea rdi, [hallo wrt rip]
xor eax, eax
call _printf
xor eax,eax
pointer `hallo` ditaruh di register RDI (destination index register pada mesin 64bit), dan bukan di-push ke stack dalam hal ini yang biasa dipegang ma RSP (stack pointer register pada mesin 64bit).
karena gak butuh stack (mungkin karena register 64bit yang jadi banyak kalo dibagi ke 32bit) sehingga function `_printf` dipanggil tanpa perlu mengembalikan posisi stack (RSP), seperti pada contoh yang om void kemukakan di atas:
call printf
add esp,4 ; stack pointer dikembalikan pada posisi semula.
FYI: fungsi printf adalah fungsi yang menggunakan VAR_ARGS artinya jumlah parameter gak ditentukan, sehingga dapat menerima parameter yang sangat banyak, karena itulah fungsi ini biasanya diikuti oleh pengembalian posisi stack setelahnya, karena dia tidak bisa mengembalikan stacknya sendiri, kayag konvensi stdcall.
ini dia contoh source code assembly untuk platform win64. saya bikin pakai fasm soalnya, ga punya linker untuk yasm ... >_<
format PE64 GUI
include 'win64a.inc'
;-- code
sub rsp,8 ; reserve stack atau aplikasinya error :(
xor eax,eax
cpuid
lea edi,[szmsg+5]
mov [edi],ebx
mov [edi+4],edx
mov [edi+8],ecx
invoke MessageBox,0,szmsg,szcap,MB_OK + MB_ICONINFORMATION
invoke ExitProcess,0
;-- data
szcap db 'info',0
szmsg db 'CPU: ############',0
;-- import
data import
library kernel32,'kernel32.dll',\
user32,'user32.dll'
include 'api\kernel32.inc'
include 'api\user32.inc'
end data
masih pakai register 32bit :p
jagot
04-08-2010, 11:34 PM
geseran dikit om nubie mau belajar juga nih...:D
kok g ada yang posting tentang syntak dasar Assembly yach,
kok langsung dikasih "MOV" "lea" "xor" dll nyubi kan jadi bingung
kok g ada yang posting tentang syntak dasar Assembly yach,
kok langsung dikasih "MOV" "lea" "xor" dll nyubi kan jadi bingung
mungkin bro bisa mulai dari link tutorial yang dikasih sama bro M2R di posting halaman 1 (http://www.ansav.com/forum/showpost.php?p=11312&postcount=3) :)
Fratier Zen
06-28-2010, 01:51 PM
Aku Jiga ingin belajar nie,,,:D
Super I Love It your's tutorial M2R and All r Rocking to teaching asm thanks 2 all
Super I Love It your's tutorial M2R and All r Rocking to teaching asm thanks 2 all
LOL, it wasn't mine :D
you right bro M2R but it's good for beginner
Fratier Zen
07-04-2010, 05:29 AM
Pertama2 apa yang harus ku pelajari tentang assembly??
Pertama2 apa yang harus ku pelajari tentang assembly??
keknya yg pertama harus dipelajari adalah instruksi dan register (CMIIW). bagusnya coba baca2 artikelnya Iczelion *googling aja* :)
widnyana putra
01-19-2011, 07:14 AM
keknya yg pertama harus dipelajari adalah instruksi dan register (CMIIW). bagusnya coba baca2 artikelnya Iczelion *googling aja* :)
http://win32assembly.online.fr/
OOT
kalo untuk C, resourcenya apa yah?
OOT
kalo untuk C, resourcenya apa yah?
coba ke sini bro : http://aelinik.free.fr/c/ :)
http://kldp.org/files/c+in+21+days.pdf
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.