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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x508870
push fcn.0048edf0
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x8090
call fcn.0048b6b0
mov eax, dword [0x50b230]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x8020], 0
mov dword [ebp - 0x8038], 0
push 0x2000
push 0
lea eax, [ebp - 0x501c]
push eax
call fcn.0048d3c0
add esp, 0xc
push 0x2000
push 0
lea ecx, [ebp - 0x201c]
push ecx
call fcn.0048d3c0
add esp, 0xc
push 0x1000
push 0
lea edx, [ebp - 0x301c]
push edx
call fcn.0048d3c0
add esp, 0xc
push 0x2000
push 0
lea eax, [ebp - 0x701c]
push eax
call fcn.0048d3c0
add esp, 0xc
cmp dword [ebp + 8], 0
jl 0x4a16f7
cmp dword [ebp + 8], 3
jl 0x4a16ff
or eax, 0xffffffff
jmp 0x4a2037
mov dword [ebp - 4], 0
cmp dword [ebp + 8], 2
jne 0x4a17c5
mov ecx, 1
lock xadd dword [0x50b294], ecx
inc ecx
test ecx, ecx
jle 0x4a17c5
push 0
push 0x1ee
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str._itow_s_nLine__szLineMessage__4096__10_
push 0xa
push 0x1000
lea edx, [ebp - 0x501c]
push edx
mov eax, dword [ebp + 0x14]
push eax
call fcn.004bde30
add esp, 0x10
push eax
call fcn.004a0b70
add esp, 0x18
push str.Second_Chance_Assertion_Failed:_File
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [ebp + 0x10], 0
je 0x4a177b
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x803c], ecx
jmp 0x4a1785
mov dword [ebp - 0x803c], str._file_unknown_
mov edx, dword [ebp - 0x803c]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push str.__Line
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea eax, [ebp - 0x501c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 0x4ef134
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
int3
cmp dword [ebp + 0x1c], 0
je 0x4a18b3
mov dword [ebp - 0x80a8], 0x13
mov dword [ebp - 0x80a4], 0xfeb
mov dword [ebp - 0x8030], 0
call fcn.004a4d80
mov ecx, dword [eax]
mov dword [ebp - 0x8094], ecx
call fcn.004a4d80
mov dword [eax], 0
mov edx, dword [ebp + 0x20]
push edx
push 0
mov eax, dword [ebp + 0x1c]
push eax
push 0xfeb
push 0x1000
lea ecx, [ebp - 0x701c]
push ecx
push 0
push 4
call fcn.004b4790
add esp, 0x20
mov dword [ebp - 0x8030], eax
cmp dword [ebp - 0x8030], 0
jge 0x4a1865
push 0
push 0x20d
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.__errno___
push 0x22
push 0x16
call fcn.004a4d80
mov edx, dword [eax]
push edx
call fcn.004a0ba0
add esp, 0x20
call fcn.004a4d80
mov ecx, dword [ebp - 0x8094]
mov dword [eax], ecx
cmp dword [ebp - 0x8030], 0
jge 0x4a18b3
push 0
push 0x210
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push 0x4ef138
push 0x4ee7c0
push 0x1000
lea edx, [ebp - 0x701c]
push edx
call fcn.004bce70
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
cmp dword [ebp + 8], 2
jne 0x4a190f
cmp dword [ebp + 0x1c], 0
je 0x4a18cb
mov dword [ebp - 0x8040], str.Assertion_failed:
jmp 0x4a18d5
mov dword [ebp - 0x8040], str.Assertion_failed_
mov eax, dword [ebp - 0x8040]
push eax
push 0x1000
lea ecx, [ebp - 0x501c]
push ecx
call fcn.004bce70
add esp, 0xc
push 0
push 0x215
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcscpy_s_szLineMessage__4096__szFormat___L_Assertion_failed:___:_L_Assertion_failed___
push eax
call fcn.004a0b70
add esp, 0x18
push 0
push 0x217
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcscat_s_szLineMessage__4096__szUserMessage_
lea edx, [ebp - 0x701c]
push edx
push 0x1000
lea eax, [ebp - 0x501c]
push eax
call fcn.0049f820
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
cmp dword [ebp + 8], 2
jne 0x4a19ce
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x50b298]
and edx, 1
je 0x4a1996
push 0
push 0x21c
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcscat_s_szLineMessage__4096__L__r__
push 0x4ef384
push 0x1000
lea eax, [ebp - 0x501c]
push eax
call fcn.0049f820
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
push 0
push 0x21e
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push 0x4ef388
push 0x4ef134
push 0x1000
lea ecx, [ebp - 0x501c]
push ecx
call fcn.0049f820
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
cmp dword [ebp + 0x10], 0
je 0x4a1ab0
mov dword [ebp - 0x8034], 0
call fcn.004a4d80
mov edx, dword [eax]
mov dword [ebp - 0x8090], edx
call fcn.004a4d80
mov dword [eax], 0
lea eax, [ebp - 0x501c]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
mov edx, dword [ebp + 0x10]
push edx
push str._ls__d__:__ls
push 0x1000
push 0x1000
lea eax, [ebp - 0x201c]
push eax
call fcn.004a0be0
add esp, 0x1c
mov dword [ebp - 0x8034], eax
cmp dword [ebp - 0x8034], 0
jge 0x4a1a60
push 0
push 0x226
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.__errno___
push 0x22
push 0x16
call fcn.004a4d80
mov ecx, dword [eax]
push ecx
call fcn.004a0ba0
add esp, 0x20
call fcn.004a4d80
mov edx, dword [ebp - 0x8090]
mov dword [eax], edx
cmp dword [ebp - 0x8034], 0
jge 0x4a1aae
push 0
push 0x228
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcscpy_s_szOutMessage__4096__L__CrtDbgReport:_String_too_long_or_IO_Error__
push 0x4ee7c0
push 0x1000
lea eax, [ebp - 0x201c]
push eax
call fcn.004bce70
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
jmp 0x4a1aea
push 0
push 0x22c
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcscpy_s_szOutMessage__4096__szLineMessage_
lea ecx, [ebp - 0x501c]
push ecx
push 0x1000
lea edx, [ebp - 0x201c]
push edx
call fcn.004bce70
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
push 0
push 0x231
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcstombs_s_nullptr__szOutMessage2__4096__szOutMessage____size_t__1__
push 0x22
push 0x16
push 0xffffffffffffffff
lea eax, [ebp - 0x201c]
push eax
push 0x1000
lea ecx, [ebp - 0x301c]
push ecx
push 0
call fcn.004beee0
add esp, 0x14
push eax
call fcn.004a0ba0
add esp, 0x20
mov dword [ebp - 0x80a0], eax
cmp dword [ebp - 0x80a0], 0
je 0x4a1b73
push 0
push 0x233
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.strcpy_s_szOutMessage2__4096____CrtDbgReport:_String_too_long_or_Invalid_characters_in_String__
push str._CrtDbgReport:_String_too_long_or_Invalid_characters_in_String
push 0x1000
lea edx, [ebp - 0x301c]
push edx
call fcn.004bb7a0
add esp, 0xc
push eax
call fcn.004a0b70
add esp, 0x18
cmp dword [0x5142b0], 0
jne 0x4a1b89
cmp dword [0x5142b4], 0
je 0x4a1cef
mov dword [ebp - 0x8024], 0
mov dword [ebp - 0x8028], 0
push 1
call fcn.004b4970
add esp, 4
mov dword [ebp - 4], 1
mov eax, dword [0x5142b0]
mov dword [ebp - 0x8024], eax
jmp 0x4a1bca
mov ecx, dword [ebp - 0x8024]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x8024], edx
cmp dword [ebp - 0x8024], 0
je 0x4a1c43
mov dword [ebp - 0x8048], 0
mov eax, dword [ebp - 0x8024]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0x8098], ecx
lea edx, [ebp - 0x8048]
push edx
lea eax, [ebp - 0x301c]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x8098]
mov dword [ebp - 0x8044], edx
mov ecx, dword [ebp - 0x8044]
call dword [0x4dc2b0]
call dword [ebp - 0x8044]
add esp, 0xc
test eax, eax
je 0x4a1c3e
mov eax, dword [ebp - 0x8048]
mov dword [ebp - 0x8020], eax
mov dword [ebp - 0x8038], 1
jmp 0x4a1cd6
jmp 0x4a1bbb
mov ecx, dword [0x5142b4]
mov dword [ebp - 0x8028], ecx
jmp 0x4a1c60
mov edx, dword [ebp - 0x8028]
mov eax, dword [edx + 4]
mov dword [ebp - 0x8028], eax
cmp dword [ebp - 0x8028], 0
je 0x4a1cd6
mov dword [ebp - 0x8050], 0
mov ecx, dword [ebp - 0x8028]
mov edx, dword [ecx + 0xc]
mov dword [ebp - 0x809c], edx
lea eax, [ebp - 0x8050]
push eax
lea ecx, [ebp - 0x201c]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x809c]
mov dword [ebp - 0x804c], eax
mov ecx, dword [ebp - 0x804c]
call dword [0x4dc2b0]
call dword [ebp - 0x804c]
add esp, 0xc
test eax, eax
je 0x4a1cd1
mov ecx, dword [ebp - 0x8050]
mov dword [ebp - 0x8020], ecx
mov dword [ebp - 0x8038], 1
jmp 0x4a1cd6
jmp 0x4a1c51
mov dword [ebp - 4], 0
call fcn.004a1ce4
jmp 0x4a1cef
cmp dword [ebp - 0x8038], 0
je 0x4a1cfd
jmp 0x4a2015
cmp dword [0x5142ac], 0
je 0x4a1d64
mov dword [ebp - 0x8058], 0
mov edx, dword [0x5142ac]
mov dword [ebp - 0x8068], edx
lea eax, [ebp - 0x8058]
push eax
lea ecx, [ebp - 0x301c]
push ecx
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x8068]
mov dword [ebp - 0x8054], eax
mov ecx, dword [ebp - 0x8054]
call dword [0x4dc2b0]
call dword [ebp - 0x8054]
add esp, 0xc
test eax, eax
je 0x4a1d64
mov ecx, dword [ebp - 0x8058]
mov dword [ebp - 0x8020], ecx
jmp 0x4a2015
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x50b298]
and eax, 1
je 0x4a1f20
mov ecx, dword [ebp + 8]
cmp dword [ecx*4 + 0x50b2a4], 0xffffffff
je 0x4a1f20
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x50b2a4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [ebp - 0x806c], eax
cmp dword [ebp - 0x806c], 2
je 0x4a1daa
jmp 0x4a1e16
mov dword [ebp - 0x8070], 0
lea ecx, [ebp - 0x201c]
push ecx
call fcn.004a4020
add esp, 4
mov dword [ebp - 0x8074], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x50b2a4]
mov dword [ebp - 0x8078], eax
push 0
lea ecx, [ebp - 0x8070]
push ecx
mov edx, dword [ebp - 0x8074]
push edx
lea eax, [ebp - 0x201c]
push eax
mov ecx, dword [ebp - 0x8078]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x4a1e06
jmp 0x4a1f20
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
je 0x4a1e16
jmp 0x4a1f20
mov dword [ebp - 0x802c], 0
push 0
push 0x27f
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str.wcstombs_s_ret__szaOutMessage__4096__szOutMessage____size_t__1__
push 0x22
push 0x16
push 0xffffffffffffffff
lea edx, [ebp - 0x201c]
push edx
push 0x1000
lea eax, [ebp - 0x801c]
push eax
lea ecx, [ebp - 0x802c]
push ecx
call fcn.004beee0
add esp, 0x14
push eax
call fcn.004a0ba0
add esp, 0x20
mov dword [ebp - 0x805c], eax
cmp dword [ebp - 0x805c], 0
je 0x4a1ed6
cmp dword [ebp - 0x805c], 0x50
je 0x4a1ed6
mov dword [ebp - 0x807c], 0
lea edx, [ebp - 0x201c]
push edx
call fcn.004a4020
add esp, 4
shl eax, 1
mov dword [ebp - 0x8080], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x50b2a4]
mov dword [ebp - 0x8084], ecx
push 0
lea edx, [ebp - 0x807c]
push edx
mov eax, dword [ebp - 0x8080]
push eax
lea ecx, [ebp - 0x201c]
push ecx
mov edx, dword [ebp - 0x8084]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4a1f20
cmp dword [ebp - 0x802c], 0
jbe 0x4a1eee
mov eax, dword [ebp - 0x802c]
sub eax, 1
mov dword [ebp - 0x802c], eax
mov dword [ebp - 0x8088], 0
push 0
lea ecx, [ebp - 0x8088]
push ecx
mov edx, dword [ebp - 0x802c]
push edx
lea eax, [ebp - 0x801c]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x50b2a4]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x50b298]
and ecx, 2
je 0x4a1f3c
lea edx, [ebp - 0x201c]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x50b298]
and ecx, 4
je 0x4a2015
mov edx, 2
imul eax, edx, 0
mov dword [ebp - 0x8064], eax
cmp dword [ebp - 0x8064], 0x2000
jae 0x4a1f6b
jmp 0x4a1f70
call fcn.0048be40
xor ecx, ecx
mov edx, dword [ebp - 0x8064]
mov word [ebp + edx - 0x501c], cx
cmp dword [ebp + 0x14], 0
je 0x4a1fbf
push 0
push 0x29f
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportW
push str._itow_s_nLine__szLineMessage__4096__10_
push 0xa
push 0x1000
lea eax, [ebp - 0x501c]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.004bde30
add esp, 0x10
push eax
call fcn.004a0b70
add esp, 0x18
mov edx, dword [ebp + 0x18]
mov dword [ebp - 0x808c], edx
cmp dword [ebp + 0x14], 0
je 0x4a1fdc
lea eax, [ebp - 0x501c]
mov dword [ebp - 0x8060], eax
jmp 0x4a1fe6
mov dword [ebp - 0x8060], 0
lea ecx, [ebp - 0x701c]
push ecx
mov edx, dword [ebp - 0x808c]
push edx
mov eax, dword [ebp - 0x8060]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.004a0b40
add esp, 0x18
mov dword [ebp - 0x8020], eax
mov dword [ebp - 4], 0xfffffffe
call fcn.004a2023
jmp 0x4a2031
mov eax, dword [ebp - 0x8020]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.0048ab20
mov esp, ebp
pop ebp
ret