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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x4c
mov esi, ecx
mov eax, dword [0x742040]
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.00502fa0
mov eax, dword [esi + 0x3c]
test al, 0x10
mov dword [ebp - 0x50], esi
je 0x495442
mov eax, dword [esi + 0x24]
mov ebx, dword [esi + 0x38]
cmp ebx, eax
jae 0x495142
mov dword [esi + 0x38], eax
mov ebx, eax
mov esi, dword [esi + 0x20]
sub ebx, esi
js 0x495403
cmp ebx, 0x7ffffff8
jae 0x495412
cmp ebx, 0xa
ja 0x495395
lea eax, [ebp - 0x1c]
mov byte [eax + 0xb], bl
lea edi, [eax + ebx]
cmp eax, esi
ja 0x495177
cmp edi, esi
ja 0x4953fc
test ebx, ebx
je 0x495186
push ebx
push esi
push eax
call fcn.00543ce0
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 0x49519a
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x54], eax
jns 0x4951aa
push dword [ebp - 0x1c]
call fcn.00540380
add esp, 4
mov eax, dword [esi + 8]
mov ecx, dword [eax + 4]
add ecx, ebx
lea esi, [ebp - 0x1c]
push esi
call fcn.004e0ff0
mov ecx, esi
push 0x7482b0
call fcn.004e2490
mov edi, eax
mov eax, dword [eax]
mov esi, dword [eax + 0x1c]
mov ecx, esi
call dword [0x73c768]
mov ecx, edi
push 0xa
call esi
mov esi, dword [ebp - 0x50]
mov edi, ebx
mov ebx, eax
lea ecx, [ebp - 0x1c]
call fcn.004e1180
movsx eax, bl
mov ecx, edi
push eax
call fcn.00412c80
mov ecx, edi
call fcn.00411690
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 0x49545f
mov eax, dword [esi + 0x24]
mov ebx, dword [esi + 0x38]
cmp ebx, eax
jae 0x495223
mov dword [esi + 0x38], eax
mov ebx, eax
mov esi, dword [esi + 0x20]
sub ebx, esi
js 0x495403
cmp ebx, 0x7ffffff8
jae 0x49541a
cmp ebx, 0xa
ja 0x495372
lea eax, [ebp - 0x40]
mov byte [eax + 0xb], bl
lea edi, [eax + ebx]
cmp eax, esi
ja 0x495258
cmp edi, esi
ja 0x4953fc
test ebx, ebx
je 0x495267
push ebx
push esi
push eax
call fcn.00543ce0
add esp, 0xc
mov byte [edi], 0
lea edx, [ebp - 0x40]
lea ebx, [ebp - 0x4c]
mov ecx, ebx
lea eax, [ebp - 0x1c]
push eax
push 0xffffffffffffffff
mov esi, dword [ebp - 0x50]
push dword [esi + 0x90]
push edx
call fcn.004e3090
mov eax, dword [esi + 0x94]
mov ecx, dword [esi + 0x98]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], 0x57
mov eax, dword [0x6cf494]
mov al, byte [eax + 0x57]
test al, al
jne 0x4954cc
cmp byte [ebp - 0x41], 0
jns 0x4952c1
push dword [ebp - 0x4c]
call fcn.00540380
add esp, 4
cmp dword [esi + 4], 3
je 0x4954fc
mov ecx, dword [0x748bb8]
test ecx, ecx
je 0x49530f
mov eax, dword [esi + 4]
mov dword [ebp - 0x58], eax
mov ebx, dword [esi + 0x90]
mov eax, dword [ebp - 0x50]
mov esi, dword [eax + 0x98]
mov eax, dword [ebp - 0x50]
mov edi, dword [eax + 0x94]
call dword [0x73c768]
lea eax, [ebp - 0x40]
push eax
push ebx
push esi
mov esi, dword [ebp - 0x50]
push edi
push dword [ebp - 0x58]
call ecx
add esp, 0x14
test al, al
jne 0x49533d
mov eax, dword [0x7441b4]
test al, 2
jne 0x495422
test al, 4
jne 0x4953b8
test eax, 0xfffffffa
jne 0x495335
cmp dword [esi + 4], 2
jge 0x4953b8
test al, 1
jne 0x49548f
cmp dword [esi + 4], 3
je 0x49547c
cmp byte [ebp - 0x35], 0
jns 0x495358
push dword [ebp - 0x40]
call fcn.00540380
add esp, 4
lea ecx, [ebp - 0x34]
call fcn.00502fd0
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005412b6
add esp, 0x4c
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.00540349
add esp, 4
mov dword [ebp - 0x40], eax
or edi, 0x80000000
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
jmp 0x495249
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.00540349
add esp, 4
mov dword [ebp - 0x1c], eax
or edi, 0x80000000
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x18], ebx
jmp 0x495168
lea ecx, [ebp - 0x40]
movsx ebx, byte [ecx + 0xb]
test ebx, ebx
cmovs ebx, dword [ecx + 4]
cmovs ecx, dword [ecx]
mov dword [ebp - 0x50], ecx
test ebx, ebx
je 0x495335
xor edi, edi
mov eax, ebx
sub eax, edi
mov ecx, dword [ebp - 0x50]
add ecx, edi
push eax
push ecx
push 2
call fcn.00557beb
add esp, 0xc
test eax, eax
jns 0x495589
mov eax, dword [0x7441b4]
jmp 0x495335
push 0x6bd32f
jmp 0x495408
push 0x6c5fd0
push 0x6bd0bf
call fcn.0057cbd0
lea ecx, [ebp - 0x1c]
call fcn.00573f90
lea ecx, [ebp - 0x40]
call fcn.00573f90
cmp byte [ebp - 0x35], 0
lea eax, [ebp - 0x40]
jns 0x49542e
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x7441b4]
mov esi, dword [ebp - 0x50]
jmp 0x49531c
xor ebx, ebx
mov esi, 0
test al, 8
je 0x495162
mov eax, dword [ebp - 0x50]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x495145
xor esi, esi
mov ebx, 0
test al, 8
je 0x495243
mov eax, dword [ebp - 0x50]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x495226
mov ecx, esi
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 0x54]
call fcn.005bd180
jmp 0x495347
call fcn.005bce50
test al, al
je 0x49533d
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 [0x748bac]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x49533d
movzx ecx, al
lea eax, [ebp - 0x28]
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], ebx
lea eax, [ebp - 0x20]
mov dword [eax], 0x6d26f8
lea edx, [ebp - 0x2c]
lea edi, [ebp - 0x1c]
push edi
push eax
call fcn.005bd6b0
add esp, 8
jmp 0x4952b0
mov bl, byte [0x748bdc]
test bl, bl
jne 0x4952cb
mov byte [0x748bdc], 1
mov eax, dword [0x748be4]
mov ecx, dword [0x746d68]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x4955ac
mov ecx, dword [ebp - 0x50]
lea esi, [ebp - 0x1c]
push esi
call fcn.005bd0d0
movsx eax, byte [ebp - 0x11]
mov ecx, esi
test eax, eax
jns 0x49554a
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
test eax, eax
js 0x495598
sete dl
test ecx, ecx
setne dh
or dh, dl
je 0x4955a2
push eax
push ecx
push dword [0x748be0]
call fcn.004aa460
add esp, 0xc
cmp byte [ebp - 0x11], 0
jns 0x49557b
push dword [ebp - 0x1c]
call fcn.00540380
add esp, 4
mov byte [0x748bdc], bl
mov esi, dword [ebp - 0x50]
jmp 0x4952cb
add edi, eax
cmp edi, ebx
jb 0x4953d5
jmp 0x4953f2
push 0x6bcfdb
jmp 0x495408
push 0x6bd0c2
jmp 0x495408
push 0x748be4
call fcn.005403cd
add esp, 4
cmp dword [0x748be4], 0xffffffff
jne 0x49552e
push 0x400
push 0x6d2703
call fcn.004aa420
add esp, 8
mov dword [0x748be0], eax
push 0x748be4
call fcn.00540447
add esp, 4
jmp 0x49552e