call external dll in assembler (reverse engineer)

403 Views Asked by At

I have a exe file of a game that I like to add some implementation.

To do this I need to add a "jump" in assembler that execute a function from a external dll.

I need to add the jump inside the function:

int __cdecl sub_43AC70(char *a1, int a2)
{
  call my_function(a1) from mylibrary.dll

  int i; // [esp+0h] [ebp-4h]

  for ( i = sub_43BC50(); i; i = *(_DWORD *)i )
  {
    if ( *(_DWORD *)(i + 88) == a2 && (!a1 || !stricmp((const char *)(i + 4), a1)) )
      return i;
  }
  return 0;

enter image description here

enter image description here

I don't have experience in assembler and I don't known how is hard add this jump.

For the moment I have found this tutorial:

https://www.youtube.com/watch?v=80bjkJcCQO4&feature=emb_logo

that execute an external exe, that is not exactly what I need ...

However if there is a way to execute an external exe from a command line with a paramter:

call myprogram.exe -a1

in assembler , can be a compromise, so instead of create a dll with a parameter I can create a command line with a parameter, both are a good solution.

Can you please tell me a assembly code that execute a function with a parameter from external dll or excecute a external command line with a parameter ?

thanks !

0

There are 0 best solutions below