Skip to content

Commit

Permalink
link with strlwr, chdir, wcsnicmp, fileno, flength, wcsicmp, wcsdup
Browse files Browse the repository at this point in the history
  • Loading branch information
bwrsandman committed Feb 23, 2025
1 parent 202cbbe commit 926ed6c
Show file tree
Hide file tree
Showing 39 changed files with 393 additions and 882 deletions.
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ endfunction()
add_library(runblack-reassembled-libcmt OBJECT IMPORTED)

set(LIBCMT_PATCHED_OBJECTS)
add_patched_libcmt_object("build\\intel\\mt_obj\\wcsdup.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\wcsicmp.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\flength.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\fileno.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\wcsnicmp.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\chdir.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\strlwr.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\getpid.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\ehvecdtr.obj" ON)
add_patched_libcmt_object("build\\intel\\mt_obj\\strspn.obj" OFF)
Expand Down
10 changes: 10 additions & 0 deletions src/asm/unprocessed/data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
.globl __mbcasemap
.globl __mbctype
.globl ___mblcid
.globl ___setlc_active
.globl ___unguarded_readlc_active
.globl ___lc_handle
.globl __except_list
.globl __NLG_Destination
.globl _start_tics
.globl ___pioinfo
.globl __nhandle

data_bytes:
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // [0x0] 0x009c6000 + 0x0 = 0x009c6000
Expand Down Expand Up @@ -161559,8 +161564,13 @@ __NLG_Destination:

