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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x50
mov esi, ecx
mov eax, dword [0x808040]
xor eax, ebp
mov dword [ebp - 0x10], eax
xor eax, eax
dec eax
lea ecx, [ebp - 0x34]
mov dword [ecx], eax
mov dword [ecx + 4], eax
call fcn.005766b0
mov eax, dword [esi + 0x3c]
test al, 0x10
mov dword [ebp - 0x50], esi
je 0x4bad11
mov eax, dword [esi + 0x24]
mov ebx, dword [esi + 0x38]
cmp ebx, eax
jae 0x4ba9b2
mov dword [esi + 0x38], eax
mov ebx, eax
mov esi, dword [esi + 0x20]
sub ebx, esi
js 0x4badef
cmp ebx, 0x7ffffff8
jae 0x4baccf
cmp ebx, 0xa
jbe 0x4bab2f
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.005c5789
add esp, 4
mov dword [ebp - 0x1c], eax
or edi, 0x80000000
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x18], ebx
lea edi, [eax + ebx]
cmp eax, esi
ja 0x4ba9ff
cmp edi, esi
ja 0x4badef
test ebx, ebx
je 0x4baa0e
push ebx
push esi
push eax
call fcn.005c9580
add esp, 0xc
mov esi, dword [ebp - 0x50]
lea ebx, [esi + 8]
mov byte [edi], 0
movsx eax, byte [ebp - 0x11]
test eax, eax
jns 0x4baa22
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x5c], eax
jns 0x4baa32
push dword [ebp - 0x1c]
call fcn.005c57c0
add esp, 4
mov eax, dword [esi + 8]
mov ecx, dword [eax + 4]
add ecx, ebx
lea esi, [ebp - 0x1c]
push esi
call fcn.00545300
mov ecx, esi
push 0x80eb10
call fcn.00548e10
mov edi, eax
mov eax, dword [eax]
mov esi, dword [eax + 0x1c]
mov ecx, esi
call dword [0x8010bc]
mov ecx, edi
push 0xa
call esi
mov esi, dword [ebp - 0x50]
mov edi, ebx
mov ebx, eax
lea ecx, [ebp - 0x1c]
call fcn.00545490
movsx eax, bl
mov ecx, edi
push eax
call fcn.00411ba0
mov ecx, edi
call fcn.00410a40
xor eax, eax
dec eax
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov eax, dword [esi + 0x3c]
test al, 0x10
je 0x4bad2e
mov eax, dword [esi + 0x24]
mov ebx, dword [esi + 0x38]
cmp ebx, eax
jae 0x4baaab
mov dword [esi + 0x38], eax
mov ebx, eax
mov esi, dword [esi + 0x20]
sub ebx, esi
js 0x4badef
cmp ebx, 0x7ffffff8
jae 0x4bacd7
cmp ebx, 0xa
jbe 0x4bab3a
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.005c5789
add esp, 4
mov dword [ebp - 0x40], eax
or edi, 0x80000000
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
lea edi, [eax + ebx]
cmp eax, esi
ja 0x4baaf4
cmp edi, esi
ja 0x4badef
test ebx, ebx
je 0x4bab03
push ebx
push esi
push eax
call fcn.005c9580
add esp, 0xc
mov byte [edi], 0
mov eax, dword [ebp - 0x50]
mov ecx, dword [eax + 0x94]
movsx eax, byte [ebp - 0x35]
mov edx, eax
test eax, eax
jns 0x4bab1c
mov edx, dword [ebp - 0x3c]
mov ebx, edx
sub ebx, ecx
jb 0x4bacdf
test al, al
js 0x4bab6e
lea edi, [ebp - 0x40]
jmp 0x4bab71
lea eax, [ebp - 0x1c]
mov byte [eax + 0xb], bl
jmp 0x4ba9f0
lea eax, [ebp - 0x40]
mov byte [eax + 0xb], bl
jmp 0x4baae5
mov esi, ebx
or esi, 7
inc esi
push esi
mov dword [ebp - 0x54], ecx
mov dword [ebp - 0x58], edx
call fcn.005c5789
mov edx, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x54]
add esp, 4
mov dword [ebp - 0x4c], eax
or esi, 0x80000000
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x48], ebx
jmp 0x4bab8a
mov edi, dword [ebp - 0x40]
cmp ebx, 0x7ffffff8
jae 0x4bace7
add edi, ecx
cmp ebx, 0xa
ja 0x4bab42
lea eax, [ebp - 0x4c]
mov byte [eax + 0xb], bl
lea esi, [eax + ebx]
cmp eax, edi
ja 0x4bab99
cmp esi, edi
ja 0x4badef
cmp edx, ecx
je 0x4baba8
push ebx
push edi
push eax
call fcn.005c9580
add esp, 0xc
mov byte [esi], 0
mov esi, dword [ebp - 0x50]
mov eax, dword [esi + 0x98]
mov ecx, dword [esi + 0x9c]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], 0x57
mov eax, dword [0x788e74]
mov al, byte [eax + 0x57]
test al, al
jne 0x4bae2e
cmp byte [ebp - 0x41], 0
jns 0x4babe8
push dword [ebp - 0x4c]
call fcn.005c57c0
add esp, 4
cmp dword [esi + 4], 3
je 0x4bad5e
mov ecx, dword [0x80f4bc]
test ecx, ecx
je 0x4bac33
mov eax, dword [esi + 4]
mov dword [ebp - 0x54], eax
mov edi, dword [esi + 0x94]
mov ebx, dword [esi + 0x9c]
mov eax, dword [ebp - 0x50]
mov esi, dword [eax + 0x98]
call dword [0x8010bc]
lea eax, [ebp - 0x40]
push eax
push edi
push ebx
push esi
mov esi, dword [ebp - 0x50]
push dword [ebp - 0x54]
call ecx
add esp, 0x14
test al, al
jne 0x4bac9a
mov eax, dword [0x80a5bc]
test al, 2
jne 0x4bacef
test al, 4
jne 0x4bac51
test eax, 0xfffffffa
jne 0x4bac8f
cmp dword [esi + 4], 2
jl 0x4bac8f
lea esi, [ebp - 0x40]
movsx edi, byte [esi + 0xb]
test edi, edi
cmovs edi, dword [esi + 4]
cmovs esi, dword [esi]
test edi, edi
je 0x4bac8f
xor ebx, ebx
mov eax, edi
sub eax, ebx
lea ecx, [esi + ebx]
push eax
push ecx
push 2
call fcn.005de576
add esp, 0xc
test eax, eax
setns cl
add ebx, eax
cmp ebx, edi
setb al
test cl, al
jne 0x4bac67
mov eax, dword [0x80a5bc]
test al, 1
mov esi, dword [ebp - 0x50]
jne 0x4badf1
cmp dword [esi + 4], 3
je 0x4bad4b
cmp byte [ebp - 0x35], 0
jns 0x4bacb5
push dword [ebp - 0x40]
call fcn.005c57c0
add esp, 4
lea ecx, [ebp - 0x34]
call fcn.005766e0
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005c6b46
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret
lea ecx, [ebp - 0x1c]
call fcn.005fb080
lea ecx, [ebp - 0x40]
call fcn.005fb080
lea ecx, [ebp - 0x4c]
call fcn.005fb1a0
lea ecx, [ebp - 0x4c]
call fcn.005fb080
cmp byte [ebp - 0x35], 0
js 0x4bacfa
lea eax, [ebp - 0x40]
jmp 0x4bacfd
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x80a5bc]
mov esi, dword [ebp - 0x50]
jmp 0x4bac40
xor ebx, ebx
mov esi, 0
test al, 8
je 0x4bab2f
mov eax, dword [ebp - 0x50]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x4ba9b5
xor esi, esi
mov ebx, 0
test al, 8
je 0x4bab3a
mov eax, dword [ebp - 0x50]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x4baaae
lea eax, [ebp - 0x40]
mov ecx, esi
push eax
push dword [ebp - 0x5c]
call fcn.00642cc0
jmp 0x4baca4
mov bl, byte [0x80f4e0]
test bl, bl
jne 0x4babf2
mov byte [0x80f4e0], 1
mov eax, dword [0x80f4e8]
mov ecx, dword [0x80d580]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x4bae61
mov ecx, dword [ebp - 0x50]
lea esi, [ebp - 0x1c]
push esi
call fcn.00642c10
movsx eax, byte [ebp - 0x11]
mov ecx, esi
test eax, eax
jns 0x4badb0
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
test eax, eax
js 0x4badef
sete dl
test ecx, ecx
setne dh
or dh, dl
je 0x4badef
push eax
push ecx
push dword [0x80f4e4]
call fcn.004d6ec0
add esp, 0xc
cmp byte [ebp - 0x11], 0
jns 0x4bade1
push dword [ebp - 0x1c]
call fcn.005c57c0
add esp, 4
mov byte [0x80f4e0], bl
mov esi, dword [ebp - 0x50]
jmp 0x4babf2
ud2
call fcn.00642920
test al, al
je 0x4bac9a
lea eax, [ebp - 0x40]
movsx ecx, byte [eax + 0xb]
test ecx, ecx
cmovs ecx, dword [eax + 4]
mov dword [ebp - 0x1c], 0xffffffff
cmovs eax, dword [eax]
push 0
lea edx, [ebp - 0x1c]
push edx
push ecx
push eax
push dword [0x80f4b0]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4bac9a
movzx ecx, al
lea eax, [ebp - 0x28]
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x20]
mov dword [eax], str.LogMessage
lea edx, [ebp - 0x2c]
lea edi, [ebp - 0x1c]
push edi
push eax
call fcn.006430b0
add esp, 8
jmp 0x4babd7
push 0x80f4e8
call fcn.005c580d
add esp, 4
cmp dword [0x80f4e8], 0xffffffff
jne 0x4bad94
push 0x400
push str.LOG_FATAL
call fcn.004d6ea0
add esp, 8
mov dword [0x80f4e4], eax
push 0x80f4e8
call fcn.005c5887
add esp, 4
jmp 0x4bad94