Function at 0x407d61
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xcc
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x24], 0
cmp dword [ebp + 8], 0
jne 0x407d8b
mov eax, 0xffffffff
jmp 0x4085d3
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x407dd4
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x12
mov dword [esp + 4], 1
mov dword [esp], str.Allocation_Error__n
call sub.msvcrt.dll_fwrite
mov eax, 0xffffffff
jmp 0x4085d3
mov eax, dword [ebp + 8]
mov ax, word [eax]
shr ax, 8
mov edx, eax
mov eax, dword [ebp + 8]
mov ax, word [eax]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x2a], ax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov ax, word [ebp - 0x2a]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
test eax, eax
je 0x407e42
mov eax, dword [ebp + 8]
mov ax, word [eax]
movzx ebx, ax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 4]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, edx
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov ax, word [eax]
movzx eax, ax
add dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 8]
shr ax, 8
mov edx, eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 8]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x2a], ax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov ax, word [ebp - 0x2a]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x407eb4
mov eax, dword [ebp + 8]
mov ax, word [eax + 8]
movzx ebx, ax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, edx
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov ax, word [eax + 8]
movzx eax, ax
add dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x10]
shr ax, 8
mov edx, eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x10]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x2a], ax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov ax, word [ebp - 0x2a]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x407f26
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x10]
movzx ebx, ax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x14]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, edx
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x10]
movzx eax, ax
add dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x18]
shr ax, 8
mov edx, eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x18]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x2a], ax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov ax, word [ebp - 0x2a]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x407f98
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x18]
movzx ebx, ax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x1c]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, edx
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x18]
movzx eax, ax
add dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x20]
shr ax, 8
mov edx, eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x20]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x2a], ax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov ax, word [ebp - 0x2a]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
test eax, eax
je 0x40800a
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x20]
movzx ebx, ax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x24]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add eax, edx
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x20]
movzx eax, ax
add dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x28]
shr ax, 8
mov edx, eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x28]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x2c], ax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x2c]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x2c]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x2c]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x2c]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x2c]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x30]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x34], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x34]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x38], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x38]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x3c], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x3c]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3c]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3c]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3c]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3c]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x40], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x40]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x40]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x40]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x40]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x40]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x44], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x44]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x44]
mov edx, eax
shr edx, 0x18
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x44]
and eax, 0xff0000
shr eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x44]
and eax, 0xff00
shl eax, 8
or edx, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x44]
shl eax, 0x18
or eax, edx
mov dword [ebp - 0x48], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x48]
mov dword [edx], eax
add dword [ebp - 0x1c], 4
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov ecx, eax
mov ebx, edx
mov ecx, ebx
xor ebx, ebx
shr ecx, 0x18
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov esi, eax
and esi, 0
mov edi, edx
and edi, 0xff0000
mov eax, esi
mov edx, edi
mov eax, edx
xor edx, edx
shr eax, 8
mov esi, ecx
or esi, eax
mov dword [ebp - 0x60], esi
mov esi, ebx
or esi, edx
mov dword [ebp - 0x5c], esi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov ecx, eax
and ecx, 0
mov dword [ebp - 0x68], ecx
mov esi, edx
and esi, 0xff00
mov dword [ebp - 0x64], esi
mov eax, dword [ebp - 0x68]
mov edx, dword [ebp - 0x64]
shrd eax, edx, 0x18
shr edx, 0x18
mov ecx, dword [ebp - 0x60]
or ecx, eax
mov dword [ebp - 0x70], ecx
mov esi, dword [ebp - 0x5c]
or esi, edx
mov dword [ebp - 0x6c], esi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov ecx, eax
and ecx, 0
mov dword [ebp - 0x78], ecx
movzx esi, dl
mov dword [ebp - 0x74], esi
mov eax, dword [ebp - 0x78]
mov edx, dword [ebp - 0x74]
shrd eax, edx, 8
shr edx, 8
mov ecx, dword [ebp - 0x70]
or ecx, eax
mov dword [ebp - 0x80], ecx
mov esi, dword [ebp - 0x6c]
or esi, edx
mov dword [ebp - 0x7c], esi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov ecx, eax
and ecx, 0xff000000
mov dword [ebp - 0x88], ecx
mov esi, edx
and esi, 0
mov dword [ebp - 0x84], esi
mov eax, dword [ebp - 0x88]
mov edx, dword [ebp - 0x84]
shld edx, eax, 8
shl eax, 8
mov ecx, dword [ebp - 0x80]
or ecx, eax
mov dword [ebp - 0x90], ecx
mov esi, dword [ebp - 0x7c]
or esi, edx
mov dword [ebp - 0x8c], esi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov ecx, eax
and ecx, 0xff0000
mov dword [ebp - 0x98], ecx
mov esi, edx
and esi, 0
mov dword [ebp - 0x94], esi
mov eax, dword [ebp - 0x98]
mov edx, dword [ebp - 0x94]
shld edx, eax, 0x18
shl eax, 0x18
mov ecx, dword [ebp - 0x90]
or ecx, eax
mov dword [ebp - 0xa0], ecx
mov esi, dword [ebp - 0x8c]
or esi, edx
mov dword [ebp - 0x9c], esi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov ecx, eax
and ecx, 0xff00
mov dword [ebp - 0xa8], ecx
mov esi, edx
and esi, 0
mov dword [ebp - 0xa4], esi
mov eax, dword [ebp - 0xa8]
mov edx, dword [ebp - 0xa4]
mov edx, eax
mov eax, 0
shl edx, 8
mov ecx, dword [ebp - 0xa0]
or ecx, eax
mov dword [ebp - 0xb0], ecx
mov esi, dword [ebp - 0x9c]
or esi, edx
mov dword [ebp - 0xac], esi
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x4c]
mov eax, dword [eax + 0x48]
mov edx, eax
mov eax, 0
shl edx, 0x18
mov ecx, dword [ebp - 0xb0]
or ecx, eax
mov dword [ebp - 0xb8], ecx
mov esi, dword [ebp - 0xac]
or esi, edx
mov dword [ebp - 0xb4], esi
mov eax, dword [ebp - 0xb8]
mov edx, dword [ebp - 0xb4]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
lea ecx, [edx + eax]
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov dword [ecx], eax
mov dword [ecx + 4], edx
add dword [ebp - 0x1c], 8
mov eax, dword [ebp + 8]
mov al, byte [eax + 0x50]
mov byte [ebp - 0x51], al
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
add edx, eax
mov al, byte [ebp - 0x51]
mov byte [edx], al
inc dword [ebp - 0x1c]
mov eax, dword [ebp + 8]
mov al, byte [eax + 0x51]
mov byte [ebp - 0x52], al
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
add edx, eax
mov al, byte [ebp - 0x52]
mov byte [edx], al
inc dword [ebp - 0x1c]
mov dword [ebp - 0x20], 0
jmp 0x40855a
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp - 0x20]
shl edx, 2
add eax, edx
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
mov ax, word [eax]
shr ax, 8
mov edx, eax
mov eax, dword [ebp - 0x28]
mov ax, word [eax]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x54], ax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
add edx, eax
mov eax, dword [ebp - 0x54]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp - 0x28]
mov ax, word [eax]
movzx edx, ax
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 4]
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x24]
add ecx, ebx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], ecx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x28]
mov ax, word [eax]
movzx eax, ax
add dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x28]
mov ax, word [eax + 8]
shr ax, 8
mov edx, eax
mov eax, dword [ebp - 0x28]
mov ax, word [eax + 8]
movzx eax, ax
shl eax, 8
or eax, edx
mov word [ebp - 0x56], ax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x24]
add edx, eax
mov ax, word [ebp - 0x56]
mov word [edx], ax
add dword [ebp - 0x1c], 2
mov eax, dword [ebp - 0x28]
mov ax, word [eax + 8]
movzx edx, ax
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 0xc]
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x24]
add ecx, ebx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], ecx
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x28]
mov ax, word [eax + 8]
movzx eax, ax
add dword [ebp - 0x1c], eax
inc dword [ebp - 0x20]
mov al, byte [ebp - 0x52]
movzx eax, al
cmp eax, dword [ebp - 0x20]
jg 0x408479
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
cmp eax, dword [ebp - 0x1c]
je 0x4085be
mov eax, dword [ebp + 0xc]
mov dword [eax], 0
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x58]
mov edx, dword [ebp - 0x1c]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.mbdb_record_build
mov dword [esp + 4], str._s:_ERROR:_inconsistent_record_size__present__d___created__d__n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, 0xffffffff
jmp 0x4085d3
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x24]
mov dword [eax], edx
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp - 0x1c]
mov dword [eax], edx
mov eax, 0
add esp, 0xcc
pop ebx
pop esi
pop edi
pop ebp
ret