Function at 0x402b90
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x328
mov eax, dword [esp + 0x440]
push ebx
push ebp
push esi
xor esi, esi
push edi
cmp eax, esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x28], esi
jne 0x402c98
mov eax, dword [esp + 0x1dcc]
mov ebx, dword [esp + 0x33c]
push esi
push eax
lea ecx, [esp + 0x3c]
push str._sTmpAttFiles__d
push ecx
mov dword [ebx + 0xe80], esi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea edx, [esp + 0x34]
push esi
push 0x4000000
push 4
push esi
push esi
push 0xc0000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebx + 0xe80]
mov edx, dword [ebx + 0xe74]
mov dword [edx + ecx*4], eax
mov eax, dword [ebx + 0xe80]
mov ecx, dword [ebx + 0xe74]
mov ebp, dword [ecx + eax*4]
cmp ebp, 0xffffffff
je 0x403277
mov eax, 0x1a8c
lea esi, [esp + 0x340]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
push ebx
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.00402000
add ebx, 0xe84
or ecx, 0xffffffff
mov edi, ebx
xor eax, eax
add esp, 0x1a94
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
repne scasb al, byte es:[edi]
not ecx
lea edx, [esp + 0x1c]
push 0
dec ecx
push edx
push ecx
push ebx
push ebp
call esi
lea eax, [esp + 0x1c]
push 0
push eax
mov edi, 0x40d244
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x40d244
push ebp
call esi
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x328
ret
mov ecx, dword [esp + 0x1dcc]
lea edx, [esp + 0x234]
push ecx
push str._sencoded_attatch_file
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [esp + 0x234]
push esi
push 0x4000000
push 4
push esi
push esi
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
mov eax, 0x1a8c
mov dword [esp + 0x20], ebp
lea esi, [esp + 0x340]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push ebp
call fcn.00401e50
mov ebx, dword [esp + 0x1dcc]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x1a90
lea esi, [ebx + 0xe84]
mov edi, esi
push eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ebp
mov edi, ecx
mov dword [esp + 0x38], edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, dword [ebx + 0xb54]
mov dword [esp + 0x24], eax
cmp ebp, 1
jne 0x402d6b
mov ecx, dword [ebx + 0xb50]
add eax, edi
xor edx, edx
mov dword [esp + 0x14], eax
div ecx
xor edx, edx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
div ecx
test edx, edx
je 0x402d59
inc dword [esp + 0x10]
mov eax, edi
xor edx, edx
div ecx
test edx, edx
je 0x402d6b
cmp edi, ecx
jbe 0x402d6b
inc dword [esp + 0x10]
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
mov dword [ebx + 0xe80], 0
repne scasb al, byte es:[edi]
mov eax, dword [ebx + 0xb50]
not ecx
dec ecx
cmp ecx, eax
mov dword [esp + 0x2c], ecx
jbe 0x402e70
cmp ebp, 1
jne 0x402e70
mov ebp, dword [esp + 0x1dcc]
mov ecx, dword [esp + 0x10]
push ebp
push ecx
mov eax, 0x1a8c
lea esi, [esp + 0x348]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push ebx
call fcn.00402950
mov edx, dword [ebx + 0xe80]
add esp, 0x1a98
lea eax, [esp + 0x34]
push edx
push ebp
push str._sTmpAttFiles__d
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea ecx, [esp + 0x34]
push 0
push 0x4000000
push 4
push 0
push 0
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, dword [ebx + 0xe80]
mov ecx, dword [ebx + 0xe74]
mov dword [ecx + edx*4], eax
mov eax, dword [ebx + 0xe80]
mov edx, dword [ebx + 0xe74]
mov ebp, dword [edx + eax*4]
cmp ebp, 0xffffffff
jne 0x402e37
or eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x328
ret
mov ecx, dword [esp + 0x10]
inc eax
push ecx
push eax
mov eax, 0x1a8c
lea esi, [esp + 0x348]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
push ebx
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.00402530
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
add esp, 0x1a9c
jmp 0x402fd1
mov edx, dword [esp + 0x1dcc]
push 0
push edx
lea eax, [esp + 0x3c]
push str._sTmpAttFiles__d
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea ecx, [esp + 0x34]
push 0
push 0x4000000
push 4
push 0
push 0
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, dword [ebx + 0xe80]
mov ecx, dword [ebx + 0xe74]
mov dword [ecx + edx*4], eax
mov eax, dword [ebx + 0xe80]
mov edx, dword [ebx + 0xe74]
mov ebp, dword [edx + eax*4]
cmp ebp, 0xffffffff
jne 0x402edb
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x328
ret
cmp dword [ebx + 0xb54], 1
jne 0x402f22
mov ecx, dword [esp + 0x24]
mov edx, dword [ebx + 0xb50]
cmp ecx, edx
jbe 0x402f22
mov edx, dword [esp + 0x10]
inc eax
push edx
push eax
mov eax, 0x1a8c
lea esi, [esp + 0x348]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
push ebx
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.00402680
add esp, 0x1a9c
jmp 0x402f49
mov eax, 0x1a8c
lea esi, [esp + 0x340]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
push ebx
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.00402140
add esp, 0x1a94
mov eax, 0x1a8c
lea esi, [esp + 0x340]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push ebp
call fcn.004023a0
add esp, 0x1a90
lea eax, [esp + 0x1c]
lea edx, [ebx + 0xe84]
or ecx, 0xffffffff
push 0
push eax
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
not ecx
dec ecx
push ecx
push edx
push ebp
call esi
lea ecx, [esp + 0x1c]
push 0
push ecx
mov edi, 0x40d244
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x40d244
push ebp
call esi
mov edi, 0x40d244
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
push 0
dec ecx
push edx
push ecx
push 0x40d244
push ebp
call esi
mov eax, dword [esp + 0x24]
mov dword [esp + 0x14], 0
test eax, eax
jbe 0x4031fd
mov eax, dword [esp + 0x28]
test eax, eax
jne 0x4030d1
mov eax, 0x1a8c
mov dword [esp + 0x28], 1
lea esi, [esp + 0x340]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
push ebp
call fcn.00402280
mov esi, dword [ebx + 0xb50]
mov eax, dword [esp + 0x1abc]
add esp, 0x1a90
cmp eax, esi
jae 0x403047
mov eax, dword [esp + 0x30]
sub esi, eax
test eax, eax
jbe 0x403047
xor edx, edx
mov ecx, 0x4e
div ecx
lea esi, [esi + edx - 0x4e]
mov eax, dword [esp + 0x24]
cmp eax, esi
jbe 0x403059
mov ecx, dword [ebx + 0xb54]
test ecx, ecx
jne 0x40305b
mov esi, eax
test esi, esi
jbe 0x4031da
mov edx, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
push 0
push 0
push edx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp esi, 0x200
push 0
jae 0x40308e
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38]
push eax
push esi
push ecx
jmp 0x40309d
lea edx, [esp + 0x1c]
lea eax, [esp + 0x38]
push edx
push 0x200
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
add edx, eax
lea ecx, [esp + 0x1c]
mov dword [esp + 0x14], edx
push 0
push ecx
lea edx, [esp + 0x3c]
push eax
push edx
push ebp
sub esi, eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test esi, esi
ja 0x403063
jmp 0x4031da
mov eax, dword [ebx + 0xe80]
mov ecx, dword [esp + 0x1dcc]
push eax
push ecx
lea edx, [esp + 0x3c]
push str._sTmpAttFiles__d
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [esp + 0x34]
push 0
push 0x4000000
push 4
push 0
push 0
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebx + 0xe80]
mov edx, dword [ebx + 0xe74]
mov dword [edx + ecx*4], eax
mov eax, dword [ebx + 0xe80]
mov ecx, dword [ebx + 0xe74]
mov ebp, dword [ecx + eax*4]
cmp ebp, 0xffffffff
je 0x402ecd
mov edx, dword [esp + 0x10]
inc eax
push edx
push eax
mov eax, 0x1a8c
lea esi, [esp + 0x348]
call fcn.00406ba0
mov ecx, 0x6a3
mov edi, esp
push ebx
push ebp
rep movsd dword es:[edi], dword [esi]
call fcn.00402530
mov esi, dword [ebx + 0xb50]
add esp, 0x1a9c
test esi, esi
jbe 0x4031da
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
push 0
push 0
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [esp + 0x18]
cmp esi, 0x200
push 0
push ecx
jae 0x403195
push esi
jmp 0x40319a
push 0x200
mov eax, dword [esp + 0x2c]
lea edx, [esp + 0x40]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
push 0
push ecx
lea eax, [esp + 0x3c]
push edx
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x18]
add edi, eax
sub esi, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x14], edi
cmp eax, edi
jbe 0x4031da
test esi, esi
ja 0x40316f
mov ecx, dword [ebx + 0xe80]
mov eax, dword [esp + 0x14]
inc ecx
mov dword [ebx + 0xe80], ecx
mov ecx, dword [esp + 0x24]
cmp ecx, eax
ja 0x402fe5
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebp, dword [ebx + 0xe80]
lea eax, [esp + 0x1c]
push 0
dec ebp
push eax
mov edi, 0x40d244
or ecx, 0xffffffff
xor eax, eax
mov dword [ebx + 0xe80], ebp
mov edx, ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
mov ecx, dword [ebx + 0xe74]
push 0x40d244
mov edx, dword [ecx + edx*4]
push edx
call esi
mov eax, 0x1a8c
lea esi, [esp + 0x340]
call fcn.00406ba0
mov eax, dword [ebx + 0xe80]
mov ecx, 0x6a3
mov edi, esp
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebx + 0xe74]
mov edx, dword [ecx + eax*4]
push edx
call fcn.00402490
mov eax, dword [esp + 0x1ab0]
add esp, 0x1a90
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x328
ret