Function at 0x437f20
Capabilities:
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x434
mov eax, dword [ecx + 0x3c]
test al, 0x10
mov dword [ebp - 0x10], ecx
je 0x4384a3
mov ebx, ecx
mov eax, dword [ecx + 0x24]
mov ecx, dword [ecx + 0x38]
cmp ecx, eax
jae 0x437f4b
mov dword [ebx + 0x38], eax
mov ecx, eax
mov edi, dword [ebx + 0x20]
sub ecx, edi
js 0x438482
cmp ecx, 0x7ffffff8
jae 0x438485
cmp ecx, 0xb
jae 0x437f78
lea esi, [ebp - 0x440]
mov byte [esi + 0xb], cl
test ecx, ecx
jne 0x437fa8
xor eax, eax
jmp 0x437fb7
mov ebx, ecx
or ebx, 7
inc ebx
push ebx
mov esi, ecx
call fcn.0045e423
mov ecx, esi
add esp, 4
mov esi, eax
mov dword [ebp - 0x440], eax
or ebx, 0x80000000
mov dword [ebp - 0x438], ebx
mov ebx, dword [ebp - 0x10]
mov dword [ebp - 0x43c], ecx
push ecx
push edi
push esi
mov edi, ecx
call fcn.00462360
mov eax, edi
add esp, 0xc
lea edi, [ebx + 8]
mov byte [esi + eax], 0
movzx eax, byte [ebp - 0x435]
test al, al
jns 0x437fcf
mov eax, dword [ebp - 0x43c]
mov dword [ebp - 0x30], eax
jns 0x437fe2
push dword [ebp - 0x440]
call fcn.0045e41e
add esp, 4
mov eax, dword [edi]
mov eax, dword [eax + 4]
mov esi, dword [edi + eax + 0x1c]
cmp esi, 0x4b9360
jne 0x438488
mov dword [ebp - 0x14], edi
mov eax, dword [0x4b9a0c]
cmp eax, 0xffffffff
jne 0x4384f8
mov eax, dword [0x4b9a10]
lea edx, [eax - 1]
mov ecx, dword [esi + 8]
mov edi, dword [esi + 0xc]
sub edi, ecx
sar edi, 2
cmp edi, edx
jbe 0x43847f
mov ebx, dword [ecx + eax*4 - 4]
test ebx, ebx
je 0x43847f
mov eax, dword [ebx]
mov edi, dword [eax + 0x1c]
mov ecx, edi
call dword [0x4b1788]
mov ecx, ebx
push 0xa
call edi
mov ebx, eax
cmp esi, 0x4b9360
jne 0x438567
movsx eax, bl
mov esi, dword [ebp - 0x14]
mov ecx, esi
push eax
call fcn.00417f50
mov ecx, esi
call fcn.0040c490
xor eax, eax
dec eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebx + 0x3c]
test al, 0x10
je 0x4384cf
mov eax, dword [ebx + 0x24]
mov ecx, dword [ebx + 0x38]
cmp ecx, eax
jae 0x43808e
mov dword [ebx + 0x38], eax
mov ecx, eax
mov esi, dword [ebx + 0x20]
sub ecx, esi
js 0x438491
cmp ecx, 0x7ffffff8
jae 0x438494
cmp ecx, 0xb
jae 0x4380b8
lea edi, [ebp - 0x20]
mov byte [edi + 0xb], cl
test ecx, ecx
jne 0x4380df
xor eax, eax
jmp 0x4380ee
mov ebx, ecx
or ebx, 7
inc ebx
push ebx
mov edi, ecx
call fcn.0045e423
mov ecx, edi
add esp, 4
mov edi, eax
mov dword [ebp - 0x20], eax
or ebx, 0x80000000
mov dword [ebp - 0x18], ebx
mov ebx, dword [ebp - 0x10]
mov dword [ebp - 0x1c], ecx
push ecx
push esi
push edi
mov esi, ecx
call fcn.00462360
mov eax, esi
add esp, 0xc
mov byte [edi + eax], 0
mov edx, dword [ebx + 0x90]
movzx ecx, byte [ebp - 0x15]
mov eax, ecx
test cl, cl
jns 0x438105
mov eax, dword [ebp - 0x1c]
mov esi, eax
sub esi, edx
mov dword [ebp - 0x14], esi
jb 0x438497
test cl, cl
js 0x43811b
lea esi, [ebp - 0x20]
jmp 0x43811e
mov esi, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x14]
cmp ecx, 0x7ffffff8
jae 0x43849a
cmp ecx, 0xb
jae 0x43813e
lea edi, [ebp - 0x2c]
mov byte [edi + 0xb], cl
cmp eax, edx
jne 0x438168
jmp 0x438178
mov ebx, ecx
or ebx, 7
inc ebx
push ebx
mov edi, edx
call fcn.0045e423
mov ecx, dword [ebp - 0x14]
mov edx, edi
add esp, 4
mov edi, eax
mov dword [ebp - 0x2c], eax
or ebx, 0x80000000
mov dword [ebp - 0x24], ebx
mov ebx, dword [ebp - 0x10]
mov dword [ebp - 0x28], ecx
add esi, edx
push ecx
push esi
push edi
call fcn.00462360
mov ecx, dword [ebp - 0x14]
add esp, 0xc
mov byte [edi + ecx], 0
mov eax, dword [ebx + 0x94]
mov ecx, dword [ebx + 0x98]
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], 0x56
mov al, byte [0x4b9a6a]
test al, al
jne 0x438414
cmp byte [ebp - 0x21], 0
jns 0x4381b3
push dword [ebp - 0x2c]
call fcn.0045e41e
add esp, 4
cmp dword [ebx + 4], 3
jne 0x4381c2
test byte [0x4b9bc0], 1
je 0x4381d6
mov eax, dword [0x4b701c]
test al, 2
je 0x438238
cmp byte [ebp - 0x15], 0
js 0x438229
lea eax, [ebp - 0x20]
jmp 0x43822c
mov byte [0x4b9bc0], 1
mov eax, dword [0x4b9bc8]
mov ecx, dword [0x4b80e0]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x438449
lea esi, [ebp - 0x440]
mov ecx, ebx
push esi
call fcn.00497600
cmp byte [esi + 0xb], 0
jns 0x438220
push dword [ebp - 0x440]
call fcn.0045e41e
add esp, 4
mov byte [0x4b9bc0], 0
jmp 0x4381c2
mov eax, dword [ebp - 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x4b701c]
test al, 4
jne 0x438249
test eax, 0xfffffffa
jne 0x438281
cmp dword [ebx + 4], 2
jl 0x438281
lea esi, [ebp - 0x20]
movzx ebx, byte [esi + 0xb]
test bl, bl
cmovs ebx, dword [esi + 4]
cmovs esi, dword [esi]
test ebx, ebx
je 0x438281
xor edi, edi
mov eax, ebx
sub eax, edi
lea ecx, [esi + edi]
push eax
push ecx
push 2
call fcn.00471f28
add esp, 0xc
test eax, eax
js 0x43827c
add edi, eax
cmp edi, ebx
jb 0x43825f
mov eax, dword [0x4b701c]
test al, 1
jne 0x4383d5
mov eax, dword [ebp - 0x10]
cmp dword [eax + 4], 3
jne 0x43832a
lea esi, [ebp - 0x440]
push 0x400
push 0xff
push esi
call fcn.004628e0
add esp, 0xc
cmp byte [ebp - 0x15], 0
js 0x4382ba
lea eax, [ebp - 0x20]
jmp 0x4382bd
mov eax, dword [ebp - 0x20]
xor ecx, ecx
mov dl, byte [eax + ecx]
mov byte [ebp + ecx - 0x440], dl
test dl, dl
je 0x4382da
inc ecx
cmp ecx, 0x400
jne 0x4382bf
mov byte [ebp - 0x41], 0
push esi
call fcn.00444920
add esp, 4
call fcn.004975b0
mov eax, dword [0x4b9bb4]
cmp eax, dword [0x4b9bb8]
je 0x43849d
call fcn.004975b0
mov eax, dword [0x4b9bb8]
test eax, eax
mov ecx, dword [0x4b9bb0]
cmove eax, ecx
lea edx, [eax - 1]
cmp ecx, edx
jb 0x4384a0
mov ecx, dword [0x4b9bac]
mov eax, dword [ecx + eax*4 - 4]
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x438346
cmp byte [ebp - 0x15], 0
jns 0x43833b
push dword [ebp - 0x20]
call fcn.0045e41e
add esp, 4
add esp, 0x434
pop esi
pop edi
pop ebx
pop ebp
ret
xor ecx, ecx
inc ecx
lock xadd dword [eax], ecx
test ecx, ecx
jle 0x43858d
cmp ecx, 0x7fffffff
mov edi, dword [ebp - 0x30]
je 0x438590
cmp byte [ebp - 0x15], 0
jns 0x43836f
mov ebx, dword [ebp - 0x20]
jmp 0x438372
lea ebx, [ebp - 0x20]
lea ecx, [ebx + edi]
mov dword [ebp - 0x14], ecx
push ecx
call fcn.004759e0
add esp, 4
mov esi, dword [ebp - 0x10]
mov ecx, dword [esi + 0x90]
sub edi, ecx
add ebx, ecx
mov edx, dword [esi + 0x94]
lea ecx, [ebp - 0x2c]
push eax
push dword [ebp - 0x14]
push edi
push ebx
push dword [esi + 0x98]
call fcn.004976b0
add esp, 0x14
lea eax, [ebp - 0x2c]
mov esi, dword [eax]
test esi, esi
je 0x43832a
lock dec dword [esi]
jne 0x43832a
mov ecx, dword [esi + 8]
call dword [0x4b1788]
push esi
call ecx
add esp, 4
jmp 0x43832a
call fcn.00497350
test al, al
je 0x438289
lea ecx, [ebp - 0x440]
lea eax, [ebp - 0x20]
movzx edx, byte [eax + 0xb]
test dl, dl
cmovs edx, dword [eax + 4]
mov dword [ecx], 0xffffffff
cmovs eax, dword [eax]
push 0
push ecx
push edx
push eax
push dword [0x4b9ba4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x438289
movzx ecx, al
lea eax, [ebp - 0x38]
lea esi, [ebp - 0x440]
mov dword [esi], eax
lea eax, [ebp - 0x3c]
mov dword [esi + 4], eax
lea eax, [ebp - 0x2c]
mov dword [esi + 8], eax
lea eax, [ebp - 0x40]
mov dword [eax], str.LogMessage
lea edx, [ebp - 0x34]
push esi
push eax
call fcn.00497810
add esp, 8
jmp 0x4381a2
push 0x4b9bc8
call fcn.0045e453
add esp, 4
cmp dword [0x4b9bc8], 0xffffffff
jne 0x4381fe
mov dword [0x4b9bc4], 0
push 0x4b9bc8
call fcn.0045e4a2
add esp, 4
jmp 0x4381fe
int3
int3
int3
lock inc dword [esi + 4]
jmp 0x437ff7
int3
int3
int3
int3
int3
int3
test al, 8
jne 0x4384bb
lea esi, [ebp - 0x440]
mov byte [esi + 0xb], 0
xor eax, eax
mov ebx, dword [ebp - 0x10]
jmp 0x437fb7
mov ebx, dword [ebp - 0x10]
mov edi, dword [ebx + 0x14]
mov ecx, dword [ebx + 0x1c]
sub ecx, edi
jns 0x437f56
int3
test al, 8
jne 0x4384e4
lea edi, [ebp - 0x20]
mov byte [edi + 0xb], 0
xor eax, eax
mov ebx, dword [ebp - 0x10]
jmp 0x4380ee
mov ebx, dword [ebp - 0x10]
mov esi, dword [ebx + 0x14]
mov ecx, dword [ebx + 0x1c]
sub ecx, esi
jns 0x438099
int3
push 0x4b8e98
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov eax, dword [0x4b9a0c]
cmp eax, 1
je 0x4385a3
mov eax, dword [0x4b9a0c]
test eax, eax
jne 0x438593
mov dword [0x4b9a0c], 1
mov edi, 0x4b8e98
mov ebx, dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push edi
call ebx
xor eax, eax
inc eax
lock xadd dword [0x4b940c], eax
inc eax
mov dword [0x4b9a10], eax
push edi
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov dword [0x4b9a0c], 0xffffffff
push edi
call ebx
push 0x4b8e9c
call dword [sym.imp.KERNEL32.dll_WakeAllConditionVariable]
jmp 0x438008
xor eax, eax
dec eax
lock xadd dword [esi + 4], eax
test eax, eax
jne 0x438050
mov eax, dword [esi]
mov edi, dword [eax + 4]
mov ecx, edi
call dword [0x4b1788]
mov ecx, esi
call edi
jmp 0x438050
int3
int3
push 0x4b8e98
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x438008
mov edi, dword [sym.imp.KERNEL32.dll_SleepConditionVariableSRW]
push 0
push 0xffffffffffffffff
push 0x4b8e98
push 0x4b8e9c
call edi
mov eax, dword [0x4b9a0c]
cmp eax, 1
jne 0x438511
jmp 0x4385a9