Function at 0x40a550
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x445c98
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push ebp
push esi
push edi
mov eax, dword [0x45accc]
xor eax, esp
push eax
lea eax, [esp + 0x34]
mov dword fs:[0], eax
mov esi, ecx
call fcn.0041aec8
xor ecx, ecx
xor ebx, ebx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40a595
push 0x80004005
call fcn.00401460
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], ebx
xor ebp, ebp
call fcn.0041aec8
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40a5d1
push 0x80004005
call fcn.00401460
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov byte [esp + 0x3c], 1
call fcn.0041aec8
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40a600
push 0x80004005
call fcn.00401460
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x20], edi
mov edx, dword [esp + 0x48]
mov eax, dword [edx]
push 2
lea ecx, [esp + 0x30]
push ecx
push ebp
push ebx
push eax
mov byte [esp + 0x50], 2
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
cmp eax, 0xffffffff
jne 0x40a6cd
lea ecx, [esp + 0x18]
push str._Error__Tester_build_image_failure_on_set_file_pointer___r_n
push ecx
call fcn.004026d0
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x4c]
add esp, 8
push esi
push 0x3ee
call fcn.0041a30b
lea eax, [edi - 0x10]
mov byte [esp + 0x3c], 1
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40a67a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
mov byte [esp + 0x3c], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a69f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
mov dword [esp + 0x3c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a6c3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
jmp 0x40a8c5
mov ecx, dword [esp + 0x54]
push ecx
lea ecx, [esp + 0x1b]
call fcn.00406db0
mov edx, dword [esp + 0x58]
push ebx
mov dword [edx], ebx
call fcn.00406f60
mov ebp, dword [esp + 0x50]
mov ebx, dword [esp + 0x54]
add esp, 4
mov dword [esp + 0x28], 0
lea ebx, [ebx]
mov eax, dword [esi + 0x204]
push 0x10000
push 0
push eax
call fcn.00431320
add esp, 0xc
lea edi, [esi + 0x438]
cmp ebx, 0x80
jb 0x40a8db
mov ecx, dword [esi + 0x204]
movsx edx, byte [0x45ca28]
push ecx
push 0x80
push ebp
push edx
mov ecx, edi
call fcn.004107f0
test eax, eax
je 0x40a793
mov eax, dword [esi + 0x204]
movsx ecx, byte [0x45ca28]
push eax
push 0x7f
push ebp
push ecx
mov ecx, edi
call fcn.004107f0
test eax, eax
jne 0x40aaca
mov edx, dword [esi + 0x204]
movsx ecx, byte [0x45ca28]
add edx, 0xfe00
push edx
push 1
lea eax, [ebp + 0x7f]
push eax
push ecx
mov ecx, edi
call fcn.004107f0
test eax, eax
jne 0x40aa40
mov edi, dword [esp + 0x48]
push 2
lea edx, [esp + 0x30]
push edx
xor eax, eax
push eax
push eax
mov eax, dword [edi]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
cmp eax, 0xffffffff
je 0x40aad1
mov edx, dword [esi + 0x204]
mov eax, dword [edi]
push 0
lea ecx, [esp + 0x28]
push ecx
push 0x10000
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40aad8
cmp dword [esp + 0x24], 0x10000
jne 0x40aabc
mov al, byte [0x45ca37]
test al, al
jne 0x40a81e
mov ecx, dword [esi + 0x204]
mov edx, dword [esp + 0x54]
push 0x10000
push ecx
push edx
lea ecx, [esp + 0x23]
call fcn.00406dc0
mov eax, dword [esi + 0x204]
mov ecx, dword [esp + 0x58]
push 0
push 0x10000
push eax
push ecx
jmp 0x40a855
cmp al, 1
jne 0x40a83e
mov edx, dword [esi + 0x204]
mov eax, dword [esp + 0x54]
push 0x10000
push edx
push eax
lea ecx, [esp + 0x23]
call fcn.00406dc0
jmp 0x40a85d
cmp al, 2
jne 0x40a85d
mov ecx, dword [esi + 0x204]
mov edx, dword [esp + 0x58]
push 0
push 0x10000
push ecx
push edx
call fcn.00406f80
add esp, 0x10
mov edi, dword [esp + 0x28]
xor edx, edx
mov eax, edi
div dword [esp + 0x50]
push eax
lea eax, [esp + 0x1c]
push str.Complete:__d_percent
push eax
call fcn.004026d0
mov ecx, dword [esp + 0x24]
add esp, 0xc
push ecx
mov ecx, dword [esp + 0x48]
push 0x3ee
call fcn.0041a30b
add edi, 0x3200
sub ebp, 0xffffff80
sub ebx, 0x80
mov dword [esp + 0x28], edi
jne 0x40a700
lea ecx, [esp + 0x20]
call fcn.004022f0
lea ecx, [esp + 0x1c]
call fcn.004022f0
lea ecx, [esp + 0x18]
call fcn.004022f0
xor eax, eax
mov ecx, dword [esp + 0x34]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret 0x18
mov edx, dword [esi + 0x204]
movsx eax, byte [0x45ca28]
push edx
push ebx
push ebp
push eax
mov ecx, edi
call fcn.004107f0
test eax, eax
je 0x40a94b
mov ecx, dword [esi + 0x204]
movsx eax, byte [0x45ca28]
push ecx
lea edx, [ebx - 1]
push edx
push ebp
push eax
mov ecx, edi
call fcn.004107f0
test eax, eax
jne 0x40aa40
mov edx, dword [esi + 0x204]
mov ecx, ebx
shl ecx, 9
lea eax, [ecx + edx - 0x200]
movsx edx, byte [0x45ca28]
push eax
push 1
lea ecx, [ebx + ebp - 1]
push ecx
push edx
mov ecx, edi
call fcn.004107f0
test eax, eax
jne 0x40aa8a
mov ecx, dword [esp + 0x48]
mov edx, dword [ecx]
push 2
lea eax, [esp + 0x30]
push eax
xor eax, eax
push eax
push eax
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
cmp eax, 0xffffffff
je 0x40aaa3
mov ecx, dword [esi + 0x204]
mov edx, dword [esp + 0x48]
push 0
lea eax, [esp + 0x28]
push eax
mov eax, dword [edx]
mov edi, ebx
shl edi, 9
push edi
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40aabc
cmp dword [esp + 0x24], edi
jne 0x40aac3
mov al, byte [0x45ca37]
test al, al
jne 0x40a9cf
mov ecx, dword [esi + 0x204]
mov edx, dword [esp + 0x54]
push edi
push ecx
push edx
lea ecx, [esp + 0x23]
call fcn.00406dc0
mov eax, dword [esi + 0x204]
mov ecx, dword [esp + 0x58]
push 0
push edi
push eax
push ecx
jmp 0x40a9fe
cmp al, 1
jne 0x40a9eb
mov edx, dword [esi + 0x204]
mov eax, dword [esp + 0x54]
push edi
push edx
push eax
lea ecx, [esp + 0x23]
call fcn.00406dc0
jmp 0x40aa06
cmp al, 2
jne 0x40aa06
mov ecx, dword [esi + 0x204]
mov edx, dword [esp + 0x58]
push 0
push edi
push ecx
push edx
call fcn.00406f80
add esp, 0x10
mov eax, ebp
sub eax, dword [esp + 0x4c]
xor edx, edx
imul eax, eax, 0x64
div dword [esp + 0x50]
push eax
lea eax, [esp + 0x1c]
push str.Complete:__d_percent
push eax
call fcn.004026d0
mov ecx, dword [esp + 0x24]
add esp, 0xc
push ecx
mov ecx, dword [esp + 0x48]
push 0x3ee
call fcn.0041a30b
jmp 0x40a8a8
push str._Error__Tester_build_image_failure_on_read_card_data___r_n
lea edx, [esp + 0x1c]
push edx
call fcn.004026d0
mov eax, dword [esp + 0x20]
add esp, 8
push eax
mov ecx, dword [esp + 0x48]
push 0x3ee
call fcn.0041a30b
lea ecx, [esp + 0x20]
call fcn.004022f0
lea ecx, [esp + 0x1c]
call fcn.004022f0
lea ecx, [esp + 0x18]
call fcn.004022f0
mov eax, 1
jmp 0x40a8c5
push str._Error__Tester_build_image_failure_on_read_card_data___r_n
lea ecx, [esp + 0x1c]
push ecx
call fcn.004026d0
mov edx, dword [esp + 0x20]
add esp, 8
push edx
jmp 0x40aa57
push str._Error__Tester_build_image_failure_on_set_file_pointer___r_n
lea eax, [esp + 0x1c]
push eax
call fcn.004026d0
mov ecx, dword [esp + 0x20]
add esp, 8
push ecx
jmp 0x40aa57
push str._Error__Save_Image_failure___r_n
jmp 0x40aa45
push str._Error__Save_Image_failure___r_n
jmp 0x40aa8f
push str._Error__Tester_build_image_failure_on_read_card_data___r_n
jmp 0x40aaa8
push str._Error__Tester_build_image_failure_on_set_file_pointer___r_n
jmp 0x40aa8f
push str._Error__Save_Image_failure___r_n
jmp 0x40aaa8