Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Assembly Language... anyone??
Logged in as: Guest
arrSession:exec spGetSession 2,7,58654
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[General Forum]
>>
Other Programming/Scripting Languages
>> Assembly Language... anyone??
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Assembly Language... anyone?? -
4/1/2008 1:50:21 PM
yfki
Posts: 27
Score: 0
Joined: 12/12/2007
Status:
offline
Some assembly code that I am trying to understand, just thought I would throw tihs out there..
I am trying to get this to work on Vista x64
Any assebly people out there?
; FANCTRL.ASM ; The fan control functions; extracted from NBFAN.MDM and NBSVC.MDM from ; the Dell Diagnostics 1052 ; Authors: Some unknown Dell engineers using Visual C++; stripped down ; and optimized by MH ;-) .386p .model flat extrn _printf:near public _hlcontrol .code ;-------------------------------------- ; _hlcontrol: high level fan control ; ; In: D[EBP+8]:Fan No (0=outer,1=inner) ; D[EBP+12]:Speed (2=high,1=slow,0=off) ; Out: 1:ok 0:error ;-------------------------------------- _hlcontrol: push ebp mov ebp,esp sub esp,32 push ebx push esi push edi mov eax,dword ptr [ebp+12] mov eax,dword ptr [4*eax+speed] push eax ; 3. arg: speed text mov eax,dword ptr [ebp+8] mov eax,dword ptr [4*eax+fan] push eax ; 2. arg: fan no push offset setspeed ; 1. arg: format string call _printf add esp,12 mov eax,dword ptr [ebp+12] ; fan speed push eax mov eax,dword ptr [ebp+8] ; fan no push eax call genfanstruct add esp,8 cmp eax,1 je @a5 push offset err1 call _printf add esp,4 xor eax,eax ;--------- @a5: pop edi pop esi pop ebx leave ret ;-------------------------------------- ; genfanstruct: create smbios structure for fan control ; ; In: D[EBP+8]:Fan No (0=outer,1=inner) ; D[EBP+12]:Speed (2=high,1=slow,0=off) ; Out: 1:ok <>1:error ;-------------------------------------- genfanstruct: push ebp mov ebp, esp sub esp, 20h push ebx push esi push edi mov byte ptr [ebp-1Ch],0a3h mov byte ptr [ebp-1Bh],1 mov al,byte ptr [ebp+8] mov byte ptr [ebp-18h],al mov al,byte ptr [ebp+12] mov byte ptr [ebp-17h],al mov word ptr [ebp-14h],0 mov word ptr [ebp-10h],0 lea eax,dword ptr [ebp-1Ch] push eax call smbiosfct add esp,4 pop edi pop esi pop ebx leave ret ;-------------------------------------- ; smbiosfct: execute commands in smbios structure ; ; In: D[EBP+8]:Pointer to smbios structure ; Out: 1:ok <>1:error ;-------------------------------------- smbiosfct: push ebp mov ebp, esp sub esp, 14h push ebx push esi push edi mov word ptr [ebp-10h], 1 mov eax, dword ptr [ebp+8] mov ax, word ptr [eax] mov word ptr [ebp-14h], ax mov eax, dword ptr [ebp+8] mov ax, word ptr [eax+4] mov word ptr [ebp-4], ax mov eax, dword ptr [ebp+8] mov ax, word ptr [eax+8] mov word ptr [ebp-8], ax mov eax, dword ptr [ebp+8] mov ax, word ptr [eax+0Ch] mov word ptr [ebp-0Ch], ax pushad mov ax, word ptr [ebp-14h] mov bx, word ptr [ebp-4] mov cx, word ptr [ebp-8] mov dx, word ptr [ebp-0Ch] out 0b2h, al out 084h, al mov word ptr [ebp-14h], ax mov word ptr [ebp-4], bx mov word ptr [ebp-8], cx mov word ptr [ebp-0Ch], dx popad mov eax, dword ptr [ebp+8] xor ecx, ecx mov cx, word ptr [eax] mov eax, dword ptr [ebp-14h] and eax, 0000FFFFh cmp ecx, eax jne @c1 mov eax, dword ptr [ebp+8] xor ecx, ecx mov cx, word ptr [eax+4] mov eax, dword ptr [ebp-4] and eax, 0000FFFFh cmp ecx, eax jne @c1 mov eax, dword ptr [ebp+8] xor ecx, ecx mov cx, word ptr [eax+8] mov eax, dword ptr [ebp-8] and eax, 0000FFFFh cmp ecx, eax jne @c1 mov eax, dword ptr [ebp+8] xor ecx, ecx mov cx, word ptr [eax+0Ch] mov eax, dword ptr [ebp-0Ch] and eax, 0000FFFFh cmp ecx, eax jne @c1 push offset svc52A8 call _printf add esp, 4 mov word ptr [ebp-10h], 0 ;--------- @c1: mov eax, dword ptr [ebp-14h] and eax, 0000FFFFh cmp eax, 0000FFFFh jne @c2 mov eax, dword ptr [ebp+8] xor ecx, ecx mov cl, byte ptr [eax+4] push ecx push offset svc52DC call _printf add esp, 8 mov word ptr [ebp-10h], 0 ;--------- @c2: mov ax, word ptr [ebp-14h] mov ecx, dword ptr [ebp+8] mov word ptr [ecx], ax mov ax, word ptr [ebp-4] mov ecx, dword ptr [ebp+8] mov word ptr [ecx+4], ax mov ax, word ptr [ebp-8] mov ecx, dword ptr [ebp+8] mov word ptr [ecx+8], ax mov ax, word ptr [ebp-0Ch] mov ecx, dword ptr [ebp+8] mov word ptr [ecx+0Ch], ax movsx eax, word ptr [ebp-10h] test eax, eax je @c4 mov eax, 1 jmp @c5 ;--------- @c4: mov eax, 5 ;--------- @c5: pop edi pop esi pop ebx leave ret ;****************************************************** .data err1 db 'Failed to set fan speed',13,10,0 setspeed db 'Setting %s fan to %s',13,10,0 speed dd offset off dd offset slow dd offset high fan dd offset right dd offset left left db 'inner',0 right db 'outer',0 high db 'high',0 slow db 'slow',0 off db 'off',0 svc52A8 db 'Smbios: Function not supported somehow..',13,10,0 svc52DC db 'Smbios: Invalid device (%d)',13,10,0 ;****************************************************** end
Post #: 1
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[General Forum]
>>
Other Programming/Scripting Languages
>> Assembly Language... anyone??
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI