Function at 0x403dd0
Capabilities:
Link many functions at runtime
Print debug messages

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x30
mov eax, dword [0x5a8564]
xor eax, ebp
mov dword [esp + 0x28], eax
cmp dword [0x5a979c], 0
je 0x403df8
mov ecx, dword [0x5a9798]
jmp 0x403e20
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.SleepConditionVariableSRW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [0x5a9798], eax
mov dword [0x5a979c], 1
mov ebx, dword [ebp + 8]
test ecx, ecx
je 0x403e41
mov esi, dword [ebp + 0x10]
call dword [section..00cfg]
push dword [ebp + 0x14]
push esi
push dword [ebp + 0xc]
push ebx
call ecx
mov esi, eax
jmp 0x404220
lock inc dword [0x5a97a0]
mov esi, dword [0x5a97a0]
xor edi, edi
mov dword [esp + 0x10], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x14], esi
cmp dword [ebx], 2
jne 0x403e7c
push str.lockAndGetRealAddr_fail_1_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
shl esi, 5
or esi, 2
mov edi, dword [ebx]
and edi, 0xfffffff0
cmp esi, edi
jne 0x403ea4
push str.lockAndGetRealAddr_fail_2_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, edi
lock cmpxchg dword [ebx], esi
cmp dword [ebx], esi
je 0x403eb2
pause
jmp 0x403e8a
mov esi, eax
and esi, 0xfffffff0
cmp esi, eax
mov edi, dword [ebp + 0xc]
je 0x403ecf
push str.lockAndGetRealAddr_fail_3_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, 3
xchg dword [ebx], eax
test esi, esi
je 0x403f21
cmp dword [ebx], 3
je 0x403ef0
push str.internalSleep_fail__lock_var_is_error_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, dword [esi + 0xc]
test eax, eax
je 0x403f17
cmp dword [eax + 8], esi
je 0x403f10
push str.internalSleep_fail__lastPtr__nextPtr___ptr
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, dword [esi + 0xc]
lea ecx, [esp + 0x10]
mov dword [eax + 8], ecx
lea eax, [esp + 0x10]
mov dword [esi + 0xc], eax
mov dword [eax + 8], esi
lea eax, [esp + 0x10]
xchg dword [ebx], eax
mov eax, dword [ebp + 0x14]
test al, 1
je 0x403f6b
cmp dword [0x5a97b0], 0
je 0x403f3f
mov ecx, dword [0x5a97ac]
jmp 0x403f67
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.ReleaseSRWLockShared
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [0x5a97ac], eax
mov dword [0x5a97b0], 1
test ecx, ecx
jne 0x403fa8
cmp dword [0x5a97a8], 0
je 0x403f7c
mov ecx, dword [0x5a97a4]
jmp 0x403fa4
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x560f2f
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [0x5a97a4], eax
mov dword [0x5a97a8], 1
test ecx, ecx
je 0x403fb3
call dword [section..00cfg]
push edi
call ecx
jmp 0x403fb7
xor eax, eax
xchg dword [edi], eax
cmp dword [esp + 0x10], 0
jne 0x403fcf
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 5
call esi
cmp dword [esp + 0x10], 0
je 0x403fc4
mov eax, dword [ebp + 0x14]
test al, 1
jne 0x403ff9
mov esi, 2
xor eax, eax
lock cmpxchg dword [0x5a978c], esi
je 0x40400a
cmp eax, 2
je 0x403fdb
cmp eax, 1
je 0x40402f
call dword [sym.imp.KERNEL32.dll_DebugBreak]
jmp 0x403fdb
cmp dword [0x5a9794], 0
je 0x40404e
mov ecx, dword [0x5a9790]
jmp 0x404076
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x560df3
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x5a9788], eax
xor eax, eax
inc eax
xchg dword [0x5a978c], eax
mov ecx, dword [0x5a9788]
test ecx, ecx
jne 0x4040bf
cmp dword [0x5a9794], 0
je 0x40408f
mov ecx, dword [0x5a9790]
jmp 0x4040b7
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.AcquireSRWLockShared
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [0x5a9790], eax
mov dword [0x5a9794], 1
test ecx, ecx
jne 0x4040bf
xor esi, esi
inc esi
xor eax, eax
lock cmpxchg dword [edi], esi
je 0x4040c8
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40407d
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push str.AcquireSRWLockShared
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, eax
mov dword [0x5a9790], eax
mov dword [0x5a9794], 1
test ecx, ecx
je 0x404235
call dword [section..00cfg]
push edi
call ecx
cmp dword [ebx], 2
jne 0x4040de
push str.lockAndGetRealAddr_fail_1_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov esi, eax
shl esi, 5
or esi, 2
mov edi, dword [ebx]
and edi, 0xfffffff0
cmp esi, edi
jne 0x404106
push str.lockAndGetRealAddr_fail_2_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, edi
lock cmpxchg dword [ebx], esi
cmp dword [ebx], esi
je 0x404114
pause
jmp 0x4040ec
mov esi, eax
and esi, 0xfffffff0
cmp esi, eax
lea edi, [esp + 0x10]
je 0x404132
push str.lockAndGetRealAddr_fail_3_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov eax, 3
xchg dword [ebx], eax
test esi, esi
je 0x404142
cmp dword [ebx], 3
je 0x404153
push str.internalSleep_fail_3_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov dword [esp + 0xc], esi
cmp edi, esi
jne 0x404177
mov eax, dword [esp + 0x18]
mov dword [esp + 0xc], eax
test eax, eax
jne 0x404177
mov eax, dword [esp + 0x1c]
mov dword [esp + 0xc], eax
test eax, eax
je 0x40424e
test esi, esi
je 0x4041b1
mov eax, esi
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x40417b
jmp 0x40418d
mov eax, dword [eax + 8]
test eax, eax
je 0x4041b1
cmp eax, edi
jne 0x404186
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4041a0
mov ecx, dword [esp + 0x18]
mov dword [eax + 8], ecx
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4041c2
mov ecx, dword [esp + 0x1c]
mov dword [eax + 0xc], ecx
jmp 0x4041c2
push str.removeCondVarEntryFromList_not_found
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
cmp dword [esp + 0x10], 1
je 0x4041da
push str.internalSleep_fail_4_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
test byte [esp + 0xc], 0xf
je 0x4041f2
push str.internalSleep__newHead_is_not_align_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_DebugBreak]
cmp dword [esp + 0xc], 0
je 0x404217
mov eax, dword [esp + 0xc]
mov esi, eax
mov eax, dword [eax + 0xc]
test eax, eax
jne 0x4041fd
cmp esi, edi
jne 0x404210
call dword [sym.imp.KERNEL32.dll_DebugBreak]
mov esi, dword [esi + 8]
test esi, esi
jne 0x404206
mov eax, dword [esp + 0xc]
xchg dword [ebx], eax
xor esi, esi
inc esi
mov ecx, dword [esp + 0x28]
xor ecx, ebp
call fcn.005327f1
mov eax, esi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
xor esi, esi
inc esi
xor eax, eax
lock cmpxchg dword [edi], esi
je 0x4040c8
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x404238
mov dword [esp + 0xc], 0
jmp 0x4041c2