Function at 0x10030320
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x1016a4f1
mov eax, dword fs:[0]
push eax
sub esp, 0x80
push ebx
push esi
push edi
mov eax, dword [0x10438fc0]
xor eax, esp
push eax
lea eax, [esp + 0x90]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [esp + 0x24], ebx
mov eax, dword [ebx + 0xc]
lea esi, [ebx + 0xc]
push eax
call fcn.10023650
add esp, 4
test al, al
jne 0x1003039a
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x1003037d
test al, 0x10
jne 0x1003039a
mov eax, 0x80004005
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push esi
lea ecx, [esp + 0x20]
call fcn.10017430
push 0
mov edi, 0x10414568
lea eax, [esp + 0x30]
mov dword [esp + 0x9c], 0
call fcn.100164f0
mov byte [esp + 0x98], 1
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax - 4]
movzx eax, word [eax + ecx*2 - 2]
cmp eax, 0x5c
je 0x100303ec
cmp eax, 0x2f
je 0x100303ec
lea eax, [esp + 0x1c]
push eax
mov eax, 0x10197e18
call fcn.10016730
mov esi, dword [esp + 0x2c]
lea ecx, [esp + 0x1c]
push ecx
mov eax, esi
call fcn.10016730
mov byte [esp + 0x98], 0
test esi, esi
je 0x10030421
lea edx, [esi - 0xc]
test edx, edx
je 0x10030421
dec dword [esi - 0xc]
lea eax, [esi - 0xc]
jne 0x10030421
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov edi, dword [esp + 0x1c]
push 0
lea eax, [esp + 0x50]
call fcn.100164f0
mov dword [esp + 0x50], 0xffffffff
mov byte [esp + 0x58], 0
push 0
push 0
push 2
push 0
push 1
mov byte [esp + 0xac], 2
mov eax, dword [esp + 0x60]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x100304c2
call fcn.10023ad0
mov dword [esp + 0x54], eax
test eax, eax
jle 0x1003047d
and eax, 0xffff
or eax, 0x80070000
mov esi, eax
lea eax, [esp + 0x4c]
call fcn.10023300
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x100304a8
lea ecx, [eax - 0xc]
test ecx, ecx
je 0x100304a8
add eax, 0xfffffff4
dec dword [eax]
jne 0x100304a8
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push 0x400
mov dword [esp + 0x54], edi
mov byte [esp + 0x5c], 0
mov dword [esp + 0x7c], 0
call dword [sym.imp.MSVCR100.dll_malloc]
mov esi, eax
add esp, 4
mov dword [esp + 0x6c], esi
mov dword [esp + 0x70], 0x400
mov byte [esp + 0x74], 1
push 0
mov byte [esp + 0x9c], 3
lea eax, [esp + 0x34]
push eax
mov dword [ebx + 0x28], 5
mov dword [esi], 5
mov edx, dword [0x10448c48]
push 8
push esi
mov dword [esi + 4], edx
push edi
mov byte [ebx + 0x228], 1
mov dword [esp + 0x44], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1003058e
push esi
mov dword [esp + 0x58], 0xfffffffd
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
lea eax, [esp + 0x4c]
call fcn.10023300
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x10030571
lea ecx, [eax - 0xc]
test ecx, ecx
je 0x10030571
add eax, 0xfffffff4
dec dword [eax]
jne 0x10030571
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, 0xfffffffd
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push edi
mov dword [esp + 0x58], 0
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebx + 0xc]
push eax
add ebx, 0x44
mov dword [esp + 0x54], 0xffffffff
call fcn.10034f80
mov edi, eax
mov dword [esp + 0x20], edi
test edi, edi
jns 0x100305e4
push esi
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
lea eax, [esp + 0x4c]
call fcn.10023300
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x10030c59
lea edx, [eax - 0xc]
test edx, edx
jmp 0x10030c46
xor edi, edi
jmp 0x100305f0
mov ecx, dword [edi + 0x10448f40]
mov edx, dword [edi + 0x10448f3c]
mov ebx, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
lea eax, [esp + 0x14]
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
mov edx, dword [edi + 0x10448f44]
push ebx
push esi
push eax
call fcn.10093040
mov edx, dword [edi + 0x10448f4c]
mov eax, dword [edi + 0x10448f48]
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [ebp + 8]
push edx
mov edx, dword [edi + 0x10448f50]
push eax
push ebx
push esi
push ecx
call fcn.10093040
add esp, 0x30
cmp word [esp + 0x14], 0
je 0x100306cb
cmp word [esp + 0x18], 0
jne 0x100306cb
mov ebx, dword [esp + 0x24]
mov edx, dword [edi + 0x10448f38]
mov ecx, ebx
call fcn.10033000
mov esi, eax
mov dword [esp + 0x20], esi
test esi, esi
js 0x100307ee
mov edx, dword [edi + 0x10448f38]
mov eax, dword [edx]
mov ecx, str.GDB_DBTune
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x100306a7
test dx, dx
je 0x100306a3
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x100306a7
add eax, 4
add ecx, 4
test dx, dx
jne 0x10030681
xor eax, eax
jmp 0x100306ac
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x100306cb
mov eax, dword [ebx + 0x28]
push eax
push ebx
call fcn.1004c7f0
mov esi, eax
add esp, 8
mov dword [esp + 0x20], esi
test esi, esi
js 0x1003081b
add edi, 0x20
cmp edi, 0x80
jb 0x100305f0
mov edx, 0xfffffffe
lea esi, [edx + 6]
lea edi, [edx + 4]
mov dword [esp + 0x18], 0
call fcn.10093000
mov edx, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov ebx, eax
call fcn.10093000
cmp ebx, 0xffffffff
je 0x10030718
cmp eax, 0xffffffff
je 0x10030718
cmp eax, ebx
jl 0x10030718
mov dword [esp + 0x18], 0xffffffff
mov ebx, 0x10448fc8
lea ecx, [ecx]
mov edx, dword [ebx + 4]
mov esi, dword [ebx]
mov edi, dword [ebx - 4]
mov dword [esp + 0x2c], 0
call fcn.10093000
mov edx, dword [ebp + 0x10]
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov dword [esp + 0x14], eax
call fcn.10093000
cmp dword [esp + 0x14], 0xffffffff
mov dword [esp + 0x28], eax
je 0x10030765
cmp eax, 0xffffffff
je 0x10030765
cmp eax, dword [esp + 0x14]
jl 0x10030765
mov dword [esp + 0x2c], 0xffffffff
mov edx, dword [ebx + 0x10]
mov esi, dword [ebx + 0xc]
mov edi, dword [ebx + 8]
mov dword [esp + 0x14], 0
call fcn.10093000
cmp eax, 0xffffffff
je 0x10030795
mov ecx, dword [esp + 0x28]
cmp ecx, 0xffffffff
je 0x10030795
cmp ecx, eax
jl 0x10030795
mov dword [esp + 0x14], 0xffffffff
cmp word [esp + 0x2c], 0
je 0x1003085c
cmp word [esp + 0x14], 0
jne 0x1003085c
cmp byte [ebx + 0x14], 0
je 0x10030840
mov ecx, dword [ebx - 8]
push ecx
mov ecx, dword [esp + 0x28]
call fcn.10033750
mov edi, eax
mov dword [esp + 0x20], edi
test edi, edi
jns 0x10030860
mov edx, dword [esp + 0x6c]
push edx
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
lea eax, [esp + 0x4c]
call fcn.10023300
jmp 0x10030c39
mov ecx, dword [esp + 0x6c]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
lea eax, [esp + 0x4c]
call fcn.10023300
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x100304a8
lea edx, [eax - 0xc]
test edx, edx
jmp 0x10030495
mov eax, dword [esp + 0x6c]
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
lea eax, [esp + 0x4c]
call fcn.10023300
lea eax, [esp + 0x1c]
call fcn.100164d0
jmp 0x100304a8
mov edx, dword [ebx - 8]
mov ecx, dword [esp + 0x24]
call fcn.10033000
mov edi, eax
mov dword [esp + 0x20], edi
test edi, edi
js 0x100307d2
jmp 0x10030860
mov edi, dword [esp + 0x20]
add ebx, 0x20
cmp ebx, 0x104494c8
jl 0x10030720
cmp word [esp + 0x18], 0
jne 0x10030bef
mov esi, dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
push 0xb
push str.GDB_Release
call esi
mov edi, eax
mov dword [esp + 0x2c], edi
mov eax, dword [esp + 0x24]
add eax, 0x1e0
mov byte [esp + 0x98], 4
mov dword [esp + 0x20], eax
mov dword [esp + 0x5c], eax
push 0
lea eax, [esp + 0x64]
call fcn.100164f0
mov dword [esp + 0x64], 4
mov dword [esp + 0x68], 0
test edi, edi
je 0x100308cf
push edi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esp + 0x60]
mov ecx, dword [eax - 4]
push ecx
push eax
call esi
mov edi, eax
mov dword [esp + 0x2c], edi
mov byte [esp + 0x98], 6
mov eax, dword [esp + 0x64]
test eax, eax
jne 0x100308f4
xor esi, esi
jmp 0x10030900
mov ecx, dword [esp + 0x5c]
push eax
call fcn.100245e0
mov esi, eax
test esi, esi
setns bl
mov byte [esp + 0x98], 5
test edi, edi
je 0x10030918
push edi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
test bl, bl
je 0x10030924
mov edx, dword [esp + 0x64]
mov dword [esp + 0x68], edx
test esi, esi
jns 0x10030979
lea eax, [esp + 0x5c]
push eax
mov byte [esp + 0x9c], 3
call fcn.10024970
mov ecx, dword [esp + 0x6c]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [esp + 0x50]
add esp, 4
test eax, eax
je 0x10030488
lea edx, [eax - 0xc]
test edx, edx
je 0x10030488
add eax, 0xfffffff4
dec dword [eax]
jne 0x10030488
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
jmp 0x10030488
push 0
mov edi, str.GDB_Release
lea eax, [esp + 0x30]
call fcn.100164f0
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x28]
push edx
push 1
lea eax, [esp + 0x34]
push eax
mov byte [esp + 0xa4], 7
call fcn.10032100
mov esi, eax
test esi, esi
mov byte [esp + 0x98], 5
mov eax, dword [esp + 0x2c]
sets bl
test eax, eax
je 0x100309d5
lea ecx, [eax - 0xc]
test ecx, ecx
je 0x100309d5
add eax, 0xfffffff4
dec dword [eax]
jne 0x100309d5
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
test bl, bl
je 0x100309fe
lea edx, [esp + 0x5c]
push edx
mov byte [esp + 0x9c], 3
call fcn.10024970
mov eax, dword [esp + 0x6c]
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
jmp 0x1003047f
push 0
mov edi, str.GDB_Release
lea eax, [esp + 0x30]
call fcn.100164f0
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
lea eax, [ecx - 0xc]
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], ecx
inc dword [eax]
test ecx, ecx
je 0x10030a3a
add ecx, 0xfffffff4
je 0x10030a3a
dec dword [eax]
jne 0x10030a3a
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov byte [esp + 0x98], 9
mov eax, dword [esp + 0x28]
mov ebx, dword [eax + 0x2c]
test ebx, ebx
jne 0x10030a53
mov dword [esp + 0x2c], ebx
jmp 0x10030a5f
mov ecx, dword [ebx]
mov edx, dword [ecx + 4]
push ebx
mov dword [esp + 0x30], ebx
call edx
push 0
lea esi, [esp + 0x44]
call fcn.10034a00
mov ecx, dword [esp + 0x48]
mov eax, 3
mov word [ecx], ax
mov edx, dword [esp + 0x48]
mov eax, dword [ebp + 8]
mov dword [edx + 8], eax
mov edx, dword [esp + 0x48]
mov ecx, 3
mov word [edx + 0x18], cx
mov eax, dword [esp + 0x48]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 0x20], ecx
mov eax, dword [esp + 0x48]
mov edx, 3
mov word [eax + 0x30], dx
mov ecx, dword [esp + 0x48]
mov edx, dword [ebp + 0x10]
push 0xb
push str.GDB_Release
mov dword [ecx + 0x38], edx
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov edi, eax
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x20]
mov byte [esp + 0x98], 0xb
mov dword [esp + 0x7c], eax
push 0
lea eax, [esp + 0x84]
call fcn.100164f0
mov dword [esp + 0x84], 2
mov dword [esp + 0x88], 0
test edi, edi
je 0x10030b00
push edi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
lea esi, [esp + 0x7c]
mov byte [esp + 0x98], 0xc
call fcn.10024a20
mov edi, eax
test edi, edi
jns 0x10030b72
mov ecx, esi
push ecx
mov byte [esp + 0x9c], 0xa
call fcn.10024970
lea esi, [esp + 0x40]
call fcn.10034a80
mov byte [esp + 0x98], 8
test ebx, ebx
je 0x10030b44
mov edx, dword [ebx]
mov eax, dword [edx + 8]
push ebx
call eax
lea ecx, [esp + 0x38]
push ecx
mov byte [esp + 0x9c], 5
call fcn.1002ffa0
lea edx, [esp + 0x5c]
push edx
mov byte [esp + 0x9c], 3
call fcn.10024970
mov eax, dword [esp + 0x6c]
push eax
jmp 0x100307d7
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx]
mov edx, dword [edx + 0xa0]
push 1
push 1
lea eax, [esp + 0x3c]
push eax
mov eax, dword [esp + 0x54]
push eax
call edx
mov dword [esp + 0x20], eax
lea eax, [esp + 0x7c]
push eax
mov byte [esp + 0x9c], 0xa
call fcn.10024970
lea esi, [esp + 0x40]
call fcn.10034a80
mov byte [esp + 0x98], 8
test ebx, ebx
je 0x10030bc1
mov ecx, dword [ebx]
mov edx, dword [ecx + 8]
push ebx
call edx
lea eax, [esp + 0x38]
push eax
mov byte [esp + 0x9c], 5
call fcn.1002ffa0
lea ecx, [esp + 0x5c]
push ecx
mov byte [esp + 0x9c], 3
call fcn.10024970
mov edi, dword [esp + 0x20]
cmp word [esp + 0x18], 0
mov esi, dword [esp + 0x24]
setne dl
movzx eax, dl
push eax
mov eax, esi
call fcn.100315a0
mov ecx, dword [esi + 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
call eax
mov ecx, dword [esp + 0x6c]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [esp + 0x50]
add esp, 4
test eax, eax
je 0x10030c39
lea edx, [eax - 0xc]
test edx, edx
je 0x10030c39
add eax, 0xfffffff4
dec dword [eax]
jne 0x10030c39
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x10030c59
lea ecx, [eax - 0xc]
test ecx, ecx
je 0x10030c59
add eax, 0xfffffff4
dec dword [eax]
jne 0x10030c59
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
mov eax, edi
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc