Jump to content

Recommended Posts

Posted (edited)

This is a Tool for changing the Auth Port in the Engine.dll made by some goldfinch guy i don't quite remember who he is.
Its written in FASM also i provide the source code.

;Lineage 2 authorization port changer, version 1.2b
;Copyleft (?) GoldFinch, 2008
;
;You may freely use, modify and distribute this code.
;
;Compile this file with fasm (http://flatassembler.net)
;===================== SETUPS ===========================
;pattern
virtual
   use32
   ;- begin -
   pushd 2106
   ;- end ---
   load PATTERN dword from $$
end virtual
;================ MACRO DEFINITIONS =====================
;High-level-like imported api calls macro.
;Lite version with procedure calls and string constants with "\n" support.
macro IMPORTS [dll,funclist] {
common	data import
forward dd 0,0,0,rva a#dll, rva v#dll
common	dd 0,0,0,0,0
	end data
forward v#dll: irp func,funclist \{
	    p\#func dd rva a\#func
	    macro func [line*] \\{common
		  match (arglist)tail,line* \\\{ push_r arglist \\\}
		  call [p\#func] \\} \}
	dd 0
forward a#dll db `dll#".dll",0
	irp func,funclist \{a\#func db 0,0,\`func,0\} }
macro push_r [arg] { reverse
      if arg eqtype ""
	 call @f
	 local str
	 str db arg,0
 @@:	 fix_str str,$-str
      else
	 pushd arg
      end if }
macro fix_str pStr,nLen {
      repeat nLen-1
	     load w word from pStr+%-1
	     if w="\n"
		store word 0x0D0A at pStr+%-1
	     end if
      end repeat }
;==============================================
;Some console output macro (print and println)
macro __print text {
      local size,str
      push_r size,0,0
      call @f
      str db text
 @@:  size = $-str
      fix_str str,size
      WriteFile([stdout]) }
macro __printf format,[arglist] {
common	wsprintfA(gMsgBuf,format,arglist)
	local ..argcount
	..argcount=0
forward ..argcount=..argcount+1
common	add esp,8+..argcount*4
	WriteFile([stdout],gMsgBuf,eax,0,0) }
macro print format,[arg] {common
      if arg eq
	 __print format
      else
	 __printf format,arg
      end if }
macro println format,[arglist] {common print format#"\n",arglist}
;********************* PROGPAM CODE **************************************************
format PE console
section 'O_o' code readable executable writeable
IMPORTS KERNEL32, < GetStdHandle,WriteFile,ReadFile,CreateFileA,SetFilePointer,GetLastError,CopyFileA,LoadLibraryA,CloseHandle,\
		    FreeLibrary,DeleteFileA,ExitProcess>,\
	USER32,<wsprintfA>
    entry $
    GetStdHandle(-11) ;STD_OUTPUT_HANDLE
    mov [stdout],eax
    GetStdHandle(-10) ;STD_INPUT_HANDLE
    mov [stdin],eax
    print "L2 authorization port changer version 1.2b\nCopyleft (?) GoldFinch, 2008\n\n"#\
	  "This program changes auth port number in engine.dll\nIt must be placed in lineage2\system folder\n"#\
	  "Enter '1' to proceed or nothing to terminate program: "
    ReadFile([stdin],gMsgBuf,1024,nRead,0)
	cmp byte[gMsgBuf],"1"
	jne exit_err
    ;------------------------------------------------
    ;[1] Analyse file
    print "Opening engine.dll ... "
    CreateFileA("engine.dll",0xC0000000,1,0,3,0,0)
    cmp eax,-1
	jnz open_ok
	GetLastError()
	println "failed with error code = %#x",eax
	jmp exit_err
open_ok:
	mov [hFile],eax
	println "OK"
    ;Get PE header offset
    SetFilePointer([hFile],0x3C,0,0)
    ReadFile([hFile],dwPE,4,nRead,0)
    ;Get entrypoint
    mov eax,[dwPE]
    add eax,0x28
    SetFilePointer([hFile],eax,0,0)
    ReadFile([hFile],Entrypoint,4,nRead,0)
    ;Check if file was patched
    cmp [Entrypoint],4
	jnz not_patched
    ;_______________________________________________
    ;File is already patched
    println "WARNING: File is already patched";
    ;Get port value
    SetFilePointer([hFile],port_value-__patch_data,0,0)
    ReadFile([hFile],port_value,4,nRead,0)
    println "Current port number is %d",[port_value]
    ;Ask new port value
    call InputPortNumber
    ;Write new port value
    SetFilePointer([hFile],port_value-__patch_data,0,0)
    WriteFile([hFile],port_value,4,nWritten,0)
    CloseHandle([hFile])
    ;Exit
    println "Port number was changed.\n\nPress [Enter] to close log."
    ReadFile([stdin],gMsgBuf,1,nRead,0) ;OR die ()
    ExitProcess(0)
    ;_______________________________________________
    ;File is not patched
not_patched:
    ;Make a copy of file to load it
    print "Creating temporary file engine.tmp ... "
    CopyFileA("engine.dll","engine.tmp",0)
	test eax,eax
	jnz copy_ok
	GetLastError()
	println "failed with error code = %#x",eax
	jmp exit_err
copy_ok:
	println "OK"
    ;Load dll
    print "Loading engine.tmp ... "
    LoadLibraryA("engine.tmp")
	test eax,eax
	jnz load_ok
	GetLastError()
	println "failed with error code = %#x",eax
	DeleteFileA("engine.tmp")
	jmp exit_err
load_ok:
	mov [hEngine],eax
	println "OK"
    ;Get image size
    mov eax,[hEngine]
    add eax,[dwPE]
    pushd [eax+0x50] ;SizeOfImage
    popd [SizeOfImage]
    ;Find pattern
    print "Looking for the pattern %#08x ... ",PATTERN
    mov edi,[hEngine]
    mov ecx,[SizeOfImage]
    mov eax,PATTERN
    cld
@@: repne scasb
	test ecx,ecx
	jz @f
	cmp dword[edi-1],eax
	jne @r
	jmp _found
@@:	println "not found. \n   Base=%x, Size=%x",[hEngine],[SizeOfImage]
	jmp exit_err
_found:
    sub edi,[hEngine] ;get rva
    println "OK, found at rva %#x",edi
    add [port_delta],edi
    ;Ask port number
    call InputPortNumber
    ;Change entrypoint
    mov eax,[Entrypoint]
    add [oep_rel],eax
    mov [Entrypoint],4
    mov eax,[dwPE]
    add eax,0x28 ;Entrypoint
    SetFilePointer([hFile],eax,0,0)
    WriteFile([hFile],Entrypoint,4,nWritten,0)
    ;Write patch code
    SetFilePointer([hFile],0,0,0)
    WriteFile([hFile],__patch_data,__patch_size,nWritten,0)
    println "%#x bytes was written.\nEngine.dll was patched with new auth port number.",[nWritten]
    CloseHandle([hFile])
    ;Exit
    println "\nNow this program will be terminated.\nYou can use it to change port number again.\n"#\
	    "Warning: probably, this program will crash now, it's normal for this version.\n\n"#\
	    "Press [Enter] to close log."
    ReadFile([stdin],gMsgBuf,1,nRead,0)
    FreeLibrary([hEngine])
    DeleteFileA("engine.tmp")
    ExitProcess(0)
    ;---------------------------
exit_err:
    println "\nPress [Enter] to close log."
    ReadFile([stdin],gMsgBuf,1,nRead,0)
    ExitProcess(0)
;------------------
InputPortNumber: ;Asking a port number
    print "Input new port number to patch or nothing to abort patching:\n-> "
    ReadFile([stdin],gMsgBuf,10,nRead,0)
    xor eax,eax ;for digits
    xor edx,edx ;for a number
    cld
    mov esi,gMsgBuf
    mov ecx,[nRead]
    sub cl,2 ;strip CR,lF
    jz	exit_err ;lmp if empty line
str2dw_loo:
	lodsb
	imul edx,10
	sub al,"0"
	cmp al,9
	ja exit_err ;jmp if not a number
	add edx,eax
    loop str2dw_loo
    mov [port_value],edx
    ret
;_____________________________________________
;Patch body
align 16
__patch_data:
	   dd "MZ"
	   ;new entrypoint will be here
	   pushd [esp+0x0C] ;copy Dllmain arguments
	   pushd [esp+0x0C]
	   pushd [esp+0x0C]
	   ;call themida "original" entry point
	   db 0xE8 ;"call rel32"
	   ;Relative offset. Must be equal to (OEP RVA) - (ret_addr RVA)
oep_rel:   dd -(ret_addr-__patch_data) ;= negative ret_addr RVA, add (OEP RVA) here
ret_addr:  call __base
__base:    pop edx  ;get __base virtual address, rva=4
	   ;in-memory patch
	   db 0xC7,0x82 ;mov dword[edx+imm32],imm32
	   ;Patch place delta offset. Must be equal to (PortValue RVA) - (__base RVA)
port_delta dd -(__base-__patch_data) ;= negative __base RVA, add (PortValue RVA) here
port_value dd 0 ;rva 0x0C ;write desired port value here
	   ret 0x0C ;return to OS
__patch_size=$-__patch_data
;_____________________________________________
;Uninitialized data. Must be at end of section
dwPE dd ?
Entrypoint dd ?
SizeOfImage dd ?
;---------------
hFile dd ?
hEngine dd ?
;---------------
nRead dd ?
org $-4
nWritten dd ?
stdout dd ?
stdin dd ?
gMsgBuf db 1024 dup (?)

Auth Port Modifier.zip

Edited by Sighed
Posted

Is the TR/Patched.Ren.Gen Trojan

 

 

Why i get that error for virus?
I had used that program also before when i had a server and when the players download the patch for the server with the edited engine.dll alll the time Antivirus Hit Red!!!

Posted (edited)

This port changer has been made by Fyyre :)

 

Actually only the base-code\poc is - goldfinch modded it and changed it to be a .exe capable of just permanently changing authport.

Because people asked to have it like that - and fyyre well within his rights told people to mod it themselves when sharing source.

 

So some credit to Goldfinch is deserved.

 

 

 

 

Wonder if the byte signature matches newer clients tho.

Edited by mcbigmac
Posted

Actually only the base-code\poc is - goldfinch modded it and changed it to be a .exe capable of just permanently changing authport.

Because people asked to have it like that - and fyyre well within his rights told people to mod it themselves when sharing source.

 

So some credit to Goldfinch is deserved.

 

 

 

 

Wonder if the byte signature matches newer clients tho.

 

Tested and didn't work. It crahes when trying to start game . H5 and GF client.

  • 1 year later...
  • 7 months later...
Posted

I think this file is incomplete , it needs authport.dll & authport.ini and dll must be added to import table of l2.exe

thats other stuff. This edits directly on engine.dll

  • 5 months later...
  • 3 months later...
Guest
This topic is now closed to further replies.
  • Posts

    • The bot video lasts 35 minutes and not everything is shown there, if everything was shown, the video could have lasted several hours. Also, the video quality is reduced so as not to take up much space.The last minutes of the video show bots attacking each other on the event. https://dropmefiles.com/1jMi2
    • We also forgot to say that the deal will be the way you want it, we are ready for almost any of your demands. And we ask the administration to review our post as soon as possible, because several hours have passed and it still hasn't passed moderation, thank you in advance!  
    • 💥Super offer GitHub Account  (5 years)💥 ⚠️ Available to order for only $20🔥
    • Good day to all! We present to your attention our source code h5, where several projects used and achieved very good results, both in terms of online and in general for the project. (Due to confidentiality, the list of projects, the test server and what the basis of the source code will be provided only to real buyers, where they can go and check them out)   The main feature is bots, which are very animated, one to one like real players. But, in addition to bots, the build has a lot of interesting and modern things. Below will be a video showing bots and a little about the server.   As we said, the build was used on several projects, so the first thing that is there is not a single backdoor on the server, all serious and critical errors have been fixed. Races and classes are closer to the official PTS platform.   And also the server can be used as a classic server, as well as a server with add-ons, because the server has added many new things, weapons, armor, jewelry, hats, cloaks, etc.   The server has a full working community board (alt+b), working locations, quests, geodata, mechanism, working ai, in general there are no problems and complaints. In alt+b, shops, various services, buffer, player statistics, clan statistics, mail, profession change, personal account, registration for events, etc. are available.   Additional services: Premium account, visual costumes, nickname change services (for yourself and your pet), nickname and title painting service, karma/PC cleaning, expand services, weapon/armor/jewelry sharpening service, level up and down service, nobles purchase service, beauty salon (new hairstyle change from higher chronicles and face change), additional window purchase service, clan reputation purchase service, weapon augmentation purchase service.   Internal services: auto potions (acp), referral system, repair services, automatic reward delivery after n. time, additional auction, and other working systems, also many available commands, such as: exact date of epic respawn, password change directly inside the game, offline buffer, auto att, registration for castle sieges directly by entering a command and other available commands.   The server has protection (both on the server side and on the client side) that protects against free software and also several other anti-bot systems that will not give the slightest chance to bot users. But if you want people to use software, you just turn it off.   Bots. As we said, one of the main features of our server is bots, they are one to one like real players, now a little about bots and below is a link to a video about how they work: Server bots are like real players, their AI is copied from the AI ??of real characters, and therefore they get what real players get and you can also do with them everything that can be done with real characters.   They write in chats, in all chats, trade, shout, pm, clan chat, general chat. They walk around the cities, level up, farm, kill each other in pvp and pc, put on weapons, armor, jewelry, sharpen weapons. According to their level, they will choose their professions, join clans, participate in different events, use alt+b services - I'm telling you, their AI is copied and adapted like a real player's AI, so they can do everything that a real player can.   Bot control: You can set a chat and words for bots, how often or rarely they will write in chats, you can control where and how the bots will level up, you can control what events they will be at, you can control what cities they will run in, you can control where they will stand, you can even call them to you and that's not all, they are completely in your hands and you can twist them as you want. The bot video lasts 35 minutes and not everything is shown there, if everything was shown, the video could have lasted several hours. Also, the video quality is reduced so as not to take up much space.   You can check the rest yourself on the test server and we will fully show you everything that bots are capable of and you will be surprised)   Now about the price and a little about our work and what is included in this price. We do not sell only the build, we sell the source code in its entirety, so that you can adapt something for yourself. The price of the source code: 15,000 euros. What is included in this price: 1. We do not have a license, you buy it once and you can use it for the rest of your life. 2. There is no online limit and there is also no limit on running bots, the server can support as much online and bots as your VDS is powerful. 3. Client-side protection. You will not pay extra for protection, the source code already has everything. 4. All builds that we have created for projects that bought the source from us (they have ready-made servers, with their own ready-made concepts, configs, different alt+b designs, for different rates x1, x10, x20, x50, x100, x1200, x5000, there are also servers for classics and servers with add-ons, they all have configured bots for their servers) all this will be included in this price. You will receive all the builds of these projects. 5. Once a year we update and improve the source, we will also improve the bots, make different paths for them, different farming places, and revive them more and more, to get them you will have to pay 20 euros to get the updates. 6. You will receive all the bot settings from our first projects to the last, the video shows little, our last configured bots are almost indistinguishable from real players and you will see this yourself on the test server or later. (Our last setup and development of bots lasted 11 months and these works and what bots can do cannot be described in words, you yourself must see them to feel this work and power) 7. We will teach you how to control both the server and training on setting up and controlling bots. 8. We will provide you with VDS for 3 months and if necessary we will help you as much as we can until the first launch of your project! 9. Our bots move, they don't stand in one place, they walk around the cities and use a teleport, after the teleport they move on to the farming place in random places. They communicate in the chat and if you hit them, they can hit you back. They are in almost every city and farming location, near many key NPCs, instance zone managers, etc. They are automatically updated and move around the cities and farming zones. They attack those who have a flag and those who is pk. These are simply unique bots that can help you in terms of your online and your project in general! 10. As we said, our latest bot development lasted 11 months and we made 92 new farm zones for bots, more than 150,000 new paths for all locations, different methods of dressing their equipment, different methods of their behavior and more than 40,000 universal words in the chat, in different languages, where no one can even doubt that these are bots! Our contact information Telegramm: https://t.me/jg_uc Discord: j.g.u.c_dev
  • Topics

×
×
  • Create New...