Function at 0x10065650
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x100a44e0
push fcn.10047f10
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x5070
call fcn.10080e80
mov eax, dword [0x100a6040]
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 - 0x5020], 0
mov dword [ebp - 0x5038], 0
push 0x1000
push 0
lea eax, [ebp - 0x101c]
push eax
call fcn.10048c00
add esp, 0xc
push 0x1000
push 0
lea ecx, [ebp - 0x201c]
push ecx
call fcn.10048c00
add esp, 0xc
push 0x2000
push 0
lea edx, [ebp - 0x501c]
push edx
call fcn.10048c00
add esp, 0xc
push 0x1000
push 0
lea eax, [ebp - 0x301c]
push eax
call fcn.10048c00
add esp, 0xc
cmp dword [ebp + 8], 0
jl 0x10065707
cmp dword [ebp + 8], 3
jl 0x1006570f
or eax, 0xffffffff
jmp 0x10065ef7
mov dword [ebp - 4], 0
cmp dword [ebp + 8], 2
jne 0x100657d0
mov ecx, 1
lock xadd dword [0x100a62d0], ecx
inc ecx
test ecx, ecx
jle 0x100657d0
push 0
push 0x114
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str._itoa_s_nLine__szLineMessage__4096__10_
push 0xa
push 0x1000
lea edx, [ebp - 0x101c]
push edx
mov eax, dword [ebp + 0x14]
push eax
call fcn.10078aa0
add esp, 0x10
push eax
call fcn.1004d350
add esp, 0x18
push 0x1008ef98
call fcn.10078f70
cmp dword [ebp + 0x10], 0
je 0x1006578a
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x503c], ecx
jmp 0x10065794
mov dword [ebp - 0x503c], 0x1008efc0
mov edx, dword [ebp - 0x503c]
push edx
call fcn.10078f70
push 0x1008efd0
call fcn.10078f70
lea eax, [ebp - 0x101c]
push eax
call fcn.10078f70
push 0x1008efd8
call fcn.10078f70
int3
cmp dword [ebp + 0x1c], 0
je 0x100658a4
mov dword [ebp - 0x502c], 0
call fcn.1005bb40
mov ecx, dword [eax]
mov dword [ebp - 0x5064], ecx
call fcn.1005bb40
mov dword [eax], 0
mov edx, dword [ebp + 0x20]
push edx
mov eax, dword [ebp + 0x1c]
push eax
push 0xfeb
push 0x1000
lea ecx, [ebp - 0x301c]
push ecx
call fcn.1000d800
add esp, 0x14
mov dword [ebp - 0x502c], eax
cmp dword [ebp - 0x502c], 0
jge 0x10065856
push 0
push 0x127
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.__errno___
push 0x22
push 0x16
call fcn.1005bb40
mov edx, dword [eax]
push edx
call fcn.1004d380
add esp, 0x20
call fcn.1005bb40
mov ecx, dword [ebp - 0x5064]
mov dword [eax], ecx
cmp dword [ebp - 0x502c], 0
jge 0x100658a4
push 0
push 0x12a
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcpy_s_szUserMessage__4096____CrtDbgReport:_String_too_long_or_IO_Error__
push str._CrtDbgReport:_String_too_long_or_IO_Error
push 0x1000
lea edx, [ebp - 0x301c]
push edx
call fcn.1005abc0
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
cmp dword [ebp + 8], 2
jne 0x10065900
cmp dword [ebp + 0x1c], 0
je 0x100658bc
mov dword [ebp - 0x5040], 0x1008f154
jmp 0x100658c6
mov dword [ebp - 0x5040], 0x1008f168
mov eax, dword [ebp - 0x5040]
push eax
push 0x1000
lea ecx, [ebp - 0x101c]
push ecx
call fcn.1005abc0
add esp, 0xc
push 0
push 0x130
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcpy_s_szLineMessage__4096__szFormat____Assertion_failed:___:__Assertion_failed___
push eax
call fcn.1004d350
add esp, 0x18
push 0
push 0x133
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcat_s_szLineMessage__4096__szUserMessage_
lea edx, [ebp - 0x301c]
push edx
push 0x1000
lea eax, [ebp - 0x101c]
push eax
call fcn.10078f50
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
cmp dword [ebp + 8], 2
jne 0x100659bf
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x100a62d4]
and edx, 1
je 0x10065987
push 0
push 0x139
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcat_s_szLineMessage__4096____r__
push 0x1008f228
push 0x1000
lea eax, [ebp - 0x101c]
push eax
call fcn.10078f50
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
push 0
push 0x13c
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcat_s_szLineMessage__4096____n__
push 0x1008efd8
push 0x1000
lea ecx, [ebp - 0x101c]
push ecx
call fcn.10078f50
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
cmp dword [ebp + 0x10], 0
je 0x10065aa1
mov dword [ebp - 0x5030], 0
call fcn.1005bb40
mov edx, dword [eax]
mov dword [ebp - 0x5068], edx
call fcn.1005bb40
mov dword [eax], 0
lea eax, [ebp - 0x101c]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
mov edx, dword [ebp + 0x10]
push edx
push str._s__d__:__s
push 0xfff
push 0x1000
lea eax, [ebp - 0x201c]
push eax
call fcn.10066940
add esp, 0x1c
mov dword [ebp - 0x5030], eax
cmp dword [ebp - 0x5030], 0
jge 0x10065a51
push 0
push 0x143
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.__errno___
push 0x22
push 0x16
call fcn.1005bb40
mov ecx, dword [eax]
push ecx
call fcn.1004d380
add esp, 0x20
call fcn.1005bb40
mov edx, dword [ebp - 0x5068]
mov dword [eax], edx
cmp dword [ebp - 0x5030], 0
jge 0x10065a9f
push 0
push 0x146
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcpy_s_szOutMessage__4096____CrtDbgReport:_String_too_long_or_IO_Error__
push str._CrtDbgReport:_String_too_long_or_IO_Error
push 0x1000
lea eax, [ebp - 0x201c]
push eax
call fcn.1005abc0
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
jmp 0x10065adb
push 0
push 0x14b
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.strcpy_s_szOutMessage__4096__szLineMessage_
lea ecx, [ebp - 0x101c]
push ecx
push 0x1000
lea edx, [ebp - 0x201c]
push edx
call fcn.1005abc0
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
mov dword [ebp - 0x506c], 0
mov dword [ebp - 0x5034], 0
push 0xffffffffffffffff
lea eax, [ebp - 0x201c]
push eax
push 0x1000
lea ecx, [ebp - 0x501c]
push ecx
lea edx, [ebp - 0x506c]
push edx
call fcn.1006e2a0
add esp, 0x14
mov dword [ebp - 0x5034], eax
push 0
push 0x151
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.e__mbstowcs_s_ret__szOutMessage2__4096__szOutMessage____size_t__1__
push 0x22
push 0x16
mov eax, dword [ebp - 0x5034]
push eax
call fcn.1004d380
add esp, 0x20
cmp dword [ebp - 0x5034], 0
je 0x10065b83
push 0
push 0x154
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str.wcscpy_s_szOutMessage2__4096__L__CrtDbgReport:_String_too_long_or_Invalid_characters_in_String__
push 0x1008f4d0
push 0x1000
lea ecx, [ebp - 0x501c]
push ecx
call fcn.1005b4a0
add esp, 0xc
push eax
call fcn.1004d350
add esp, 0x18
cmp dword [0x100a90d4], 0
jne 0x10065b99
cmp dword [0x100a90d8], 0
je 0x10065cff
mov dword [ebp - 0x5024], 0
mov dword [ebp - 0x5028], 0
push 1
call fcn.1005bbd0
add esp, 4
mov dword [ebp - 4], 1
mov edx, dword [0x100a90d4]
mov dword [ebp - 0x5024], edx
jmp 0x10065bdb
mov eax, dword [ebp - 0x5024]
mov ecx, dword [eax + 4]
mov dword [ebp - 0x5024], ecx
cmp dword [ebp - 0x5024], 0
je 0x10065c54
mov dword [ebp - 0x5048], 0
mov edx, dword [ebp - 0x5024]
mov eax, dword [edx + 0xc]
mov dword [ebp - 0x5070], eax
lea ecx, [ebp - 0x5048]
push ecx
lea edx, [ebp - 0x201c]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x5070]
mov dword [ebp - 0x5044], ecx
mov ecx, dword [ebp - 0x5044]
call dword [0x10085208]
call dword [ebp - 0x5044]
add esp, 0xc
test eax, eax
je 0x10065c4f
mov dword [ebp - 0x5038], 1
mov edx, dword [ebp - 0x5048]
mov dword [ebp - 0x5020], edx
jmp 0x10065ce6
jmp 0x10065bcc
mov eax, dword [0x100a90d8]
mov dword [ebp - 0x5028], eax
jmp 0x10065c70
mov ecx, dword [ebp - 0x5028]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x5028], edx
cmp dword [ebp - 0x5028], 0
je 0x10065ce6
mov dword [ebp - 0x5050], 0
mov eax, dword [ebp - 0x5028]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0x5074], ecx
lea edx, [ebp - 0x5050]
push edx
lea eax, [ebp - 0x501c]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x5074]
mov dword [ebp - 0x504c], edx
mov ecx, dword [ebp - 0x504c]
call dword [0x10085208]
call dword [ebp - 0x504c]
add esp, 0xc
test eax, eax
je 0x10065ce1
mov dword [ebp - 0x5038], 1
mov eax, dword [ebp - 0x5050]
mov dword [ebp - 0x5020], eax
jmp 0x10065ce6
jmp 0x10065c61
mov dword [ebp - 4], 0
call fcn.10065cf4
jmp 0x10065cff
cmp dword [ebp - 0x5038], 0
je 0x10065d0d
jmp 0x10065ed5
cmp dword [0x100a90d0], 0
je 0x10065d74
mov dword [ebp - 0x5058], 0
mov ecx, dword [0x100a90d0]
mov dword [ebp - 0x5078], ecx
lea edx, [ebp - 0x5058]
push edx
lea eax, [ebp - 0x201c]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0x5078]
mov dword [ebp - 0x5054], edx
mov ecx, dword [ebp - 0x5054]
call dword [0x10085208]
call dword [ebp - 0x5054]
add esp, 0xc
test eax, eax
je 0x10065d74
mov eax, dword [ebp - 0x5058]
mov dword [ebp - 0x5020], eax
jmp 0x10065ed5
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x100a62d4]
and edx, 1
je 0x10065de3
mov eax, dword [ebp + 8]
cmp dword [eax*4 + 0x100a62e0], 0xffffffff
je 0x10065de3
mov dword [ebp - 0x507c], 0
lea ecx, [ebp - 0x201c]
push ecx
call fcn.1005ed80
add esp, 4
mov dword [ebp - 0x5080], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x100a62e0]
mov dword [ebp - 0x5084], eax
push 0
lea ecx, [ebp - 0x507c]
push ecx
mov edx, dword [ebp - 0x5080]
push edx
lea eax, [ebp - 0x201c]
push eax
mov ecx, dword [ebp - 0x5084]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x100a62d4]
and eax, 2
je 0x10065dfe
lea ecx, [ebp - 0x201c]
push ecx
call fcn.10078f70
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x100a62d4]
and eax, 4
je 0x10065ed5
mov ecx, 1
imul edx, ecx, 0
mov dword [ebp - 0x505c], edx
cmp dword [ebp - 0x505c], 0x1000
jae 0x10065e2d
jmp 0x10065e32
call fcn.10046980
mov eax, dword [ebp - 0x505c]
mov byte [ebp + eax - 0x101c], 0
cmp dword [ebp + 0x14], 0
je 0x10065e7f
push 0
push 0x1a1
push str.minkernelcrtsucrt_src_appcrtmiscdbgrptt.cpp
push str._VCrtDbgReportA
push str._itoa_s_nLine__szLineMessage__4096__10_
push 0xa
push 0x1000
lea ecx, [ebp - 0x101c]
push ecx
mov edx, dword [ebp + 0x14]
push edx
call fcn.10078aa0
add esp, 0x10
push eax
call fcn.1004d350
add esp, 0x18
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x5088], eax
cmp dword [ebp + 0x14], 0
je 0x10065e9c
lea ecx, [ebp - 0x101c]
mov dword [ebp - 0x5060], ecx
jmp 0x10065ea6
mov dword [ebp - 0x5060], 0
lea edx, [ebp - 0x301c]
push edx
mov eax, dword [ebp - 0x5088]
push eax
mov ecx, dword [ebp - 0x5060]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.1004d2f0
add esp, 0x18
mov dword [ebp - 0x5020], eax
mov dword [ebp - 4], 0xfffffffe
call fcn.10065ee3
jmp 0x10065ef1
mov eax, dword [ebp - 0x5020]
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.10045fd0
mov esp, ebp
pop ebp
ret