Function at 0x10004030
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x94
push ebx
push ebp
push esi
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
push edi
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x40]
xor ebx, ebx
push 0xa0
rep stosd dword es:[edi], eax
mov dword [esp + 0x30], ebx
mov dword [esp + 0x1c], 0x14
call esi
mov ebp, eax
add esp, 4
cmp ebp, ebx
mov dword [esp + 0x14], ebp
jne 0x10004087
pop edi
pop esi
pop ebp
mov dword [0x10024160], 0xb
or eax, 0xffffffff
pop ebx
add esp, 0x94
ret
push str.TP_BITMAP
call sym.tmax.dll_fbget_fldkey
push str.NEWFILE
mov dword [esp + 0x40], eax
call sym.tmax.dll_fbget_fldkey
mov ecx, 0x28
xor eax, eax
mov edi, ebp
push 0xa0
rep stosd dword es:[edi], eax
mov dword [esp + 0x28], 0x14
call esi
mov edi, eax
add esp, 0xc
cmp edi, ebx
mov dword [esp + 0x10], edi
jne 0x100040e8
push ebp
mov dword [0x10024160], 0xb
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov esi, dword [esp + 0xa8]
mov ecx, 0x28
xor eax, eax
mov dword [esp + 0x30], ebx
rep stosd dword es:[edi], eax
mov edi, esi
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x20], ebx
mov ebx, ecx
add ebx, esi
cmp esi, ebx
jae 0x10004204
mov eax, 0xa0
mov dword [esp + 0x28], eax
mov dword [esp + 0x24], eax
push esi
call fcn.100048a0
mov ebp, eax
add esp, 4
test ebp, ebp
jl 0x1000425f
cmp byte [esi], 0
jne 0x1000413f
xor edi, edi
jmp 0x100041a6
push esi
call sym.tmax.dll_fbget_fldkey
mov edi, eax
add esp, 4
test edi, edi
je 0x1000428e
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x1c]
cmp eax, ecx
jl 0x10004191
mov eax, dword [esp + 0x24]
mov edx, ecx
add eax, 0x50
add edx, 0xa
mov dword [esp + 0x24], eax
push eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], edx
push eax
call dword [sym.imp.MSVCRT.dll_realloc]
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
je 0x100042c2
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x10]
inc eax
mov dword [esp + 0x30], eax
mov dword [ecx + eax*8 - 8], edi
mov dword [ecx + eax*8 - 4], 0
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov byte [esi + ebp - 1], 0xa
mov dword [ecx + eax*8], edi
add esi, ebp
mov dword [ecx + eax*8 + 4], 0
inc eax
cmp eax, edx
mov dword [esp + 0x20], eax
jl 0x100041f8
mov eax, dword [esp + 0x28]
mov edi, edx
add eax, 0x50
add edi, 0xa
push eax
push ecx
mov dword [esp + 0x20], edi
mov dword [esp + 0x30], eax
call dword [sym.imp.MSVCRT.dll_realloc]
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
je 0x100042e8
cmp esi, ebx
jb 0x10004123
mov ebp, dword [esp + 0x14]
mov ebx, dword [esp + 0x20]
mov edx, dword [esp + 0xb0]
lea ecx, [esp + 0x40]
dec ebx
push ecx
push edx
mov dword [esp + 0x28], ebx
call fcn.10004bd0
add esp, 8
test eax, eax
jle 0x1000430e
lea edi, [esp + 0x40]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
jne 0x1000430e
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebp
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov ecx, dword [esp + 0x14]
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ecx
mov dword [0x10024160], 0xa
call esi
mov edx, dword [esp + 0x14]
push edx
call esi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov eax, dword [esp + 0x14]
mov byte [esi + ebp - 1], 0xa
mov esi, dword [sym.imp.MSVCRT.dll_free]
push eax
mov dword [0x10024160], 6
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov edx, dword [esp + 0x14]
mov dword [0x10024160], 0xb
push edx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov eax, dword [esp + 0x10]
mov dword [0x10024160], 0xb
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov esi, dword [esp + 0xac]
xor edx, edx
mov dword [esp + 0x1c], edx
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
cmp eax, ecx
jge 0x100044ad
mov edi, dword [ebp + eax*8]
mov ecx, esi
cmp edi, edx
mov dword [esp + 0x24], edx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x18], eax
je 0x10004411
lea ebp, [ebp + eax*8 + 4]
mov dword [esp + 0x28], ebp
mov ebx, dword [esp + 0x2c]
cmp ebx, 0xffffffff
je 0x100043e8
cmp edi, dword [esp + 0x38]
jne 0x10004457
mov ecx, dword [esp + 0xb0]
push ebx
push edi
push ecx
call sym.tmax.dll__find_matching_fldkey
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x10004385
mov dword [ebp], 0xffffffff
jmp 0x100043e8
mov edx, dword [ebx + 4]
lea eax, [esp + 0x40]
push 0x1001c59c
push eax
mov dword [esp + 0x3c], edx
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x100044d3
mov ecx, dword [esp + 0x34]
push ebp
push 1
add ebx, 8
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll_fwrite]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov ebp, dword [esp + 0x3c]
add esp, 0x14
mov ecx, dword [ebp]
mov eax, dword [esp + 0x38]
inc ecx
cmp edi, eax
mov dword [ebp], ecx
mov dword [esp + 0x24], 1
je 0x100043e8
mov ecx, dword [esp + 0x34]
lea esi, [esi + ecx - 1]
mov edx, dword [esp + 0x18]
add ebp, 8
mov byte [esi], 9
inc esi
mov edi, dword [ebp - 4]
inc edx
test edi, edi
mov dword [esp + 0x18], edx
mov dword [esp + 0x28], ebp
jne 0x1000434d
mov ebp, dword [esp + 0x14]
mov ecx, dword [esp + 0x3c]
xor edx, edx
mov edi, dword [esp + 0x2c]
mov eax, dword [esp + 0x24]
inc edi
cmp eax, edx
mov dword [esp + 0x2c], edi
jne 0x1000449f
mov eax, dword [esp + 0xac]
mov esi, ecx
cmp ecx, eax
je 0x1000443b
cmp byte [ecx - 1], 0xa
je 0x10004441
cmp byte [ecx - 2], 0xd
je 0x10004441
mov byte [ecx], 0xa
lea esi, [ecx + 1]
mov eax, dword [esp + 0x18]
mov byte [esi], 0x7f
inc esi
inc eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x2c], edx
jmp 0x1000431b
mov edx, dword [esp + 0x30]
xor eax, eax
test edx, edx
jle 0x10004471
mov ecx, dword [esp + 0x10]
cmp dword [ecx], edi
je 0x10004471
inc eax
add ecx, 8
cmp eax, edx
jl 0x10004465
mov eax, dword [esp + 0xb0]
lea edx, [esp + 0x34]
push 7
push edx
push esi
push ebx
push edi
push eax
call sym.tmax.dll_fbget_tut
add esp, 0x18
test eax, eax
jge 0x100043c9
mov dword [ebp], 0xffffffff
jmp 0x100043e8
dec esi
mov byte [esi], 0xd
inc esi
mov byte [esi], 0xa
inc esi
jmp 0x1000431b
mov byte [esi], 0xa
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebp
call esi
mov ecx, dword [esp + 0x14]
push ecx
call esi
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret
mov edx, dword [esp + 0x14]
mov esi, dword [sym.imp.MSVCRT.dll_free]
push edx
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
add esp, 8
mov dword [0x10024160], 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret