Function at 0x409000
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push edi
push esi
push ebx
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x14], 0xfffffffd
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x34], 0
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x48]
mov edi, edx
mov al, 0
cld
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
lea eax, [ecx - 1]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x18], eax
cmp byte [edx + eax - 1], 0x2f
sete al
movzx edx, al
mov dword [ebp - 0x30], edx
lea ebx, [ebp - 0x10]
push ebx
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x18]
push eax
push dword [ecx + 0x38]
call fcn.0040ee3c
mov dword [ebp - 0x20], eax
add esp, 0x10
test eax, eax
je 0x409210
mov eax, dword [ebp - 0x14]
cmp eax, 0xfffffffd
je 0x409210
cmp eax, 0xfffffffe
je 0x4090ac
mov eax, dword [ebp - 0x18]
shr eax, 4
and eax, 1
cmp dword [ebp - 0x30], eax
je 0x4090ba
mov eax, 0xffffffff
jmp 0x4097f6
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x14], 0
mov ecx, dword [ebp + 8]
mov word [ecx + 0x2a], 0xffff
mov dword [ecx + 0x30], 0
cmp dword [ecx + 0x1c], 0
je 0x4090de
add esp, 0xfffffff4
push dword [ecx + 0x3c]
call sub.msvcrt.dll_free
add esp, 0x10
mov eax, dword [ebp + 8]
cmp dword [eax + 0x20], 0
je 0x4090fe
mov eax, dword [eax + 0x40]
mov edx, dword [ebp + 8]
cmp dword [edx + 0x3c], eax
je 0x4090fe
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll_free
add esp, 0x10
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x40], 0
mov dword [ecx + 0x3c], 0
mov dword [ecx + 0x20], 0
mov dword [ecx + 0x1c], 0
mov dword [0x44dcc0], 0
mov eax, dword [0x411200]
test eax, eax
je 0x409143
add esp, 0xfffffff8
push eax
push dword [ecx + 0x38]
call fcn.00408e34
add esp, 0x10
test eax, eax
jne 0x409150
mov eax, dword [0x4111c4]
mov dword [ebp - 0x1c], eax
jmp 0x409157
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp + 8]
mov esi, dword [eax + 0x38]
mov edi, 0x408ed9
mov ecx, 2
cld
test al, 0
repe cmpsb byte [esi], byte es:[edi]
jne 0x4091ac
mov dword [0x412030], 0
add esp, 0xfffffff4
push 0
call sub.msvcrt.dll__isatty
add esp, 0x10
test eax, eax
jne 0x40919b
add esp, 0xfffffff8
push 0x8000
push 0
call sub.msvcrt.dll__setmode
add esp, 0x10
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp + 8]
mov dword [edx + 8], ecx
jmp 0x40923d
cmp dword [0x4111f8], 0
je 0x4091c5
add esp, 0xfffffff8
push ebx
mov eax, dword [ebp + 8]
push eax
call fcn.0040f310
add esp, 0x10
add esp, 0xfffffff4
push dword [ebp - 0x18]
call fcn.0040a714
mov dword [ebp - 0x28], eax
add esp, 0x10
test eax, eax
je 0x4091e8
mov dword [0x412030], 0xffffffff
jmp 0x409234
cmp dword [ebp - 0x30], 0
jne 0x40921c
add esp, 0xfffffffc
push 0x40
push 0x8000
mov edx, dword [ebp + 8]
push dword [edx + 0x38]
call sub.msvcrt.dll__sopen
mov dword [0x412030], eax
add esp, 0x10
cmp eax, 0xffffffff
jne 0x409234
mov eax, 0x12
jmp 0x4097f6
mov dword [0x412030], 0xffffffff
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 8]
mov dword [ecx + 8], eax
cmp dword [ebp - 0x28], 0
jne 0x409249
cmp dword [ebp - 0x14], 0
jne 0x409250
mov dword [ebp - 0x1c], 0
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x40925d
mov dword [ebp - 0x1c], 8
mov edx, dword [ebp + 8]
cmp dword [edx + 0x58], 0
je 0x40927c
mov eax, 0x17
cmp dword [0x4111c8], 0
je 0x409281
mov eax, 0x14
jmp 0x409281
mov eax, 0xb17
mov ecx, dword [ebp + 8]
mov word [ecx], ax
cmp dword [ebp - 0x1c], 0
jne 0x409298
mov word [ecx + 2], 0xa
jmp 0x4092a1
mov eax, dword [ebp + 8]
mov word [eax + 2], 0x14
mov edx, dword [ebp + 8]
mov dword [edx + 0xc], 0
mov word [edx + 4], 8
mov word [edx + 0x2c], 8
mov eax, dword [ebp - 0x1c]
mov word [edx + 6], ax
xor edx, edx
cmp dword [ebp - 0x1c], 0
jne 0x4092cf
mov eax, dword [ebp - 0x14]
test eax, eax
jl 0x4092cf
mov edx, eax
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x10], edx
mov eax, dword [ebp - 0x14]
xor edx, edx
cmp eax, 0xffffffff
je 0x4092e1
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x14], edx
mov word [eax + 0x28], 0
cmp word [eax + 0x2a], 0xffff
jne 0x409301
mov word [eax + 0x2a], 0
mov dword [ebp - 0x34], 1
mov edx, dword [ebp + 8]
cmp dword [edx + 0x58], 0
je 0x409310
movzx eax, byte [ebp - 0x18]
jmp 0x40931e
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x30]
and eax, 0xff00
or eax, dword [ebp - 0x18]
mov edx, dword [ebp + 8]
mov dword [edx + 0x30], eax
mov eax, dword [0x42dc00]
mov dword [edx + 0x34], eax
add esp, 0xfffffff8
mov ecx, dword [ebp + 0xc]
push ecx
push edx
call fcn.00407f4c
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x40935c
mov eax, dword [0x412030]
cmp eax, 0xffffffff
je 0x409355
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll__close
mov eax, ebx
jmp 0x4097f6
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x1c]
add eax, 0x1e
add eax, dword [edx + 0x18]
add dword [0x42dc00], eax
add esp, 0xfffffff4
mov ecx, dword [ebp + 0xc]
push ecx
call sub.msvcrt.dll_ferror
add esp, 0x10
test eax, eax
je 0x4093a9
mov eax, dword [0x412030]
cmp eax, 0xffffffff
je 0x409397
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll__close
add esp, 0x10
add esp, 0xfffffff8
push 0x408edb
push 0xe
call fcn.004023bc
add esp, 0x10
add esp, 0xfffffff4
mov eax, dword [ebp + 0xc]
push eax
call sub.msvcrt.dll_ftell
mov edi, eax
add esp, 0xfffffff4
mov edx, dword [ebp + 0xc]
push edx
call sub.msvcrt.dll_ferror
add esp, 0x20
test eax, eax
je 0x4093d9
add esp, 0xfffffff4
mov ecx, dword [ebp + 0xc]
push ecx
call sub.msvcrt.dll_clearerr
add esp, 0x10
mov dword [0x412480], 0
mov dword [0x412020], 0
cmp dword [ebp - 0x1c], 8
jne 0x409450
cmp dword [ebp - 0x34], 0
je 0x409402
mov eax, dword [ebp + 8]
mov word [eax + 0x2a], 0xffff
add esp, 0xfffffffc
lea eax, [ebp - 0x1c]
push eax
mov edx, dword [ebp + 0xc]
push edx
mov ecx, dword [ebp + 8]
push ecx
call fcn.00409a3c
mov dword [ebp - 0x2c], eax
add esp, 0x10
mov eax, dword [ebp + 8]
cmp word [eax + 0x2a], 0
jne 0x40955d
cmp dword [0x4111dc], 0
je 0x40955d
add esp, 0xfffffff8
push 0x408ef8
push 0x408ef9
call fcn.00402624
jmp 0x40955a
cmp dword [ebp - 0x30], 0
jne 0x40955d
add esp, 0xfffffff4
push 0x4000
call sub.msvcrt.dll_malloc
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x40947c
mov eax, 4
jmp 0x4097f6
cmp dword [ebp - 0x28], 0
je 0x40952b
mov dword [ebp - 0x24], 0
add esp, 0xfffffffc
push 0
push ebx
push dword [0x412020]
call fcn.0040d648
mov dword [0x412020], eax
mov edx, dword [ebp + 0xc]
push edx
push 0
push 1
push ebx
call sub.msvcrt.dll_fwrite
add esp, 0x20
test eax, eax
jne 0x4094f6
mov dword [0x412480], 0
jmp 0x409548
mov ecx, dword [ebp + 0xc]
push ecx
mov eax, dword [ebp - 0x24]
push eax
push 1
push ebx
call sub.msvcrt.dll_fwrite
add esp, 0x10
cmp eax, dword [ebp - 0x24]
je 0x40950c
mov eax, dword [0x412030]
cmp eax, 0xffffffff
je 0x4094f6
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll__close
add esp, 0x10
add esp, 0xfffffff4
push ebx
call sub.msvcrt.dll_free
mov eax, 0xa
jmp 0x4097f6
cmp dword [0x4111cc], 0
je 0x40952b
add esp, 0xfffffff8
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push 0x2e
call sub.msvcrt.dll_putc
add esp, 0x10
add esp, 0xfffffff8
push 0x4000
push ebx
call fcn.00409800
mov dword [ebp - 0x24], eax
add esp, 0x10
test eax, eax
je 0x409548
cmp eax, 0xffffffff
jne 0x4094c8
add esp, 0xfffffff4
push ebx
call sub.msvcrt.dll_free
mov edx, dword [0x412480]
mov dword [ebp - 0x2c], edx
add esp, 0x10
cmp dword [0x412030], 0xffffffff
je 0x4095a5
cmp dword [ebp - 0x24], 0xffffffff
jne 0x40958f
add esp, 0xfffffff4
push 0x408f10
call sub.msvcrt.dll_perror
add esp, 0xfffffff8
mov ecx, dword [ebp + 8]
push dword [ecx + 0x4c]
push 0x408f1d
call fcn.00402624
add esp, 0x20
mov eax, dword [0x412030]
cmp eax, 0xffffffff
je 0x4095a5
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll__close
add esp, 0x10
mov esi, dword [ebp - 0x2c]
add esi, dword [0x42dc00]
mov dword [0x42dc00], esi
mov eax, dword [0x412020]
mov edx, dword [ebp + 8]
mov dword [edx + 0xc], eax
mov ecx, dword [ebp - 0x2c]
mov dword [edx + 0x10], ecx
mov eax, dword [0x412480]
mov dword [edx + 0x14], eax
add esp, 0xfffffff4
mov eax, dword [ebp + 0xc]
push eax
call fcn.0040dd70
add esp, 0x10
test eax, eax
je 0x4095fb
add esp, 0xfffffffc
push 0
mov edx, dword [ebp + 8]
push dword [edx + 0x34]
mov ecx, dword [ebp + 0xc]
push ecx
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
je 0x40966c
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp + 8]
cmp word [edx + 6], ax
je 0x409617
add esp, 0xfffffff4
push 0x408f39
call fcn.004025d8
add esp, 0x10
cmp dword [ebp - 0x1c], 0
jne 0x409635
cmp dword [ebp - 0x14], 0
jge 0x409635
add esp, 0xfffffff8
push 0x408f6c
push 0x10
call fcn.004023bc
add esp, 0x10
add esp, 0xfffffff8
mov ecx, dword [ebp + 0xc]
push ecx
mov eax, dword [ebp + 8]
push eax
call fcn.0040816c
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4097f6
add dword [0x42dc00], 0x10
mov edx, dword [ebp + 8]
movzx eax, word [edx + 0x2c]
mov word [edx + 4], ax
jmp 0x40973a
mov eax, esi
sub eax, edi
cmp eax, dword [ebp - 0x2c]
je 0x40969a
push eax
mov ecx, dword [ebp - 0x2c]
push ecx
push 0x408f9d
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0xfffffff4
push 0x408fb1
call fcn.004025d8
add esp, 0x20
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp + 8]
mov word [edx + 6], ax
mov eax, 0x14
cmp dword [ebp - 0x1c], 0
jne 0x4096b4
mov eax, 0xa
mov ecx, dword [ebp + 8]
mov word [ecx + 2], ax
movzx eax, word [ecx + 4]
test al, 1
jne 0x4096c9
and al, 0xf7
mov word [ecx + 4], ax
mov edx, dword [ebp + 8]
movzx eax, word [edx + 4]
mov word [edx + 0x2c], ax
add esp, 0xfffffff8
mov ecx, dword [ebp + 0xc]
push ecx
push edx
call fcn.00407f4c
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4097f6
add esp, 0xfffffffc
push 0
push esi
mov eax, dword [ebp + 0xc]
push eax
call sub.msvcrt.dll_fseek
add esp, 0x10
test eax, eax
je 0x409710
mov eax, 0xb
jmp 0x4097f6
mov edx, dword [ebp + 8]
test byte [edx + 4], 1
je 0x40973a
add esp, 0xfffffff8
mov ecx, dword [ebp + 0xc]
push ecx
push edx
call fcn.0040816c
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4097f6
add dword [0x42dc00], 0x10
mov eax, dword [ebp + 8]
cmp dword [eax + 0x1c], 0
je 0x40976e
mov eax, dword [eax + 0x3c]
mov edx, dword [ebp + 8]
cmp eax, dword [edx + 0x40]
je 0x409764
add esp, 0xfffffff4
push eax
call sub.msvcrt.dll_free
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3c], 0
add esp, 0x10
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0
cmp dword [0x4111f4], 0
je 0x4097f4
cmp dword [0x4111cc], 0
je 0x40979d
mov edx, dword [ebp - 0x2c]
push edx
push dword [0x412480]
push 0x408fcb
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0x10
cmp dword [ebp - 0x1c], 8
jne 0x4097d0
add esp, 0xfffffffc
add esp, 0xfffffff8
mov ecx, dword [ebp - 0x2c]
push ecx
push dword [0x412480]
call fcn.00408dec
push eax
push 0x408fdf
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0x20
jmp 0x4097e6
add esp, 0xfffffff8
push 0x408ff1
push dword [0x42dc10]
call sub.msvcrt.dll_fprintf
add esp, 0x10
add esp, 0xfffffff4
push dword [0x42dc10]
call sub.msvcrt.dll_fflush
xor eax, eax
lea esp, [ebp - 0x58]
pop ebx
pop esi
pop edi
leave
ret