Advertising (This ad goes away for registered users. You can Login or Register)

meta-pc asm help

Programming on your favorite platform, for your favorite platform? Post here
Post Reply
User avatar
Posts: 13
Joined: Sun Feb 27, 2011 7:04 pm

meta-pc asm help

Post by Kuci » Fri Aug 17, 2012 4:48 pm

Hello, I'm new to meta-pc assembler and I need help with reversing some function.
Here is function, which I need to reserve:

Code: Select all

		public function

var_80		= byte ptr -80h
arg_0		= dword	ptr  8
arg_4		= dword	ptr  0Ch

		push	ebp
		mov	ebp, esp
		and	esp, 0FFFFFFF8h
		sub	esp, 80h
		mov	eax, [ebp+arg_4]
		cmp	eax, 80h
		push	esi
		push	edi
		jl	short loc_100032DD
		mov	eax, 7Fh

loc_100032DD:				; CODE XREF: c4atoi+16j
		mov	esi, [ebp+arg_0]
		mov	ecx, eax
		mov	edx, ecx
		shr	ecx, 2
		lea	edi, [esp+88h+var_80]
		rep movsd
		mov	ecx, edx
		and	ecx, 3
		rep movsb
		mov	[esp+eax+88h+var_80], 0
		lea	eax, [esp+88h+var_80]
		push	eax		; char *
		call	j__atol
		add	esp, 4
		pop	edi
		pop	esi
		mov	esp, ebp
		pop	ebp
		retn	8
function		endp
So, I need to get number and type of function parameters and returned type. How could I get it ?

User avatar
Posts: 3817
Joined: Mon Sep 27, 2010 6:01 pm

Re: meta-pc asm help

Post by m0skit0 » Mon Aug 20, 2012 9:29 pm

meta-pc? That's IA32 (Intel's x86). You first need to learn IA32/x86 assembly. Some links to get started:

Hint: parameters on IA32 are passed through the stack. EAX holds the returned value from the function.
I wanna lots of mov al,0xb
"just not into this RA stuffz"

Post Reply

Return to “Programming”