// Virtual (non-allocated at build time)
.set __except_list, 0x00000000
.set ___lc_handle, 0x00e84298
.set _start_tics, 0x00fac880
.set ___pioinfo, 0x00fac960
.set __nhandle, 0x00faca60
.set ___mbcodepage, 0x00faca64
.set __mbcasemap, 0x00faca80
.set __mbctype, 0x00facb80
.set ___mblcid, 0x00facc84
.set ___setlc_active, 0x00fadcc4
.set ___unguarded_readlc_active, 0x00fadcc8
12 changes: 6 additions & 6 deletions src/asm/unprocessed/rdata.000.008a9000-008a99a8.dllimports.asm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
.globl __imp__EnterCriticalSection@4
.globl __imp__LeaveCriticalSection@4
.globl __imp__SetCurrentDirectoryA@4
.globl __imp__GetCurrentDirectoryA@4
.globl __imp__GetCurrentDirectoryA@8
.globl __imp__RemoveDirectoryA@4
.globl __imp__FindFirstFileA@4
.globl __imp__FindNextFileA@4
Expand All @@ -104,7 +104,7 @@
.globl __imp__SetStdHandle@4
.globl __imp__TlsGetValue@4
.globl __imp__GetCurrentThread@4
.globl __imp__SetEnvironmentVariableA@4
.globl __imp__SetEnvironmentVariableA@8
.globl __imp__GlobalMemoryStatus@4
.globl __imp__GetVersionExA@4
.globl __imp__GetFileAttributesA@4
Expand All @@ -122,7 +122,7 @@
.globl __imp__GetLocalTime@4
.globl __imp__GetSystemTime@4
.globl __imp__GetTimeZoneInformation@4
.globl __imp__GetLastError@4
.globl __imp__GetLastError@0
.globl __imp__HeapFree@4
.globl __imp__HeapAlloc@4
.globl __imp__IsBadReadPtr@4
Expand Down Expand Up @@ -702,7 +702,7 @@ rdata_bytes:
.long 0x005c03a0 /* KERNEL32.DLL::EnterCriticalSection */ ; .set __imp__EnterCriticalSection@4, 0x008a9180
.long 0x005c0388 /* KERNEL32.DLL::LeaveCriticalSection */ ; .set __imp__LeaveCriticalSection@4, 0x008a9184
.long 0x005c0370 /* KERNEL32.DLL::SetCurrentDirectoryA */ ; .set __imp__SetCurrentDirectoryA@4, 0x008a9188
.long 0x005c0358 /* KERNEL32.DLL::GetCurrentDirectoryA */ ; .set __imp__GetCurrentDirectoryA@4, 0x008a918c
.long 0x005c0358 /* KERNEL32.DLL::GetCurrentDirectoryA */ ; .set __imp__GetCurrentDirectoryA@8, 0x008a918c
.long 0x005c0344 /* KERNEL32.DLL::RemoveDirectoryA */ ; .set __imp__RemoveDirectoryA@4, 0x008a9190
.long 0x005c0332 /* KERNEL32.DLL::FindFirstFileA */ ; .set __imp__FindFirstFileA@4, 0x008a9194
.long 0x005c0322 /* KERNEL32.DLL::FindNextFileA */ ; .set __imp__FindNextFileA@4, 0x008a9198
Expand All @@ -712,7 +712,7 @@ rdata_bytes:
.long 0x005c4b60 /* KERNEL32.DLL::SetStdHandle */ ; .set __imp__SetStdHandle@4, 0x008a91a8
.long 0x005c498e /* KERNEL32.DLL::TlsGetValue */ ; .set __imp__TlsGetValue@4, 0x008a91ac
.long 0x005c499c /* KERNEL32.DLL::GetCurrentThread */ ; .set __imp__GetCurrentThread@4, 0x008a91b0
.long 0x005c4b46 /* KERNEL32.DLL::SetEnvironmentVariableA */ ; .set __imp__SetEnvironmentVariableA@4, 0x008a91b4
.long 0x005c4b46 /* KERNEL32.DLL::SetEnvironmentVariableA */ ; .set __imp__SetEnvironmentVariableA@8, 0x008a91b4
.long 0x005c028a /* KERNEL32.DLL::GlobalMemoryStatus */ ; .set __imp__GlobalMemoryStatus@4, 0x008a91b8
.long 0x005c027a /* KERNEL32.DLL::GetVersionExA */ ; .set __imp__GetVersionExA@4, 0x008a91bc
.long 0x005c0264 /* KERNEL32.DLL::GetFileAttributesA */ ; .set __imp__GetFileAttributesA@4, 0x008a91c0
Expand All @@ -730,7 +730,7 @@ rdata_bytes:
.long 0x005c479a /* KERNEL32.DLL::GetLocalTime */ ; .set __imp__GetLocalTime@4, 0x008a91f0
.long 0x005c478a /* KERNEL32.DLL::GetSystemTime */ ; .set __imp__GetSystemTime@4, 0x008a91f4
.long 0x005c4770 /* KERNEL32.DLL::GetTimeZoneInformation */ ; .set __imp__GetTimeZoneInformation@4, 0x008a91f8
.long 0x005c4760 /* KERNEL32.DLL::GetLastError */ ; .set __imp__GetLastError@4, 0x008a91fc
.long 0x005c4760 /* KERNEL32.DLL::GetLastError */ ; .set __imp__GetLastError@0, 0x008a91fc
.long 0x005c4754 /* KERNEL32.DLL::HeapFree */ ; .set __imp__HeapFree@4, 0x008a9200
.long 0x005c4748 /* KERNEL32.DLL::HeapAlloc */ ; .set __imp__HeapAlloc@4, 0x008a9204
.long 0x005c4738 /* KERNEL32.DLL::IsBadReadPtr */ ; .set __imp__IsBadReadPtr@4, 0x008a9208
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
.extern _jmp_addr_0x007c5e51
.extern _operator_new
.extern _jmp_addr_0x007c6587
.extern _jmp_addr_0x007c664c
.extern _malloc
.extern _free
.extern _jmp_addr_0x007c686f
.extern _jmp_addr_0x007c68ed
Expand Down Expand Up @@ -304,7 +304,7 @@ _jmp_addr_0x00426f0b: {disp8} mov edx, dword ptr [esp + 0x10]
call dword ptr [rdata_bytes + 0x760] // 0x00426f28 ff1560978a00
shl eax, 2 // 0x00426f2e c1e002
push eax // 0x00426f31 50
call _jmp_addr_0x007c664c // 0x00426f32 e815f73900
call _malloc // 0x00426f32 e815f73900
add esp, 0x04 // 0x00426f37 83c404
mov.s ecx, ebp // 0x00426f3a 8bcd
{disp8} mov dword ptr [ebp + 0x18], eax // 0x00426f3c 894518
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
.extern _jmp_addr_0x007c6425
.extern _operator_new
.extern _jmp_addr_0x007c6587
.extern _jmp_addr_0x007c664c
.extern _malloc
.extern _jmp_addr_0x007c6bd1
.extern _jmp_addr_0x007c6c29
.extern _jmp_addr_0x007c6c34
Expand Down Expand Up @@ -439,7 +439,7 @@ _jmp_addr_0x0042af55: push esi
lea edx, dword ptr [eax + eax * 0x2] // 0x0042afb3 8d1440
shl edx, 3 // 0x0042afb6 c1e203
push edx // 0x0042afb9 52
call _jmp_addr_0x007c664c // 0x0042afba e88db63900
call _malloc // 0x0042afba e88db63900
mov.s edi, eax // 0x0042afbf 8bf8
{disp8} mov eax, dword ptr [esp + 0x18] // 0x0042afc1 8b442418
{disp8} mov dword ptr [esp + 0x20], eax // 0x0042afc5 89442420
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
.extern _jmp_addr_0x007c57d2
.extern _jmp_addr_0x007c5a19
.extern _operator_new
.extern _jmp_addr_0x007c664c
.extern _malloc
.extern _free
.extern _fprintf__10LHFilePath
.extern _jmp_addr_0x007c7e13
Expand Down Expand Up @@ -1680,7 +1680,7 @@ _jmp_addr_0x0050f7b0: sub esp, 0x00000100
mov edi, 0x00cc5ee8 // 0x0050f7b8 bfe85ecc00
mov esi, 0x00be8414 // 0x0050f7bd be1484be00
_jmp_addr_0x0050f7c2: push 0x6c // 0x0050f7c2 6a6c
call _jmp_addr_0x007c664c // 0x0050f7c4 e8836e2b00
call _malloc // 0x0050f7c4 e8836e2b00
add esp, 0x04 // 0x0050f7c9 83c404
push esi // 0x0050f7cc 56
mov dword ptr [edi], eax // 0x0050f7cd 8907
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
.extern _jmp_addr_0x00870920
.extern _jmp_addr_0x00870990
.extern __filelength
.extern _jmp_addr_0x008a5ca3
.extern __fileno

.globl _jmp_addr_0x00548990

Expand Down Expand Up @@ -313,7 +313,7 @@ _jmp_addr_0x005482e0: sub esp, 0x44
add esp, 0x44 // 0x00548358 83c444
ret 0x000c // 0x0054835b c20c00
_jmp_addr_0x0054835e: push edi // 0x0054835e 57
call _jmp_addr_0x008a5ca3 // 0x0054835f e83fd93500
call __fileno // 0x0054835f e83fd93500
push eax // 0x00548364 50
call __filelength // 0x00548365 e8afd83500
push edi // 0x0054836a 57
Expand Down
Loading

0 comments on commit 926ed6c

Please sign in to comment.